query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Never trust parameters from the scary internet, only allow the white list through.
def informacao_ged_params params.require(:informacao_ged).permit(:orgao_id, :processo_digitalizacao, :numero_digitalizacao, :documentos_indexados, :hospedado_sepog) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
why can't I use alias for this?
def item_description "Donation: #{account_code.name_or_code}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alias_of; end", "def aliased_name; end", "def alias_decls; end", "def is_alias?; end", "def aliases; end", "def aliases; end", "def aliases; end", "def alias_method(sym1,sym2) end", "def aliases=(_arg0); end", "def aliases=(_arg0); end", "def aliases\n end", "def with_class_alias(x); end", "def alias_names; end", "def aliases\n\n end", "def print_alias(*) end", "def hardcore_alias(klass, *args)\n \"__#{klass.name}#{args}\"\n end", "def alias?\n false\nend", "def metaalias(to, from)\n metaclass.instance_eval{alias_method to, from}\n end", "def as(alias_name)\n \"#{self} as #{alias_name}\".to_sym\n end", "def as(alias_name)\n \"#{self} as #{alias_name}\".to_sym\n end", "def realname\n alias? ? aliasof.name : name\n end", "def add_alias as\n @display.print_alias as\n end", "def alias(a)\n Registry.alias_command(self, a)\n end", "def rdl_alias(new_name, old_name)\n klass = self.to_s\n klass = \"Object\" if (klass.is_a? Object) && (klass.to_s == \"main\")\n RDL.aliases[klass] = {} unless RDL.aliases[klass]\n if RDL.aliases[klass][new_name]\n raise RuntimeError,\n \"Tried to alias #{new_name}, already aliased to #{RDL.aliases[klass][new_name]}\"\n end\n RDL.aliases[klass][new_name] = old_name\n\n if self.method_defined? new_name\n RDL::Wrap.wrap(klass, new_name)\n else\n RDL.to_wrap << [klass, old_name]\n end\n nil\n end", "def aliases\n short ? [name, short] : [name]\n end", "def backup(c, m, prefix=\"original\")\nn = :\"#{prefix}_#{m}\"\n# Compute the alias\nc.class_eval {\n# Because alias_method is private\nalias_method n, m\n# Make n an alias for m\n}\nend", "def register_alias(type, shortcut); end", "def alias(name)\n @aliases << convert(name)\n end", "def alias(name)\n @aliases << convert(name)\n end", "def define_alias_methods(member_name, options); end", "def alias(name, visibility, original_name, original_exec, original_mod)\n Rubinius.primitive :methodtable_alias\n raise PrimitiveFailure, \"MethodTable#alias primitive failed\"\n end", "def alias(alias_name)\n clone.alias! alias_name\n end", "def alias_change(al)\n obj_change al, Alias\n end", "def singleton_method_alias( newname, original )\n\t\t\tsingleton_class.__send__( :alias_method, newname, original )\n\t\tend", "def dir_alias()\n #This is a stub, used for indexing\n end", "def wrapper(name); end", "def explicit; end", "def alias_identity(_, new_identity)\n %(mixpanel.alias(\"#{new_identity}\");)\n end", "def alias_attribute(new_name, old_name)\n module_eval <<-STR, __FILE__, __LINE__ + 1\n def #{new_name}; self.#{old_name}; end # def subject; self.title; end\n def #{new_name}?; self.#{old_name}?; end # def subject?; self.title?; end\n def #{new_name}=(v); self.#{old_name} = v; end # def subject=(v); self.title = v; end\n STR\n end", "def alias_attribute(new_name, old_name)\n module_eval <<-STR, __FILE__, __LINE__+1\n def #{new_name}; self.#{old_name}; end # def subject; self.title; end\n def #{new_name}?; self.#{old_name}?; end # def subject?; self.title?; end\n def #{new_name}=(v); self.#{old_name} = v; end # def subject=(v); self.title = v; end\n STR\n end", "def alias\n super || \"Local Relay\"\n end", "def preserve_query_aliases\n class << self\n # I have to do the interesting hack below instead of using alias_method\n # because there's some sort of weirdness going on with how __all binds\n # to all in Ruby 2.0.\n __all = self.instance_method(:all)\n\n define_method(:__all) do\n __all.bind(self).call\n end\n\n # From ActiveRecord::Querying\n delegate :find, :take, :take!, :first, :first!, :last, :last!, :exists?, :any?, :many?, :to => :__all\n delegate :first_or_create, :first_or_create!, :first_or_initialize, :to => :__all\n delegate :find_or_create_by, :find_or_create_by!, :find_or_initialize_by, :to => :__all\n delegate :find_by, :find_by!, :to => :__all\n delegate :destroy, :destroy_all, :delete, :delete_all, :update, :update_all, :to => :__all\n delegate :find_each, :find_in_batches, :to => :__all\n delegate :select, :group, :order, :except, :reorder, :limit, :offset, :joins,\n :where, :preload, :eager_load, :includes, :from, :lock, :readonly,\n :having, :create_with, :uniq, :distinct, :references, :none, :unscope, :to => :__all\n delegate :count, :average, :minimum, :maximum, :sum, :calculate, :pluck, :ids, :to => :__all\n end\n end", "def alias_path(path)\n end", "def add_alias an_alias\n return an_alias unless @document_self\n\n method_attr = find_method(an_alias.old_name, an_alias.singleton) ||\n find_attribute(an_alias.old_name, an_alias.singleton)\n\n if method_attr then\n method_attr.add_alias an_alias, self\n else\n add_to @external_aliases, an_alias\n unmatched_alias_list =\n @unmatched_alias_lists[an_alias.pretty_old_name] ||= []\n unmatched_alias_list.push an_alias\n end\n\n an_alias\n end", "def create_alias(new_name, old_name)\n alias_method new_name.to_sym, old_name.to_sym #getter\n alias_method \"#{new_name}=\".to_sym, \"#{old_name}=\".to_sym #setter\n end", "def alias(name)\n @aliases << normalize(name)\n nil\n end", "def alias_processing\n self.alias = Russian.translit(self.alias.strip.gsub(' ', '_').gsub(/[\\W\\d]/, '')).downcase\n end", "def for(name)\n (@alias_map ||= {})[name] ||= version_class(name)\n end", "def backup(c, m, prefix = \"original\") #method m ,in the class (or module) c\r\n n = :\"#{prefix}_#{m}\" #compute the alias\r\n c.class_eval { #alias method is private\r\n alias_method n,m #make n alias for m\r\n }\r\nend", "def aref\n type = singleton ? 'c' : 'i'\n \"#alias-#{type}-#{html_name}\"\n end", "def circular_definition?(alias_name); end", "def aliasing_name_if_not_self\n aln = self.aliasing_name\n aln.nil? || aln == self.name ? \"\" : aln\n end", "def extended(*) end", "def +@\n self.class[ self ]\n end", "def attr_alias(name)\n name = name.intern\n if synonym = self.class.attr_alias(name)\n return synonym\n else\n return name\n end\n end", "def alias_add(al,member)\n obj_add(al,Alias,member)\n end", "def wrapper; end", "def register_alias(string, symbol, extension_synonyms = T.unsafe(nil)); end", "def aliases!\n @schema.aliases!\n end", "def alias(name, alias_to)\n params = { :_n => alias_to, :_p => name }\n request('a', params)\n end", "def alias\n\t\tmodule_info['Alias']\n\tend", "def add_alias(an_alias)\n object_class.record_location self\n return an_alias unless @document_self\n object_class.add_alias an_alias\n end", "def add_alias(var_name, class_obj, old_name, new_name, comment)\n al = RDoc::Alias.new '', old_name, new_name, ''\n al.singleton = @singleton_classes.key? var_name\n al.comment = comment\n al.record_location @top_level\n class_obj.add_alias al\n @stats.add_alias al\n al\n end", "def add_alias_impl(an_alias, meth)\n new_meth = RDoc::AnyMethod.new an_alias.text, an_alias.new_name\n new_meth.is_alias_for = meth\n new_meth.singleton = meth.singleton\n new_meth.params = meth.params\n new_meth.comment = \"Alias for \\##{meth.name}\"\n meth.add_alias new_meth\n add_method new_meth\n end", "def add_alias(an_alias, context)\n raise NotImplementedError\n end", "def alt; end", "def to_alias\n \"-#{@alias}\"\n end", "def alias(name)\n @db.open_class(name) do |c|\n c.type = @klass.type\n c.library = @library\n c.aliasof = @klass\n c.source = \"Alias of [[c:#{@klass.name}]]\\n\"\n @library.add_class c\n @klass.alias c\n end\n end", "def alias(new, old)\n @values << new unless @values.include? new\n @aliases[new] = old\n end", "def resolve_alias(group_alias)\n ALIASES[group_alias]\n end", "def visit_Psych_Nodes_Alias(node)\n # Psych's implementation\n # @st.fetch(o.anchor) { raise BadAlias, \"Unknown alias: #{o.anchor}\" }\n @st[node.anchor]\n end", "def alias_name\n name.to_s.pluralize\n end", "def aliasing_hash_aliases\n @aliases ||= {}\n end", "def name_alias(arg=nil)\n\t\t\t\tset_or_return(:name_alias, arg, :kind_of => String)\n\t\t\tend", "def add_alias an_alias, context = nil\n method = self.class.new an_alias.text, an_alias.new_name\n\n method.record_location an_alias.file\n method.singleton = self.singleton\n method.params = self.params\n method.visibility = self.visibility\n method.comment = an_alias.comment\n method.is_alias_for = self\n @aliases << method\n context.add_method method if context\n method\n end", "def alias(c)\n aliases().push c\n end", "def nalias(m1, m2)\n %w(define_method define_singleton_method).each do |method|\n send(method, m1) do\n namespace, method = m2.split('.')\n self.send(namespace).send(method)\n end\n end\n end", "def as(scope); end", "def ext=(_arg0); end", "def ext=(_arg0); end", "def ext=(_arg0); end", "def add_alias(an_alias)\n meth = find_instance_method_named(an_alias.old_name)\n\n if meth then\n add_alias_impl an_alias, meth\n else\n add_to @aliases, an_alias\n unmatched_alias_list = @unmatched_alias_lists[an_alias.old_name] ||= []\n unmatched_alias_list.push an_alias\n end\n\n an_alias\n end", "def as(aliased_name)\n @aliased_name = aliased_name\n\n self\n end", "def type\n @alias_of.type\n end", "def aliased?\n any?(&:aliased?)\n end", "def aliases generic_alias_too\n result, is_special = [], special_method?\n name = is_special ? cleaned_name : @name\n if generic_alias_too and (file = existing_rd_file) and\n not file =~ /#{cleaned_s4_class}/\n result << \"\\\\alias{#{name}-methods}\"\n end\n result << \"\\\\alias{#{name},#{@s4_class}-method}\"\n if is_special\n result << \"\\\\alias{#{@name.gsub(/%/, \"\\\\%\")},#{@s4_class}-method}\"\n end\n result.join \"\\n\"\n end", "def use(sym); end", "def is_alias_for\n case @is_alias_for\n when String then\n found = @store.find_class_or_module @is_alias_for\n @is_alias_for = found if found\n @is_alias_for\n else\n @is_alias_for\n end\n end", "def alias?\r\n show_alias_flg == 'yes'\r\n end", "def aliases(other)\n common_names(other).each_with_object({}) { |name, aliases|\n left, right = fetch(name), other.fetch(name)\n aliases[name] = :\"#{name}_#{right}\" if left != right\n }\n end", "def alias_view(to, from, node = nil)\n trait[:alias_view] || trait(:alias_view => {})\n trait[:alias_view][to.to_s] = node ? [from.to_s, node] : from.to_s\n end", "def table_alias\r\n @table_alias || from_table_name\r\n end", "def alias(builder)\n repo = builder.repo\n aliased_repo = builder.aliased_repo\n msg = Simple::Ansi.green(\"Aliasing #{repo} -> #{aliased_repo}\")\n $stderr.puts msg\n end", "def alias=(new_alias)\n @alias = new_alias[0..512]\n end", "def contains_alias(aliaz)\n\n end", "def alias_class_method(new_name, old_name)\n #klass = self.to_s\n metaclass.instance_eval do\n alias_method new_name, old_name\n end\n end", "def alias_class_method(new_name, old_name)\n #klass = self.to_s\n metaclass.instance_eval do\n alias_method new_name, old_name\n end\n end", "def alias(an_alias)\n { alias: an_alias }\n end", "def to_s\n self.alias\n end", "def parse_alias(context, single, tk, comment)\n line_no = tk[:line_no]\n\n skip_tkspace\n\n if :on_lparen === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n new_name = get_symbol_or_name\n\n skip_tkspace\n if :on_comma === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n begin\n old_name = get_symbol_or_name\n rescue RDoc::Error\n return\n end\n\n al = RDoc::Alias.new(get_tkread, old_name, new_name, comment,\n single == SINGLE)\n record_location al\n al.line = line_no\n\n read_documentation_modifiers al, RDoc::ATTR_MODIFIERS\n context.add_alias al\n @stats.add_alias al\n\n al\n end", "def wrapped_in=(_arg0); end" ]
[ "0.8360058", "0.75075996", "0.7261705", "0.72487354", "0.71658796", "0.71658796", "0.71658796", "0.7137943", "0.702921", "0.702921", "0.6907842", "0.69076127", "0.6889313", "0.67918396", "0.66580033", "0.6648208", "0.66142905", "0.6512604", "0.6479124", "0.6479124", "0.62227064", "0.61943763", "0.619279", "0.615323", "0.6140038", "0.60976046", "0.6091027", "0.60901374", "0.60901374", "0.6087891", "0.60839444", "0.60731596", "0.6055133", "0.60433275", "0.6000706", "0.5997563", "0.5973469", "0.5967578", "0.59605545", "0.5942479", "0.59229666", "0.59225947", "0.58973014", "0.5886843", "0.5883901", "0.58642906", "0.58537525", "0.5835617", "0.58228123", "0.58222723", "0.5814215", "0.5807622", "0.58038574", "0.57789606", "0.57740474", "0.5769482", "0.57630396", "0.5756941", "0.57449496", "0.57433736", "0.57348835", "0.57328343", "0.5724431", "0.5717729", "0.570743", "0.5670827", "0.5663145", "0.56557345", "0.5648841", "0.5644753", "0.5640367", "0.5624178", "0.56224453", "0.5611937", "0.560724", "0.56023425", "0.56012076", "0.5593221", "0.5592478", "0.5592478", "0.5592478", "0.5568251", "0.5558661", "0.5545466", "0.55390394", "0.5532183", "0.55304426", "0.5524579", "0.5520684", "0.55180514", "0.5517924", "0.55064625", "0.5500816", "0.55005926", "0.54966855", "0.54956186", "0.54956186", "0.54848915", "0.54816437", "0.54693127", "0.54566765" ]
0.0
-1
GET /status_de_la_inscripcions GET /status_de_la_inscripcions.json
def index @status_de_la_inscripcions = StatusDeLaInscripcion.all respond_to do |format| format.html # index.html.erb format.json { render json: @status_de_la_inscripcions } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end", "def index\n @status_ref_pago_inscs = StatusRefPagoInsc.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_ref_pago_inscs }\n end\n end", "def show\n @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end", "def index\n @inscripcions = Inscripcion.all\n end", "def index\n @status_de_interes_de_prospecto_validados = StatusDeInteresDeProspectoValidado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validados }\n end\n end", "def index\n @status_del_admitidos = StatusDelAdmitido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_admitidos }\n end\n end", "def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end", "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subcategorias }\n end\n end", "def index\n @status_del_tramite_de_becas = StatusDelTramiteDeBeca.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_tramite_de_becas }\n end\n end", "def index\n @inscriptions = Inscription.all\n end", "def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end", "def show\n @status_de_la_notificacion = StatusDeLaNotificacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end", "def show\n @status_ref_pago_insc = StatusRefPagoInsc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_ref_pago_insc }\n end\n end", "def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end", "def index\n @inscriptions = Inscription.includes(:tournament).all\n\n respond_to do |format|\n format.html # index.rb\n format.xml { render :xml => @inscriptions }\n end\n end", "def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end", "def index\n\n if @notification\n json_response(@notification.user_subscriptions)\n end\n if request.path_parameters.has_key?(:user_id)\n json_response(@user.user_subscriptions)\n end\n end", "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end", "def get_mission_invites\n\t#get all missions of user with invitaion_status = pending\n user = User.exists? (params[:user_id])\n\tif user\n\t\tmissions = user.missions.references( :user_missions).select('missions.id, missions.title, user_missions.invitation_time').where( user_missions:{ invitation_status: PENDING_MESA_INVITATION})\n\t\trespond_to do |format|\n\t\t format.json {render :json=> {:mesa_invites=> missions, :status => true} }\n\t\tend\n else\n\t respond_to do |format|\n\t\t format.json {render :json=> {:error=>'No user exists with id' , :status => false} }\n\t end\n\tend\n end", "def statuses\n request(:get, \"applicant_tracking/statuses\")\n end", "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def notifications\n @campus_id = current_user.campus_users.first.campus_id\n invi_status=CRUD::Utility::Invitations.new(@campus_id)\n data = invi_status.get_request_sent\n render :json=>{:data=>data}\n end", "def index\n # @ideias = Ideia.all\n @ideias = Ideia.where(:status => '3')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ideias }\n end\n end", "def situations_arrivals_countries_three\n @situations_arrivals_countries = SituationsArrivalsCountry.where(status:true, id: [1,2,3]).order('name ASC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @situations_arrivals_countries}\n end\n end", "def index\n if params[:alunno_id]\n @notedisciplinari = Notadisciplinare.where(alunno_id: params[:alunno_id])\n else\n @notedisciplinari = Notadisciplinare.all\n end\n end", "def index\n notifications = params[:unread].nil? || params[:unread] == 0 ? current_user.notifications : Notification.where(user: current_user, status: :unread).all\n\n render json: {\n status: 'Success',\n message: '',\n notifications: notifications.as_json(except: [\n :created_at,\n :updated_at\n ])\n }, status: 200\n end", "def index\n @estado_notificacions = EstadoNotificacion.all\n end", "def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end", "def show\n @status_de_interes_de_prospecto_validado = StatusDeInteresDeProspectoValidado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validado }\n end\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def index\n @requests = Request.where(status: -1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requests }\n end\n end", "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end", "def index\n @instituicao_responsavels = InstituicaoResponsavel.all\n end", "def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end", "def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end", "def statuses\n api.get('status')\n end", "def new\n @status_de_la_inscripcion = StatusDeLaInscripcion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end", "def statuses\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Available\", \"2\" => \"On Hold\", \"3\" => \"Borrowed\", \"4\" => \"Unavailable\"}}, :status => 200\n\t\treturn\n\tend", "def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end", "def index\n @request_statuses = RequestStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @request_statuses }\n end\n end", "def index\n @minicursos = Minicurso.all\n\t\t#@minicursos = Minicurso.scoped\n\t\t#@users = Minicurso.inscritos(params[:id]) if params[:id].present?\n\n respond_to do |format|\n\t\t\t format.html # index.html.erb\n\t\t\t format.json { render json: @minicursos }\n end\n end", "def index\n @sa_request_statuses = SaRequestStatus.all\n end", "def index\n @misuration_subscriptions = current_user.misuration_subscriptions.all\n end", "def subscriber_list(statuspage_id)\n request :method => :get,\n :url => @url + 'subscriber/list/' + statuspage_id\n end", "def index\n @idea_statuses = IdeaStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @idea_statuses }\n end\n end", "def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end", "def index\n if is_client_app?\n if params[:user_id].present?\n t = Subscription.arel_table\n s = Subscription.statuses\n @subscriptions = Subscription.where(user_id: params[:user_id]).where(t[:status].eq(s[:authorized]).or(t[:status].eq(s[:paused])))\n else\n @subscriptions = Subscription.all\n end\n\n render json: @subscriptions\n else\n response.headers['X-Total-Count'] = @subscriptions.count.to_s\n @subscriptions = @subscriptions.page(params[:page]) if params[:page].present?\n @subscriptions = @subscriptions.per(params[:per]) if params[:per].present?\n\n _render collection: @subscriptions, flag: params[:flag].try(:to_sym)\n end\n end", "def index\n @solicitantes = Solicitante.all\n end", "def index\n @inscricaos = Inscricao.all\n end", "def show\n @status_ativ = StatusAtiv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_ativ }\n end\n end", "def show\n @status_confirmacao_adotando = StatusConfirmacaoAdotando.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_confirmacao_adotando }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def get_working_missions\n \t#get all missions of user with invitaion_status = pending and mission status = true\n user = User.exists?(params[:user_id])\n\tif user\n\t\tmissions = user.missions.references(:user_missions).select('missions.id, missions.title').where( user_missions:{ invitation_status: ACCEPTED_MESA_INVITATION}, missions: {is_authorized: true})\n\t\trespond_to do |format|\n\t\t format.json {render :json=> {:working_mesa=> missions, :status => true} }\n\t\tend\n else\n\t respond_to do |format|\n\t\t format.json {render :json=> {:error=>'No user exists with id' , :status => false} }\n\t end\n\tend\n end", "def index\n if @current_user.super_admin?\n @event_subscriptions = EventSubscription.all\n elsif @current_user.admin?\n @event_subscriptions = EventSubscription.event_is_upcoming.where(approved: false).select {|es| es.pending_review}\n else\n @event_subscriptions = @current_user.event_subscriptions.event_is_upcoming.order(\"approved DESC\")\n end\n render json: @event_subscriptions\n end", "def index\n @transcriptions = Transcription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transcriptions }\n end\n end", "def index\n @status_akun = StatusAkun.all\n end", "def check\n\n\t\t@unseenNotifications = {notifications: current_user.notifications.unseen.count}\n\t\trespond_to do |format|\n\n\t\t\tformat.json { render json: @unseenNotifications }\n\n\t\tend\n\n\tend", "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @subscriptions }\n end\n end", "def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end", "def index\n @insurancestatuses = Insurancestatus.all\n end", "def show\n @status_del_admitido = StatusDelAdmitido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_del_admitido }\n end\n end", "def index\n @nvs_mig_statuses = NvsMigStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_mig_statuses }\n end\n end", "def index\n @inciting_incidents = IncitingIncident.all\n render json: @inciting_incidents\n end", "def index\r\n @subscriptions = current_business_user.subscriptions.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @subscriptions }\r\n end\r\n end", "def index\n @disciplines = Discipline.all\n #respond_to do |format|\n # format.json { render json: @disciplines, status: :ok }\n #end\n #render json: @disciplines, status: :ok\n respond_with @disciplines\n end", "def listCon\n @opportunities = Opportunity.where(\"status = ?\", \"Publish\")\n render json: @opportunities\n end", "def index\n @innings = Inning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @innings }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def list\n if params[:status] == 'open'\n render :json => ExpaPerson.list_open(params[:lc].to_i).epi(params[:epi]).ops(params[:ops]).to_timeline(params[:page].to_i)\n elsif params[:status] == 'applied'\n render :json => ExpaPerson.list_applied(params[:lc].to_i).epi(params[:epi]).ops(params[:ops]).to_timeline(params[:page].to_i)\n elsif params[:status] == 'accepted'\n render :json => ExpaPerson.list_approved(params[:lc].to_i).epi(params[:epi]).ops(params[:ops]).to_timeline(params[:page].to_i)\n elsif params[:status] == 'realizing'\n render :json => ExpaPerson.list_realized(params[:lc].to_i).epi(params[:epi]).ops(params[:ops]).to_timeline(params[:page].to_i)\n elsif params[:status] == 'completed'\n render :json => ExpaPerson.list_completed(params[:lc].to_i).epi(params[:epi]).ops(params[:ops]).to_timeline(params[:page].to_i)\n else\n render :json => ExpaPerson.listing(params[:lc].to_i).epi(params[:epi]).ops(params[:ops]).to_timeline(params[:page].to_i)\n end\n end", "def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end", "def status\n get('/api/status')\n end", "def index\n @incidents = @quote.incidents.all\n respond_to do |format|\n format.json { render :json => @incidents }\n end\n end", "def index\n @prescribtion_details = PrescribtionDetail.all\n end", "def index\n @service_requests = ServiceRequest.where(\"status != ?\", 2).order(\"updated_at DESC\").paginate(:page => params[:page], :per_page => 12) #ServiceRequest.order('updated_at DESC').where('status != ?', '2') #status == 2 means \"archived\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_requests }\n end\n end", "def status\n get_json('status.json')\n end", "def show\n @status_del_tramite_de_beca = StatusDelTramiteDeBeca.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_del_tramite_de_beca }\n end\n end", "def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "def show\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscriptionprepaconcour }\n end\n end", "def index\n @perfiles_transacciones = PerfilTransaccion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @perfiles_transacciones }\n end\n end", "def get_ack_incidents\n # use status of incident as a filter\n res = RestClient.get INCIDENT_QUERY_URL, :params => { :status => \"acknowledged\", :fields => \"incident_number\" }\n end", "def index\n @status_requests = StatusRequest.all\n end", "def index\n #Получаем все заказы для пользователя, который закреплен за одной или нескольких аптек\n\n # current_user = User.find_by_authentication_token(params[:authenticity_token])\n if params[:fltr] == \"3\" then\n @inv = Invoice.all.where(\"status = '3' and pharmacy_id in (:ph_id)\",ph_id: Pharmacy.where('user_id=:p',p:current_user.id).map{ |ph| ph.id })\n #@inv = Invoice.all.where(\"status = '3'\")\n @status = \"Отгруженные\"\n elsif params[:fltr] == \"4\"\n @inv = Invoice.all.where(\"status = '4' and pharmacy_id in (:ph_id)\",ph_id: Pharmacy.where('user_id=:p',p:current_user.id).map{ |ph| ph.id })\n #@inv = Invoice.all.where(\"status = '2'\").order(\"status DeSC\")\n @status = \"Отказ\"\n elsif params[:fltr] == \"2\"\n @inv = Invoice.all.where(\"status = '2' and pharmacy_id in (:ph_id)\",ph_id: Pharmacy.where('user_id=:p',p:current_user.id).map{ |ph| ph.id })\n #@inv = Invoice.all.where(\"status = '2'\").order(\"status DeSC\")\n @status = \"В работе\"\n else\n @inv = Invoice.all.where(\"status not in ('2','3','4') and pharmacy_id in (:ph_id)\",ph_id: Pharmacy.where('user_id=:p',p:current_user.id).map{ |ph| ph.id })\n #@inv = Invoice.all.where(\"status not in ('2','3')\").order(\"status DeSC\")\n @status = \"Новые\"\n end\n\n #render json: @user\nend", "def index\n @activacionclientets = Activacionclientet.all\n end", "def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end", "def index\n @resources = Resource.where(\"is_approved = true\")\n render json: @resources, status: 200\n end", "def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end", "def index\n @subscribes = Subscribe.all\n end", "def index\n @subscribes = Subscribe.all\n end", "def index\n @subscribes = Subscribe.all\n end", "def index\n @transacciones = Transaccion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transacciones }\n end\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def index\n @sesions = Sesion.where(entidad_paraestatal_id: @entidad_paraestatal.id).all\n @suplente = Suplente.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sesions }\n end\n end", "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "def index\n @insurance_queries = InsuranceQuery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_queries }\n end\n end", "def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end", "def show\n @circulos = @compra.get_deliveries\n\t\t@statuses = @compra.get_statuses\n\n end", "def index\n @antrag_statuses = AntragStatus.all\n end" ]
[ "0.6817553", "0.6750615", "0.6737539", "0.6696948", "0.6389955", "0.6274525", "0.62664276", "0.62091666", "0.6182181", "0.618101", "0.6176908", "0.6150047", "0.6121304", "0.61050725", "0.61016417", "0.60100645", "0.60027856", "0.5997084", "0.597072", "0.5937746", "0.592776", "0.59271604", "0.5908295", "0.58921605", "0.5855349", "0.5851888", "0.58351755", "0.5823558", "0.58087116", "0.57955444", "0.57936925", "0.5789729", "0.57840794", "0.57765216", "0.57761943", "0.5769092", "0.5765308", "0.5754595", "0.5748563", "0.57395333", "0.57392824", "0.5735328", "0.5733032", "0.5731117", "0.5730122", "0.5729181", "0.571961", "0.5715873", "0.5712538", "0.570541", "0.57008755", "0.5694228", "0.5691388", "0.567998", "0.56772125", "0.5674594", "0.56741524", "0.5669207", "0.5669076", "0.5667743", "0.56674", "0.5664753", "0.5662851", "0.5661582", "0.56548226", "0.56531495", "0.5647546", "0.56419444", "0.56414217", "0.5640941", "0.56306255", "0.56256384", "0.5610023", "0.5605661", "0.55976874", "0.5594956", "0.55905616", "0.55902267", "0.5587837", "0.55874956", "0.55804", "0.5580239", "0.5579053", "0.5574333", "0.55701035", "0.5564547", "0.5558776", "0.5558269", "0.5547392", "0.5546601", "0.5546601", "0.5546601", "0.5543253", "0.55389595", "0.5538012", "0.5537019", "0.55357367", "0.55291194", "0.5529073", "0.5528988" ]
0.7461563
0
GET /status_de_la_inscripcions/1 GET /status_de_la_inscripcions/1.json
def show @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @status_de_la_inscripcion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end", "def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end", "def index\n @status_ref_pago_inscs = StatusRefPagoInsc.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_ref_pago_inscs }\n end\n end", "def show\n @status_de_la_notificacion = StatusDeLaNotificacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end", "def index\n @inscripcions = Inscripcion.all\n end", "def show\n @status_ref_pago_insc = StatusRefPagoInsc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_ref_pago_insc }\n end\n end", "def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subcategorias }\n end\n end", "def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end", "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "def index\n @status_de_interes_de_prospecto_validados = StatusDeInteresDeProspectoValidado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validados }\n end\n end", "def index\n @integrantes = Integrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @integrantes }\n end\n end", "def new\n @status_de_la_inscripcion = StatusDeLaInscripcion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end", "def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end", "def index\n @status_del_tramite_de_becas = StatusDelTramiteDeBeca.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_tramite_de_becas }\n end\n end", "def index\n @status_del_admitidos = StatusDelAdmitido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_admitidos }\n end\n end", "def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end", "def show\n @status_de_interes_de_prospecto_validado = StatusDeInteresDeProspectoValidado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validado }\n end\n end", "def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end", "def show\n @status_ativ = StatusAtiv.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_ativ }\n end\n end", "def show\n @status_del_tramite_de_beca = StatusDelTramiteDeBeca.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_del_tramite_de_beca }\n end\n end", "def show\n @status_del_admitido = StatusDelAdmitido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_del_admitido }\n end\n end", "def show\n @status_confirmacao_adotando = StatusConfirmacaoAdotando.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_confirmacao_adotando }\n end\n end", "def index\n @inscriptions = Inscription.all\n end", "def index\n # @ideias = Ideia.all\n @ideias = Ideia.where(:status => '3')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ideias }\n end\n end", "def show\n @core_status_selo_fiscal_tipo = Core::StatusSeloFiscalTipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_status_selo_fiscal_tipo }\n end\n end", "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end", "def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end", "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "def show\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscriptionprepaconcour }\n end\n end", "def show\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inscrito }\n end\n end", "def show\n @indicativo = Indicativo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicativo }\n end\n end", "def index\n if params[:alunno_id]\n @notedisciplinari = Notadisciplinare.where(alunno_id: params[:alunno_id])\n else\n @notedisciplinari = Notadisciplinare.all\n end\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def situations_arrivals_countries_three\n @situations_arrivals_countries = SituationsArrivalsCountry.where(status:true, id: [1,2,3]).order('name ASC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @situations_arrivals_countries}\n end\n end", "def show\n @integrante = Integrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @integrante }\n end\n end", "def get_mission_invites\n\t#get all missions of user with invitaion_status = pending\n user = User.exists? (params[:user_id])\n\tif user\n\t\tmissions = user.missions.references( :user_missions).select('missions.id, missions.title, user_missions.invitation_time').where( user_missions:{ invitation_status: PENDING_MESA_INVITATION})\n\t\trespond_to do |format|\n\t\t format.json {render :json=> {:mesa_invites=> missions, :status => true} }\n\t\tend\n else\n\t respond_to do |format|\n\t\t format.json {render :json=> {:error=>'No user exists with id' , :status => false} }\n\t end\n\tend\n end", "def show\n @core_status_unidade_carga = Core::StatusUnidadeCarga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_status_unidade_carga }\n end\n end", "def show\n @core_status_processamento = Core::StatusProcessamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_status_processamento }\n end\n end", "def index\n @requests = Request.where(status: -1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @requests }\n end\n end", "def index\n @uchronias = Uchronia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @uchronias }\n end\n end", "def show\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end", "def index\n @inscriptions = Inscription.includes(:tournament).all\n\n respond_to do |format|\n format.html # index.rb\n format.xml { render :xml => @inscriptions }\n end\n end", "def show\n @incucai = Incucai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incucai }\n end\n end", "def show\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instituicao }\n end\n end", "def show\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indicacao }\n end\n end", "def show\n @core_status_desembaraco = Core::StatusDesembaraco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_status_desembaraco }\n end\n end", "def index\n @notadedebito = Notadedebito.find(params[:notadecredito_id])\n @renglon_notadebitos = @notadedebito.renglon_notadebitos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_notadebitos }\n end\n end", "def show\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sitio_entrega }\n end\n end", "def index\r\n# @asistencias = Asistencia.all\r\n seccion = params[:seccion_id]\r\n if params[:seccion_id].nil?\r\n fecha = Date.current\r\n else\r\n fecha = params[:fecha].to_date\r\n end\r\n \r\n @asistencias = Asistencia.por_seccion_fecha(anio_escolar.id, seccion, fecha).salida\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @asistencias }\r\n end\r\n end", "def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end", "def show\n @historial = Historial.find(params[:id])\n @receta = Recete.histori(@historial.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial }\n end\n end", "def show\n @chamado = Chamado.find(params[:id])\n\n #Traduz o tipo do chamado e seu status para string\n tipo = Chamado::CHAMADO_OPTIONS.invert[@chamado.tipochamado]\n status = Chamado::STATUS_OPTIONS.invert[@chamado.status]\n\n #Serializa o chamado\n chamado = @chamado.as_json(:except => [:tipochamado, :status])\n dtipo = { :tipochamado => tipo, :status => status }.as_json\n chamado = dtipo.merge(chamado)\n\n #Encontra o historico do chamado\n @audits = Audit.find_all_by_idchamado(params[:id])\n #Transforma o historico em json\n historico = @audits.as_json(:except => [:updated_at, :idchamado, :id])\n \n\n #Converte os valores armazenados no banco para os correspondentes nomes em\n #linguagem humana\n @audits.each do |h|\n if h.mudancas.has_key?(\"status\")\n h.mudancas[\"status\"].map!{ |j| Chamado::STATUS_OPTIONS.invert[j] }\n elsif h.mudancas.has_key?(\"tipochamado\")\n h.mudancas[\"tipochamado\"].map!{ |j| Chamado::CHAMADO_OPTIONS.invert[j] }\n end\n\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: { :chamado => chamado, :alteracoes => historico}}\n end\n end", "def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end", "def index\n @solicitantes = Solicitante.all\n end", "def show\n @invoice_status = InvoiceStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invoice_status }\n end\n end", "def show\n @civil_status = CivilStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @civil_status }\n end\n end", "def new\n @status_ref_pago_insc = StatusRefPagoInsc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_ref_pago_insc }\n end\n end", "def status\n get_json('status.json')\n end", "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end", "def show\n @tipo_convenio = TipoConvenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_convenio }\n end\n end", "def index\n\n if @notification\n json_response(@notification.user_subscriptions)\n end\n if request.path_parameters.has_key?(:user_id)\n json_response(@user.user_subscriptions)\n end\n end", "def index\n @ultimo_grado_de_estudios = UltimoGradoDeEstudio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ultimo_grado_de_estudios }\n end\n end", "def show\n @conta = Conta.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @conta, :include => {\n :movimentos => {\n :include => [:nota, :pessoa],\n :methods => [:favorecido],\n :except => [:created_at, :updated_at]\n }\n },\n :methods => [:saldo]\n }\n end\n end", "def index\n @minicursos = Minicurso.all\n\t\t#@minicursos = Minicurso.scoped\n\t\t#@users = Minicurso.inscritos(params[:id]) if params[:id].present?\n\n respond_to do |format|\n\t\t\t format.html # index.html.erb\n\t\t\t format.json { render json: @minicursos }\n end\n end", "def show\n @movimentacao_de_estoque = MovimentacaoDeEstoque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @movimentacao_de_estoque }\n end\n end", "def status\n get('/api/status')\n end", "def show\n @colegiatura = Colegiatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegiatura }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def show\n @suplente = Suplente.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @suplente }\n end\n end", "def show\n @central_correio = CentralCorreio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @central_correio }\n end\n end", "def show\n @sezione = Sezione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sezione }\n end\n end", "def show\n @requerimiento ||= Requerimiento.where(:numero => params[:id]).first\n @areas = Area.where(\" nombre like '%DIT%' \")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @requerimiento }\n end\n end", "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "def show\r\n @title = Title.includes([pinyin_comments: :user], :title_comments, :institutions, translations: [:user, comments: :user]).order(\"translations.created_at\").find_by(id: params[:id])\r\n if params[:official]\r\n @title = @title.where({translations: {approved: true}})\r\n end\r\n render json: @title, include: [:pinyin_comments, :title_comments, :institutions, translations: {include: [:user, comments: {include: :user}]}]\r\n end", "def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end", "def show\n @sinh_vien = SinhVien.where(ma_sinh_vien: params[:id]).first\n # Resque.enqueue(GvLogger, params[:id])\n if @sinh_vien and @sinh_vien.trucnhat\n respond_to do |format| \n format.json { render json: JSON.parse(@sinh_vien.trucnhat)[\"days\"].sort_by }\n end\n else\n respond_to do |format| \n format.json { render json: nil }\n end\n end\n end", "def show\n @impuesto = Impuesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @impuesto }\n end\n end", "def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end", "def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end", "def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end", "def index\n @instituicao_responsavels = InstituicaoResponsavel.all\n end", "def show\n @inscripcione = Inscripcione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inscripcione }\n end\n end", "def index\n @estado_notificacions = EstadoNotificacion.all\n end", "def show\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @calificacion_servicio }\n end\n end", "def show\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_negocio }\n end\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def index\n @one_reg_institutions = OneRegInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @one_reg_institutions }\n end\n end", "def show\n @core_status_parametrizacao = Core::StatusParametrizacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_status_parametrizacao }\n end\n end", "def index\n @activacionclientets = Activacionclientet.all\n end", "def show\n @articulo = Articulo.find(params[:id])\n @noticias = Articulo.where(\"tipo = 'noticia'\").order(\"created_at desc\")\n @title = @articulo.titulo\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @articulo }\n end\n end", "def index\n @transcriptions = Transcription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transcriptions }\n end\n end", "def index\n @inscricaos = Inscricao.all\n end", "def index\n @idea_statuses = IdeaStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @idea_statuses }\n end\n end", "def show\n @situacion_revistum = SituacionRevistum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @situacion_revistum }\n end\n end", "def index\n @status_akun = StatusAkun.all\n end", "def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end", "def index\n @disciplines = Discipline.all\n #respond_to do |format|\n # format.json { render json: @disciplines, status: :ok }\n #end\n #render json: @disciplines, status: :ok\n respond_with @disciplines\n end", "def index\n @formatos = Formato.where(ativo: true)\n \t\n render json: @formatos\n end", "def status(id)\n get(\"mailers/status/#{id.to_i}\")\n end" ]
[ "0.73690134", "0.6739656", "0.66322225", "0.65064174", "0.6447876", "0.6446406", "0.63924336", "0.63177633", "0.63115704", "0.6276682", "0.62350416", "0.6232295", "0.6220298", "0.62199974", "0.62154335", "0.6141549", "0.61362237", "0.6094502", "0.60912776", "0.6070321", "0.6017665", "0.60025734", "0.5989085", "0.59760475", "0.59706795", "0.5948647", "0.59464586", "0.59354115", "0.59323937", "0.59238225", "0.5896112", "0.5880095", "0.5864683", "0.58612657", "0.584859", "0.58308476", "0.58288336", "0.58288133", "0.58109134", "0.58039635", "0.5801147", "0.5791362", "0.57899976", "0.57590306", "0.5755207", "0.57542056", "0.57528716", "0.57498795", "0.57492965", "0.57453173", "0.5734112", "0.57333684", "0.5731957", "0.5731093", "0.57107764", "0.57095903", "0.5706964", "0.5703788", "0.57015735", "0.56935525", "0.5692575", "0.5678412", "0.56773037", "0.5666746", "0.5666591", "0.56629246", "0.56564534", "0.5652397", "0.5651098", "0.5645723", "0.56411666", "0.56376064", "0.56353706", "0.5633023", "0.56310403", "0.56250405", "0.562", "0.56132203", "0.5611906", "0.56094766", "0.5607674", "0.56066847", "0.5606193", "0.5604579", "0.5604536", "0.5602273", "0.5601521", "0.5601422", "0.5600717", "0.5596812", "0.5596577", "0.559556", "0.55944955", "0.5594344", "0.5592757", "0.5592334", "0.5591012", "0.5587509", "0.55853826", "0.5583086" ]
0.7122019
1
GET /status_de_la_inscripcions/new GET /status_de_la_inscripcions/new.json
def new @status_de_la_inscripcion = StatusDeLaInscripcion.new respond_to do |format| format.html # new.html.erb format.json { render json: @status_de_la_inscripcion } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @status_de_la_notificacion = StatusDeLaNotificacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_notificacion }\n end\n end", "def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end", "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "def new\n @status_de_interes_de_prospecto_validado = StatusDeInteresDeProspectoValidado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validado }\n end\n end", "def create\n @status_de_la_inscripcion = StatusDeLaInscripcion.new(params[:status_de_la_inscripcion])\n\n respond_to do |format|\n if @status_de_la_inscripcion.save\n format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully created.' }\n format.json { render json: @status_de_la_inscripcion, status: :created, location: @status_de_la_inscripcion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @status_ref_pago_insc = StatusRefPagoInsc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_ref_pago_insc }\n end\n end", "def new\n @status_ativ = StatusAtiv.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_ativ }\n end\n end", "def new\n @prioridade = Prioridade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prioridade }\n end\n end", "def new\n @status_del_tramite_de_beca = StatusDelTramiteDeBeca.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_del_tramite_de_beca }\n end\n end", "def new\n @indicativo = Indicativo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicativo }\n end\n end", "def new\n @request_status = RequestStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request_status }\n end\n end", "def new\n @sitio_entrega = SitioEntrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sitio_entrega }\n end\n end", "def new\n @civil_status = CivilStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @civil_status }\n end\n end", "def new\n @suplente = Suplente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suplente }\n end\n end", "def new\n @status = Status.new\n @status.build_document\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "def new\n @tipo_negocio = TipoNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_negocio }\n end\n end", "def new\n @indicacao = Indicacao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @indicacao }\n end\n end", "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end", "def new\n @sezione = Sezione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sezione }\n end\n end", "def new\n @tipo_convenio = TipoConvenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_convenio }\n end\n end", "def new\n @categoria = Categoria.new\n @categoria.status = Status.find_by_descricao('Ativo')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @categoria }\n end\n end", "def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end", "def create\n @new_ = New.new(new__params)\n\n respond_to do |format|\n if @new_.save\n format.html { redirect_to @new_, notice: \"New was successfully created.\" }\n format.json { render :show, status: :created, location: @new_ }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @new_.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerimiento }\n end\n end", "def new\n @mission = Mission.new(:convocationjours => [Convocationjour.new])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @mission }\n end\n end", "def new\n redirect_to new_prospecto_path, :flash => { :info => \"No es posible crear Inscritos sin antes seguir el proceso\" } \n @inscrito = Inscrito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inscrito }\n end\n end", "def new\n @itemstatus = Itemstatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @itemstatus }\n end\n end", "def create\n @new_status = NewStatus.new(params[:new_status])\n\n respond_to do |format|\n if @new_status.save\n format.html { redirect_to @new_status, notice: 'New status was successfully created.' }\n format.json { render json: @new_status, status: :created, location: @new_status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @new_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @status_del_admitido = StatusDelAdmitido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_del_admitido }\n end\n end", "def new\n @inscriptionprepaconcour = Inscriptionprepaconcour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inscriptionprepaconcour }\n end\n end", "def new\n @integrante = Integrante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @integrante }\n end\n end", "def new\n @published = Published.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @published }\n end\n end", "def new\n @importdatum = Importdatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @importdatum }\n end\n end", "def new\n @invoice_status = InvoiceStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_status }\n end\n end", "def new\n @invite_status = InviteStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite_status }\n end\n end", "def new\n @breadcrumb = 'create'\n @insurance = Insurance.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insurance }\n end\n end", "def new\n @core_nota = Core::Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_nota }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @po }\n end\n end", "def create\n @status_de_la_notificacion = StatusDeLaNotificacion.new(params[:status_de_la_notificacion])\n\n respond_to do |format|\n if @status_de_la_notificacion.save\n format.html { redirect_to @status_de_la_notificacion, notice: 'Status de la notificacion was successfully created.' }\n format.json { render json: @status_de_la_notificacion, status: :created, location: @status_de_la_notificacion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_de_la_notificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end", "def new\n @inning = Inning.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inning }\n end\n end", "def new\n @subcategoria = Subcategoria.new\n @subcategoria.status = Status.find_by_descricao('Ativo')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subcategoria }\n end\n end", "def new\n @tipo_actividad = TipoActividad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_actividad }\n end\n end", "def new\n authorize! :manage, LopMonHocSinhVien\n @lop_mon_hoc_sinh_vien = @lop_mon_hoc.lop_mon_hoc_sinh_viens.build\n respond_to do |format|\n format.html { render :layout => (request.headers['X-PJAX'] ? false : true)}\n format.json { render json: @lop_mon_hoc_sinh_vien }\n end\n end", "def new\n @ongoing = Ongoing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ongoing }\n end\n end", "def new\n @importation = Importation.new\n @importation.status = 1\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @importation }\n end\n end", "def new\r\n @subscription = Subscription.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end", "def new\n @noto = Noto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noto }\n end\n end", "def new\n @sitio = Sitio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sitio }\n end\n end", "def new\n @subscription = current_user.subscriptions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription }\n end\n end", "def new\n @interested = Interested.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interested }\n end\n end", "def new\n @sesion = Sesion.where(entidad_paraestatal_id: @entidad_paraestatal.id).new\n #@sesion.suplente = Suplente.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sesion }\n end\n end", "def new\n @subscription_request = SubscriptionRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @subscription_request }\n end\n end", "def new\n @suc = Suc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suc }\n end\n end", "def new\n @situacion_revistum = SituacionRevistum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @situacion_revistum }\n end\n end", "def new\n @presence = Presence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @presence }\n end\n end", "def new\n @activite = Activite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @activite }\n end\n end", "def new\n @ci = Ci.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ci }\n end\n end", "def new\n @subscription = Subscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @subscription }\n end\n end", "def new\n @info_polen = InfoPolen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @info_polen }\n end\n end", "def new\n @info_polen = InfoPolen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @info_polen }\n end\n end", "def new\n get_status\n @tag = Tag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end", "def new\n options = {} \n options[:status_id] = Status.find_by_title(params[:page]).id if params[:page]\n @task = Task.new(options)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @task }\n format.js { render :layout => false }\n end\n end", "def new\n @instituicao = Instituicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @instituicao }\n end\n end", "def new\n @precinct = Precinct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precinct }\n end\n end", "def new\n @nvs_mig_status = NvsMigStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nvs_mig_status }\n end\n end", "def new\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "def new\n @idea_status = IdeaStatus.new\n # create the translation object for however many locales there are\n # so the form will properly create all of the nested form fields\n I18n.available_locales.each do |locale|\n\t\t\t@idea_status.idea_status_translations.build(:locale => locale)\n\t\tend\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @idea_status }\n end\n end", "def new\n @sotrudniki = Sotrudniki.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sotrudniki }\n end\n end", "def new\n @searchstatus = Searchstatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @searchstatus }\n end\n end", "def new\r\n @status_task = StatusTask.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @status_task }\r\n end\r\n end", "def new\n @movimentacao_de_estoque = MovimentacaoDeEstoque.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movimentacao_de_estoque }\n end\n end", "def new\n @periodos = Periodo.all.collect{|p|[\"#{t p.inicio.strftime(\"%B\")} - #{t p.fim.strftime(\"%B\")}\",p.id]}\n @requisicao = Requisicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @requisicao }\n end\n end", "def new\n @respuesta = Respuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @respuesta }\n end\n end", "def new\n @solicitud_servicio = SolicitudServicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solicitud_servicio }\n end\n end", "def new\n @interval = Interval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interval }\n end\n end", "def new\n @cliente = Cliente.new\n localidad_new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cliente }\n end\n end", "def new\n @venta = Venta.new(:fecha => Date.today, confirmada: true)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @venta }\n end\n end", "def new\n @tenni = Tenni.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tenni }\n end\n end", "def new\n @spiel = Spiel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spiel }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "def new\n @core_status_processamento = Core::StatusProcessamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_status_processamento }\n end\n end", "def new\n @localisation = Localisation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @localisation }\n end\n end", "def new\n @selecao = Selecao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @selecao }\n end\n end", "def new\n @comisaria = Comisaria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comisaria }\n end\n end", "def new\n @evaluationstatus = Evaluationstatus.new\n @title = 'New Evaluation Status'\n @description = 'Add a new evaluation status to the system'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evaluationstatus }\n end\n end", "def new\n @pto = Pto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pto }\n end\n end", "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status }\n end\n end", "def new\n @core_status_selo_fiscal_tipo = Core::StatusSeloFiscalTipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @core_status_selo_fiscal_tipo }\n end\n end" ]
[ "0.740104", "0.73748904", "0.69888073", "0.6972228", "0.69482505", "0.6943155", "0.6906172", "0.6898177", "0.6893697", "0.68728787", "0.6843964", "0.6828469", "0.6769151", "0.6768448", "0.6748386", "0.6746288", "0.6740954", "0.6739909", "0.6729575", "0.67295265", "0.67252254", "0.6721654", "0.6720491", "0.6704097", "0.67005455", "0.66860723", "0.66797465", "0.666508", "0.66558164", "0.665526", "0.6649367", "0.6648613", "0.664525", "0.6640531", "0.6640054", "0.66119075", "0.6610362", "0.6597376", "0.6597376", "0.6597376", "0.6597376", "0.6597376", "0.6588584", "0.65860856", "0.6582759", "0.6577928", "0.657789", "0.65770847", "0.65752023", "0.65746516", "0.65740675", "0.656487", "0.6562814", "0.65581805", "0.65560603", "0.6548917", "0.65480924", "0.6546884", "0.65436065", "0.6537879", "0.653655", "0.6535606", "0.65339035", "0.6530124", "0.6527601", "0.6527601", "0.6526789", "0.6523572", "0.65213734", "0.6518098", "0.65034217", "0.6501573", "0.6495401", "0.6493893", "0.64928925", "0.6491416", "0.64862233", "0.64859927", "0.6484256", "0.6479206", "0.64773303", "0.64750355", "0.64736754", "0.64727986", "0.6471922", "0.6469608", "0.6469608", "0.6469608", "0.6469608", "0.6469608", "0.6464285", "0.64611244", "0.6460714", "0.64606774", "0.64604664", "0.6459184", "0.64584816", "0.64584816", "0.64584816", "0.6457675" ]
0.7762496
0
POST /status_de_la_inscripcions POST /status_de_la_inscripcions.json
def create @status_de_la_inscripcion = StatusDeLaInscripcion.new(params[:status_de_la_inscripcion]) respond_to do |format| if @status_de_la_inscripcion.save format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully created.' } format.json { render json: @status_de_la_inscripcion, status: :created, location: @status_de_la_inscripcion } else format.html { render action: "new" } format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @inscripcion = Inscripcion.new(inscripcion_params)\n\n respond_to do |format|\n if @inscripcion.save\n format.html { redirect_to @inscripcion, notice: 'Inscripcion was successfully created.' }\n format.json { render :show, status: :created, location: @inscripcion }\n else\n format.html { render :new }\n format.json { render json: @inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @status_de_la_inscripcions = StatusDeLaInscripcion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_inscripcions }\n end\n end", "def create\n @status_ref_pago_insc = StatusRefPagoInsc.new(params[:status_ref_pago_insc])\n\n respond_to do |format|\n if @status_ref_pago_insc.save\n format.html { redirect_to @status_ref_pago_insc, notice: 'Status ref pago insc was successfully created.' }\n format.json { render json: @status_ref_pago_insc, status: :created, location: @status_ref_pago_insc }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_ref_pago_insc.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unsubscription = Unsubscription.new(unsubscription_params)\n is_specific = @unsubscription.reason_specific\n respond_to do |format|\n if @unsubscription.save\n if is_specific\n @unsubscription.choices.last.specific = true\n @unsubscription.save\n format.html { redirect_to limit_right_confirmation_requests_path(user_id: params[:user_id]) }\n else\n flash[:success] = \"Le traitement a bien été créé!\"\n format.html { redirect_to @unsubscription }\n format.json { render :show, status: :created, location: @unsubscription }\n end\n else\n format.html { render :new }\n format.json { render json: @unsubscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @inscripcione = Inscripcione.new(params[:inscripcione])\n\n respond_to do |format|\n if @inscripcione.save\n format.html { redirect_to(@inscripcione, :notice => 'Inscripcione was successfully created.') }\n format.xml { render :xml => @inscripcione, :status => :created, :location => @inscripcione }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @inscripcione.errors, :status => :unprocessable_entity }\n end\n end\n end", "def inscripcion_params\n params.require(:inscripcion).permit(:fecha, :estudiante_id, :curso_id, :monto)\n end", "def create\n @misuration_subscription = MisurationSubscription.new(misuration_subscription_params)\n @misuration_subscription.user_id=current_user.id\n respond_to do |format|\n if @misuration_subscription.save\n format.html { redirect_to @misuration_subscription, notice: 'Iscrizione al sensore creata correttamente' }\n format.json { render :show, status: :created, location: @misuration_subscription }\n else\n format.html { render :new }\n format.json { render json: @misuration_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @inscripcions = Inscripcion.all\n end", "def new\n @status_de_la_inscripcion = StatusDeLaInscripcion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end", "def create\n @inscricao = Inscricao.new(inscricao_params)\n\n respond_to do |format|\n if @inscricao.save\n format.html { redirect_to @inscricao, notice: \"Inscricao was successfully created.\" }\n format.json { render :show, status: :created, location: @inscricao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i\n @electronic_prescription = ElectronicPrescription.new(electronic_prescription_params)\n\n respond_to do |format|\n if @electronic_prescription.save\n format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully created.' }\n format.json { render :show, status: :created, location: @electronic_prescription }\n else\n format.html { render :new }\n format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @status_de_la_notificacion = StatusDeLaNotificacion.new(params[:status_de_la_notificacion])\n\n respond_to do |format|\n if @status_de_la_notificacion.save\n format.html { redirect_to @status_de_la_notificacion, notice: 'Status de la notificacion was successfully created.' }\n format.json { render json: @status_de_la_notificacion, status: :created, location: @status_de_la_notificacion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_de_la_notificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def invoice_created(data)\n subscription = ::Subscription.find_by(iugu_id: data[:subscription_id])\n\n unless subscription.nil?\n subscription.update(iugu_payment_status: data[:status])\n end\n end", "def test_accueil_et_inscription\n\t\tpost '/accueil', identifiant: '2', date_naiss: '1915-12-19'\n\t\tassert last_response.body.include? 'son inscription'\n\tend", "def create\n params.permit(:intitule, :estObligatoire, :nombreDeCaractere, :ordre, :sondage_id)\n ajout = QuestionOuverteService.instance.creerQuestionOuverte(params[:intitule], params[:estObligatoire], params[:nombreDeCaractere], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end", "def create\n @categories = Category.all\n @subscription = Subscription.new(subscription_params)\n respond_to do |format|\n if @subscription.save\n\t @subscription.update(ordinal: Subscription.count)\n SubscriptionMailer.with(subscription: @subscription, new: \"true\").notification_email.deliver_now\n format.html { render :subscription_judging, notice: '加盟店サブスクショップの審査申請しました' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def inscription_params\n params.require(:inscription).permit(:nome, :endereco, :bairro, :local_trabalho, :municipio, :uf, :regime_juridico, :cargo_funcao, :rg, :cpf, :email, :contato, :responsavel)\n end", "def create\n @informativo_obra = InformativoObra.new(informativo_obra_params)\n\n @status = Statusobra.find_by_statusobra_type(\"Salvo\")\n @informativo_obra.statusobra_id = @status.id\n\n respond_to do |format|\n if @informativo_obra.save\n format.html { redirect_to @informativo_obra, notice: 'Informativo de obra foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @informativo_obra }\n else\n format.html { render :new }\n format.json { render json: @informativo_obra.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @datos_insumos_reactivo = DatosInsumosReactivo.new(datos_insumos_reactivo_params)\n\n respond_to do |format|\n if @datos_insumos_reactivo.save\n format.html { redirect_to @datos_insumos_reactivo, notice: 'Datos insumos reactivo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @datos_insumos_reactivo }\n else\n format.html { render action: 'new' }\n format.json { render json: @datos_insumos_reactivo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @inscrito = Inscrito.new(params[:inscrito])\n\n respond_to do |format|\n if @inscrito.save\n format.html { redirect_to @inscrito, notice: 'Inscrito was successfully created.' }\n format.json { render json: @inscrito, status: :created, location: @inscrito }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inscrito.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @inscricao = Inscricao.new(inscricao_params)\n \n respond_to do |format|\n if @inscricao.save\n @arquivo = PdfInscricao.gerar_comprovante_inscricao(@inscricao)\n flash[:message] = \"mensagem\"\n flash[:notice] = \"Inscrição nº: #{@inscricao.id} realizada com sucesso. #{view_context.link_to('Clique aqui', download_pdf_inscricao_inscricaos_path(arquivo: @arquivo), class: 'alert-link', target: '_blank')} para baixar o comprovante de inscrição.\"\n format.html { redirect_to inscricao_realizada_inscricaos_path }\n format.json { redirect_to inscricao_realizada_inscricaos_path, status: :created, location: @inscricao }\n else\n format.html { render :new }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @indicacao = Indicacao.new(params[:indicacao])\n\n respond_to do |format|\n if @indicacao.save\n format.html { redirect_to @indicacao, notice: 'A Indicação de Condutor foi criada com sucesso.' }\n format.json { render json: @indicacao, status: :created, location: @indicacao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @invoice = Invoice.new(invoice_params)\n #@invoice.type_invoice = 'Venda'\n\n respond_to do |format|\n @invoice.status = 'ABERTA'\n @invoice.form_receipt = 'NÃO INFORMADO'\n @invoice.installments = '1'\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Criado com sucesso.' }\n format.json { render :show, status: :created, location: @invoice }\n #sweetalert_success('Dados cadastrados com sucesso!', 'Sucesso!', useRejections: false)\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @insumo = Insumo.new(insumo_params)\n\n respond_to do |format|\n if @insumo.save\n format.html { redirect_to insumos_url, notice: 'Insumo was successfully created.' }\n format.json { render :show, status: :created, location: @insumo }\n else\n format.html { render :new }\n format.json { render json: @insumo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n sub_email = params[:sub_email]\n status = params[:status].to_i\n if Subscribe.exists?(sub_email: sub_email)\n @subscribe = Subscribe.find_by_sub_email(sub_email)\n @subscribe.status = status\n @subscribe.save\n else\n @subscribe = Subscribe.new\n @subscribe.sub_email = sub_email\n @subscribe.status = status\n @subscribe.save\n end\n msg = '订阅成功'\n if status == 0\n msg = '取消订阅成功!'\n else\n @projects = Project.take(10)\n puts @projects.to_json\n # 发送一个邮件\n UserMailer.send_mail(@projects, sub_email, 'HuntCode每周项目精选', request.raw_host_with_port).deliver_later\n end\n render :json=>{:status=>100, :msg=>msg}\n end", "def set_inscripcion\n @inscripcion = Inscripcion.find(params[:id])\n end", "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end", "def accept\n respond_to do |format|\n user_quest = UsersQuest.update(params[:id], :is_accepted => true, :is_rejected => false)\n @assignor_id = Connection.find_by(\"user_id = ? OR connection_id = ?\", user_quest.assignor_id, user_quest.assignee_id)\n if @assignor_id == nil\n @assignor_id = Connection.create(:user_id => user_quest.assignor_id, :connection_id => user_quest.assignee_id)\n end\n @assignor_id.frequency += 1\n @assignor_id.save\n notif_user = User.find_by(:id => user_quest.assignor_id)\n notif = Notification.create(:user_id => user_quest.assignor_id,\n :title => \"#{@current_user.first_name} #{@current_user.last_name} has accepted your assigned quest: #{Quest.find(params[:id]).title}\",\n :url => quest_path(user_quest.quest_id))\n @options = {:channel => \"/notifs/#{user_quest.assignor_id}\",\n :message => notif.title,\n :count => \"#{User.unread_notifications_count notif_user}\", :redirect => quest_path(params[:id]),\n :url => quest_path(user_quest.quest_id),\n :id => notif.id}\n format.html {redirect_to quest_path(params[:id])}\n format.js\n end\n end", "def status\n respond_to do |format|\n quest = Quest.find(params[:id])\n quest.update(:status=> params[:string])\n #update status in the db when it is done\n if (params[:string] == \"Done\")\n quest.is_completed=true\n quest.completed_at = DateTime.now.utc\n quest.save\n user = User.find(@current_user.id)\n user.points += 10\n user.save\n if @current_user.gender\n gender = 'Male'\n else\n gender = 'Female'\n end\n User.publish_event :gender, ({:gender => gender})\n\n userQuest = UsersQuest.find_by_quest_id(quest.id)\n if @current_user.id==userQuest.assignor_id && @current_user.id==userQuest.assignee_id\n User.publish_event :quest_type, ({:self_assigned => 'Self Assigned'})\n else\n User.publish_event :quest_type, ({:self_assigned => 'Not Self Assigned'})\n end\n\n notif_user = User.find_by(:id => userQuest.assignor_id)\n notif = Notification.create(:user_id => userQuest.assignor_id,\n :title => \"#{@current_user.first_name} #{@current_user.last_name} has completed your assigned quest: #{quest.title}\",\n :url => quest_path(userQuest.quest_id))\n @options = {:channel => \"/notifs/#{userQuest.assignor_id}\",\n :message => notif.title,\n :count => \"#{User.unread_notifications_count notif_user}\", :redirect => quest_path(params[:id]),\n :url => quest_path(userQuest.quest_id),\n :id => notif.id}\n\n end\n format.html {redirect_to quest_path(params[:id])}\n format.js\n end\n end", "def create\n @inscriptionprepaconcour = Inscriptionprepaconcour.new(params[:inscriptionprepaconcour])\n\n respond_to do |format|\n if @inscriptionprepaconcour.save\n format.html { redirect_to @inscriptionprepaconcour, notice: 'Inscriptionprepaconcour was successfully created.' }\n format.json { render json: @inscriptionprepaconcour, status: :created, location: @inscriptionprepaconcour }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inscriptionprepaconcour.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n\n @it_inscripcion_registro = current_user.it_inscripcion_registros.build(it_inscripcion_registro_params)\n\n #Se cuenta cuantas personas se han preinscrito a un grupo. Se cuenta con todos los registros no\n #importando que éstos no hayan sido validados. El dato se obtiene a través de todos los registros\n #de preinscripción, el id para el grupo actual se obtiene con @it_inscripcion_registro.grupo_id\n cupos = ItInscripcionRegistro.where(grupo_id: @it_inscripcion_registro.grupo_id).count\n\n #Se localiza si el usuatio tiene un id previo con ese mismo grupo. Si existe se le envia un mensaje\n # y no se permite guardar el registro por segunda ocasión.\n usuario = User.find(current_user.id)\n registro = ItInscripcionRegistro.find_by(user_id: usuario, grupo_id: @it_inscripcion_registro.grupo_id)\n\n #Si el cupo del grupo excede los 25 alunos se le muestra un mensaje al usuario donde se le indica\n #que deberá elegir un grupo distinto, el registro de inscripción no se guardará en la base dde datos_bancos\n #hay que agregar este metodo a las rb de el modelo correspondiente.\n if cupos > 40\n redirect_to new_it_inscripcion_registro_path, notice: \"El grupo ha alcanzado su ocupación máxima. Por favor elija otro grupo\"\n elsif registro.present? && registro.grupo_id == @it_inscripcion_registro.grupo_id\n redirect_to panel_alumnos_path, notice: \"Usted ya tiene registrada una solicitud con este grupo.\"\n else\n\n respond_to do |format|\n if @it_inscripcion_registro.save\n format.html { redirect_to @it_inscripcion_registro, notice: 'El registro de inscripción se creó correctamente.' }\n format.json { render :show, status: :created, location: @it_inscripcion_registro }\n else\n format.html { render :new }\n format.json { render json: @it_inscripcion_registro.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def interessado_params\n params.require(:interessado).permit(:nome, :cpf, :rg, :data_nasc, :estado_civil, :regime_bens, :renda, :sera_admin, :dispon_integral, :pagto_taxas, :pro_contratos, :valid_ponto_comers, :doc_ponto_comers, :aprov_estabelecimento, :oprov_proj_arqus , :trein_consul_comercia, :trein_coord_pedags, :trein_oper_franquia, :trein_prof_titulars, :quem_sera_admin, :resumo_prof, :planilhas, :manifesto_pos, :email, :redacaos, :cronogramas, :projeto_arquitetonicos, :cartum, :status, :doc_fiscais, :interessado_id, :doc_fiscais)\n end", "def create\n @nota_progreso = NotaProgreso.new(nota_progreso_params)\n \n @nota_progreso.historia_clinica_id = @historia_clinica.id\n\n\n\n\n respond_to do |format|\n if @nota_progreso.save\n format.html { redirect_to paciente_historia_clinica_nota_progreso_path(@paciente, @historia_clinica, @nota_progreso), notice: 'Nota de Evolución creada Satisfactoriamente.' }\n\n format.json { render :show, status: :created, location: @nota_progreso }\n else\n format.html { render :new }\n format.json { render json: @nota_progreso.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create\n @incucai = Incucai.new(params[:incucai])\n\n respond_to do |format|\n if @incucai.save\n format.html { redirect_to @incucai, notice: 'Incucai was successfully created.' }\n format.json { render json: @incucai, status: :created, location: @incucai }\n else\n format.html { render action: \"new\" }\n format.json { render json: @incucai.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params.permit(:id_groupe, :id_question)\n ajout = GroupeService.instance.ajouterQuestion(params[:id_groupe], params[:id_question])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end", "def updateStatus\n result = Hash.new\n begin # try\n result = SubscribesHlp.updateStatus(params)\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def create\n @services = params[:inputserv]#[:inputcantidad]\n @quantity = params[:inputcantidad]\n @citation = Citation.new(citation_params)\n @client = Client.where(:id => @citation.client_id).select(:email)\n @client_name = Client.where(:id => @citation.client_id).select(:name, :firstlastname)\n\n respond_to do |format|\n if @citation.save\n cont = 0\n @services.each do |p|\n detalle = CitationDetail.new(service_id: p, quantity: @quantity[cont], citation_id:@citation.id)\n detalle.save\n cont +=1\n end\n #NotifyMailer.notify_mail(@citation).deliver\n \n format.html { redirect_to @citation, notice: 'Citation was successfully created.' }\n format.json { render :show, status: :created, location: @citation }\n else\n @clients = Client.all.map{|p| [ p.name, p.id ] }\n @services_combo = Service.all.map{|p| [ p.name, p.id ] }\n @citation_details = CitationDetail.where(:service_id => params[:id])\n #@services = params[:inputserv][:inputcantidad]\n format.html { render :new }\n format.json { render json: @citation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tecnica_de_impresion = TecnicaDeImpresion.new(tecnica_de_impresion_params)\n\n respond_to do |format|\n if @tecnica_de_impresion.save\n format.html { redirect_to @tecnica_de_impresion, notice: 'Tecnica de impresion was successfully created.' }\n format.json { render :show, status: :created, location: @tecnica_de_impresion }\n else\n format.html { render :new }\n format.json { render json: @tecnica_de_impresion.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @status_de_la_notificacions = StatusDeLaNotificacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_la_notificacions }\n end\n end", "def create\n @inquilino = Inquilino.new(inquilino_params)\n respond_to do |format|\n if @inquilino.save\n #@pagamento = Pagamento.create(mes: @inquilino.dataVencimento.to_s, pago: @inquilino.pago, inquilino_id: @inquilino.id)\n #@mensalidade = Mensalidade.create(inquilino_id: @inquilino.id, pagamento_id: @pagamento.id)\n #@mensalidade = Mensalidade.create(pago: @inquilino.pago, inquilino_id: @inquilino.id)\n @mesa = @inquilino.dataVencimento\n @cont = 0\n 12.times do\n @cont += 1\n @mes = @mesa + @cont.month\n @mensalidades = Mensalidade.create(inquilino_id: @inquilino.id, mes: @mes, pago: false)\n end\n #\n @whatsapp = Whatsapp.create(inquilino_id: @inquilino.id, numero: \" \", endereco: \" \")\n\n format.html {redirect_to @inquilino, notice: 'Inquilino criado com sucesso!.'}\n format.json {render :show, status: :created, location: @inquilino}\n else\n format.html {render :new}\n format.json {render json: @inquilino.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @incident = Incident.new(incident_params)\n @incident.status = \"abierto\"\n @incident.user ||= current_user\n\n respond_to do |format|\n if @incident.save\n format.html { redirect_to @incident, notice: 'Incidencia registrada' }\n format.json { render :show, status: :created, location: @incident }\n else\n format.html { render :new }\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end", "def notifications\n @campus_id = current_user.campus_users.first.campus_id\n invi_status=CRUD::Utility::Invitations.new(@campus_id)\n data = invi_status.get_request_sent\n render :json=>{:data=>data}\n end", "def create\n @prescribtion_detail = PrescribtionDetail.new(prescribtion_detail_params)\n\n respond_to do |format|\n if @prescribtion_detail.save\n format.html { redirect_to @prescribtion_detail, notice: 'Prescribtion detail was successfully created.' }\n format.json { render :show, status: :created, location: @prescribtion_detail }\n else\n format.html { render :new }\n format.json { render json: @prescribtion_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @iscrizione = Iscrizione.new(iscrizione_params)\n\n respond_to do |format|\n if @iscrizione.save\n format.html { redirect_to @iscrizione, notice: \"Iscrizione was successfully created.\" }\n format.json { render :show, status: :created, location: @iscrizione }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @iscrizione.errors, status: :unprocessable_entity }\n end\n end\n end", "def taskasign\n @story = Story.find(params[:id])\n @stat = Status.where(:id => @story.status_id).first.descripcion\n @task = Task.new\n \n @student = Student.where(:usuario_id => @session_student.id).first\n @team_id = @student.team_id \n respond_to do |format|\n format.html # taskasign.html.erb\n format.json { render json: @task }\n end\n end", "def index\n @status_ref_pago_inscs = StatusRefPagoInsc.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_ref_pago_inscs }\n end\n end", "def suscribe\n @estate = Estate.find(params[:id])\n @estate.update_attribute(:status, true)\n respond_to do |format|\n format.html { redirect_to estates_url, notice: 'Propiedad publicada exitosamente.' }\n format.json { head :no_content }\n end\n end", "def create\n @thesis = Thesis.new(thesis_params)\n project = Project.find(@thesis.project_id)\n @thesis.titulo = project.titulo\n @thesis.line_investigation_id = project.line_investigation.id\n @thesis.tutor = project.tutor\n \n respond_to do |format|\n if @thesis.save\n Tracing.create(thesis_id: @thesis.id, descripcion: \"Tesis/TEG Registrada\")\n\n #Notificaciones\n notific = Notification.create(tittle: \"Se ha registrado su T.E.G: \"+@thesis.titulo.upcase,\n event: \"Se ha registrado su T.E.G: \"+@thesis.titulo.upcase,\n viewed: FALSE,\n id_user: @thesis.user_id,\n id_publisher: nil,\n url: $domain_url+\"/notifications\")\n\n publicar_notificacion(notific.tittle,\"Hace un momento\",\"Postgrado\", notific.id_user,\n notific.event,Notification.where(:viewed => FALSE).where(:id_user => notific.id_user).count)\n NewThesesMailer.sample_email(@thesis).deliver_now\n\n\n format.html { redirect_to theses_path }\n format.json { render action: 'show', status: :created, location: @thesis }\n\n else\n format.html { render action: 'new' }\n format.json { render json: @thesis.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @indicativo = Indicativo.new(params[:indicativo])\n\n respond_to do |format|\n if @indicativo.save\n format.html { redirect_to @indicativo, notice: 'Indicativo was successfully created.' }\n format.json { render json: @indicativo, status: :created, location: @indicativo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @indicativo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @invoicestatus = Invoicestatus.new(invoicestatus_params)\r\n\r\n respond_to do |format|\r\n if @invoicestatus.save\r\n format.html { redirect_to @invoicestatus, notice: 'Invoicestatus was successfully created.' }\r\n format.json { render :show, status: :created, location: @invoicestatus }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @invoicestatus.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @situacoes_juridica = SituacoesJuridica.new(params[:situacoes_juridica])\n\n respond_to do |format|\n if @situacoes_juridica.save\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica cadastrada com sucesso.') }\n format.xml { render :xml => @situacoes_juridica, :status => :created, :location => @situacoes_juridica }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @suplente = Suplente.new(params[:suplente])\n\n respond_to do |format|\n if @suplente.save\n format.html { redirect_to @suplente, notice: 'Lista acuerdo was successfully created.' }\n format.json { render json: @suplente, status: :created, location: @suplente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @suplente.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @invoice = Invoice.new(params[:invoice])\n @invoice.client_id = params[:clients]\n @invoice.discount_id = params[:discount_id]\n @invoice.tax_id = params[:tax_id]\n @invoice.status = Invoice::DRAFT\n @invoice.year = @counter.year\n @invoice.invoice_id = @counter.number\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @iprannet_qosegressinterface = IprannetQosegressinterface.new(iprannet_qosegressinterface_params)\n\n respond_to do |format|\n if @iprannet_qosegressinterface.save\n format.html { redirect_to @iprannet_qosegressinterface, notice: 'Iprannet qosegressinterface was successfully created.' }\n format.json { render :show, status: :created, location: @iprannet_qosegressinterface }\n else\n format.html { render :new }\n format.json { render json: @iprannet_qosegressinterface.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @instum = current_user.insta.build(instum_params)\n # @instum.user_id = current_user.id\n\n respond_to do |format|\n if @instum.valid?\n @instum.save\n # binding.pry\n # redirect_to insta_path, notice: \"写真を投稿しました!\"\n # NoticeMailer.sendmail_insta(@instum).deliver\n format.html { redirect_to @instum, notice: '投稿が成功しました!' }\n format.json { render :show, status: :created, location: @instum }\n else\n format.html { render :new }\n format.json { render json: @instum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @patient = Patient.find(params[:patient_id])\n @prescription = @patient.prescriptions.build(prescription_params)\n @prescription.formulary_status = FORMULARY_STATUSES.sample\n @prescription.date_prescribed = Time.zone.now\n @prescription.active = true\n\n respond_to do |format|\n if @prescription.save\n format.html { redirect_to @patient, notice: 'Prescription was successfully created.' }\n format.json { render :show, status: :created, location: @prescription }\n else\n format.html { render :new }\n format.json { render json: @prescription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @instituicao = Instituicao.new(params[:instituicao])\n\n respond_to do |format|\n if @instituicao.save\n format.html { redirect_to @instituicao, notice: 'Instituicao was successfully created.' }\n format.json { render json: @instituicao, status: :created, location: @instituicao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @instituicao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @status_de_interes_de_prospecto_validado = StatusDeInteresDeProspectoValidado.new(params[:status_de_interes_de_prospecto_validado])\n\n respond_to do |format|\n if @status_de_interes_de_prospecto_validado.save\n format.html { redirect_to @status_de_interes_de_prospecto_validado, notice: 'Status de interes de prospecto validado was successfully created.' }\n format.json { render json: @status_de_interes_de_prospecto_validado, status: :created, location: @status_de_interes_de_prospecto_validado }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_de_interes_de_prospecto_validado.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @status_de_interes_de_prospecto_validados = StatusDeInteresDeProspectoValidado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_de_interes_de_prospecto_validados }\n end\n end", "def create\n @news = News.new(news_params)\n respond_to do |format|\n if params[:dirigido] == \"1\"\n @news.estado = \"activo\"\n if @news.save\n @users = User.all\n @users.each do |u|\n notificar(@news,u)\n end\n format.html { redirect_to '/news', notice: 'Noticia creada exitosamente'}\n format.json { render action: 'show', status: :created, location: @news }\n else\n @subjects = Subject.all\n @cohorts = Cohort.all\n @line_investigations = LineInvestigation.all\n @area_interests = AreaInterest.all\n format.html { render action: 'new' }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n elsif params[:dirigido] == \"2\"\n rol = Role.find_by(descripcion: 'Coordinador de Programa')\n @users = rol.users\n @users.each do |u|\n notificar(@news,u)\n end\n elsif params[:dirigido] == \"3\"\n rol = Role.find_by(descripcion: 'Profesor')\n @users = rol.users\n @users.each do |u|\n notificar(@news,u)\n end\n elsif params[:dirigido] == \"4\"\n rol = Role.find_by(descripcion: 'Participante')\n @users = rol.users\n @users.each do |u|\n notificar(@news,u)\n end\n format.html { redirect_to '/news', notice: 'Noticia creada exitosamente'}\n format.json { render action: 'show', status: :created, location: @news }\n elsif params[:dirigido] == \"5\"\n @cohort = Cohort.find(params[:cohort_id])\n @users = @cohort.users\n @users.each do |u|\n notificar(@news,u)\n end\n elsif params[:dirigido] == \"6\"\n @line_investigation = LineInvestigation.find(params[:line_investigation_id])\n @users = @line_investigation.users\n @users.each do |u|\n notificar(@news,u)\n end\n else\n @subjects = Subject.all\n @cohorts = Cohort.all\n @line_investigations = LineInvestigation.all\n @area_interests = AreaInterest.all\n format.html { render action: 'new', alert: \"A quien va elegido\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n #if @news.save\n # format.html { redirect_to users_path, notice: 'Noticia creada exitosamente' }\n # format.json { render action: 'show', status: :created, location: @news }\n # @user = User.all\n # if @user.length != 0\n # if params[:dirigido] == \"7\"\n # @selected_area_interests = AreaInterest.find(params[:area_interest_id])\n # @users_per_area = @selected_area_interests.users\n # if @users_per_area.count != 0\n # @users_per_area.each do |u|\n # notificar(@news,u)\n # end\n # end\n # else if params[:dirigido] == \"6\"\n # @selected_line_investigation = LineInvestigation.find(params[:line_investigation_id])\n # @areas_interest = @selected_line_investigation.area_interests\n # if @areas_interest.count != 0\n # @areas_interest.each do |a|\n # @users_per_area = a.users\n # if @users_per_area.count != 0\n # @users_per_area.each do |u|\n # notificar(@news,u)\n # end\n # end\n # end\n # end\n # else if params[:dirigido] == \"5\"\n # @subject = Subject.find(params[:subject_id])\n # @user_subject = @subject.users\n # if @user_subject.count != 0\n # @user_subject.each do |u|\n # notificar(@news,u)\n # end\n # end\n # end\n # end\n # @user.each do |usuario|\n # if params[:dirigido] == \"2\" and usuario.role.descripcion.downcase.include? \"coordinador\"\n # notificar(@news,usuario)\n #\n # else if params[:dirigido] == \"3\" and usuario.role.descripcion.downcase == \"profesor\"\n # notificar(@news,usuario)\n # else if params[:dirigido] == \"4\" and usuario.role.descripcion.downcase == \"participante\"\n # notificar(@news,usuario)\n #\n # end\n # end\n # end\n #\n # end\n #\n # end\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @news.errors, status: :unprocessable_entity }\n # end\n #end\n end\n end", "def index\n @inscriptions = Inscription.all\n end", "def subscribe_params\n params.require(:subscribe).permit(:status, :description)\n end", "def update\n respond_to do |format|\n if @inscripcion.update(inscripcion_params)\n format.html { redirect_to @inscripcion, notice: 'Inscripcion was successfully updated.' }\n format.json { render :show, status: :ok, location: @inscripcion }\n else\n format.html { render :edit }\n format.json { render json: @inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @invt = Invt.new(invt_params)\n\n respond_to do |format|\n if @invt.save\n format.html { redirect_to @invt, notice: 'El producto fue almacenado exitosamented.' }\n format.json { render :show, status: :created, location: @invt }\n else\n format.html { render :new }\n format.json { render json: @invt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @indivisual = Indivisual.new(indivisual_params)\n\n respond_to do |format|\n if @indivisual.save\n format.html { redirect_to @indivisual, notice: 'Indivisual was successfully created.' }\n format.json { render :show, status: :created, location: @indivisual }\n else\n format.html { render :new }\n format.json { render json: @indivisual.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @clinica = Clinica.new(clinica_params)\n @clinica.estatus = \"A\" \n respond_to do |format|\n if @clinica.save\n format.html { redirect_to @clinica, notice: 'La clinica fue registrada exitosamente.' }\n format.json { render :show, status: :created, location: @clinica }\n else\n format.html { render :new }\n format.json { render json: @clinica.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_de_la_inscripcion }\n end\n end", "def create\n @status_ativ = StatusAtiv.new(params[:status_ativ])\n\n respond_to do |format|\n if @status_ativ.save\n format.html { redirect_to @status_ativ, notice: 'Status ativ was successfully created.' }\n format.json { render json: @status_ativ, status: :created, location: @status_ativ }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_ativ.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n ActiveRecord::Base.transaction do\n @status = Status.new(status_params)\n\n respond_to do |format|\n if @status.save\n format.html { redirect_to @status, notice: 'El Estado se cre&oacute; exitosamente.' }\n format.json { render :show, status: :created, location: @status }\n else\n format.html { render :new }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @integrante = Integrante.new(params[:integrante])\n\n respond_to do |format|\n if @integrante.save\n format.html { redirect_to @integrante, notice: 'Integrante was successfully created.' }\n format.json { render json: @integrante, status: :created, location: @integrante }\n else\n format.html { render action: \"new\" }\n format.json { render json: @integrante.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @integrante = Integrante.new(integrante_params)\n\n respond_to do |format|\n if @integrante.save\n format.html { redirect_to @integrante, notice: 'Integrantes adicionados.' }\n format.json { render :show, status: :created, location: @integrante }\n else\n format.html { render :new }\n format.json { render json: @integrante.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ingresso = Ingresso.new(ingresso_params)\n\n respond_to do |format|\n if @ingresso.save\n format.html { redirect_to @ingresso, notice: 'Ingresso was successfully created.' }\n format.json { render :show, status: :created, location: @ingresso }\n else\n format.html { render :new }\n format.json { render json: @ingresso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @customizing = Customizing.new(customizing_params)\n # params[:goal][:user_id]\n # params :c, :freigabe_status_id\n respond_to do |format|\n if @customizing.save\n format.html { redirect_to @customizing, notice: 'Customizing was successfully created.' }\n format.json { render :show, status: :created, location: @customizing }\n else\n format.html { render :new }\n format.json { render json: @customizing.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @inscripcion_diplomado = InscripcionDiplomado.new(inscripcion_diplomado_params)\n grupo_id = GruposDiplomado.find_by(diplomado_id: @inscripcion_diplomado.diplomado_id).id\n @inscripcion_diplomado.grupos_diplomado_id = grupo_id\n # Se calcula el número de módulos que tiene el diplomado al que se inscribe\n # el usuario para crear ese mismo número de campos de calificación.\n #modulos = inscripcion_diplomado.grupos_diplomado.numero_modulos\n modulos = ModuloDiplomado.where(diplomado_id: @inscripcion_diplomado.diplomado_id)\n\n respond_to do |format|\n if @inscripcion_diplomado.save\n # Se guardan al mismo tiempo los datos de la inscripción y el número de\n # espacios de calificación para ese usuario.\n modulos.each do |modulo|\n CalificacionModulo.create(calificacion: \"\", inscripcion_diplomado_id: @inscripcion_diplomado.id,\n instructor_id: modulo.instructor_id, numero_modulo: modulo.numero_modulo, asistencia: \"\")\n end\n format.html { redirect_to new_inscripcion_diplomado_path, notice: 'La inscripción al diplomado fue creada correctamente.' }\n format.json { render :show, status: :created, location: @inscripcion_diplomado }\n else\n format.html { render :new }\n format.json { render json: @inscripcion_diplomado.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sindicato = Sindicato.new(sindicato_params)\n\n respond_to do |format|\n if @sindicato.save\n format.html { redirect_to @sindicato, notice: 'Sindicato fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @sindicato }\n else\n format.html { render :new }\n format.json { render json: @sindicato.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @actividad = @solicitud.actividades.new(params[:actividad])\n @actividades = @solicitud.actividades\n\n respond_to do |format|\n if @actividad.save\n flash[:success] = 'Asignacion creada con exito.'\n format.js\n else\n @actividad.institucion_id = current_usuario.institucion_id\n @instituciones = current_usuario.institucion.familia\n @usuarios = @institucion.usuarios.enlaces\n\n flash[:error] = 'Asignacion fallida.'\n format.js do\n render :failed\n end\n end\n end\n end", "def create \n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n @conta = Conta.new(nome: params[:nome], status: params[:status])\n @conta.pai = pai\n @conta.data_criacao = Time.now\n \n respond_to do |format|\n if @conta.save\n #format.html { redirect_to @conta, notice: 'Conta was successfully created.' }\n #format.json { render :show, status: :created, location: @conta }\n format.json { render json: @conta.to_json, status: :created }\n #@conta.to_json\n else\n #format.html { render :new }\n format.json { render json: @conta.errors, status: :unprocessable_entity } \n end\n end\n end", "def create\n getinvoicedatum = Getinvoicedatum.get_invoice_data(params)\n\n respond_to do |format|\n if getinvoicedatum.body.include?(\"<boolean xmlns=\\\"http://www.reconline.com/\\\">true</boolean>\")\n flash[:notice] = 'Getinvoicedatum was successfully created.'\n format.html { redirect_to :action=>:index }\n format.json { render json: @getinvoicedatum, status: :created, location: @getinvoicedatum }\n else\n flash[:notice] = getinvoicedatum.body\n \n format.html { render action: \"new\" }\n format.json { render json: @getinvoicedatum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @interesado = Interesado.new(interesado_params)\n\n respond_to do |format|\n if @interesado.save\n format.html { redirect_to @interesado, notice: 'Interesado was successfully created.' }\n format.json { render :show, status: :created, location: @interesado }\n else\n format.html { render :new }\n format.json { render json: @interesado.errors, status: :unprocessable_entity }\n end\n end\n end", "def tout\n #propriétaire\n \n # Block execution if there is no current user\n if(current_user.blank?)\n return render json:{\n errors: \"true\",\n message: \"User not connected\"\n }, status: 401\n end\n\n user = current_user\n logements = Logement.where(user_id: user)\n tarif = []\n #================ propriétaire =====================\n logements.each do |logement|\n tarif << {logement:logement,tarif:logement.calendrier,photo:\"#{logement.photos.first.photo}\",promotion:logement.promotions}\n end\n \n #================= cogestion ============\n logcngestions = Logement.all\n logcngestions.each do |logcogestion|\n if logcogestion.user != user && logcogestion.cogestion.present?\n if logcogestion.cogestion.include?(user.id)\n tarif << {logement:logcogestion,tarif:logcogestion.calendrier,photo:\"#{logcogestion.photos.first.photo}\",promotion:logcogestion.promotions}\n end\n end\n end\n \n render json:{\n tarif:tarif\n } \n end", "def inscricao_params\n params.require(:inscricao).permit(:nome_completo, :naturalidade, :nacionalidade, :nome_mae, :sexo, :estado_civil, :data_nascimento, :cpf, :rg, :orgao_emissor, :endereco, :complemento, :bairro, :cidade, :uf, :cep, :telefone_fixo, :telefone_celular, :email, :formacao, :orgao_representacao_classe, :numero_registro, :termo_aceito, :curriculo, {documentacao: []}, :recurso_solicitado, :recurso)\n end", "def create\n @solicitacao = Solicitacao.new(solicitacao_params)\n\n respond_to do |format|\n if @solicitacao.save\n @solicitacao.produto_solicitados.each do |item|\n i = Produto.find(item.produto_id)\n i.quantidade = i.quantidade - item.quantidade\n i.save\n end\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully created.' }\n format.json { render action: 'show', status: :created, location: @solicitacao }\n else\n format.html { render action: 'new' }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @insurancestatus = Insurancestatus.new(insurancestatus_params)\n\n respond_to do |format|\n if @insurancestatus.save\n format.html { redirect_to @insurancestatus, notice: 'Insurancestatus was successfully created.' }\n format.json { render :show, status: :created, location: @insurancestatus }\n else\n format.html { render :new }\n format.json { render json: @insurancestatus.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @solicitudlabexa = Solicitudlabexa.new(params[:solicitudlabexa])\n @solicitudlabexa.usuario_id = @usuario_actual.id\n @solicitudlabexa.asignatura_id = params[:asignatura][:id].to_i unless params[:asignatura].nil?\n @solicitudlabexa.fechasol=Date.today\n @solicitudlabexa.npuestos=params[:npuestos]\n @solicitudlabexa.curso=params[:nivel].to_s == \"0\" ? \"optativa\" : params[:nivel].to_s\n @solicitudlabexa.comentarios=Iconv.conv('ascii//translit//ignore', 'utf-8', params[:comentarios].to_s)\n @solicitudlabexa.horaini=params[:horaini][:comienzo]\n @solicitudlabexa.horafin=params[:horafin][:fin]\n @solicitudlabexa.asignado=false\n \n if params[:fecha]=~ /[0-3]?[0-9]\\-[0-1]?[0-9]\\-[0-9]{4}/\n nfecha=formato_europeo(params[:fecha])\n #nfechaini=params[:fechaini].to_s.split('-')\n #nfechaini=fecha[2]+\"-\"+fecha[1]+\"-\"+fecha[0]\n @solicitudlabexa.fecha=nfecha.to_date\n else\n @solicitudlabexa.fecha=nil\n end\n\n pref=\"\"\n @especiales=Laboratorio.where('especial=?',\"t\").to_a\n for especial in @especiales do\n nombre=especial.ssoo.to_s\n if params[:\"#{nombre}\"].to_s!='in'\n pref+=especial.nombre_lab.to_s+'-'+nombre+'-'+params[:\"#{nombre}\"]+\";\"\n end\n end\n @solicitudlabexa.preferencias=pref\n @solicitudlabexa.tipo=\"P\"\n \n respond_to do |format|\n\n if @solicitudlabexa.save \n CorreoTecnicos::emitesolicitudexamen(@solicitudlabexa,params[:fecha],\"\",\"Nueva \").deliver_later \n @solicitudlabexas = Solicitudlabexa.where(\"usuario_id = ? \",@usuario_actual.id).to_a\n format.html { redirect_to :action => \"index\" }\n format.xml { render :xml => @solicitudlabexas, :status => :created, :location => @solicitudlabexas }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @solicitudlabexas.errors, :status => :unprocessable_entity }\n end\n \n end\n \n end", "def create\n @ficha_ingreso = FichaIngreso.new(ficha_ingreso_params)\n\n respond_to do |format|\n if @ficha_ingreso.save\n format.html { redirect_to @ficha_ingreso, notice: 'Ficha ingreso was successfully created.' }\n format.json { render :show, status: :created, location: @ficha_ingreso }\n else\n format.html { render :new }\n format.json { render json: @ficha_ingreso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @activite = Activite.new(params[:activite])\n @activite.dossier_id = params[:dossier]\n @activite.save\n render :json => {\"success\"=>true,\"data\"=>@activite}\n \n end", "def create\n @ideia = Ideia.find(params[:ideia_id])\n @sugestao = @ideia.sugestoes.build(params[:sugestao])\n @sugestao.usuario = current_usuario\n\n respond_to do |format|\n if @ideia.status > 2\n if @sugestao.save\n format.html { redirect_to(@ideia, :notice => 'Sugestão enviada com sucesso.') }\n else\n format.html { redirect_to(@ideia, :notice => 'Houve um erro ao gravar sua sugestão (sugestão vazia ou sugestão com texto muito longo).') }\n end\n else\n format.html { redirect_to(@ideia, :notice => 'Sugestões são limitadas a ideias publicadas.') }\n end \n end\n end", "def create\n @estacionamiento = Estacionamiento.new(estacionamiento_params)\n @lista_departamentos = Ubigeo.find_by_sql(\"select distinct idDepartamento, Departamento from ubigeos\")\n @lista_provincias = Ubigeo.find_by_sql(\"select distinct idProvincia, Provincia from ubigeos\")\n @lista_distritos = Ubigeo.find_by_sql(\"select distinct idDistrito, Distrito from ubigeos\")\n @serv_adicinales = ServAdicinale.all\n\n respond_to do |format|\n if @estacionamiento.save\n format.html { redirect_to @estacionamiento, notice: 'Estacionamiento was successfully created.' }\n format.json { render :show, status: :created, location: @estacionamiento }\n else\n format.html { render :new }\n format.json { render json: @estacionamiento.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @estado_notificacion = EstadoNotificacion.new(estado_notificacion_params)\n\n respond_to do |format|\n if @estado_notificacion.save\n format.html { redirect_to @estado_notificacion, notice: 'Estado notificacion was successfully created.' }\n format.json { render action: 'show', status: :created, location: @estado_notificacion }\n else\n format.html { render action: 'new' }\n format.json { render json: @estado_notificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @iglesia = Iglesia.new(iglesia_params)\n\n respond_to do |format|\n if @iglesia.save\n format.html { redirect_to iglesias_path, notice: \"La iglesia #{@iglesia.nombre} ha sido creada.\" }\n format.json { render action: 'show', status: :created, location: @iglesia }\n else\n format.html { render action: 'new' }\n format.json { render json: @iglesia.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n existe = UsuarioPartida.where(:partida_id => params[:usuario_partida][:partida_id], :usuario_id => params[:usuario_partida][:usuario_id]).first\n @partida = Partida.find(params[:usuario_partida][:partida_id])\n count = UsuarioPartida.where(:partida_id => params[:usuario_partida][:partida_id]).count\n \n respond_to do |format|\n if @partida.cantidad_jugadores > count && existe.nil?\n @usuario_partida = UsuarioPartida.new(params[:usuario_partida])\n if @usuario_partida.save\n count = count + 1\n if @partida.cantidad_jugadores = count\n @partida.update_attributes(:estado => true)\n end\n format.html { redirect_to @usuario_partida, notice: 'Usuario partida was successfully created.' }\n format.json { render json: @usuario_partida, status: :created, location: @usuario_partida }\n else\n format.html { render action: \"new\" }\n format.json { render json: {:id => 0} }\n end\n else\n format.html { redirect_to usuario_partidas_path, notice: 'El usuario ya existe en la partida o ya se agotaron los cupos.' }\n format.json { render json: {:id => 0} }\n end\n end\n end", "def create\n @request = Request.new(params[:request])\n @verifica = Request.where(:user_id => current_user.id,:job_id =>@request.job_id).first\n respond_to do |format|\n unless @verifica\n @request.user_id = current_user.id\n @request.status_request_id = CONS::REQUEST[:AGUARDANDO_RESPOSTA]\n \n if @request.save\n @name='Você se candidatou a esse plantão com sucesso.'\n #passa o id do job para o js\n @save=@request.job_id\n #passa o numero de candidatos pro js\n @num=@request.job.requests.count\n\n # envia o email para o dono do plantão \n if Rails.env == 'production' \n UserMailer.send_email_ownner_job(@request.job_id,current_user.id,CONS::REQUEST[:AGUARDANDO_RESPOSTA])\n end\n \n p @num\n else\n @name='Não foi possivel completar sua requisição'\n end\n end\n format.js\n end \n \n end", "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n\t\n if @subscription.valid? && @subscription.save\n\t SubscriptionMailer.delay.send_welcome(@subscription)\n\t \n format.html { redirect_to \"/subscriptions/done\", notice: 'Twoj adres zostal dodany do listy mailingowej' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.new(params[:roof_status])\n\n respond_to do |format|\n if @status.save\n format.html { redirect_to @roof, notice: 'Спасибо что помогаете нам! Заявка отправлена на модерацию :)' }\n format.json { render json: @status, status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @incident = Incident.new(incident_params)\n @catalogList = [['Tecnologia/Proyectores',1], ['Plomeria/Tuberias',2], ['Logistica/Bancos', 3], ['Tecnologia/IT',4]]\n\n begin\n id = ActiveRecord::Base.connection.execute(\"SELECT COUNT(*) FROM incidents;\")\n id.each do |row|\n id = row\n end\n id = id[0].to_i + 1\n sql = \"INSERT INTO incidents (incident_id, u_id, descripcion, prioridad, fecha_inicio, catalog) VALUES ('#{id}', '#{session[:user_id]}', '#{@incident.descripcion}', '#{@incident.prioridad}', #{Time.now.strftime(\"%Y%m%d\").to_i}, '#{@incident.catalog}');\"\n ActiveRecord::Base.connection.execute sql\n\n redirect_to incidents_url, notice: \"Gracias, el incidente será revisado\"\n rescue \n flash[:notice] = \"Error en la forma\"\n render :new\n end\n end", "def inscricao_params\n params.require(:inscricao).permit(:nome, :cpf, :email, :datanascimento, :evento_id)\n end", "def create\n\n if @veiculo.categoria_cnh == current_usuario.cnh\n @reserva = Reserva.new(reserva_params)\n @salvar = @veiculo.update(status: reserva_params[:status])\n\n respond_to do |format|\n if @reserva.save\n format.html { redirect_to reserva_path(@reserva), notice: 'Reserva was successfully created.' }\n format.json { render :show, status: :created, location: @reserva }\n else\n format.html { render :new }\n format.json { render json: @reserva.errors, status: :unprocessable_entity }\n end\n end\n\n else\n flash[:info] = \"Sua categoria de CNH é diferente da necessária para dirigir esse veículo.\"\n redirect_to index2_path\n end\n end", "def create\n @isncription = Isncription.new(params[:isncription])\n\n respond_to do |format|\n if @isncription.save\n format.html { redirect_to @isncription, notice: 'Isncription was successfully created.' }\n format.json { render json: @isncription, status: :created, location: @isncription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @isncription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @itineraire = Itineraire.new(params[:itineraire])\n\n respond_to do |format|\n if @itineraire.save\n format.html { redirect_to @itineraire, :notice => 'L\\'itinéraire a bien été créé' }\n format.json { render :json => @itineraire, :status => :created, :location => @itineraire }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @itineraire.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_it_inscripcion_registro\n @it_inscripcion_registro = ItInscripcionRegistro.find(params[:id])\n end" ]
[ "0.6513466", "0.6204412", "0.6174564", "0.6056668", "0.5968436", "0.5911479", "0.58587986", "0.58019316", "0.57594216", "0.5749314", "0.5697092", "0.56924576", "0.56914103", "0.5672923", "0.56533813", "0.56482595", "0.56437844", "0.5611982", "0.55920184", "0.55852854", "0.5580019", "0.5557543", "0.5541197", "0.5537575", "0.5537531", "0.5535322", "0.55320597", "0.54981923", "0.54786", "0.54700243", "0.546985", "0.5460164", "0.54586476", "0.5446106", "0.5434591", "0.5415641", "0.5406431", "0.5405377", "0.540434", "0.5389616", "0.5384085", "0.5381527", "0.537995", "0.53728586", "0.53712", "0.5367177", "0.5357961", "0.53543085", "0.53511053", "0.53447884", "0.5344536", "0.5342827", "0.53309315", "0.53254074", "0.5318902", "0.53175217", "0.5314782", "0.5310497", "0.5297753", "0.5296969", "0.52947044", "0.52866393", "0.52825046", "0.5278506", "0.5277618", "0.52690417", "0.5268707", "0.5268275", "0.5267823", "0.5267187", "0.5266434", "0.5263465", "0.52625436", "0.5243013", "0.52418125", "0.5241282", "0.5236549", "0.5233232", "0.52255905", "0.5224906", "0.5223453", "0.5222556", "0.5215958", "0.52080613", "0.52002674", "0.5196831", "0.5182993", "0.5181155", "0.51753175", "0.5175022", "0.5172494", "0.5172146", "0.51709086", "0.5162405", "0.5159953", "0.5155295", "0.51497066", "0.5146409", "0.51453894", "0.51449907" ]
0.6544218
0
PUT /status_de_la_inscripcions/1 PUT /status_de_la_inscripcions/1.json
def update @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id]) respond_to do |format| if @status_de_la_inscripcion.update_attributes(params[:status_de_la_inscripcion]) format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suscribe\n @estate = Estate.find(params[:id])\n @estate.update_attribute(:status, true)\n respond_to do |format|\n format.html { redirect_to estates_url, notice: 'Propiedad publicada exitosamente.' }\n format.json { head :no_content }\n end\n end", "def update\n respond_to do |format|\n if @inscripcion.update(inscripcion_params)\n format.html { redirect_to @inscripcion, notice: 'Inscripcion was successfully updated.' }\n format.json { render :show, status: :ok, location: @inscripcion }\n else\n format.html { render :edit }\n format.json { render json: @inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @inscripcione = Inscripcione.find(params[:id])\n\n respond_to do |format|\n if @inscripcione.update_attributes(params[:inscripcione])\n format.html { redirect_to(@inscripcione, :notice => 'Inscripcione was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inscripcione.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @status_ref_pago_insc = StatusRefPagoInsc.find(params[:id])\n\n respond_to do |format|\n if @status_ref_pago_insc.update_attributes(params[:status_ref_pago_insc])\n format.html { redirect_to @status_ref_pago_insc, notice: 'Status ref pago insc was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_ref_pago_insc.errors, status: :unprocessable_entity }\n end\n end\n end", "def updateStatus\n result = Hash.new\n begin # try\n result = SubscribesHlp.updateStatus(params)\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:presentacion][:activo]\n id = params[:id]\n Presentacion.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n\n electronic_prescription_params[:status] = electronic_prescription_params[:status].to_i\n\n respond_to do |format|\n if @electronic_prescription.update(electronic_prescription_params)\n format.html { redirect_to @electronic_prescription, notice: 'Electronic prescription was successfully updated.' }\n format.json { render :show, status: :ok, location: @electronic_prescription }\n else\n format.html { render :edit }\n format.json { render json: @electronic_prescription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @status.update(isshared: params[:isshared])\n format.json { head :no_content }\n else\n format.json {\n render json: @status.errors,\n status: :unprocessable_entity\n }\n end\n end\n end", "def update\n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n \n respond_to do |format|\n if @conta.update(nome: conta_params[:nome], status: conta_params[:status], pai: pai) \n #format.json { render :show, status: :ok, location: @conta }\n format.json { render json: @conta.to_json, status: :ok }\n else \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @misuration_subscription.user.id==current_user.id && @misuration_subscription.update(misuration_subscription_params)\n format.html { redirect_to @misuration_subscription, notice: 'Iscrizione al sensore aggiornata correttamente' }\n format.json { render :show, status: :ok, location: @misuration_subscription }\n else\n format.html { flash[:notice] = 'Non puoi modificare una iscrizione non tua! '\n render :edit }\n format.json { render json: @misuration_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @inscricao.update(inscricao_params)\n format.html { redirect_to @inscricao, notice: \"Inscricao was successfully updated.\" }\n format.json { render :show, status: :ok, location: @inscricao }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n if params[:status] == 'reject'\n @prescription.update(status: 'Reject')\n end\n end", "def update\n @status_de_la_notificacion = StatusDeLaNotificacion.find(params[:id])\n\n respond_to do |format|\n if @status_de_la_notificacion.update_attributes(params[:status_de_la_notificacion])\n format.html { redirect_to @status_de_la_notificacion, notice: 'Status de la notificacion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_de_la_notificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @inscricao.update(inscricao_params)\n format.html { redirect_to @inscricao, notice: 'Inscricao was successfully updated.' }\n format.json { render :show, status: :ok, location: @inscricao }\n else\n format.html { render :edit }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end", "def activo_update\n respond_to do |format|\n activo = params[:producto][:activo]\n id = params[:id]\n Producto.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n respond_to do |format|\n if @prescribtion_detail.update(prescribtion_detail_params)\n format.html { redirect_to @prescribtion_detail, notice: 'Prescribtion detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @prescribtion_detail }\n else\n format.html { render :edit }\n format.json { render json: @prescribtion_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @suplente = Suplente.find(params[:id])\n\n respond_to do |format|\n if @suplente.update_attributes(params[:suplente])\n format.html { redirect_to @suplente, notice: 'Lista acuerdo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @suplente.errors, status: :unprocessable_entity }\n end\n end\n end", "def restobooking\n @buchung = Buchung.find(params[:id])\n @buchung.status='B' \n \n respond_to do |format|\n if @buchung.update_attributes(params[:buchung])\n format.html { redirect_to @buchung, notice: 'Buchung wurde erfolgreich geaendert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @buchung.errors, status: :unprocessable_entity }\n end\n end \n end", "def update\n ya_estaba_resuelto = Comentario::RESUELTOS.include?(@comentario.estatus) #Ya estaba en algun estatus de resuleto?\n if params[:estatus].present?\n @comentario.estatus = params[:estatus]\n @comentario.usuario_id2 = current_usuario.id\n @comentario.fecha_estatus = Time.now\n end\n\n @comentario.categorias_contenido_id = params[:categorias_contenido_id] if params[:categorias_contenido_id].present?\n\n if @comentario.changed? && @comentario.save\n if Comentario::RESUELTOS.include?(@comentario.estatus)\n EnviaCorreo.comentario_resuelto(@comentario).deliver unless ya_estaba_resuelto #Solo envia correo cuando cambia el estatus\n end\n if params[:categorias_contenido_id].present?\n EnviaCorreo.avisar_responsable_contenido(@comentario, dame_usuarios_envio).deliver\n end\n render json: {estatus: 1}.to_json\n else\n render json: {estatus: 0}.to_json\n end\n end", "def update\n respond_to do |format|\n if @inventario_cosa.update(inventario_cosa_params)\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario_cosa }\n else\n format.html { render :edit }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @status_de_la_inscripcion = StatusDeLaInscripcion.new(params[:status_de_la_inscripcion])\n\n respond_to do |format|\n if @status_de_la_inscripcion.save\n format.html { redirect_to @status_de_la_inscripcion, notice: 'Status de la inscripcion was successfully created.' }\n format.json { render json: @status_de_la_inscripcion, status: :created, location: @status_de_la_inscripcion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_de_la_inscripcion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n if @solicitud_servicio.update_attributes(params[:solicitud_servicio])\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @inscrito = Inscrito.find(params[:id])\n\n respond_to do |format|\n if @inscrito.update_attributes(params[:inscrito])\n format.html { redirect_to @inscrito, notice: 'Inscrito was successfully updated. #{undo_link}' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inscrito.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @indicacao = Indicacao.find(params[:id])\n\n respond_to do |format|\n if @indicacao.update_attributes(params[:indicacao])\n format.html { redirect_to @indicacao, notice: 'A Indicação do Condutor foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sindicato.update(sindicato_params)\n format.html { redirect_to @sindicato, notice: 'Sindicato fue actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @sindicato }\n else\n format.html { render :edit }\n format.json { render json: @sindicato.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @invoicestatus.update(invoicestatus_params)\r\n format.html { redirect_to @invoicestatus, notice: 'Invoicestatus was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @invoicestatus }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @invoicestatus.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\r\n respond_to do |format|\r\n if @sivic_participantecelula.update(sivic_participantecelula_params)\r\n format.html { redirect_to @sivic_participantecelula, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_participantecelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @status_de_interes_de_prospecto_validado = StatusDeInteresDeProspectoValidado.find(params[:id])\n\n respond_to do |format|\n if @status_de_interes_de_prospecto_validado.update_attributes(params[:status_de_interes_de_prospecto_validado])\n format.html { redirect_to @status_de_interes_de_prospecto_validado, notice: 'Status de interes de prospecto validado was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_de_interes_de_prospecto_validado.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n if @tipo_pregunta.update(params[:tipo_pregunta])\n head :no_content\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end", "def destroy\n @oferta = Oferta.find(params[:id])\n @oferta.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_ofertas_path }\n format.json { head :ok }\n end\n end", "def update\n @movimentacao_de_estoque = MovimentacaoDeEstoque.find(params[:id])\n\n respond_to do |format|\n if @movimentacao_de_estoque.update_attributes(params[:movimentacao_de_estoque])\n format.html { redirect_to @movimentacao_de_estoque, notice: 'Movimentacao de estoque was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movimentacao_de_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if caixa_params[:status] && (current_caixa.try(:status) && current_caixa.try(:id) != @caixa.id)\n redirect_to caixas_path, alert: \"Não foi possível atualizar, já há um caixa em aberto.\" and return\n end\n\n respond_to do |format|\n if @caixa.update(caixa_params)\n format.html { redirect_to @caixa, notice: 'Caixa foi atualizado(a) com sucesso.' }\n format.json { render :show, status: :ok, location: @caixa }\n else\n format.html { render :edit }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n if @sitio_entrega.update_attributes(params[:sitio_entrega])\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @sivic_contcelula.update(sivic_contcelula_params)\r\n format.html { redirect_to @sivic_contcelula, notice: 'Sivic contcelula was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_contcelula.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @solicitacoes_avaliacoes_servico.update(solicitacoes_avaliacoes_servico_params)\n format.html { redirect_to @solicitacoes_avaliacoes_servico, notice: 'Solicitacoes avaliacoes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacoes_avaliacoes_servico.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tecnica_de_impresion.update(tecnica_de_impresion_params)\n format.html { redirect_to @tecnica_de_impresion, notice: 'Tecnica de impresion was successfully updated.' }\n format.json { render :show, status: :ok, location: @tecnica_de_impresion }\n else\n format.html { render :edit }\n format.json { render json: @tecnica_de_impresion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @imposto.update_attributes(imposto_params)\n format.html { redirect_to @imposto, notice: 'Imposto atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @imposto }\n else\n format.html { render :edit }\n format.json { render json: @imposto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n\n respond_to do |format|\n if @inscriptionprepaconcour.update_attributes(params[:inscriptionprepaconcour])\n format.html { redirect_to @inscriptionprepaconcour, notice: 'Inscriptionprepaconcour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inscriptionprepaconcour.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @participation = Participation.find(params[:id])\n @participation.update( status: params[:status])\n end", "def update\n ActiveRecord::Base.transaction do\n respond_to do |format|\n if @status.update(status_params)\n format.html { redirect_to @status, notice: 'El Estado se actualizo correctamente.' }\n format.json { render :show, status: :ok, location: @status }\n else\n format.html { render :edit }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def set_inscripcion\n @inscripcion = Inscripcion.find(params[:id])\n end", "def set_situacao\n logger.debug \"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"\n\n id_busca = params[:id]\n @os_id = params[:os_id]\n @os_tarefa = OsTarefa.find(id_busca)\n @os_tarefa.situacao=params[:situacao]\n @ordem_servico = OrdemServico.find(@os_id)\n logger.debug \"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ\"\n\n if @os_tarefa.situacao=='REJEITADA'\n @os_tarefa.ordem_servico_pagamento= nil\n @os_tarefa.situacao=OsTarefa.situacoes[2]\n else\n @os_tarefa.ordem_servico_pagamento= @ordem_servico\n @os_tarefa.situacao=OsTarefa.situacoes[0]\n end\n @os_tarefa.save\n respond_to do |format|\n\n format.json { head :no_content }\n format.js { render :layout => false }\n\n end\n end", "def update\n respond_to do |format|\n if @sa_request_status.update(sa_request_status_params)\n format.html { redirect_to @sa_request_status, notice: 'Sa request status was successfully updated.' }\n format.json { render :show, status: :ok, location: @sa_request_status }\n else\n format.html { render :edit }\n format.json { render json: @sa_request_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @seguro = Seguro.find(params[:id])\n\n respond_to do |format|\n if @seguro.update_attributes(params[:seguro])\n format.html { redirect_to @seguro, notice: 'Seguro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seguro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @unsubscription.update(unsubscription_params)\n flash[:success] = \"Le traitement a bien été modifié!\"\n format.html { redirect_to @unsubscription }\n format.json { render :show, status: :ok, location: @unsubscription }\n else\n format.html { render :edit }\n format.json { render json: @unsubscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tipo_de_servicio.update(tipo_de_servicio_params)\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sinh_vien = SinhVien.find(params[:id])\n\n respond_to do |format|\n if @sinh_vien.update_attributes(params[:sinh_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @respuesta = Respuesta.find(params[:id])\n\n if @respuesta.update(params[:respuesta])\n head :no_content\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "def update\n nueva_cantidad = compra_params[:cantidad].to_i\n\n respond_to do |format|\n if @compra.edit_stock(nueva_cantidad) && @compra.update(compra_params)\n format.html { redirect_to @compra, notice: 'Compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n\n respond_to do |format|\n if @situacoes_juridica.update_attributes(params[:situacoes_juridica])\n format.html { redirect_to(@situacoes_juridica, :notice => 'Situação jurídica atualizada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @situacoes_juridica.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @datos_insumos_reactivo.update(datos_insumos_reactivo_params)\n format.html { redirect_to @datos_insumos_reactivo, notice: 'Datos insumos reactivo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @datos_insumos_reactivo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @espacio_comun.update(espacio_comun_params)\n format.html { redirect_to @espacio_comun, notice: 'Espacio comun was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @espacio_comun.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @regra_negocio.update(regra_negocio_params)\n format.html { redirect_to @regra_negocio, notice: 'Regra negocio was successfully updated.' }\n format.json { render :show, status: :ok, location: @regra_negocio }\n else\n format.html { render :edit }\n format.json { render json: @regra_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @catalogs_ubication = Catalogs::Ubication.find(params[:id])\n #@catalogs_ubication.attributes = params[:catalogs_ubication]\n #if @catalogs_ubication.available == \"1\"\n # @catalogs_ubication.available = \"1\"\n #else\n # @catalogs_ubication.available = nil\n #end\n \n respond_to do |format|\n if @catalogs_ubication.update_attributes(params[:catalogs_ubication])\n format.html { redirect_to(@catalogs_ubication, :notice => 'La ubicación fue actualizada.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @catalogs_ubication.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @comissao = Comissao.find(params[:id])\n\n respond_to do |format|\n if @comissao.update_attributes(params[:comissao])\n flash[:notice] = 'Comissão atualizado com sucesso.'\n format.html { redirect_to(@comissao) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @comissao.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @core_status_selo_fiscal_tipo = Core::StatusSeloFiscalTipo.find(params[:id])\n\n respond_to do |format|\n if @core_status_selo_fiscal_tipo.update_attributes(params[:core_status_selo_fiscal_tipo])\n format.html { redirect_to @core_status_selo_fiscal_tipo, notice: 'Status selo fiscal tipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @core_status_selo_fiscal_tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: \"Solicitud was successfully updated.\" }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end", "def invoice_status_changed(data)\n @subscription = ::Subscription.find_by(iugu_id: data[:subscription_id])\n @subscription.update(iugu_payment_status: data[:status])\n end", "def update\n respond_to do |format|\n if @certificate.update(type_status_certificate_id: params[:type_status_certificate_id])\n if @certificate.type_status_certificate_id == 3\n #Notifico de que en caso de estar lista que lo vaya a buscar\n ReadyCertificateMailer.sample_email(@certificate).deliver_now\n end \n notific = Notification.create(tittle: \"Su \"+TypeCertificate.find(@certificate.type_certificate.id).descripcion+\" se encuentra en estado: '\"+TypeStatusCertificate.find(@certificate.type_status_certificate.id).descripcion+\"'\",\n event: \"Su \"+TypeCertificate.find(@certificate.type_certificate.id).descripcion.to_s+\" se encuentra lista para ser retirada en nuestras instalaciones\",\n viewed: FALSE,\n id_user: @certificate.user.id,\n url: $domain_url+\"/notifications\")\n publicar_notificacion(notific.tittle,\"Hace un momento\",\"Postgrado\", notific.id_user,\n notific.event,Notification.where(:viewed => FALSE).where(:id_user => notific.id_user).count)\n\n\n\n format.html { redirect_to certificates_path}\n format.json { render :show, status: :ok, location: @certificate }\n else\n @type_status_certificates = TypeStatusCertificate.all\n format.html { render :edit }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "def unsuscribe\n @estate = Estate.find(params[:id])\n @estate.update_attribute(:status, false)\n respond_to do |format|\n format.html { redirect_to estates_url, notice: 'Propiedad dada de baja exitosamente.' }\n format.json { head :no_content }\n end\n end", "def update\n respond_to do |format|\n if @asiento_de_servicio.update(asiento_de_servicio_params)\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @asiento_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @nossos_servico = NossosServico.find(params[:id])\n\n respond_to do |format|\n if @nossos_servico.update_attributes(params[:nossos_servico])\n format.html { redirect_to(@nossos_servico, :notice => 'Nossos servico was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nossos_servico.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, Concepto\n if params[:concepto][:tipo_ids]\n params[:concepto][:tipo_ids] = params[:concepto][:tipo_ids].map { |k, _v| k }\n else\n params[:concepto][:tipo_ids] = []\n end\n\n respond_to do |format|\n if @concepto.update(concepto_params)\n\n\n format.html { redirect_to @concepto, notice: '<i class=\"fa fa-check-square fa-lg\"></i> Los datos del concepto fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @concepto }\n else\n format.html { render :edit } if params[:concepto][:tipo_ids]\n format.json { render json: @concepto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n if @ativo_outro.update_attributes(params[:ativo_outro])\n format.html { redirect_to @ativo_outro, notice: 'Ativo foi salvo com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ativo_outro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to servicos_url, notice: 'Serviço atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @suscription.update(suscription_params)\n format.html { redirect_to @suscription, notice: 'Suscription was successfully updated.' }\n format.json { render :show, status: :ok, location: @suscription }\n else\n format.html { render :edit }\n format.json { render json: @suscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sugerencia = Sugerencia.find(params[:id])\n\n respond_to do |format|\n if @sugerencia.update_attributes(params[:sugerencia])\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @nota_tecnica.update(nota_tecnica_params)\n format.html { redirect_to @nota_tecnica, notice: 'Nota tecnica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nota_tecnica.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @objeto.update(requisito_params)\n format.html { redirect_to @objeto, notice: \"Requisito was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @titulacao.update(titulacao_params)\n format.html { redirect_to titulacaos_path, notice: 'Titulo atualizado com successo.' }\n format.json { render titulacaos_path, status: :ok, location: titulacaos_path }\n else\n format.html { render :edit }\n format.json { render json: @titulacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @instituicao = Instituicao.find(params[:id])\n\n respond_to do |format|\n if @instituicao.update_attributes(params[:instituicao])\n format.html { redirect_to @instituicao, notice: 'Instituicao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @instituicao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @inicio.update(inicio_params)\n format.html { redirect_to @inicio, notice: 'Inicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @inicio }\n else\n format.html { render :edit }\n format.json { render json: @inicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:recursos][:status] == '1'\n @count = count_of_resource\n save_multiples_recursos\n end\n respond_to do |format|\n if @area.update(area_params)\n format.html { redirect_to @area, notice: 'El Área fue modificada éxitosamente.' }\n format.json { render :show, status: :ok, location: @area }\n else\n format.html { render :edit }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @historico_converca.update(historico_converca_params)\n format.html { redirect_to @historico_converca, notice: 'Historico converca was successfully updated.' }\n format.json { render :show, status: :ok, location: @historico_converca }\n else\n format.html { render :edit }\n format.json { render json: @historico_converca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update_almacen,Sigesp::Solicitud\n if @sigesp_solicitud.update(sigesp_solicitud_alamcen_params)\n return render json: { url: sigesp_solicitudsalmacen_path(@sigesp_solicitud)} \n else\n return render json:@sigesp_solicitud.errors ,status: :unprocessable_entity\n end \n end", "def update\n @citation_details = CitationDetail.where(:citation_id => params[:id])\n @services = params[:inputserv]\n @quantity = params[:inputcantidad]\n \n respond_to do |format|\n if @citation.update(citation_params)\n CitationDetail.delete_all(:citation_id => params[:id])\n cont = 0\n @services.each do |p|\n detalle = CitationDetail.new(service_id: p, quantity: @quantity[cont], citation_id:@citation.id)\n detalle.save\n cont +=1\n end\n \n format.html { redirect_to @citation, notice: 'Citation was successfully updated.' }\n format.json { render :show, status: :ok, location: @citation }\n else\n format.html { render :edit }\n format.json { render json: @citation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @question_localized = QuestionLocalized.find(params[:id])\n\n respond_to do |format|\n if @question_localized.update_attributes(params[:question_localized])\n flash[:notice] = 'QuestionLocalized was successfully updated.'\n format.html { redirect_to(@question_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question_localized.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @registro_insumos_reactivo.update(registro_insumos_reactivo_params)\n format.html { redirect_to @registro_insumos_reactivo, notice: 'Registro insumos reactivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_insumos_reactivo }\n else\n format.html { render :edit }\n format.json { render json: @registro_insumos_reactivo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @os_nivel_servico.update(os_nivel_servico_params)\n format.html { redirect_to @os_nivel_servico, notice: 'Os nivel servico foi atualizado(a)' }\n format.json { render :show, status: :ok, location: @os_nivel_servico }\n else\n format.html { render :edit }\n format.json { render json: @os_nivel_servico.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @inquilino.update(inquilino_params)\n\n format.html {redirect_to @inquilino, notice: 'Inquilino atualizado com sucesso!.'}\n format.json {render :show, status: :ok, location: @inquilino}\n else\n format.html {render :edit}\n format.json {render json: @inquilino.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\n @status_ativ = StatusAtiv.find(params[:id])\n\n respond_to do |format|\n if @status_ativ.update_attributes(params[:status_ativ])\n format.html { redirect_to @status_ativ, notice: 'Status ativ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_ativ.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, Tipo\n respond_to do |format|\n if @tipo.update(tipo_params)\n log(\"Se ha editado la nomina #{@lt}\", 1)\n format.html { redirect_to tipos_path, notice: 'Los datos de la nómina fueron actualizados exitosamente.' }\n format.json { head :no_content }\n end\n end\n end", "def update\n flash[:notice] = t('scaffold.notice.updated', :item => SicossSituation.model_name.human) if @sicoss_situation.update_attributes(params[:sicoss_situation])\n respond_with(@sicoss_situation, :location => sicoss_situations_path)\n end", "def update\n respond_to do |format|\n if @solicitacao_tipo.update(solicitacao_tipo_params)\n format.html { redirect_to @solicitacao_tipo, notice: 'Solicitacao tipo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacao_tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @movimentacao.data_movimentacao = params[:data].to_date + 3.hours if params[:data].present?\n @movimentacao.tipo = params[:tipo].upcase\n if @movimentacao.update(movimentacao_params)\n format.html { redirect_to @movimentacao, notice: \"Movimentação Atualizada com Sucesso.\" }\n format.json { render :show, status: :ok, location: @movimentacao }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @situacao_reserva.update(situacao_reserva_params)\n format.html { redirect_to action: \"new\", notice: 'Situação reserva atualizado com sucesso..' }\n format.json { render :show, status: :ok, location: @situacao_reserva }\n else\n format.html { render :edit }\n format.json { render json: @situacao_reserva.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n invoice_params[:data_prevenda] = Date.today\n respond_to do |format|\n puts 'esse é o id da venda ' + @invoice.id.to_s + invoice_params[:data_prevenda].to_s\n if @invoice.update(invoice_params)\n #ataualiza a data de prevenda em cada item lançado para o relatorio de analise geral\n #Item.where(invoice_id: @invoice.id).update_all(data_prevenda: invoice_params[:data_prevenda])\n format.html { redirect_to @invoice, notice: 'atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @invoice }\n sweetalert_success('Dados atualizados com sucesso!', 'Sucesso!', useRejections: false)\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @sucursale.usuarios_id = current_usuario.id\n if @sucursale.update(sucursale_params)\n format.html { redirect_to @sucursale, notice: 'Sucursal actualizada con exito!' }\n format.json { render :show, status: :ok, location: @sucursale }\n else\n format.html { render :edit }\n format.json { render json: @sucursale.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @integrante.update(integrante_params)\n format.html { redirect_to @integrante, notice: 'Integrante atualizados.' }\n format.json { render :show, status: :ok, location: @integrante }\n else\n format.html { render :edit }\n format.json { render json: @integrante.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @repuesto_servicio.update(repuesto_servicio_params)\n format.html { redirect_to @repuesto_servicio, notice: 'Repuesto o servicio fue actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @repuesto_servicio }\n else\n format.html { render :edit }\n format.json { render json: @repuesto_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n disponibilidad = params[:pro_far][:disponibilidad_id]\n id = params[:id]\n laboratorio = params[:pro_far][:producto_id]\n ProFar.where(id: id).update_all(disponibilidad_id: disponibilidad )\n format.html { redirect_to \"/pro_farmacia/#{laboratorio}\", notice: 'Disponibilidad producto actualizado con éxito.' }\n end\n\n end", "def update\n respond_to do |format|\n if @insumo.update(insumo_params)\n format.html { redirect_to insumos_url , notice: 'Insumo was successfully updated.' }\n format.json { render :show, status: :ok, location: @insumo }\n else\n format.html { render :edit } \n format.json { render json: @insumo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @asistencia.update_attributes(params[:asistencia])\r\n format.html { redirect_to @asistencia, notice: 'Asistencia was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @asistencia.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end" ]
[ "0.6380254", "0.627651", "0.61416256", "0.61043155", "0.60850084", "0.6033485", "0.6012915", "0.6007504", "0.5993994", "0.5984675", "0.59749246", "0.594909", "0.59403986", "0.5934573", "0.59191024", "0.5898397", "0.5866879", "0.5849501", "0.5835973", "0.58139676", "0.5787276", "0.5733076", "0.57311755", "0.57111347", "0.5704089", "0.56964004", "0.56789064", "0.56775063", "0.5673082", "0.566893", "0.5668744", "0.5665705", "0.5663867", "0.5650308", "0.5649854", "0.56404054", "0.5634971", "0.56343937", "0.56333166", "0.56312555", "0.56280375", "0.56257886", "0.5625243", "0.56228185", "0.5621213", "0.561295", "0.5609642", "0.5606109", "0.56055474", "0.5601543", "0.5596316", "0.5596084", "0.55951697", "0.5594075", "0.5592985", "0.5586891", "0.55774254", "0.5573043", "0.5569221", "0.5566164", "0.55644155", "0.55629987", "0.5562271", "0.55605686", "0.555795", "0.55560964", "0.5551804", "0.55515814", "0.55457634", "0.55424404", "0.5541104", "0.5540281", "0.55358243", "0.55334836", "0.5532486", "0.55321604", "0.553018", "0.5528455", "0.55278236", "0.5525188", "0.55251503", "0.55236334", "0.5521251", "0.5511045", "0.550491", "0.5504808", "0.55043256", "0.55039746", "0.5503872", "0.5498526", "0.54972255", "0.54933465", "0.5491766", "0.54912496", "0.54909056", "0.54883265", "0.5485653", "0.5485317", "0.5484662", "0.54825556" ]
0.66473645
0
DELETE /status_de_la_inscripcions/1 DELETE /status_de_la_inscripcions/1.json
def destroy rol = Role.where(:id=>current_user.role).first if rol.nombre == "ACRM" @status_de_la_inscripcion = StatusDeLaInscripcion.find(params[:id]) @status_de_la_inscripcion.destroy else flash[:error] ='No tienes permiso para realizar esta accion' end respond_to do |format| format.html { redirect_to status_de_la_inscripcions_url } format.json { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n #@clinica.destroy\n @clinica.update(:status => 0)\n respond_to do |format|\n format.html { redirect_to clinicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @datos_insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to datos_insumos_reactivos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @misuration_subscription.destroy\n respond_to do |format|\n format.html { redirect_to misuration_subscriptions_url, notice: 'Iscrizione al sensore eliminata correttamente' }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @core_status_desembaraco = Core::StatusDesembaraco.find(params[:id])\n @core_status_desembaraco.destroy\n\n respond_to do |format|\n format.html { redirect_to core_status_desembaracos_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n result = Hash.new\n begin # try\n result = SubscribesHlp.delete(params[:id])\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end", "def destroy\n @it_inscripcion_registro.destroy\n respond_to do |format|\n format.html { redirect_to it_inscripcion_registros_url, notice: 'El registro de inscripción se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @inscripcion.destroy\n respond_to do |format|\n format.html { redirect_to inscripcions_url, notice: 'Inscripcion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_ativ = StatusAtiv.find(params[:id])\n @status_ativ.destroy\n\n respond_to do |format|\n format.html { redirect_to status_ativs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @substancia.destroy\n respond_to do |format|\n format.html { redirect_to substancias_url, notice: 'Substancia was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @oferta = Oferta.find(params[:id])\n @oferta.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_ofertas_path }\n format.json { head :ok }\n end\n end", "def destroy\n @inscripcione = Inscripcione.find(params[:id])\n @inscripcione.destroy\n\n respond_to do |format|\n format.html { redirect_to(inscripciones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n# redirect_to activacionclientets_path # ted esto para evitar que borren por la web. ok. Que valla al index. provisional ok.\n \n #@activacionclientet.destroy\n respond_to do |format|\n format.html { redirect_to activacionclientets_url, notice: 'Activacionclientes no se puede eliminar por esta via. Contacte el administrador.' } # ted esto para evitar que borren por la web\n format.json { head :no_content }\n end\n end", "def delete\n supprimer = QuestionOuverteService.instance.supprimerQuestion(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\n end", "def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sivic_discipulo.destroy\n respond_to do |format|\n format.html { redirect_to sivic_discipulos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_convenio = TipoConvenio.find(params[:id])\n @tipo_convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_convenios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @inscripcion_diplomado.destroy\n respond_to do |format|\n format.html { redirect_to inscripcion_diplomados_url, notice: 'La inscripción al diplomado fue eliminada correctamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_contcelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contcelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @core_status_unidade_carga = Core::StatusUnidadeCarga.find(params[:id])\n @core_status_unidade_carga.destroy\n\n respond_to do |format|\n format.html { redirect_to core_status_unidade_cargas_url }\n format.json { head :no_content }\n end\n end", "def delete\n supprimer = SondageService.instance.supprimerSondage(params[:id])\n (supprimer) ? (render json: true, status: :ok) : (render json: false, status: :not_found)\nend", "def destroy\n @sugerencia = Sugerencia.find(params[:id])\n @sugerencia.destroy\n\n respond_to do |format|\n format.html { redirect_to sugerencias_url }\n format.json { head :ok }\n end\n end", "def destroy\n @status_akun.destroy\n respond_to do |format|\n format.html { redirect_to status_akun_index_url, notice: 'Status akun was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sindicato.destroy\n respond_to do |format|\n format.html { redirect_to sindicatos_url, notice: 'Sindicato fue eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n @solicitud_servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to solicitudes_servicios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @suplente = Suplente.find(params[:id])\n @suplente.destroy\n\n respond_to do |format|\n format.html { redirect_to suplentes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nota_tecnica.destroy\n respond_to do |format|\n format.html { redirect_to nota_tecnicas_url }\n format.json { head :no_content }\n end\n end", "def delete_from_entzumena\n headline = Headline.where({:source_item_type => params[:source_item_type], :source_item_id => params[:source_item_id]}).first\n if headline.destroy\n render :json => true, :status => 200\n else\n render :json => false, :status => :error\n end\n end", "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @indicacao = Indicacao.find(params[:id])\n @indicacao.destroy\n\n respond_to do |format|\n format.html { redirect_to indicacoes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_status_selo_fiscal_tipo = Core::StatusSeloFiscalTipo.find(params[:id])\n @core_status_selo_fiscal_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to core_status_selo_fiscal_tipos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @inscriptionprepaconcour = Inscriptionprepaconcour.find(params[:id])\n @inscriptionprepaconcour.destroy\n\n respond_to do |format|\n format.html { redirect_to inscriptionprepaconcours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @central_correio = CentralCorreio.find(params[:id])\n @central_correio.destroy\n\n respond_to do |format|\n format.html { redirect_to central_correios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_confirmacao_adotando = StatusConfirmacaoAdotando.find(params[:id])\n @status_confirmacao_adotando.destroy\n\n respond_to do |format|\n format.html { redirect_to status_confirmacao_adotandos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_item.destroy\n respond_to do |format|\n format.html { redirect_to status_items_url, notice: 'El estatus del articulo fue eliminado.' }\n format.json { head :no_content }\n end\n end", "def destroy\n respond_to do |format|\n @lp = ListaPreco.where(servico_id: params[:id])\n if(@lp.any?)\n format.html { redirect_to servicos_url, alert: 'Serviço não pode ser excluido!' }\n format.json { head :no_content }\n else\n @servico.status = 0\n @servico.save\n format.html { redirect_to servicos_url, notice: 'Serviço excluido com sucesso.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicituds_url, notice: \"Solicitud was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicituds_url, notice: 'Solicitud was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sitio_entrega = SitioEntrega.find(params[:id])\n @sitio_entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to sitio_entregas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interessado.destroy\n respond_to do |format|\n format.html { redirect_to interessados_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n head :no_content\n end", "def destroy\n @sa_request_status.destroy\n respond_to do |format|\n format.html { redirect_to sa_request_statuses_url, notice: 'Sa request status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @congestion = Congestion.find(params[:id])\n @congestion.destroy\n\n respond_to do |format|\n format.html { redirect_to congestions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cooperativa = Cooperativa.find(params[:id])\n @cooperativa.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_cooperativas_path }\n format.json { head :ok }\n end\n end", "def destroy\n @integrante = Integrante.find(params[:id])\n @integrante.destroy\n\n respond_to do |format|\n format.html { redirect_to integrantes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @detalle_documento_de_compra.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Linea eliminada' }\n format.json { head :no_content }\n end\n end", "def destroy\n @indicativo = Indicativo.find(params[:id])\n @indicativo.destroy\n\n respond_to do |format|\n format.html { redirect_to indicativos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @movimentacao_de_estoque = MovimentacaoDeEstoque.find(params[:id])\n @movimentacao_de_estoque.destroy\n\n respond_to do |format|\n format.html { redirect_to movimentacao_de_estoques_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @informacao_ged.destroy\n respond_to do |format|\n format.html { redirect_to informacoes_ged_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @invoice_status = InvoiceStatus.find(params[:id])\n @invoice_status.destroy\n\n respond_to do |format|\n format.html { redirect_to invoice_statuses_url }\n format.json { head :no_content }\n end\n end", "def cfa_delete\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Entered in cfa titles cfa_delete method\"\n begin\n id=params[\"format\"] \n cfa=RestClient.delete $api_service+'/cfa_titles/'+id\n rescue =>e\n Rails.logger.custom_log.error { \"#{e} Cfa controller delete method\" }\n end\n redirect_to action: \"index\"\n end", "def destroy\n @sezione = Sezione.find(params[:id])\n @sezione.destroy\n\n respond_to do |format|\n format.html { redirect_to sezioni_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n @observacao_vocacionada.destroy\n\n respond_to do |format|\n format.html { redirect_to observacao_vocacionadas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gran_unidad.destroy\n respond_to do |format|\n format.html { redirect_to gran_unidad_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @sinh_vien = SinhVien.find(params[:id])\n @sinh_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contaminationstatus.destroy\n respond_to do |format|\n format.html { redirect_to contaminationstatuses_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n if current_rule.antragStatus\n @antrag_status.destroy\n respond_to do |format|\n format.html { redirect_to antrag_statuses_url, notice: 'Antrag status was successfully destroyed.' }\n format.json { head :no_content }\n end \n else\n redirect_to root_path alert: \"Keine Recht\"\n end\n \n end", "def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @especie_estatus_bibliografia.destroy\n respond_to do |format|\n format.html { redirect_to especies_estatus_bibliografia_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n \r\n @sivic_participantecelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_participantecelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @inscricao.destroy\n respond_to do |format|\n format.html { redirect_to inscricaos_url, notice: \"Inscricao was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @inscricao.destroy\n respond_to do |format|\n format.html { redirect_to inscricaos_url, notice: 'Inscricao was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_nota = Core::Nota.find(params[:id])\n @core_nota.destroy\n\n respond_to do |format|\n format.html { redirect_to core_notas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estado_notificacion.destroy\n respond_to do |format|\n format.html { redirect_to estado_notificacions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @situacoes_juridica = SituacoesJuridica.find(params[:id])\n @situacoes_juridica.destroy\n\n respond_to do |format|\n format.html { redirect_to(situacoes_juridicas_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @annonce.destroy\n respond_to do |format|\n format.html { redirect_to annonces_url, notice: 'Votre annonce à été supprimé avec succès.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @clinica = Clinica.find(params[:id])\n @clinica.estatus = \"I\"\n @clinica.save \n respond_to do |format|\n format.html { redirect_to clinicas_url, notice: 'La Clínica ha sido eliminada exitosamente' }\n format.json { head :no_content }\n end\n \n end", "def destroy\n @apoio_educacioanl.destroy\n respond_to do |format|\n format.html { redirect_to apoio_educacioanls_url, notice: 'Apoio educacioanal foi excluído com Sucesso !' }\n format.json { head :no_content }\n end\n end", "def destroy\n @integrante.destroy\n respond_to do |format|\n format.html { redirect_to integrantes_url, notice: 'Integrante removidos.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_status_parametrizacao = Core::StatusParametrizacao.find(params[:id])\n @core_status_parametrizacao.destroy\n\n respond_to do |format|\n format.html { redirect_to core_status_parametrizacaos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @smp_referenz.destroy\n respond_to do |format|\n format.html { redirect_to smp_referenzs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @seguidore = Seguidore.find(params[:id])\n @seguidore.destroy\n\n respond_to do |format|\n format.html { redirect_to seguidores_url }\n format.json { head :ok }\n end\n end", "def destroy\n @situacion_revistum = SituacionRevistum.find(params[:id])\n @situacion_revistum.destroy\n\n respond_to do |format|\n format.html { redirect_to situacion_revista_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rescate.destroy\n respond_to do |format|\n format.html { redirect_to rescates_url, notice: 'Rescate fue eleminado' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipo_negocio = TipoNegocio.find(params[:id])\n @tipo_negocio.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_negocios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @auditoria = Auditoria.find(params[:id])\n @auditoria.destroy\n\n respond_to do |format|\n format.html { redirect_to auditorias_url }\n format.json { head :ok }\n end\n end", "def destroy\n @visarequest = Visarequest.find(params[:id])\n @visarequest.destroy\n\n respond_to do |format|\n format.html { redirect_to(visarequests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @instituicao = Instituicao.find(params[:id])\n @instituicao.destroy\n\n respond_to do |format|\n format.html { redirect_to instituicoes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @notificaciones_admin_actualouse = NotificacionesAdminActualouse.find(params[:id])\n @notificaciones_admin_actualouse.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end", "def destroy\r\n @sivic_relatorioscelula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_relatorioscelulas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.find(params[:id])\n @competency_pertenece_asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to competency_pertenece_asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subcategoria = Subcategoria.find(params[:id])\n @subcategoria.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_subcategorias_path }\n format.json { head :ok }\n end\n end", "def destroy\n @comentariu_licenta.destroy\n respond_to do |format|\n format.html { redirect_to comentariu_licentas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @concedente.destroy\n respond_to do |format|\n format.html { redirect_to concedentes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @giang_vien = GiangVien.find(params[:id])\n @giang_vien.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @respuestum.destroy\n respond_to do |format|\n format.html { redirect_to comentarios_url }\n format.json { head :no_content }\n end\n end", "def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end" ]
[ "0.71111596", "0.6977709", "0.6918947", "0.68485117", "0.6823194", "0.6798436", "0.67939365", "0.67886096", "0.67820346", "0.6779645", "0.67665964", "0.67656493", "0.67538947", "0.6748301", "0.67446303", "0.6732159", "0.672812", "0.67167014", "0.67012346", "0.6653971", "0.66437393", "0.6642264", "0.6637649", "0.66209555", "0.66182286", "0.66163397", "0.66148424", "0.6613723", "0.66129047", "0.66088384", "0.660663", "0.6603472", "0.6603472", "0.6599882", "0.6599098", "0.659012", "0.65900654", "0.65723366", "0.657229", "0.65713435", "0.6567698", "0.656346", "0.65632", "0.65616316", "0.6561291", "0.65607846", "0.6560214", "0.6553083", "0.65519613", "0.65490013", "0.6547395", "0.6545279", "0.65450656", "0.65419126", "0.6539384", "0.6522723", "0.6519078", "0.65188897", "0.6517509", "0.65112907", "0.6510944", "0.651056", "0.65098834", "0.6509543", "0.6501227", "0.64974403", "0.6496588", "0.6496173", "0.6495432", "0.6495331", "0.64944345", "0.6493347", "0.64911044", "0.64891875", "0.6488028", "0.64832133", "0.64783067", "0.64766806", "0.64765424", "0.647388", "0.64724356", "0.64681256", "0.64675206", "0.6464886", "0.6464655", "0.6463128", "0.64629495", "0.64626974", "0.64623815", "0.6461849", "0.64611536", "0.645724", "0.64564455", "0.6454894", "0.6454386", "0.64531285", "0.64527845", "0.6449542", "0.6445603", "0.6443905", "0.644355" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_course @course = Course.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def course_params params.require(:course).permit(:title, :description, :time, :day, :limit, :price) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Toy and Product Helper Methods
def get_products_report(include_header = true) # method generates a products report # optional argument 'include_header', if true, includes a products header in ascii-art # reliant upon the 'items' list in $products_hash file report = '' report += get_products_report_header if include_header # For each product in the data set: $products_hash['items'].each do | toy | report += get_toy_report(toy) end return report end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_stock(toy)\n \"Toy Stock: #{toy.stock}\"\n end", "def products\n end", "def product_price(toy)\n \"Retail Price: $#{toy.price}\"\n end", "def product_info_seller\n products = @seller.show_product_info \n choice = @view.display_info_product(products)\n choice == \"1\" ? buy_product : input = @view.menu(\"2\") \n seller_actions(input)\n end", "def manufacture; end", "def product_information\n super\n end", "def product_name; end", "def market\n end", "def set_product\n \n end", "def food_and_drink; end", "def analyze_product(toy)\n [\n toy.title, stars, product_price(toy), total_purchases(toy),\n total_sales(toy), product_stock(toy), stars, \"\\n\"\n ]\n end", "def terms_of_use\n end", "def buy_product\n products = @seller.show_product_info \n product_buy = @view.buy_product(products)\n @total_price = @seller.save_buy_a_product(product_buy)\n @view.buy_status(@total_price)\n input = @view.menu(\"2\")\n seller_actions(input) \n end", "def buyer\n starter\n end", "def choice_a_shop\n sell_item\n end", "def donizetti; end", "def investor\n end", "def prod?\n is_prod\n end", "def production_partnerships_shared_products\n#\t\tMoved to production products\n\tend", "def thorins_company; end", "def helpers; end", "def helpers; end", "def helpers; end", "def setup\n @products = products(:kit_lapis)\n end", "def products\n coach.courts\n end", "def sittinae_hooey(scrawny_appulsion, termly)\n end", "def apprentice\n\n\tend", "def toy_full_price toy\n\t$toy_full_price = toy[\"full-price\"]\nend", "def industry; end", "def show\n products()\n bills()\n today_bills()\n end", "def troop; end", "def shop_products\n products.shop_products\n end", "def product \r\n\t\tcase self.likeable_type.downcase\r\n\t\twhen 'bounty'\r\n\t\t\tself.likeable.product\r\n\t\twhen 'features'\r\n\t\t\tself.likeable.features_group.product\r\n\t\twhen 'product'\r\n\t\t\tself.likeable\r\n\t\telse\r\n\t\t\tnil\r\n\t\tend\r\n\tend", "def promotion\r\n\r\n end", "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "def pending_test_prod_tr_ids\r\n prods = Product.find(1, 2)\r\n assert_equal 2, prods.length\r\n assert_equal \"first-product\", prods[0].code\r\n assert_equal \"second-product\", prods[1].code\r\n assert_equal \"these are the specs for the first product\",\r\n prods[0].specs \r\n assert_equal \"This is a description of the first product\",\r\n prods[0].description \r\n assert_equal \"these are the specs for the second product\",\r\n prods[1].specs\r\n end", "def bought?\n # paym\n end", "def make_products_section\n\t$products_hash[\"items\"].each do |toy|\n\t\ttoy_name toy\n print_toy_name\n\t\ttoy_full_price toy\n\t print_toy_full_price\n \ttotal_purchases toy\n\t\tprint_total_purchases\n\t total_sales toy\n\t\tprint_total_sales\n \taverage_price toy\n\t\tprint_average_price\n \taverage_discount toy\n\t\tprint_average_discount\n\tend\nend", "def test_should_show_if_is_new_or_on_sale\n a_product = items(:towel)\n assert a_product.is_on_sale?\n a_product = items(:the_stuff)\n assert !a_product.is_on_sale?\n a_product = items(:lightsaber)\n assert a_product.is_new?\n a_product = items(:holy_grenade)\n assert !a_product.is_new?\n end", "def terpene; end", "def catalog; end", "def nonprofit\n end", "def pending_test_prod_tr_ids\n prods = Product.find(1, 2)\n assert_equal 2, prods.length\n assert_equal \"first-product\", prods[0].code\n assert_equal \"second-product\", prods[1].code\n assert_equal \"these are the specs for the first product\",\n prods[0].specs\n assert_equal \"This is a description of the first product\",\n prods[0].description\n assert_equal \"these are the specs for the second product\",\n prods[1].specs\n end", "def benefits\n self.ticket_price * self.spectators\n end", "def description\n super + \", Soy\"\n end", "def activate\n\n Product.class_eval do\n def already_purchased?\n purchased = false\n\n user = UserSession.find.user if UserSession.find\n if user\n orders = Order.find_all_by_user_id user.id\n else\n orders = []\n end\n orders.each do |order|\n line_item = LineItem.conditions('variant_id = ? AND order_id = ?', master.id, order.id).all\n purchased = true if line_item.size > 0\n end\n purchased\n end\n end\n\n LineItem.class_eval do\n def increment_quantity\n self.quantity\n end\n\n def decrement_quantity\n self.quantity\n end\n end\n end", "def print_products\n\treturn \"\n ____ _ _ \n | _ \\\\ _ __ ___ __| |_ _ ___| |_ ___ \n | |_) | '__/ _ \\\\ / _` | | | |/ __| __/ __|\n | __/| | | (_) | (_| | |_| | (__| |_\\\\__ \\\\\n |_| |_| \\\\___/ \\\\__,_|\\\\__,_|\\\\___|\\\\__|___/\\n\\n\"\n\nend", "def tow\n auto_shop.tow_vehicle\n end", "def tow\n auto_shop.tow_vehicle\n end", "def products\n find_products\n end", "def price_is_right(bids, actual_retail_price)\n \nend", "def scientist; end", "def create_full_product\n generate_product_name\n generate_product_code\n generate_product_manufacturer\n generate_product_description\n generate_product_price\n end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def spouse; end", "def update_products_details; end", "def description\n desc = \"Vouchers are not issued to customers for product promotions; \" \n if self.delivery? \n desc += \"customers require delivery and will provide a shipping address.\"\n else\n desc += \"customers will pick up the product.\"\n end\n \n desc\n end", "def show_tickets_sold()\n end", "def stock_market; end", "def price_is_right(bids, actual_retail_price)\n #\n # your code goes here\n #\nend", "def make_coffee(beans, water, electricity, milk)\n #do somehting with the ingredients\n #return finished product\nend", "def product_details\n\t# loop and call on methods for each details\n\t$products_hash[\"items\"].each do | toy_name |\n\t\tsave_array = [(\"\\nProduct: \"+product_name(toy_name)+\"\\n**********************************\\n\"),\n\t\t\t\t\t\t(\"Retail Price: $\"+product_full_price(toy_name)+\"\\n\"),\n\t\t\t\t\t\t(\"Total Number of Purchases: \"+product_tot_purchases(toy_name).to_s+\"\\n\"),\n\t\t\t\t\t\t(\"Total Sales Amount: $\"+product_tot_sales(toy_name).to_s+\"\\n\"),\n\t\t\t\t\t\t(\"Average Price: $\"+product_avg_price(toy_name).to_s+\"\\n\"),\n\t\t\t\t\t\t(\"Average Discount: $\"+product_avg_discount(toy_name).to_s+\"\\n\"),\n\t\t\t\t\t\t(\"Average Discount Percentage: \"+product_avg_discount_per(toy_name).to_s+\"%\\n\")]\n\t\tsave_file_array(save_array)\t\t\n\tend\nend", "def require_product?\n !!!catalog_request?\n end", "def require_product?\n !!!catalog_request?\n end", "def coolingtower\n\n end", "def potion; end", "def kitten\n end", "def vendor; end", "def price\n \n end", "def secondary_terms\n list = super\n\n if current_user.admin?\n list -= [:date_available] if model.new_record? || model.suppressed?\n list\n else\n list - [:date_available, :note, :access_note]\n end\n end", "def create \n @toy = Toy.new(item_params) \n if @toy.save \n flash[:notice] = 'Product added!' \n redirect_to \"toys#new\" \n else \n flash[:error] = 'Failed to edit product!' \n render :new \n end \n end", "def sell_bonus\n rpg_shop.sell_bonus\n end", "def the_products\n the_posts('commerce')\n end", "def meal\n return 'Breakfast'\n end", "def description\n purchase.store.present? ? \"Bought from #{purchase.store.name}\" : ''\n end", "def aow_price\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.parent(\"p\").span, format_method(__method__))\n end", "def promotion_tools\n @title = \"Promotion Tools\"\n end", "def seller\n author\n end", "def who_we_are\r\n end", "def weighIntrade()\n\n end", "def check_toys\n puts \"I have #{toys}\"\n end", "def title\n \"line item for #{product.name}\"\n end", "def variety; end", "def variety; end", "def romeo_and_juliet_quote; end", "def company; end", "def company; end", "def romeo_and_juliet; end", "def relation_method\n :product\n end", "def suivre; end", "def price\n \n end", "def sell_pending\n end", "def test_sell_pet_to_customer__pet_found\n customer = @customers[0]\n pet = find_pet_by_name(@pet_shop,\"Arthur\")# pre-exising function #9\n\n sell_pet_to_customer(@pet_shop, pet, customer)# need to define this function\n\n assert_equal(1, customer_pet_count(customer))#pre-existing\n assert_equal(1, pets_sold(@pet_shop))#pre-existing\n assert_equal(100, customer_cash(customer))#pre-existing\n assert_equal(1900, total_cash(@pet_shop))#pre-existing\n end", "def key_skill; end", "def cap? ; prod_type == 'cap' end", "def production_curtailment; end", "def description\n super + \", Milk\"\n end" ]
[ "0.63411975", "0.61930186", "0.6177824", "0.60906893", "0.5951873", "0.58251035", "0.5809664", "0.5784339", "0.5764976", "0.57347864", "0.5724205", "0.56822073", "0.5668991", "0.56638443", "0.5655707", "0.5626236", "0.55807257", "0.55781674", "0.55771846", "0.5574581", "0.55635065", "0.55635065", "0.55635065", "0.54844433", "0.54779804", "0.5463558", "0.54618293", "0.54407996", "0.54353666", "0.5433874", "0.5432818", "0.54156804", "0.54128957", "0.5393151", "0.539028", "0.539028", "0.5388384", "0.5379211", "0.5373868", "0.5371904", "0.5371544", "0.5364727", "0.5336124", "0.5327438", "0.5327319", "0.53254175", "0.53214335", "0.53155226", "0.530993", "0.530993", "0.5306229", "0.5303341", "0.5303138", "0.5298453", "0.52954006", "0.52954006", "0.52954006", "0.52954006", "0.52660227", "0.52630556", "0.52476734", "0.5235239", "0.5227174", "0.52248824", "0.52234113", "0.5220885", "0.5207162", "0.5207162", "0.52065676", "0.52038616", "0.5199999", "0.5196199", "0.5195556", "0.5195512", "0.5181856", "0.51804644", "0.5175186", "0.51621205", "0.5159843", "0.51551366", "0.5150632", "0.5150317", "0.51434976", "0.5142693", "0.51421994", "0.51362973", "0.51343787", "0.51343787", "0.5132768", "0.51279634", "0.51279634", "0.5123235", "0.51231045", "0.51173073", "0.5113775", "0.5104401", "0.5103116", "0.5101616", "0.509906", "0.5097709", "0.5096245" ]
0.0
-1
SHOW / HIDE FORM Hides the Use of Collections Information form
def hide_uoc_info_form logger.info 'Hiding the Use of Collections Info form' wait_for_element_and_click form_show_hide_button('Use of Collections Information') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide_uoc_info_form\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end", "def show_uoc_info_form\n logger.info 'Showing the Use of Collections Info form'\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end", "def show_uoc_info_form\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end", "def show\n form_collection\n end", "def hide_elements\n true\n end", "def index\n @show_form = false\n\n end", "def hide; end", "def hide; end", "def hide(val = true)\n show_in_details !val\n show_in_table !val\n editable !val\n end", "def hide!\n self[:hidden] = true\n self\n end", "def hidden_fields\n fields = hidden_field_tag 'view', @view\n @entries.each_pair do |key, value|\n unless @fields.nil? || @fields.key?(key)\n fields += hidden_field_tag key, value\n end\n end\n fields.html_safe\n end", "def hidden?\n false\n end", "def hidden?; self[:hidden] ||= false; end", "def hidden?\n false\n end", "def hidden?\n false\n end", "def hide!\n visible(false)\n end", "def hide!\n visible(false)\n end", "def hidden!\n @hidden = true\n self\n end", "def show_hidden_data\n @show_hidden_data = true\n end", "def show_hidden_data\n @show_hidden_data = true\n end", "def edit\n @hidden = 2\n end", "def show\n @group = @form.group.descendants.where.not(type: Form::CollectionGroup).find(params[:id])\n @model = build_form_model(@group)\n @instance = @model.new params.fetch(:form, {}).permit!\n end", "def index\n @groups = @form.group.descendants.where.not(type: Form::CollectionGroup)\n end", "def find_collections_for_form\n Hyrax::CollectionsService.new(self).search_results(:edit)\n end", "def display_delete_collections\r\n clear\r\n custom_banner\r\n puts\r\n options = []\r\n # Try to read the collection object and if error arise prompt user to add collecction feature\r\n begin custom = @custom.custom_load\r\n if custom['Custom'].size > 0\r\n custom['Custom'].each do |e|\r\n options.push({ name: \"Custom:#{e['Custom_Name']}\", value: lambda {\r\n delete_decision(custom, e)\r\n } })\r\n end\r\n else\r\n puts 'Sorry,the content is empty.'\r\n end\r\n rescue JSON::ParserError, NoMethodError, NoMemoryError, StandardError\r\n puts \"It seems the custom content is empty. Please move to custom menu to add a new custom collection.\\n\\n\\n\"\r\n end\r\n options.push({ name: 'Back', value: lambda {\r\n custom_collection\r\n } })\r\n option = @prompt.select(\r\n \"Please select one custom collection you want to delete. If you don't want to delete any thing, just select 'Back'.\", options, help: \"(Select with pressing ↑/↓ arrow keys, and then pressing Enter)\\n\\n\\n\", show_help: :always, per_page: 15\r\n )\r\n end", "def form_class\n Hyrax::CalifornicaCollectionsForm\n end", "def hide\n \tupdate_attribute(:hidden, true)\n end", "def hidden?\n end", "def hidden\n context.hidden.map(&:name)\n end", "def hide\n super\n\n Vedeu.buffers.by_name(name).hide\n end", "def show_collection_preface(collection)\n show_collection_section(collection, \"intro\") || show_collection_section(collection, \"faq\") || show_collection_section(collection, \"rules\")\n end", "def hide\n client.post('/api/hide', id: read_attribute(:name))\n end", "def show_hidden_field_tags\n hidden_fields = ''\n options = params.except(:search_field, :fromDetail, :facetfilter, :pagenumber, :q, :dbid, :an, :fulltext_type, :highlight, :resultId, :utf8)\n options.each do |key, value|\n if key == 'eds_action'\n if value =~ /addlimiter/ or value =~ /removelimiter/ or value =~ /setsort/ or value =~ /SetResultsPerPage/\n hidden_fields << '<input type=\"hidden\" name=\"' << key.to_s << '\" value=\"' << value.to_s << '\" />'\n end\n elsif value.kind_of?(Array)\n value.each do |v|\n hidden_fields << '<input type=\"hidden\" name=\"' << key.to_s << '[]\" value=\"' << v.to_s << '\" />'\n end\n else\n hidden_fields << '<input type=\"hidden\" name=\"' << key.to_s << '\" value=\"' << value.to_s << '\" />'\n end\n end\n hidden_fields.html_safe\n end", "def collection_form(params)\n render(:partial => \"layouts/collection_form\", :locals => params)\n end", "def hidden_entities\n end", "def index\n @forms = Form.where(hidden: false).page params[:page]\n end", "def hidden?(*)\n false\n end", "def relation_condition_option_form\n # Nothing to do here\n end", "def forFriendfunctions\n @status = false\n self.hide\n showElements\n end", "def help(use_visibility_link)\n @fields.map do |field|\n field.help use_visibility_link\n end\n end", "def make_hidden\n @linkage_vis = :hidden\n end", "def hide_entities\n if not @selection.empty?\n begin\n @model.start_operation \"Hide selected entities\"\n @selection.each { |e|\n puts \"Making '#{e}' entity hidden...\" if @debug\n e.visible = false\n }\n @model.commit_operation \n rescue Exception => e\n puts \"Error encountered: #{e}\" # Show even if debuggnig is off.\n @model.abort_operation\n end\n else\n puts \"Nothing selected!!!\" if @debug\n end\n end", "def hiddens\n @hiddens ||= fields.select { |f| f.class == Hidden }\n end", "def hide\n @visible = false\n self\n end", "def show_fields\n self.class.fields.values.select { |field| field.show }\n end", "def hide_hid!\n @hide_hid = true\n end", "def hidden?\n not visible\n end", "def help(use_visibility_link)\n help_item = [get_field_config['label'], get_field_config['description']]\n if use_visibility_link\n visibility_link = html_form_id\n help_item << visibility_link\n end\n help_item\n end", "def format_checkbox\n @opts[:no_hidden] = true unless @opts.has_key?(:no_hidden)\n super\n end", "def hide_admin\n admin? ? '' : 'hide'\n end", "def hidden_field?(field_name); end", "def search_as_hidden_fields(options={})\n ordered_query_facet_parameters = params_for_ui\n ordered_query_facet_parameters.delete(:q) if options[:omit_keys].include?(:q)\n return hash_as_hidden_fields(ordered_query_facet_parameters)\n end", "def show\n init_collection\n render 'edit'\n end", "def display_fields\n @form.fields.each {|f| puts f.name}\n end", "def show; @showing = false; end", "def hide_secret\n @is_showing_secret = false\n # TODO secret should be using a JPanel or something, not a dialog.\n end", "def hidden(name, value)\n# opts = options.collect { |k, v| %[#{k}=\"#{v}\"] }.join(' ')\n %[<input type=\"hidden\" name=\"#{name}\" value=\"#{value}\" />]\n end", "def wrapper_visibility\n @field_config[:hide_on_load] = !@field_config[:initially_visible] if @field_config&.key?(:initially_visible)\n return '' unless @field_config[:hide_on_load]\n\n ' hidden'\n end", "def check_hidden_fields\n self.hidden_fields= Set.new(self.hidden_fields)\n end", "def hide_as(arg = nil, &proc) # :yields: field_def or nil\n @view_control.hide_as(arg, &proc)\n end", "def hide_filter\n perm_links = ministry.lmi_hide.map { |lmi| \"lmi_total_#{lmi}\" }\n query = table[:perm_link].does_not_match(\"%_custom_%\")\n query = query.and(table[:perm_link].not_in(perm_links)) if perm_links.any?\n query\n end", "def default_hidden_widget\n Widgets::HiddenInput\n end", "def show\n @menu = \"option\"\n @board = \"option\"\n @section = \"show\"\n \n @option = Option.get(params[:id])\n @optionsubs = @option.optionsubs.all(:order => [ :priority.asc ])\n \n render 'admin/options/option', :layout => false\n end", "def show\n\t\t#no need b/c we just show all at once\n\tend", "def forms; end", "def show\n\t\tselect_type\n\t\tselect_sub_type\n\t\tunless current_admin.full_access? || current_admin.partial_access?\n\t\t redirect_to \"/404.html\"# configurar pagina 403\n\t\tend\n\tend", "def add_show_field(*) super end", "def unhide\n post(\"/api/unhide\", id: fullname)\n end", "def default_hide(for_view_control = @view_control)\n if this_field = get_field_defs_field(for_view_control)\n this_field.hide_proc.call(current_object)\n else\n \"\"\n end\n end", "def info_for_forms\n #Info for page\n #Saving info if we are SA\n @is_super_admin = is_super?\n #Array of admins for SA\n @admins = User.admins_list(with_mentors: false) if @is_super_admin\n end", "def hidden?()\n not visible?()\n end", "def hide_subnet\n render :update do |page|\n page.visual_effect :toggle_blind, 'subnet'\n end\n end", "def show\n admin_only\n end", "def show\n admin_only\n end", "def show\n admin_only\n end", "def hide()\n @view__.hide\n end", "def show\n\t\t# Initializing the Inivitation form from profile page\n\tend", "def show\n\t\trequire_admin!\n\tend", "def show_only\n @options = {:show_all => true, :show_only => true, :action => 'show_answer', :validation => true}\n survey_id = params[:id].to_i\n @survey = Survey.and_questions.find(params[:id])\n @color = @survey.color\n @page_title = @survey.get_title\n # flash[:notice] = \"Denne side viser ikke et brugbart spørgeskema. Du har tilgang til besvarelser gennem journaler.\"\n render :template => 'surveys/show', :layout => \"layouts/jsurvey\"\n end", "def is_hidden?\n\t\tself.hidden\n\tend", "def view_issues_bulk_edit_details_bottom(context = { })\n if context[:project].module_enabled?('dashboards') and Dashboard.find_by_project_id(context[:project].id)\n select = select_tag('objective_id',\n content_tag('option', l(:label_no_change_option), :value => '') +\n content_tag('option', l(:label_none), :value => 'none') +\n options_for_select(\n Dashboard.find_by_project_id(context[:project].id).objectives.all(\n :order => 'name').sort {|x, y| x.ancestors_path <=> y.ancestors_path}.collect {|v| [\"#{v.ancestors_path} #{v.name}\", v.id]}))\n\n return content_tag(:p, \"<label>#{l(:field_objective)}: \" + select + \"</label>\")\n else\n return ''\n end\n end", "def hidden?\n @field.widget.hidden?\n end", "def edit_form\n\t\toptions = { :disabled => false, :show_all => true, :edit => true}\n\t\tform_template(options)\n\tend", "def edit_form\n\t\toptions = { :disabled => false, :show_all => true, :edit => true}\n\t\tform_template(options)\n\tend", "def admin_display_fields\n admin.class.terminology.terms.keys - [:admin, :published_at, :edited_at, :template_name, :batch_id]\n end", "def show_only_managed_collections_for_non_admins(solr_parameters)\n return if current_ability.admin?\n clauses = [\n '-' + ActiveFedora::SolrQueryBuilder.construct_query_for_rel(depositor: current_user_key),\n '-' + ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: Hyrax.config.admin_set_model, creator: current_user_key)\n ]\n solr_parameters[:fq] ||= []\n solr_parameters[:fq] += [\"(#{clauses.join(' OR ')})\"]\n end", "def hide\n @notice.display(false)\n end", "def process_collections #:nodoc\r\n # If result_set is not defined on form, then it will fail. :return_to should know where to go\r\n if @form['result_set'].nil?\r\n process_return_to(params[:return_to] || 'reload')\r\n return true\r\n end\r\n # when result set is evaluated as Rails helper\r\n @form['result_set']['type'] ||= 'default'\r\n return unless @form['result_set']['type'] == 'default'\r\n\r\n # for now enable only filtering of top level documents\r\n if @tables.size == 1 \r\n check_filter_options()\r\n check_sort_options()\r\n end \r\n # result set is defined by filter method in control object\r\n form_filter = @form['result_set']['filter'] || 'default_filter'\r\n if respond_to?(form_filter)\r\n @records = send(form_filter)\r\n # something went wrong. flash[] should have explanation.\r\n if @records.class == FalseClass\r\n @records = []\r\n render(action: :index)\r\n return true\r\n end\r\n process_select_and_deny_fields\r\n # pagination but only if not already set\r\n unless (@form['table'] == 'dc_memory' || (@records.respond_to?(:options) && @records.options[:limit]))\r\n per_page = (@form['result_set']['per_page'] || 25).to_i\r\n @records = @records.page(params[:page]).per(per_page) if per_page > 0\r\n end\r\n else\r\n if @tables.size > 1 \r\n rec = @tables.first[0].find(@ids.first) # top most document.id\r\n 1.upto(@tables.size - 2) { |i| rec = rec.send(@tables[i][1].pluralize).find(@ids[i]) } # find embedded childrens by ids\r\n # TO DO. When field name is different then pluralized class name. Not working yet.\r\n embedded_field_name = @tables.last[0] ? @tables.last[1].pluralize : @tables.last[1]\r\n @records = rec.send(embedded_field_name) # current embedded set\r\n # sort by order if order field is present in model\r\n if @tables.last[1].classify.constantize.respond_to?(:order)\r\n @records = @records.order_by(order: 1)\r\n end\r\n end\r\n end\r\n false\r\nend", "def hide_unless(condition)\n hide(:unless => condition)\n end", "def hide\n set_publish_state(Event::DRAFT_STATE)\n end", "def hide_contact_details?\n #hide for non-login and non-project-member\n if !logged_in? or !current_user.person.member?\n return true\n else\n Seek::Config.hide_details_enabled\n end\n end", "def hidden(name = \"\", value = nil)\n attributes = if name.kind_of?(String)\n { \"TYPE\" => \"hidden\", \"NAME\" => name, \"VALUE\" => value }\n else\n name[\"TYPE\"] = \"hidden\"\n name\n end\n input(attributes)\n end", "def show\r\n find_record\r\n # before_show callback\r\n if (m = callback_method('before_show') )\r\n ret = call_callback_method(m)\r\n if ret.class == FalseClass\r\n @form['readonly'] = nil # must be\r\n flash[:error] ||= t('drgcms.not_authorized')\r\n return index\r\n end\r\n end \r\n\r\n render action: 'edit', layout: 'cms'\r\nend", "def no_column\n @browser.div(:class => \"shortlist_area shortlist_no section\")\n end", "def view_issues_form_details_bottom(context = { })\n if context[:project].module_enabled?('dashboards') and Dashboard.find_by_project_id(context[:project])\n select = context[:form].select :objective_id,\n Dashboard.find_by_project_id(context[:project]).objectives.all(\n :order => 'name').sort {|x, y| x.ancestors_path <=> y.ancestors_path}.collect { |d| [\"#{d.ancestors_path} #{d.name}\", d.id] },\n :include_blank => true\n return \"<p>#{select}</p>\"\n else\n return ''\n end\n end", "def show\n style[:hidden] = false\n update_visibility\n end", "def no_admin_set_abilities\n cannot [:edit, :create, :delete], Hydra::Admin::Collection\n end", "def hidden_class\n model.is_hidden? ? [\"kono_utils-hidden\"] : []\n end", "def field_for_select\n candidate_fields = [primary_field, list_view_fields, fields].flatten.compact\n candidate_fields.reject(&:restricted?).find(&:human_readable?)\n end", "def hide_flagged_records(solr_parameters)\n unless see_unpublished?\n solr_parameters[:fq] << '-flags_isim:[* TO *]'\n end\n end" ]
[ "0.7118138", "0.67549753", "0.64603233", "0.61388296", "0.60713583", "0.60540086", "0.596597", "0.596597", "0.5956695", "0.59062546", "0.5876109", "0.5767108", "0.5704933", "0.56766367", "0.56766367", "0.5676521", "0.5676521", "0.56571317", "0.5640662", "0.5640662", "0.5638199", "0.5577361", "0.55105114", "0.5494854", "0.54800063", "0.5478949", "0.5471822", "0.54590756", "0.5455165", "0.5447074", "0.543301", "0.5424327", "0.53996", "0.5389747", "0.5383914", "0.53816026", "0.53801024", "0.5378349", "0.53780496", "0.5371251", "0.5360479", "0.5348402", "0.5345961", "0.53443265", "0.5341813", "0.5316946", "0.5294167", "0.52845794", "0.52803963", "0.52683973", "0.52633566", "0.5245059", "0.5238293", "0.52379084", "0.52034086", "0.51958454", "0.5191612", "0.5179229", "0.51773244", "0.5176898", "0.5152968", "0.51512283", "0.51431423", "0.51420265", "0.5140075", "0.5139794", "0.51377875", "0.5133829", "0.5125351", "0.5123915", "0.5122587", "0.51213086", "0.51210594", "0.51210594", "0.51210594", "0.5113363", "0.5112035", "0.5109904", "0.5109518", "0.51068455", "0.5105951", "0.51017106", "0.5099695", "0.5099695", "0.5089712", "0.5086745", "0.5078221", "0.5076011", "0.5075286", "0.50593334", "0.50519514", "0.50503254", "0.5050047", "0.5049878", "0.50461596", "0.50389576", "0.5034245", "0.50318724", "0.5024535", "0.5021125" ]
0.7515609
0
Unhides the Use of Collections Information form
def show_uoc_info_form logger.info 'Showing the Use of Collections Info form' wait_for_element_and_click form_show_hide_button('Use of Collections Information') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hide_uoc_info_form\n logger.info 'Hiding the Use of Collections Info form'\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end", "def hide_uoc_info_form\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end", "def hide; end", "def hide; end", "def remove_invisible min_visibility\n return if [:private, :nodoc].include? min_visibility\n remove_invisible_in @method_list, min_visibility\n remove_invisible_in @attributes, min_visibility\n remove_invisible_in @constants, min_visibility\n end", "def hide!\n self[:hidden] = true\n self\n end", "def unhide\n post(\"/api/unhide\", id: fullname)\n end", "def hide_elements\n true\n end", "def make_hidden\n @linkage_vis = :hidden\n end", "def unhide\n client.post('/api/unhide', id: read_attribute(:name))\n end", "def unhide!\n update_attribute(:hidden_at, nil)\n end", "def unhide!\n update_attribute(:hidden_at, nil)\n end", "def unhide!\n update_attribute(:hidden_at, nil)\n end", "def hide!\n visible(false)\n end", "def hide!\n visible(false)\n end", "def hide\n super\n\n Vedeu.buffers.by_name(name).hide\n end", "def remove_invisible_in array, min_visibility # :nodoc:\n if min_visibility == :public then\n array.reject! { |e|\n e.visibility != :public and not e.force_documentation\n }\n else\n array.reject! { |e|\n e.visibility == :private and not e.force_documentation\n }\n end\n end", "def unhide app\n app.perform :unhide\n end", "def hide\n \tupdate_attribute(:hidden, true)\n end", "def hide\n @visible = false\n self\n end", "def complete min_visibility\n update_aliases\n remove_nodoc_children\n update_includes\n remove_invisible min_visibility\n end", "def unhide(current_user_id)\n self.current_user_id = current_user_id\n Subcategory.find(subcategory_id).unhide(current_user_id)\n self.hidden = false\n save\n end", "def hide_secret\n @is_showing_secret = false\n # TODO secret should be using a JPanel or something, not a dialog.\n end", "def hide\n self.visible = false\n clear_dmg_preview\n end", "def show_uoc_info_form\n wait_for_element_and_click form_show_hide_button('Use of Collections Information')\n end", "def remove_discard_supernatant(items)\n show do\n title 'Remove Supernatant'\n note 'Remove and discard supernatant from:'\n items.each do |item|\n bullet item.to_s\n end\n end\n end", "def hide()\n @view__.hide\n end", "def hideElements \n @hideElements.each do |element|\n element.hide\n end\n end", "def hide_word\t\n\t\thidden_word\n\tend", "def hide\n client.post('/api/hide', id: read_attribute(:name))\n end", "def hide(val = true)\n show_in_details !val\n show_in_table !val\n editable !val\n end", "def unmarkHelpful\n update_attribute(:isHelpful, false)\n end", "def hidden!\n @hidden = true\n self\n end", "def hidden\n hidden = @pack.sample(2)\n @pack.delete_if { |el| hidden.include?(el) }\n hidden\n end", "def hide_hid!\n @hide_hid = true\n end", "def display_delete_collections\r\n clear\r\n custom_banner\r\n puts\r\n options = []\r\n # Try to read the collection object and if error arise prompt user to add collecction feature\r\n begin custom = @custom.custom_load\r\n if custom['Custom'].size > 0\r\n custom['Custom'].each do |e|\r\n options.push({ name: \"Custom:#{e['Custom_Name']}\", value: lambda {\r\n delete_decision(custom, e)\r\n } })\r\n end\r\n else\r\n puts 'Sorry,the content is empty.'\r\n end\r\n rescue JSON::ParserError, NoMethodError, NoMemoryError, StandardError\r\n puts \"It seems the custom content is empty. Please move to custom menu to add a new custom collection.\\n\\n\\n\"\r\n end\r\n options.push({ name: 'Back', value: lambda {\r\n custom_collection\r\n } })\r\n option = @prompt.select(\r\n \"Please select one custom collection you want to delete. If you don't want to delete any thing, just select 'Back'.\", options, help: \"(Select with pressing ↑/↓ arrow keys, and then pressing Enter)\\n\\n\\n\", show_help: :always, per_page: 15\r\n )\r\n end", "def unhide\n @this_user.update_attributes(:visible => true)\n redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name]\n end", "def hide\n set_publish_state(Event::DRAFT_STATE)\n end", "def hidden_entities\n end", "def suitable_for_none\n \tself.disciplines.delete_all\n end", "def hide(position)\n row, col = position\n @secret_grid[row][col].hide\n end", "def hide(id)\n\t\tset_attribute_property(id, 'style', DISPLAY, NONE)\n\tend", "def cleanup\n show do\n title \"Discard stripwells\"\n note \"Please discard all stripwells.\"\n operations.each do |op|\n op.input(\"PCR\").collection.mark_as_deleted\n end\n end\n \n show do\n title \"Make sure machine in parked position\"\n check \"Click \\\"Processes\\\" -> \\\"Parked\\\" icon.\"\n image \"Actions/Fragment Analyzer/frag_an_parked.JPG\"\n end\n end", "def display_unconfigured_elements\n elts = @unconf_elts.keys\n if elts.empty?\n puts \"The document contains no unconfigured elements.\"\n else\n puts \"The following document elements were assigned no formatting options:\"\n puts line_wrap(elts.sort.join(\" \"), 0, 0, 65).join(\"\\n\")\n end\n\n elts.each do |elt_name|\n @elt_opts.delete(elt_name)\n end\n end", "def hide_entities\n if not @selection.empty?\n begin\n @model.start_operation \"Hide selected entities\"\n @selection.each { |e|\n puts \"Making '#{e}' entity hidden...\" if @debug\n e.visible = false\n }\n @model.commit_operation \n rescue Exception => e\n puts \"Error encountered: #{e}\" # Show even if debuggnig is off.\n @model.abort_operation\n end\n else\n puts \"Nothing selected!!!\" if @debug\n end\n end", "def unhide\n @goal = Mg::Goal.find(params[:id])\n @goal.update_attribute(:is_hidden, false)\n flash[:notice] = \"Goal #{@goal.name} has been restored.\"\n \n respond_to do |format|\n format.html { redirect_to mg_goals_url }\n format.xml { head :ok }\n end\n end", "def hide(*stuff)\n hide_methods(self, [Object], *stuff)\n end", "def hide\n Control.functions[__method__] ||= AU3_Function.new(\"ControlHide\", 'SSS', 'L')\n res = Control.functions[__method__].call(@title.wide, @text.wide, @c_id.wide)\n raise_unfound if res == 0\n nil\n end", "def display_drop_items\n # Does nothing, will be managed in Scene_Victory\n end", "def display_drop_items\n # Does nothing, will be managed in Scene_Victory\n end", "def remove_access_info(opts)\n opts = check_params(opts,[:access_info])\n super(opts)\n end", "def exclude_from_display\n [::Ability.public_group_name, ::Ability.registered_group_name, ::Ability.admin_group_name, @depositor]\n end", "def undisplay\n @queue << \"undisplay\"\n end", "def hidden\n context.hidden.map(&:name)\n end", "def hidden?; self[:hidden] ||= false; end", "def remove name_or_index\n \n # Name_or_index and positioning list, receiving always an Array\n #\n nip_list = extract_va_options name_or_index, false \n \n # Input homogeneization\n #\n nip_list.map!{ |ni| ni.is_a?(Hash) ? ni : { \n :item => ni, \n :layout_constraint => nil } }\n \n # Preparing input for super, and for method retval\n #\n name_or_index = nip_list.map{ |ni| ni[:item] }\n \n\n # If have a layout manager then remove layout constraint...\n #\n if @renderer && @renderer.layout_manager\n \n ip_list.each do |i| \n @renderer.layout_manager.remove i[:layout_constraint]\n end\n end\n \n # ...and then we do as abstract container for contained items\n #\n super name_or_index\n \n end", "def hideOffer()\n @item['offer']['activate'] = false\n self.updateOffer()\n end", "def remove_view_info(opts)\n opts = check_params(opts,[:view_info])\n super(opts)\n end", "def clear_deprecated\n @data.each do |k, _v|\n @data.delete(k) if @deprecated.include?(k)\n end\n end", "def hide_all()\n\t#images\n\tfor i in 0..3\n\t\tfor j in 0..4\n\t\t\t@computerimages[i][j].path = \"images/54.png\"\n\t\tend\n\tend\n\t#ranks\n\tfor i in 0..3\n\t\t@computerranks[i].text = \"-----\"\n\tend\t\nend", "def suppress\n return unless @track_visibility\n\n @suppressed = true\n\n stop_doc\n end", "def filter_fields\n\t \n\t \tremove_attribute(:version)\n\t \tremove_attribute(:op_success)\n\t \tattributes\n\n\t \t\n\t end", "def filter_fields\n\t \n\t \tremove_attribute(:version)\n\t \tremove_attribute(:op_success)\n\t \tattributes\n\n\t \t\n\t end", "def remove_unwanted_views\n blacklight_config.view.delete(:gallery)\n blacklight_config.view.delete(:masonry)\n blacklight_config.view.delete(:slideshow)\n end", "def visual_block_clear\n if @visual_block_start\n star = [@visual_block_start, @cursor].min\n fin = [@visual_block_start, @cursor].max\n remove_from_selection @view[star..fin]\n end\n @visual_block_start = nil\n @toggles[:visual_mode] = @visual_mode = false\n @mode = nil if @mode == 'VIS'\n # is this the right place to put this ??? 2019-04-16 -\n clean_selected_files\nend", "def remove_roles\n render(:layout => false)\n end", "def urp\n to_display = to_s\n @sections.clear\n to_display\n end", "def hide\n begin\n study = Study.find(params[:study_id])\n \n if study.user_id == session[:user_id] && study.active\n study.public = false\n study.save\n end\n rescue\n \n ensure\n redirect_to(manage_study_path)\n end\n end", "def hide_as(arg = nil, &proc) # :yields: field_def or nil\n @view_control.hide_as(arg, &proc)\n end", "def clear_accessors\n get_privacy_setting.accessors.clear\n end", "def forFriendfunctions\n @status = false\n self.hide\n showElements\n end", "def unhide_activity\n @categories = Category.all\n @activities = Activity.where(:category_id => nil)\n @activities.update_all(hidden: false)\n\n #Similar to the edit and create, we call a custom JS file with AJAX as all three functions will have to render\n #the activities after they are completed successfully\n respond_to do |format|\n format.js {render 'activity_ajax.js.erb'}\n end\n end", "def untranslated(collection)\n @texts.reject { |i| collection.translated?(i, @provider.name) }\n end", "def hide\n self.visible = false\n self.active = false\n Input.text_input = false if $MKXP\n end", "def hide\n @notice.display(false)\n end", "def display_attributes\n super.reject { |k, v| imported_attributes.fetch(k, nil) == v }\n end", "def display_attributes\n super.reject { |k, v| imported_attributes.fetch(k, nil) == v }\n end", "def trim_checklist_for_design_type\n \n design = self.design\n \n # Remove the sections that are not used in the audit.\n self.checklist.sections.delete_if { |section| !design.belongs_to(section) }\n \n self.checklist.sections.each do |section|\n \n # Remove the subsections that are not used in the audit.\n section.subsections.delete_if { |subsection| !design.belongs_to(subsection) }\n \n section.subsections.each do |subsection|\n # Remove the checks that are not used in the audit.\n subsection.checks.delete_if { |check| !design.belongs_to(check) }\n end\n end\n \n end", "def uncheck_content(item)\n name_li(item).checkbox.clear\n end", "def hideLayer(layer)\n\t\tlayer['style'] = setting(DISPLAY, NONE)\n\tend", "def unselect; end", "def del\n\t\t#methode ruft show auf ==> !?! ==> err aber funktioniert\n\tend", "def visibility; end", "def visibility; end", "def visibility; end", "def visibility; end", "def visibility; end", "def remove plataform\n end", "def remove_collection_supernatant(plates, amaps: [])\n return unless plates.present?\n plates.each_with_index do |plate, idx|\n amap = amaps[idx]\n\n unless amap.present?\n amap = one_to_one_association_map(from_collection: plate)\n end\n\n rc_list = amap.map { |hash| hash[:from_loc] }\n\n show do\n title 'Remove Supernatant'\n note \"Remove and discard supernatant from plate #{plate}:\"\n table highlight_collection_rc(plate, rc_list)\n end\n end\n end", "def clear_fields\n\t\tend", "def unuse\n @use = nil\n end", "def suppress_holding?(holding)\n # there are way too many collection codes involved, so we actually\n # filter based on display label -- many times one display label\n # has a dozen or more collection codes. \n ! ([\"Welch Online Journal\", \"Internet\", \"Internet resource\", \"Electronic Resources -- Welch Medical Library\", \"Welch Online Journals\", \"Gibson - Electronic Journals\", \"Gibson-Electronic Books or Documents\", \"Internet resource\", \"Online Book\", \"Friedheim -- Electronic Access\", \"OCLC Electronic Collections Online\", /Electronic Resource/i, /Online Book/i ].find {|test| test === holding.collection.display_label }).nil?\n end", "def no_admin_set_abilities\n cannot [:edit, :create, :delete], Hydra::Admin::Collection\n end", "def remove_classification_filter_if_used\n begin\n click_on 'Remove classification filter'\n rescue\n nil # Sometimes we're in a hierarchy. Oof.\n end\nend", "def hiddens\n @hiddens ||= fields.select { |f| f.class == Hidden }\n end", "def deverrouiller()\n\t\tself.set_sensitive(true)\n\tend", "def disown(w)\n super(w)\n DOM.changeToStaticPositioning(w.getElement)\n end", "def remove_map\n remove_widget\n end", "def show_hidden_data\n @show_hidden_data = true\n end", "def show_hidden_data\n @show_hidden_data = true\n end" ]
[ "0.71880895", "0.71395576", "0.6606297", "0.6606297", "0.634565", "0.63103616", "0.6225441", "0.6158702", "0.6151472", "0.6141419", "0.6085629", "0.6085629", "0.6085629", "0.60803616", "0.60803616", "0.60292125", "0.6016051", "0.59640527", "0.5871893", "0.5845322", "0.58349764", "0.5785159", "0.5733996", "0.57048625", "0.5700015", "0.5643459", "0.5642346", "0.5637042", "0.5598951", "0.5595572", "0.5587852", "0.55768126", "0.55645597", "0.5558847", "0.5531526", "0.55189574", "0.5491599", "0.5488881", "0.5471692", "0.5468399", "0.5454874", "0.54435843", "0.5441707", "0.5441361", "0.543943", "0.5428443", "0.54261315", "0.54256797", "0.54180235", "0.54180235", "0.5416569", "0.54105633", "0.54026157", "0.53874946", "0.53803444", "0.5358732", "0.53530717", "0.5339111", "0.5328706", "0.53277624", "0.53183943", "0.5314098", "0.5314098", "0.5308809", "0.5308246", "0.5305458", "0.52968484", "0.5296819", "0.5295731", "0.52922297", "0.5288743", "0.5274957", "0.52558774", "0.5248571", "0.5245604", "0.5239281", "0.5239281", "0.52385813", "0.52275574", "0.5225574", "0.52211744", "0.5218491", "0.5211506", "0.5211506", "0.5211506", "0.5211506", "0.5211506", "0.5211174", "0.5204632", "0.5192476", "0.5191863", "0.51854104", "0.5179485", "0.5174333", "0.51705885", "0.5161495", "0.51545805", "0.51432824", "0.5143032", "0.5143032" ]
0.5692069
25
REFERENCE NUMBER Selects the next autogenerated reference number and inserts it into the test data set
def select_auto_reference_nbr(test_data) hide_notifications_bar ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options) logger.info "Selected auto-generated reference number '#{ref_nbr}'" test_data.merge!({CoreUseOfCollectionsData::REFERENCE_NBR.name => ref_nbr}) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_auto_reference_nbr(test_data)\n hide_notifications_bar\n ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options)\n test_data.merge!({ UseOfCollections::REFERENCE_NBR.name => ref_nbr})\n end", "def enter_reference_nbr(test_data)\n hide_notifications_bar\n logger.info \"Entering reference number '#{test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name]}'\"\n wait_for_options_and_type(reference_nbr_input, reference_nbr_options, test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name])\n end", "def enter_reference_nbr(test_data)\n hide_notifications_bar\n wait_for_options_and_type(reference_nbr_input, reference_nbr_options, test_data[UseOfCollections::REFERENCE_NBR.name])\n end", "def store_reference\n 5.times do\n self[:reference] = generate_reference\n return reference unless self.class.where(:reference => reference).first\n end\n\n raise \"Could not generate unique reference for order\"\n end", "def ref_id\n 300_000_000 + data[0].to_i\n end", "def enter_ref_num(data_set)\n ref_num = data_set[Acquisition::ACQUIS_REF_NUM.name]\n wait_for_element_and_type(acquis_ref_num_input(0), ref_num) if ref_num\n end", "def enter_acquisition_ref_num(data_set)\n acquis_ref_num = data_set[CoreAcquisitionData::ACQUIS_REF_NUM.name]\n logger.debug \"Entering reference number '#{acquis_ref_num}'\"\n ref_num_options_locator = input_options_locator([], CoreAcquisitionData::ACQUIS_REF_NUM.name)\n wait_for_options_and_type(ref_num_input_locator, ref_num_options_locator, acquis_ref_num)\n end", "def add_number\n return unless %w[techreport manual].include? @bib.type\n\n did = @bib.docidentifier.detect { |i| i.primary == true }\n did ||= @bib.docidentifier.first\n @item.number = did.id if did\n end", "def get_next_number\n if project && number.blank?\n last_invoice_number = Invoice.where(:project_id => project.id).max(:number)\n self.number = last_invoice_number ? ((last_invoice_number + 1).to_i) : 1\n end\n end", "def generate_number\n record = true\n while record\n random = \"O#{Array.new(9){rand(9)}.join}\"\n record = Order.find(:first, :conditions => [\"number = ?\", random])\n end\n self.number = random\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[UseOfCollections::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def reference_it(value)\n reference_number = value[0,2].to_s.downcase\n reference_number += value.reverse[0,1].to_s.downcase\n reference_number += random_numeric(6)\n return reference_number\n end", "def generate_order_number\n record = true\n while record\n random = \"R#{Array.new(9){rand(9)}.join}\"\n record = self.class.where(:number => random).first\n end\n self.number = random if self.number.blank?\n self.number\n end", "def enter_valuation_control_ref_num(data_set)\n vc_ref_num = data_set[CoreValuationControlData::VALUE_NUM.name]\n logger.debug \"Entering reference number '#{vc_ref_num}'\"\n ref_num_options_locator = input_options_locator([], CoreValuationControlData::VALUE_NUM.name)\n wait_for_options_and_type(ref_num_input_locator, ref_num_options_locator, vc_ref_num)\n end", "def up_number\n unless number\n if Invoice.count == 0\n self.number = '001'\n else\n last_invoice = Invoice.order(:number).last\n self.number = last_invoice.number.succ\n end\n end\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def set_default_number\n self.number ||= self.class.next_number repository\n end", "def next_reference(reference, limit = 6, seperator = '-')\n if reference[/[0-9]+\\z/] == ?9 * limit\n \"#{reference[/\\A[a-z]+/i].next}#{seperator}#{?0 * (limit - 1)}1\"\n else\n reference.next\n end\n end", "def next_txn_num\n @txn_num += 1\n end", "def test_next\n\t\tassert_equal(6, @freeid.next, \"Extras not working\")\n\t\tassert_equal(1, @freeid.next, \"Last not working\")\n\t\tassert_equal(2, @freeid.next, \"Last not incrementing\")\n\tend", "def next_auto_ref\n count = -1\n User.transaction do\n self.lock!\n count = self.image_ref_count + 1\n # for some reason update_attributes doesn't appear to work here\n self.image_ref_count = count\n self.save!\n end\n count\n end", "def set_number\n return set_transaction_id if self.id\n #self.transaction_id = (Time.now.to_i).to_s(CHARACTERS_SEED)## fake number for friendly_id validator\n begin\n self.transaction_id = SecureRandom.random_number(FIXNUM_MAX)\n end while self.class.exists?(transaction_id: transaction_id)\n end", "def next_id\n self.latest_id += 1\n end", "def set_invoice_number\n self.invoice_number = self.id + 777777\n self.save\n end", "def next_number\n Sequence.next_val\n end", "def file_number_initial_value\n @file_number ||= 100_000\n # this seed file creates 40 new veterans on each run, 100 is sufficient margin to add more data\n @file_number += 100 while Veteran.find_by(file_number: format(\"%<n>09d\", n: @file_number))\n @file_number\n end", "def ensure_invoice_number\n self.number = series.next_number\n yield\n series.update_attribute :next_number, number + 1\n end", "def show\n\n @internal_ref = (@health_case.id)+(123565)\n @health_case.internal_reference = @internal_ref\n @health_case.save\n end", "def inc_seq_no!()\n @seq_no += 1\n return(nil)\n end", "def next_revision_number\n # Need to retrieve existing revision numbers to sort them as integers\n sql = \"SELECT revision FROM #{Changeset.table_name} \" \\\n \"WHERE repository_id = #{id} AND revision NOT LIKE 'tmp%'\"\n @current_revision_number ||= (self.class.connection.select_values(sql).collect(&:to_i).max || 0)\n @current_revision_number += 1\n end", "def enter_conservation_ref_num(data_set)\n cons_ref_num = data_set[CoreConservationData::CONS_REF_NUM.name]\n logger.debug \"Entering condition ref number '#{cons_ref_num}'\"\n wait_for_element_and_type(cons_ref_num_input_locator(0), cons_ref_num) if cons_ref_num\n end", "def next_temp_id\n @id ||= ASSET_GROUP_TEMPORARY_ID.to_i\n @id -= 1\nend", "def ref\n @references += 1\n end", "def next_bib\n self[:next_bib] = self.inc(next_bib: 1)[:next_bib]\n\tend", "def next_sequence_number!\n sequence_number && @sequence_number += 1\n end", "def next_id\n (@curr_id +=1).to_s\n end", "def enter_valuation_control_ref_num(data_set)\n vc_ref_num = data_set[ValuationControl::VALUE_NUM.name]\n wait_for_element_and_type(ref_num_input_locator, vc_ref_num)\n end", "def next_bib\n \tself[:next_bib] = self[:next_bib] + 1\n end", "def assign_control_doc_number\n\t\tself.control_doc_number = Time.now.strftime(\"%Y\") + \"/\" + Time.now.to_i.to_s\n\t\tself.control_doc_number\n\tend", "def first_reference_id\n nil\n end", "def next_number\n process_next_block if @numbers.empty?\n\n @numbers.shift\n end", "def assign_tx_seq_num\n self.update(tx_seq_num: Order.max_tx_seq_num + 1) \n end", "def ref_number\n batch = check.batch\n facility_name = facility.name.upcase\n if (facility_name == 'AHN' || facility_name == 'SUBURBAN HEALTH' ||\n facility_name == 'UWL' || facility_name == 'ANTHEM')\n file_number = batch.file_name.split('_')[0][3..-1] rescue \"0\"\n date = batch.date.strftime(\"%Y%m%d\")\n \"#{date}_#{file_number}\"\n else\n (batch.batchid.include?(\"AH\") ? batch.batchid : batch.date.strftime(\"%Y%m%d\"))\n end\n end", "def reference_number_prefix\n nil\n end", "def ensure_invoice_number\n self.number = serie.next_number\n yield\n serie.update_attribute :next_number, number + 1\n end", "def append_number\n append table.pick\n end", "def test_runner_using_refs\n ref = create_records(@client)\n get_record(@client, ref)\n update_record(@client, ref)\n delete_record(@client, ref)\n end", "def _next_id\n @@id -= 1\n @@id\n end", "def new_id\n @last_id ||= 0\n @last_id += 1\n end", "def new_id\n @last_id ||= 0\n @last_id += 1\n end", "def next_serial_number\n serial = permute(permute(@offset % BOUNDARY))\n @offset += STEP\n serial\n end", "def next_check_number\n\t\tmaximum = cash_bank_check_offereds.maximum(\"number\")\n\t\t(maximum ? maximum+1 : initial_check_number).to_s\n\tend", "def next_match_number\n # This returns a PGresult object\n # [http://rubydoc.info/github/ged/ruby-pg/master/PGresult]\n result = Match.connection.execute(\"SELECT nextval('match_number_seq')\")\n result[0]['nextval']\n end", "def next_auto_increment\n if Visit.count > 0\n Visit.last.id + 1\n else\n tmp_visit = Visit.create(evid: \"00000000-0000-0000-0000-000000000000\")\n auto_increment = tmp_visit.id + 1\n tmp_visit.delete\n auto_increment\n end\n end", "def test_add\n\t\tassert_raise( RuntimeError ) { @freeid.add(\"Yo\") }\n\t\t@freeid.next\n\t\t@freeid.next\n\t\t@freeid.add(6)\n\t\tassert_equal(6, @freeid.next, \"Add not working\")\n\t\tassert_equal(2, @freeid.next, \"Last not working after add\")\n\tend", "def insert_id\n rID = @ID\n\n @CallsList << [ 'insert_id', @ID ]\n @ID += 1\n\n return rID\n end", "def next_sequence_id\n last_sequence_id + 1\n end", "def generate_number(isofferte)\n return id if isofferte.to_i == 1\n\n # TODO: scope per firm here!\n last_invoice = Invoice.order('number').last\n\n self.number = if last_invoice\n last_invoice.number + 1\n else\n # generate invoice nr based on year+month\n \"#{Time.new.strftime('%Y%m')}0001\".to_i\n end\n end", "def new_id\n @last_id ||= 0\n @last_id += 1\n end", "def add_serial_number\n serial_number = serial_number_stub\n # Converting to Base 36 can be useful when you want to generate random combinations of letters and numbers, since it counts using every number from 0 to 9 and then every letter from a to z. Read more about base 36 here: https://en.wikipedia.org/wiki/Senary#Base_36_as_senary_compression\n alphanumerics = (0...36).map{ |i| i.to_s 36 }\n 13.times{|t| serial_number << alphanumerics.sample}\n self.update(serial_number: serial_number)\n end", "def add_serial_number\n serial_number = serial_number_stub\n # Converting to Base 36 can be useful when you want to generate random combinations of letters and numbers, since it counts using every number from 0 to 9 and then every letter from a to z. Read more about base 36 here: https://en.wikipedia.org/wiki/Senary#Base_36_as_senary_compression\n alphanumerics = (0...36).map{ |i| i.to_s 36 }\n 13.times{|t| serial_number << alphanumerics.sample}\n self.update(serial_number: serial_number)\n end", "def next_id\n @id ||= 0\n @id += 1\n end", "def idref\n \"c#{rank}\"\n end", "def test_insert_page_numbers\n local_file_name = 'test_multi_pages.docx'\n remote_file_name = 'TestInsertPageNumbers.docx'\n\n upload_file File.join(local_test_folder, 'Common/' + local_file_name), remote_data_folder + '/' + remote_file_name\n\n request_page_number = PageNumber.new({:Alignment => 'center', :Format => '{PAGE} of {NUMPAGES}'})\n request = InsertPageNumbersRequest.new(name: remote_file_name, page_number: request_page_number, folder: remote_data_folder, dest_file_name: remote_test_out + '/' + remote_file_name)\n\n result = @words_api.insert_page_numbers(request)\n assert_equal false, result.nil?\n end", "def assign_uuid\n self.uuid = UUIDTools::UUID.random_create.to_s\n self.document_number ||= Numerator.get_number\n end", "def new_ref!(viewmodel)\n vm_ref = viewmodel.to_reference\n if vm_ref.model_id\n vm_ref.stable_reference\n else\n format('ref:i:%06<count>d', count: (@last_ref += 1))\n end\n end", "def next_number\n counter.call(files.last_number).to_s\n end", "def next_number(num)\n num + 1\n end", "def insert_linking_identifier(opts={})\n node = Medusa::Premis::Agent.linking_identifier_template\n nodeset = self.find_by_terms(:linkingIdentifier)\n\n unless nodeset.nil?\n if nodeset.empty?\n self.ng_xml.root.add_child(node)\n index = 0\n else\n nodeset.after(node)\n index = nodeset.length\n end\n self.dirty = true\n end\n\n return node, index\n end", "def _set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n _get_serial_number\n end\n _backup filename\n change_row filename, pattern, \"#{appname}:#{number}\"\n end", "def sequence_number; end", "def get_next_serial_number(dt_wo)\n dt_wo.total_serial_nums += 1\n raise \"invalid serial number\" if dt_wo.total_serial_nums > 65525\n end_num = dt_wo.total_serial_nums.to_s\n serial_number = dt_wo.starting_serial_num\n serial_number = serial_number.ljust(10, \"0\")\n serial_number[serial_number.size - end_num.size, serial_number.size]= end_num\n dt_wo.current_serial_num = serial_number\n dt_wo.save!\n return serial_number\n end", "def enter_condition_ref_num(data_set)\n cond_ref_num = data_set[ConditionCheck::COND_REF_NUM.name]\n wait_for_element_and_type(cond_ref_num_input_locator(0), cond_ref_num) if cond_ref_num\n end", "def next_identifier\n if @identifier >= @max_identifier\n @identifier = 1\n else\n @identifier += 1\n end\n end", "def next_id\n @imutex.synchronize do\n @mid += 1\n end\n end", "def next_serial_number\n size + 1\n end", "def test_next_ax_account_number_begining\n assert_equal \"CU 0100001\", AxAccount.next_ax_account_number\n end", "def create_referring_record\n return unless @ref_record_type\n\n @referring_record = find_referring_record\n ModelReference.create_with @referring_record, self if @referring_record\n end", "def next_sequence_value(sequence_name)\n select_one(\"select #{sequence_name}.nextval id from dual\")['id']\n end", "def generate_new_id()\n\t\tbegin\n\t\t\t(id = rand(9000)+1000)\n\t\tend while @objects[id]\n\t\treturn id\n\tend", "def generate_number\r\n return randomNumber = 1 + rand(100)\r\n end", "def set_next_seqno\n a = self.pcp_subject.pcp_items\n m = a.maximum( :seqno ) || 0\n n = a.count\n self.seqno = ( n > m ? n : m ) + 1\n end", "def next_id\n COUNTER_LOCK.synchronize do\n @@id_counter += 1\n end\n end", "def ref\n @_references_mutex.synchronize {\n @_references += 1\n }\n\n self\n end", "def ref\n\t\t@_references_mutex.synchronize {\n\t\t\t@_references += 1\n\t\t}\n\n\t\tself\n\tend", "def generate(init)\n subject.transaction do\n # Create a record in internal_ids if one does not yet exist\n # and increment its last value\n #\n # Note this will acquire a ROW SHARE lock on the InternalId record\n (lookup || create_record(init)).increment_and_save!\n end\n end", "def get_next_membership_number\n self.class.connection.execute(\"SELECT nextval('membership_number_seq')\").getvalue(0, 0).to_s\n end", "def get_new_random_number random_numbers\n random_number = 0\n begin\n random_number = rand @working_dataset.get_dataset_size\n end while (random_numbers.has_key?(random_number))\n random_numbers[random_number] = 1\n return random_number\n end", "def increment_sequence_number\n @sequence_number += 1\n @sequence_number = 0 if @sequence_number > 0xFFFFFFFF\n end", "def test_generate_random_unique_order_number\n sample_number = Order.generate_order_number\n assert_nil Order.find(:first, :conditions => [\"order_number = ?\", sample_number])\n end", "def next_gen\n @grid.calc_new_generation\n @generation += 1\n @current_gen_same_as_prev = @grid.current_gen_same_as_prev\n end", "def auto_tracknumber\n i = 0\n @files.each { |file|\n next unless @selected_files.include? file\n file.set_values('TRACKNUMBER', (i+1).to_s)\n i += 1\n }\n end", "def get_next_patid\n\t\tStudySubject.maximum(:patid).to_i + 1\n#\n#\tWhat happens if/when this goes over 4 digits? \n#\tThe database field is only 4 chars.\n#\n\tend", "def second_reference_id\n nil\n end", "def next_order_number\n return 0 unless highest_order_number\n highest_order_number + 1\n end", "def set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n get_serial_number\n end\n backup filename\n # from Sed\n change_row filename, pattern, \"#{appname}:#{number}\"\n end", "def next_file_number\r\n most_recent_file_number + 1\r\n end", "def new_serial\n @soa[:serial] = self.class.next_serial(@soa[:serial])\n end", "def generate_number\r\n \r\n #Generate and return a random number between 1 and 1000\r\n return randomNo = 1 + rand(1000)\r\n \r\n end", "def new_reference(options={}, &block)\n save = options.delete(:save)\n\n if options[:number]\n options[:ref_id] = \"ref.#{options[:number]}\" unless options.has_key?(:ref_id)\n end\n\n if !options.has_key?(:cited_paper)\n uri = options.delete(:uri) || mk_random_uri\n bib = options.delete(:bibliographic)\n options[:cited_paper] = Paper.new(uri:uri, bibliographic:bib)\n end\n\n result = Reference.new(options)\n\n if block_given?\n if block.arity==0\n result.instance_eval &block\n else\n yield self\n end\n end\n\n result.save! if save\n result\n end" ]
[ "0.73228556", "0.6703032", "0.642455", "0.6364688", "0.6173592", "0.6141458", "0.60801643", "0.58830035", "0.5871635", "0.5862146", "0.58420545", "0.58301", "0.57963765", "0.57961184", "0.57651025", "0.57562673", "0.57513845", "0.5722359", "0.56142944", "0.5597772", "0.5579361", "0.557592", "0.5573037", "0.5549765", "0.5545893", "0.55350643", "0.5529633", "0.55077857", "0.5484876", "0.5476414", "0.547227", "0.54674244", "0.54299676", "0.5399589", "0.5394681", "0.53938097", "0.53914076", "0.5385275", "0.53759855", "0.5322369", "0.5317811", "0.53101486", "0.5308671", "0.5294087", "0.5292327", "0.52883595", "0.5287578", "0.52847433", "0.5281832", "0.5281832", "0.5276914", "0.52753985", "0.5274957", "0.52723527", "0.5272299", "0.5270383", "0.52544194", "0.5249325", "0.52479494", "0.52402467", "0.52402467", "0.52343446", "0.52330405", "0.5227816", "0.52256256", "0.5225155", "0.52198994", "0.52196217", "0.5207641", "0.52043754", "0.51969916", "0.51967233", "0.5196432", "0.51860917", "0.5178157", "0.5161079", "0.51606894", "0.5158364", "0.5144963", "0.51354444", "0.5133313", "0.5132713", "0.51275194", "0.5121319", "0.5117941", "0.5113142", "0.5109547", "0.5107885", "0.51077986", "0.5096264", "0.5094964", "0.50837576", "0.5077074", "0.50770617", "0.5073002", "0.5070747", "0.5058818", "0.50553834", "0.5052528", "0.5050982" ]
0.731959
1
Adds or removes a custom reference number per a given set of test data
def enter_reference_nbr(test_data) hide_notifications_bar logger.info "Entering reference number '#{test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name]}'" wait_for_options_and_type(reference_nbr_input, reference_nbr_options, test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_auto_reference_nbr(test_data)\n hide_notifications_bar\n ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options)\n test_data.merge!({ UseOfCollections::REFERENCE_NBR.name => ref_nbr})\n end", "def select_auto_reference_nbr(test_data)\n hide_notifications_bar\n ref_nbr = select_id_generator_option(reference_nbr_input, reference_nbr_options)\n logger.info \"Selected auto-generated reference number '#{ref_nbr}'\"\n test_data.merge!({CoreUseOfCollectionsData::REFERENCE_NBR.name => ref_nbr})\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[UseOfCollections::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def reference_it(value)\n reference_number = value[0,2].to_s.downcase\n reference_number += value.reverse[0,1].to_s.downcase\n reference_number += random_numeric(6)\n return reference_number\n end", "def ref\n @references += 1\n end", "def enter_reference_nbr(test_data)\n hide_notifications_bar\n wait_for_options_and_type(reference_nbr_input, reference_nbr_options, test_data[UseOfCollections::REFERENCE_NBR.name])\n end", "def ref_id\n 300_000_000 + data[0].to_i\n end", "def store_reference\n 5.times do\n self[:reference] = generate_reference\n return reference unless self.class.where(:reference => reference).first\n end\n\n raise \"Could not generate unique reference for order\"\n end", "def add_number\n return unless %w[techreport manual].include? @bib.type\n\n did = @bib.docidentifier.detect { |i| i.primary == true }\n did ||= @bib.docidentifier.first\n @item.number = did.id if did\n end", "def delete_before_data(tests, object, test, rrefs)\n cust_before = @provider.get_code_multiline(tests, test[:path])\n if cust_before.nil?\n get = \"expect_network_get_#{test[:exists] ? 'success' : 'failed'}\"\n get_line = create_expectation(get, test[:has_name], object, 12)\n code = [get_line]\n\n if test[:exists]\n has_rrefs = !object.uri_properties\n .select { |p| p.is_a? Api::Type::ResourceRef }\n .empty?\n # Delete specifies name as a parameter, not as part of data\n params = []\n params = ['nil'] if test[:has_name] && has_rrefs\n params = ['\\'title0\\''] unless test[:has_name]\n\n code << create_expectation('expect_network_delete',\n true, object, 12, params, 1)\n\n unless object.async.nil?\n code << create_expectation('expect_network_get_async',\n test[:has_name], object, 12, [],\n 1)\n end\n end\n\n rrefs.each do |ref|\n next if ref.object == object\n name = Google::StringUtils.underscore(ref.object.name)\n # Puppet style refs include a seed\n code << create_expectation(\"expect_network_get_success_#{name}\",\n true, ref.object, 12, [],\n (ref.seed % MAX_ARRAY_SIZE) + 1)\n end\n\n code.flatten.uniq\n else\n # rubocop:disable Security/Eval\n eval(\"\\\"#{cust_before}\\\"\", binding, __FILE__, __LINE__)\n # rubocop:enable Security/Eval\n end\n end", "def remove_or_decrement_ref(*nodes); end", "def add_reference(value)\n ref = @ref_by_value[value]\n\n unless ref.present?\n ref = new_ref!(value)\n @ref_by_value[value] = ref\n @value_by_ref[ref] = value\n end\n\n ref\n end", "def reference_number_prefix\n nil\n end", "def test_runner_using_refs\n ref = create_records(@client)\n get_record(@client, ref)\n update_record(@client, ref)\n delete_record(@client, ref)\n end", "def handle_references_label(vals)\n @references_collection << vals.last\n @references = vals.last if matches_mdes_version(vals)\n end", "def increment_reference_amount(node)\n definition = definition_for_node(node)\n\n if definition and !definition.frozen?\n definition.reference_amount += 1\n end\n end", "def add(num, *aliases)\n # for alfred, ARGV comes in as one blob\n # have since updated input bash script, but leaving this here anyway\n num, *aliases = num.split if aliases.empty?\n\n data = db_from_file\n # if the number already exists, we will add this alias to that entry\n # TODO: be able to add an alias to an existing alias e.g.: n.aliases.include?(num)\n old_data = data.detect { |n| n.num == num }\n data.reject! { |n| n.num == num }\n # merge old data and new data\n aliases = (old_data.aliases + aliases).uniq if old_data && !old_data.aliases.empty?\n\n new_num = BjUrl::Num.new(num, *aliases)\n data.push(new_num)\n\n db_to_file(data)\n new_num\n end", "def add_customer_ref_num(params, customer_ref_num)\n params[:customer_ref_num] = customer_ref_num\n end", "def bump_reference(resource)\n @references[resource] = ref_count(resource) + 1\n end", "def create_sorted_references_to_test\n all_formulae = all_formulae()\n references_to_test = {}\n\n # First get the list of references we should test\n worksheets do |name, xml_filename|\n log.info \"Workingout references to test for #{name}\"\n\n # Either keep all the cells on the sheet \n if !cells_to_keep || cells_to_keep.empty? || cells_to_keep[name] == :all\n keep = all_formulae[name].keys || []\n else # Or just those specified as cells that will be kept\n keep = cells_to_keep[name] || []\n end\n\n # Now go through and match the cells to keep with their values\n i = input([name,\"Values\"])\n i.each_line do |line|\n ref, formula = line.split(\"\\t\")\n next unless keep.include?(ref.upcase)\n references_to_test[[name, ref]] = formula\n end\n close(i)\n end\n \n # Now work out dependency tree\n sorted_references = SortIntoCalculationOrder.new.sort(all_formulae)\n\n references_to_test_file = intermediate(\"References to test\")\n sorted_references.each do |ref|\n ast = references_to_test[ref]\n next unless ast\n c_name = c_name_for_worksheet_name(ref[0])\n references_to_test_file.puts \"#{c_name}\\t#{ref[1]}\\t#{ast}\"\n end\n\n close references_to_test_file\n end", "def enter_ref_num(data_set)\n ref_num = data_set[Acquisition::ACQUIS_REF_NUM.name]\n wait_for_element_and_type(acquis_ref_num_input(0), ref_num) if ref_num\n end", "def test_default_reference\n v = @user.flags.default_reference[0]\n @user.flags.default_reference[0] = rand(10) + 10\n new_user = HasEasyUserTest.new\n assert_equal v, new_user.flags_default_reference[0]\n end", "def ref_number\n batch = check.batch\n facility_name = facility.name.upcase\n if (facility_name == 'AHN' || facility_name == 'SUBURBAN HEALTH' ||\n facility_name == 'UWL' || facility_name == 'ANTHEM')\n file_number = batch.file_name.split('_')[0][3..-1] rescue \"0\"\n date = batch.date.strftime(\"%Y%m%d\")\n \"#{date}_#{file_number}\"\n else\n (batch.batchid.include?(\"AH\") ? batch.batchid : batch.date.strftime(\"%Y%m%d\"))\n end\n end", "def add_reference(post, identification)\n auth, trans_id = identification.split(';')\n post[:authnum] = auth\n post[:transid] = trans_id\n end", "def add_report_reference(id, reference)\n body = {\n data: {\n type: \"issue-tracker-reference-id\",\n attributes: {\n reference: reference\n }\n }\n }\n\n post(\"reports/#{id}/issue_tracker_reference_id\", body)\n end", "def replace_refs\n doc.xpath('.//ref').each_with_index.map do |node, index|\n text = node.inner_html\n\n ref_node = create_ref_node(node, index + 1)\n node.replace(ref_node)\n\n text\n end\n end", "def set_reference\n extract_reference_data\n values = reference_data.split\n @reference = Reference.new(thermometer: Float(values[1]), humidity: Float(values[2]))\n end", "def add_num_checkin\n self[:numCheckIn] += 1\n end", "def change_reference(new_reference)\n\n # In datamapper it's not possible to update the key value, so we use adapter\n # https://stackoverflow.com/questions/32302407/updating-a-property-set-as-the-key-in-datamapper\n BookingItem.change_item_reference(new_reference, reference)\n # Update the item references assigned\n BookingDataSystem::BookingLineResource.all(booking_item_reference: reference).update(booking_item_reference: new_reference)\n # Update stock locking references\n BookingDataSystem::BookingPrereservationLine.all(booking_item_reference: reference).update(booking_item_reference: new_reference)\n\n end", "def add_report_reference(reference)\n body = {\n type: \"issue-tracker-reference-id\",\n attributes: {\n reference: reference\n }\n }\n\n response_json = make_post_request(\"reports/#{id}/issue_tracker_reference_id\", request_body: body)\n @report = response_json[:relationships][:report][:data]\n self\n end", "def new_ref!(viewmodel)\n vm_ref = viewmodel.to_reference\n if vm_ref.model_id\n vm_ref.stable_reference\n else\n format('ref:i:%06<count>d', count: (@last_ref += 1))\n end\n end", "def enter_acquisition_ref_num(data_set)\n acquis_ref_num = data_set[CoreAcquisitionData::ACQUIS_REF_NUM.name]\n logger.debug \"Entering reference number '#{acquis_ref_num}'\"\n ref_num_options_locator = input_options_locator([], CoreAcquisitionData::ACQUIS_REF_NUM.name)\n wait_for_options_and_type(ref_num_input_locator, ref_num_options_locator, acquis_ref_num)\n end", "def flag_ref(ref_name)\n @flagged << ref_name.to_s\n @flagged.uniq!\n end", "def number(name, number)\n push(name, number)\n end", "def renumber_lists\n lists.order(\"upper(name) asc\").each_with_index do |list, ndx|\n list.update(number: ndx+1)\n end\n end", "def set_ref_seq\n\n seq = segments.map(&:ref_seq).reduce(:+)\n update_attributes(:_ref_seq => seq)\n\n seq\n\n end", "def enter_valuation_control_ref_num(data_set)\n vc_ref_num = data_set[CoreValuationControlData::VALUE_NUM.name]\n logger.debug \"Entering reference number '#{vc_ref_num}'\"\n ref_num_options_locator = input_options_locator([], CoreValuationControlData::VALUE_NUM.name)\n wait_for_options_and_type(ref_num_input_locator, ref_num_options_locator, vc_ref_num)\n end", "def add_reference key, target, opts = {}, &blk\n\t\tadd_reference_set(key,target,opts) if target.is_a? Array\n\t\tadd_to_db(target, nil, :if_in_use => opts[:add_then_reference]) if opts[:add_then_reference]\n\t\tadd_to_db Database::Reference.new(self, target, :proc => blk), key, :if_in_use => opts[:if_in_use]\n\tend", "def increment_matrix_row_reference_count(mr)\n mr.update_columns(reference_count: (mr.reference_count || 0) + 1)\n mr.update_columns(cached_observation_matrix_row_item_id: id) if type =~ /Single/\n end", "def idref\n \"c#{rank}\"\n end", "def test_match_reference\n parser = CEdictParser.new(Rails.root.join(\"data/cedict/test_data/cedict_parser_match_reference.txt\").to_s)\n entries = parser.run\n assert_equal(6,entries.count)\n assert_equal(1,parser.reference_only_entries.count)\n \n merged_entries = parser.merge_references_into_base_entries(entries,parser.reference_only_entries)\n assert_equal(6,merged_entries.count)\n end", "def add_reference(table, ref_name, **kwargs)\n current_instructions << Instructions::AddReference.new(\n table: table,\n ref_name: ref_name,\n **kwargs,\n )\n end", "def generate_referral_code!\n ref_code = ''\n existing_referral_codes = User.pluck(:referral_code)\n while existing_referral_codes.include?(ref_code) && ref_code == ''\n ref_code = ''\n ref_code << Team.pluck(:short_city_name).sample\n # 3.times do\n # ref_code << ('a'..'z').to_a.sample\n # end\n 4.times do\n ref_code << ('0'..'9').to_a.sample\n end \n end\n self.update_attribute(:referral_code, ref_code)\n end", "def reference_custom_fields\n reference_custom_field_ids.collect{|cf_id| CustomFields::Reference.find(cf_id) }\n end", "def test_adding_an_otu_plus_adds_to_matrix\n setup2\n assert_equal 0, @mx.otus_plus.count \n o = Otu.create!(:name => 'foo')\n @mx.otus_plus << o\n @mx.reload\n\n # adds to the + list?\n assert_equal 1, @mx.otus_plus.count\n assert_equal o, @mx.otus_plus[0]\n\n # adds to the master list?\n assert_equal 1, @mx.otus.count\n assert_equal o, @mx.otus[0]\n end", "def claim_or_create_references(references)\n references.map do |ref_string|\n indirect_vm_ref = update_context.resolve_reference(ref_string, blame_reference).viewmodel_reference\n claim_or_create_member(indirect_vm_ref, ref_string)\n end\n end", "def add_phone_numbers!(list_of_phone_numbers)\n phone_numbers = Expect.normalize_string_to_array(list_of_phone_numbers)\n \n phone_numbers.each do |phone_number|\n add_phone_number!(phone_number)\n end\n end", "def count_debate_references\n extr = FileLinesExtractor.new\n mp_refs = {} # cia bus sumesti visi SN vardai i kuriuos buvo kreiptasi\n count do |mp, sten|\n puts \"#{mp}\"\n extr.extract(sten).each do |line|\n line.scan(/( \\D\\.(\\D\\.)?\\w{4,})/).each do |ref|\n puts \"\\t#{ref}\"\n (mp_refs[mp] ||= []) << ref[0].strip if ref[0].strip.size > 4\n end\n end\n end\n \n #TODO sitas turetu eiti i kita vieta (t.y. i lrs moduli), bet kolkas nera architekturos kaip tvarkyti stenogramas\n DebateReference.delete_all\n mp_refs.each{|p,ref|\n author = Politician.find_by_id_in_lrs(p)\n ref.each{|ref|\n name = ref.gsub(/(ai|as|ą|čiui|čio|is|io|į|iuj|iu|iaus|iui|ius|ių|iumi|os|iaus|o|u|ui|ys)$/, '').gsub(/(|ė|ės|ei|e|ę|a)$/, '')\n \n first_name_initials = name.split('.').first\n last_name = name.split('.').last\n reference_sql=<<-SQL\n select * from politicians\n where\n last_name like '#{last_name + '%'}' and\n (substring(first_name, 1,1) = '#{first_name_initials}' or substring(second_name, 1,1) = '#{first_name_initials}')\n SQL\n ref_mp = Politician.find_by_sql(reference_sql).first \n author.debate_references << \n author.debate_references.new(:name_reference_id => ref_mp.id, :sitting_id=>nil) if ref_mp\n }\n }\nend", "def create_references_list_items(refs)\n refs.each_with_index.reduce('') do |inner_html, args|\n note = args.first\n num = args[1] + 1\n inner_html << %Q(<li id=\"#{NOTE}-#{num}\"><b><a href=\"##{REF}-#{num}\">^</a></b> #{note}</li>\\n)\n end\n end", "def create_ref_node(node, index)\n ref_node = node.document.create_element('sup', :class => 'reference', :id => \"#{REF}-#{index}\")\n ref_node.inner_html = create_ref_link(index)\n ref_node\n end", "def use_mci_numbers!\n path = Indexer::ROOT + \"collector_numbers/#{set_code}.txt\"\n return unless path.exist?\n mci_numbers = path.readlines.map{|line|\n number, name = line.chomp.split(\"\\t\", 2)\n [number, name.downcase]\n }.group_by(&:last).transform_values{|x| x.map(&:first)}\n\n cards = set_data[\"cards\"]\n\n if set_code == \"ced\" or set_code == \"cedi\"\n # Not on Gatherer\n cards.each do |card|\n name = card[\"name\"]\n card[\"number\"] = mci_numbers[name.downcase].shift\n end\n else\n mvids = cards.map{|c| [c[\"name\"], c[\"multiverseid\"]]}.group_by(&:first).transform_values{|x| x.map(&:last).sort}\n cards.each do |card|\n name = card[\"name\"]\n rel_idx = mvids[name].index(card[\"multiverseid\"])\n raise unless mci_numbers[name.downcase]\n card[\"number\"] = mci_numbers[name.downcase][rel_idx]\n end\n end\n end", "def test_with_node_some\r\n link1 = @linklist.add_link(@node1, @node3, false)\r\n link2 = @linklist.add_link(@node2, @node3, false)\r\n link3 = @linklist.add_link(@node1, @node6, false)\r\n link4 = @linklist.add_link(@node3, @node4, false)\r\n link5 = @linklist.add_link(@node4, @node5, false)\r\n \r\n assert(@linklist.with_node(@node3).size == 3)\r\n \r\n @mymodel.node_list.delete_node(@node1)\r\n \r\n assert(@mymodel.link_list.size == 3)\r\n end", "def replace_references(refs)\n set = doc.xpath('.//references')\n\n if set\n inner_html = create_references_list_items(refs)\n replace_references_node(set, inner_html)\n end\n\n nil\n end", "def reference_custom_field_ids\n self[:value] ||= {}\n self[:value][:custom_field_ids] ||= []\n \n @custom_field_ids ||= self[:value][:custom_field_ids].collect{|cf_id| cf_id.to_i if CustomField.exists?(cf_id) }.compact\n end", "def test_no_branch_for_plus_equals_with_number\n assert_alias '6', <<-INPUT\n x = 1\n x += 2 if something\n x += 3 if something_else\n x\n INPUT\n end", "def show\n\n @internal_ref = (@health_case.id)+(123565)\n @health_case.internal_reference = @internal_ref\n @health_case.save\n end", "def auto_tracknumber\n i = 0\n @files.each { |file|\n next unless @selected_files.include? file\n file.set_values('TRACKNUMBER', (i+1).to_s)\n i += 1\n }\n end", "def macro\n :references_one\n end", "def update_xrefs\n unless solution_ids.nil?\n self.user_solution_xrefs.each do |x|\n x.destroy\n end\n solution_ids.each do |s|\n unless s.blank? or s.nil?\n index = Integer(solution_ids_all.index(s))\n self.user_solution_xrefs.create(:solution_id => s, :line_max => user_solution_xrefs_line_max[index].strip) unless user_solution_xrefs_line_max[index].blank?\n end\n end\n reload\n self.solution_ids = nil\n self.solution_ids_all = nil\n self.user_solution_xrefs_line_max = nil\n end\n\n unless apd_supply_ids.nil?\n self.user_apd_supply_xrefs.each do |m|\n m.destroy\n end\n apd_supply_ids.each do |g|\n unless g.blank? or g.nil?\n index = Integer(apd_supply_ids_all.index(g))\n self.user_apd_supply_xrefs.create(:apd_supply_id => g, :line_max => user_apd_supply_xrefs_line_max[index].strip, :units_per_cycle => user_apd_supply_xrefs_units_per_cycle[index]) unless user_apd_supply_xrefs_line_max[index].blank? or user_apd_supply_xrefs_units_per_cycle[index].blank?\n end\n end\n reload\n self.apd_supply_ids = nil\n self.apd_supply_ids_all = nil\n self.user_apd_supply_xrefs_line_max = nil\n self.user_apd_supply_xrefs_units_per_cycle = nil\n end\n\n unless capd_supply_ids.nil?\n self.user_capd_supply_xrefs.each do |m|\n m.destroy\n end\n capd_supply_ids.each do |g|\n unless g.blank? or g.nil?\n index = Integer(capd_supply_ids_all.index(g))\n self.user_capd_supply_xrefs.create(:capd_supply_id => g, :line_max => user_capd_supply_xrefs_line_max[index].strip, :units_per_cycle => user_capd_supply_xrefs_units_per_cycle[index]) unless user_capd_supply_xrefs_line_max[index].blank? or user_capd_supply_xrefs_units_per_cycle[index].blank?\n end\n end\n reload\n self.capd_supply_ids = nil\n self.capd_supply_ids_all = nil\n self.user_capd_supply_xrefs_line_max = nil\n self.user_capd_supply_xrefs_units_per_cycle = nil\n end\n\n unless ancillary_supply_ids.nil?\n self.user_ancillary_supply_xrefs.each do |m|\n m.destroy\n end\n ancillary_supply_ids.each do |g|\n self.user_ancillary_supply_xrefs.create(:ancillary_supply_id => g) unless g.blank?\n end\n reload\n self.ancillary_supply_ids = nil\n self.ancillary_supply_ids_all = nil\n end\n end", "def set_invoice_number\n self.invoice_number = self.id + 777777\n self.save\n end", "def use_mci_numbers(set_code)\n mci_numbers = get_mci_numbers(set_code)\n cards = cards_by_set[set_code]\n\n if set_code == \"ced\" or set_code == \"cei\"\n # Not on Gatherer\n cards.each do |card|\n name = card[\"name\"]\n card[\"number\"] = mci_numbers[name.downcase].shift\n end\n else\n mvids = cards.map{|c| [c[\"name\"], c[\"multiverseid\"]]}\n .group_by(&:first)\n .transform_values{|x| x.map(&:last).sort}\n cards.each do |card|\n name = card[\"name\"]\n rel_idx = mvids[name].index(card[\"multiverseid\"])\n raise unless mci_numbers[name.downcase]\n card[\"number\"] = mci_numbers[name.downcase][rel_idx]\n end\n end\n end", "def push_new_numbers(new_numbers, numbers, index, counter)\n new_numbers << counter.to_s\n new_numbers << numbers[index]\nend", "def ref_number\n if ['AHN', 'SUBURBAN HEALTH', 'UWL', 'ANTHEM'].include?(@facility_name)\n file_number = @batch.file_name.split('_')[0][3..-1] rescue \"0\"\n date = @batch.date.strftime(\"%Y%m%d\")\n \"#{date}_#{file_number}\"\n else\n (@batch.batchid.include?(\"AH\") ? @batch.batchid : @batch.date.strftime(\"%Y%m%d\"))\n end\n end", "def enter_conservation_ref_num(data_set)\n cons_ref_num = data_set[CoreConservationData::CONS_REF_NUM.name]\n logger.debug \"Entering condition ref number '#{cons_ref_num}'\"\n wait_for_element_and_type(cons_ref_num_input_locator(0), cons_ref_num) if cons_ref_num\n end", "def append_number\n append table.pick\n end", "def inc_AddedToCal\n self[:numAddedToCal] += 1\n end", "def incement_number_of_locations(number)\n self.number_of_locations += number\n self.save\n end", "def test_add\n\t\tassert_raise( RuntimeError ) { @freeid.add(\"Yo\") }\n\t\t@freeid.next\n\t\t@freeid.next\n\t\t@freeid.add(6)\n\t\tassert_equal(6, @freeid.next, \"Add not working\")\n\t\tassert_equal(2, @freeid.next, \"Last not working after add\")\n\tend", "def qty_to_add=(num)\n ### TODO this method needs a history of who did what\n add_count_on_hand(num)\n end", "def add_one_to(cref)\n if @statistics.has_key? cref\n @statistics[cref] +=1\n else\n @statistics[cref] =1\n end\n end", "def add_valid_url(url, refs)\n @results[url] = 1\n end", "def add_valid_url(url, refs)\n @results[url] = 1\n end", "def remove_reference(table, ref_name, **kwargs)\n current_instructions << Instructions::RemoveReference.new(\n table: table,\n ref_name: ref_name,\n **kwargs,\n )\n end", "def biblio_renumber(xmldoc)\n i = 0\n xmldoc.xpath(\"//references[not(@normative = 'true')]\" \\\n \"[not(@hidden = 'true')]\").each do |r|\n r.xpath(\"./bibitem[not(@hidden = 'true')]\").each do |b|\n i += 1\n docid = b.at(\"./docidentifier[@type = 'metanorma']\") or next\n /^\\[\\d+\\]$/.match?(docid.text) or next\n docid.children = \"[#{i}]\"\n end\n end\n end", "def test_delete_link\r\n @node5.measurement = 45.8\r\n @node4.value_function = ValueFunction.new(0, 100, 'elephants')\r\n \r\n link = @linklist.add_link(@node5, @node4, true)\r\n\r\n (0..1).each { |i| assert_in_delta(@node4.evidence[i], 0.458, 0.0001) } \r\n \r\n @linklist.remove_link(link)\r\n assert_equal(Evidence.undefined, @node4.evidence) \r\n \r\n @node5.measurement = 10\r\n assert_equal(Evidence.undefined, @node4.evidence) \r\n end", "def test_six\n my_number = [\"1234\", \"2234\", \"3234\"]\n bash_numbers = [\"1233\", \"2233\", \"3233\", \"2222\", \"5555\"]\n assert_equal([\"1234\", \"2234\", \"3234\"], offbyonenumber(my_number, bash_numbers))\n end", "def associate_lot_numbers(stripwell_list, responses)\n stripwell_list.each do |stripwell|\n lot_number = responses.get_response(\"#{LOT_NUM_KEY}#{stripwell.id}\")\n stripwell.associate(LOT_NUM_KEY, lot_number)\n end\n end", "def references=(value)\n @references = value\n end", "def add_item_ref_properties(element)\n item_ref = element.attribute('itemref')\n if item_ref\n item_ref.value.split(' ').each { |id| parse_elements(find_with_id(id)) }\n end\n end", "def parse_reference_ids full_document\n full_document.gsub(/%r(\\d+)/) do\n if Reference.exists? $1\n reference = Reference.find($1)\n reference.decorate.to_link\n else\n broken_markdown_link \"reference\", $1\n end\n end\n end", "def add_item(grocery_hash, new_item)\n new_item.each do |i|\n grocery_hash[i] += 1\n end\n grocery_hash\nend", "def update_ref_id(ref_id)\r\n node_set = self.datastreams[\"VRA\"].ng_xml.xpath('/vra:vra/vra:image[@refid]')\r\n node_set[0].set_attribute(\"refid\", ref_id)\r\n self.datastreams[\"VRA\"].content = self.datastreams[\"VRA\"].ng_xml.to_s\r\n end", "def test_reference_purchase\n assert response = @gateway.purchase(10000, @credit_card, @options)\n assert_approved response\n assert_success response\n assert response.test?\n assert_not_nil pn_ref = response.authorization\n \n # now another purchase, by reference\n assert response = @gateway.purchase(10000, pn_ref)\n assert_approved response\n assert_success response\n assert response.test?\n end", "def renumber(map)\n raise \"player number #{@num} not found in renumbering hash\" unless map[@num]\n self.num = map[@num]\n @results.each{ |r| r.renumber(map) }\n self\n end", "def get_new_random_number random_numbers\n random_number = 0\n begin\n random_number = rand @working_dataset.get_dataset_size\n end while (random_numbers.has_key?(random_number))\n random_numbers[random_number] = 1\n return random_number\n end", "def ref\n\t\t@_references_mutex.synchronize {\n\t\t\t@_references += 1\n\t\t}\n\n\t\tself\n\tend", "def generate_mref\n self.mref = \"#{Date.today.strftime(\"%Y%m%d\")}-#{self.object_id}\"\n end", "def object_ref\n @objects += 1\n end", "def reference(name)\n new(name).tap do |vt|\n vt.reference = true\n end\n end", "def deref\n @used_references += 1\n end", "def add_number(number)\n self.numbers << number\n end", "def ref\n @_references_mutex.synchronize {\n @_references += 1\n }\n\n self\n end", "def increment_manuscript_rev_num\n if self.version && self.article\n num = self.manuscript_number \n rev = num.scan(/\\.R\\d+/)[0]\n if rev\n num.gsub!(/\\.R\\d+/,\"\")\n rev_num = rev.gsub(/\\.R/,\"\")\n rev_num = rev_num.to_i\n num+=\".R#{rev_num+1}\"\n else\n num = \"#{num}.R1\"\n end \n self.article.update_attribute(:manuscript_num,num)\n end\n end", "def macro\n :references_one\n end", "def updateReference\n return @references\n end", "def prepareReference()\n # remove all symlinks to interface declarations\n local, remote, command = REF.test_and_drop_results \\\n \"cleanup.sh\"\n local.should == 0; remote.should == 0; command.should == 0\n\n # stop the bonding if any\n local, remote, command = REF.test_and_drop_results \\\n \"ip link show dev bond0\", \"testuser\"\n local.should == 0; remote.should == 0\n if command == 0\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev bond0\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n local, remote, command = REF.test_and_drop_results \\\n \"ip link show dev bond1\", \"testuser\"\n local.should == 0; remote.should == 0\n if command == 0\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev bond1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # stop the bridging if any\n local, remote, command = REF.test_and_drop_results \\\n \"ip link show dev br0\", \"testuser\"\n local.should == 0; remote.should == 0\n if command == 0\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev br0\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # stop the vlans if any\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ip link show\", \"testuser\"\n local.should == 0; remote.should == 0; command.should == 0\n if out.include? \"eth0.42@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev eth0.42\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"eth1.42@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev eth1.42\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"eth0.1@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev eth0.1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"eth1.1@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev eth1.1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"bond0.42@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev bond0.42\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"bond0.73@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev bond0.73\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # stop openvpn if started\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ps aux\", \"testuser\"\n local.should == 0; remote.should == 0; command.should == 0\n if out.include? \"openvpn\"\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl stop openvpn@server\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # remove tunnel interfaces if any\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ip link show\", \"testuser\"\n local.should == 0; remote.should == 0; command.should == 0\n if out.include? \"tun1:\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev tun1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"tap1:\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev tap1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"gre1:\" or out.include? \"gre1@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev gre1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"tunl1:\" or out.include? \"tunl1@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev tunl1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"sit1:\" or out.include? \"sit1@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev sit1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"gre0:\" or out.include? \"gre0@\" \\\n or out.include? \"tunl0:\" or out.include? \"tunl0@\" \\\n or out.include? \"sit0:\" or out.include? \"sit0@\"\n local, remote, command = REF.test_and_drop_results \\\n \"modprobe -r ip_gre gre ipip sit ip_tunnel tunnel4\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if out.include? \"ib0.8001@\"\n local, remote, command = REF.test_and_drop_results \\\n \"ip link delete dev ib0.8001\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # start the interfaces if needed\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ip address show dev eth0\", \"testuser\"\n local.should == 0; remote.should == 0; command.should == 0\n if !out.include? \"UP\" or \\\n !out.include? \"#{STAT4_REF0}\" or \\\n !out.include? \"#{STAT6_REF0}\" or \\\n !out.include? \"#{DHCP4_REF0}\" or \\\n !out.include? \"#{RADVD_REF0}\" or \\\n !out.include? \"#{DHCP6_REF0}\"\n local, remote, command = REF.test_and_drop_results \\\n \"ifdown eth0 && ifup eth0\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n #\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ip address show dev eth1\", \"testuser\"\n local.should == 0; remote.should == 0; command.should == 0\n if !out.include? \"UP\" or \\\n !out.include? \"#{STAT4_REF1}\" or \\\n !out.include? \"#{STAT6_REF1}\"\n local, remote, command = REF.test_and_drop_results \\\n \"ifdown eth1 && ifup eth1\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # start the DHCP services if needed\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ps aux | grep dhcp\", \"testuser\"\n local.should == 0; remote.should == 0\n if !out.include? \"dhcpd -4\"\n local, remote, command = REF.test_and_drop_results \\\n \"ln -sf /etc/dhcpd-default.conf /etc/dhcpd.conf\"\n local.should == 0; remote.should == 0; command.should == 0\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl start dhcpd.service\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n if !out.include? \"dhcpd6 -6\"\n local, remote, command = REF.test_and_drop_results \\\n \"ln -sf /etc/dhcpd6-default.conf /etc/dhcpd6.conf\"\n local.should == 0; remote.should == 0; command.should == 0\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl start dhcpd6.service\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # start the radvd service if needed\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ps aux | grep radv\", \"testuser\"\n local.should == 0; remote.should == 0\n if !out.include? \"radvd\"\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl start radvd.service\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # return to default DHCP configuration, if needed\n local, remote, command = REF.test_and_drop_results \\\n \"grep '# Default configuration' /etc/dhcpd.conf\", \"testuser\"\n local.should == 0; remote.should == 0\n if command != 0\n local, remote, command = REF.test_and_drop_results \\\n \"ln -sf /etc/dhcpd-default.conf /etc/dhcpd.conf\"\n local.should == 0; remote.should == 0; command.should == 0\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl restart dhcpd.service\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n local, remote, command = REF.test_and_drop_results \\\n \"grep '# Default configuration' /etc/dhcpd6.conf\", \"testuser\"\n local.should == 0; remote.should == 0\n if command != 0\n local, remote, command = REF.test_and_drop_results \\\n \"ln -sf /etc/dhcpd-default.conf /etc/dhcpd6.conf\"\n local.should == 0; remote.should == 0; command.should == 0\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl restart dhcpd6.service\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # return to default NDP configuration, if needed\n local, remote, command = REF.test_and_drop_results \\\n \"grep '# Default configuration' /etc/radvd.conf\", \"testuser\"\n local.should == 0; remote.should == 0\n if command != 0\n local, remote, command = REF.test_and_drop_results \\\n \"ln -sf /etc/radvd-default.conf /etc/radvd.conf\"\n local.should == 0; remote.should == 0; command.should == 0\n local, remote, command = REF.test_and_drop_results \\\n \"systemctl restart radvd.service\"\n local.should == 0; remote.should == 0; command.should == 0\n end\n\n # stop tcpdump, if needed\n out, local, remote, command = REF.test_and_store_results_together \\\n \"ps aux\", \"testuser\"\n local.should == 0; remote.should == 0; command.should == 0\n if out.include? \"tcpdump\"\n local, remote, command = REF.test_and_drop_results \\\n \"tcpdump.sh stop\"\n local.should == 0; remote.should == 0; command.should == 0\n end\nend", "def can_add_reference?\n true\n end", "def create_before_data(tests, object, test, rrefs)\n cust_before = @provider.get_code_multiline(tests, test[:path])\n if cust_before.nil?\n name_prop = object.all_user_properties.select { |p| p.name == 'name' }\n # Get failed logic\n get_failed = create_expectation('expect_network_get_failed',\n test[:has_name], object, 12, [],\n 1)\n\n extra_props = []\n extra_props << \"#{name_prop[0].field_name}: 'title0'\" \\\n unless test[:has_name] || name_prop.empty?\n\n rref_list = object.uri_properties.map do |ref|\n # We need to verify that only resourcerefs directly belonging to\n # this object are inserted into the expectation.\n next unless ref.is_a? Api::Type::ResourceRef\n name = Google::StringUtils.underscore(ref.resource_ref.name)\n value = @data_gen.value(ref.property.class, ref.property, 0)\n { name => value }\n end\n\n extra_props.concat(\n rref_list.flatten.compact.reduce({}, :merge)\n .map { |k, v| \"#{k}: '#{v}'\" }\n )\n\n code = [get_failed, 'expect_network_create \\\\',\n @provider.indent(\n if extra_props.empty?\n ['1,', test[:expected_data]]\n else\n ['1,', '{',\n @provider.indent(test[:expected_data], 2),\n '},', @provider.indent_list(extra_props, 0)]\n end,\n 2\n )]\n\n unless object.async.nil?\n code << create_expectation('expect_network_get_async',\n test[:has_name], object, 12, [], 1)\n end\n\n code.concat(create_resource_ref_get_success(object, rrefs, 12))\n\n add_style_exemptions code, object, test\n\n code.flatten.compact.uniq\n else\n # rubocop:disable Security/Eval\n eval(\"\\\"#{cust_before}\\\"\", binding, __FILE__, __LINE__)\n # rubocop:enable Security/Eval\n end\n end", "def references\n @references ||= ApiFactory.new 'GitData::References'\n end" ]
[ "0.63957834", "0.61673796", "0.61345214", "0.6068089", "0.5763147", "0.55785394", "0.55367684", "0.5531793", "0.5478721", "0.53989387", "0.53921115", "0.53144467", "0.52319586", "0.5187802", "0.5167938", "0.5128536", "0.5123717", "0.5083208", "0.50793636", "0.50664884", "0.50364286", "0.50049835", "0.49753734", "0.4969258", "0.4958522", "0.4957786", "0.4955975", "0.49187592", "0.4909677", "0.48832595", "0.48705196", "0.48644763", "0.48598537", "0.4845033", "0.48420691", "0.48278165", "0.48077554", "0.47931734", "0.4788841", "0.47880217", "0.4782225", "0.47565418", "0.4746085", "0.47416165", "0.474103", "0.47369248", "0.47356516", "0.46912646", "0.46889827", "0.46883723", "0.4687872", "0.46808818", "0.46547207", "0.46516427", "0.46457016", "0.4638245", "0.4631359", "0.46269596", "0.46246514", "0.46245027", "0.46180508", "0.46147832", "0.4605255", "0.4605176", "0.45966396", "0.45936987", "0.45908573", "0.4586012", "0.4579661", "0.45795238", "0.457784", "0.457675", "0.457675", "0.45729032", "0.45722774", "0.4565453", "0.45625883", "0.45607066", "0.45585632", "0.45566988", "0.45560145", "0.45544225", "0.45497307", "0.4541063", "0.45383915", "0.45353457", "0.45318443", "0.4522281", "0.4519649", "0.45181614", "0.4514574", "0.45141536", "0.45125943", "0.45115325", "0.45079547", "0.44997132", "0.44944265", "0.44939032", "0.44893983", "0.44849545" ]
0.5636159
5
Verifies that the reference number matches test data
def verify_reference_nbr(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name], element_value(reference_nbr_input)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_reference_nbr(test_data)\n verify_values_match(test_data[UseOfCollections::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def check_solution(test_number, argument, expected)\n actual = fields(argument)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def check_solution(test_number, array, expected)\n actual = find_peaks(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_block_number_correct_true\n assert @bv.block_number_correct?(1, 1)\n end", "def test_check_block_num_equal\r\n assert_equal true, @g.check_block_num(1, 1)\r\n end", "def test_prev_hash_correct_true\n assert @bv.prev_hash_correct?(0, \"abcd\", \"abcd\")\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end", "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def check_solution(test_number, array, target, expected)\n actual = linear_search(array, target)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_rec_number_positive\n @numbers.each do |value, expected|\n assert_equal expected, @TS_Rec.format(value)\n end\n end", "def verify\n new_rb_id_list = @rb_bmet.redbox_ids - @ds_bmet.redbox_ids\n update_rb_id_list = @rb_bmet.redbox_ids - new_rb_id_list\n if DEBUG\n puts\n puts \"@ds_bmet.redbox_ids=#{@ds_bmet.redbox_ids.inspect}\"\n puts \"@rb_bmet.redbox_ids=#{@rb_bmet.redbox_ids.inspect}\"\n puts\n puts \"new_rb_id_list=#{new_rb_id_list.inspect}\"\n puts \"update_rb_id_list=#{update_rb_id_list.inspect}\"\n puts\n end\n end", "def test_number_49\n\t\t\tassert_equal(49, mineminds_array[48])\n\t\tend", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def test_check_good_prev_hash\n p_hash = '1'\n line_num = '1'\n block_p_hash = '1'\n hash = '1'\n assert_equal '1', @verify.check_prev_hash(p_hash, block_p_hash, hash, line_num)\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_num_transactions_correct_not_0_true\n assert @bv.num_transactions_correct?(1, [0,2,3])\n end", "def verify()\n # TODO\n end", "def test_num_transactions_correct_0_true\n assert_equal(false, @bv.num_transactions_correct?(0, [0,1]))\n end", "def check_indices(data, num)\n data.length.should == num\n end", "def test_check_hash_equal\r\n assert_equal true, @g.check_hash(1, 1)\r\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def check_solution(test_number, array, target, expected)\n actual = binary_search(array, target)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_block_number_correct_false\n assert_equal(false, @bv.block_number_correct?(0, 1))\n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def verify_hash\r\n raise \"Line #{total_block_number}: hash was incorrectly calculated\" unless @current_hash == @computed_hash\r\n\r\n true\r\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def test_prev_hash_correct_false\n assert_equal(false, @bv.prev_hash_correct?(0, \"abcd\", \"efgh\"))\n end", "def consistency_checks\n unless certificate_serial_number == voucher_serial_number\n error_report << \"serial number mismatch certificate '#{certificate_serial_number}' vs '#{voucher_serial_number}'\"\n return false\n end\n # other tests here.\n return true\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def check_solution(test_number, array, expected)\n actual = is_sorted?(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def check_solution(test_number, array, expected)\n actual = is_sorted?(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def verify_block_num\r\n unless @block_number == @@total_block_number\r\n raise \"Line #{@@total_block_number}: invalid block number #{@block_number}, should be #{@@total_block_number}\"\r\n\r\n end\r\n\r\n true\r\n end", "def test_check_digits_true\r\n assert_equal true, @g.check_digits('0123456789')\r\n end", "def test_recognize_successfully_cracked\n\t\tguess = 'axel'\n\t\ttarget = Digest::MD5.hexdigest(guess)\n\n\t\tassert @pass_cracker.successfully_cracked?(guess, target)\n\tend", "def verify_ref_1l_condition\n Unified835Output::BenignNull.new\n end", "def test_check_hash_unequal\r\n assert_equal false, @g.check_hash(1, 0)\r\n end", "def test_validate_pass_877195869x_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"877195869x\"))\r\n\tend", "def test_validate_pass_877195869x_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"877195869x\"))\r\n\tend", "def test_validate_pass_978d0d13d149505d0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"978-0-13-149505-0\"))\r\n\tend", "def test_validate_pass_978d0d13d149505d0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"978-0-13-149505-0\"))\r\n\tend", "def test_num_transactions_correct_0_true\n assert @bv.num_transactions_correct(0, [0])\n end", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def test_check_for_num_or_x\r\n\t\tisbn_number = '123456789B'\r\n\t\tassert_equal(false, check_for_x(isbn_number))\r\n\tend", "def test_check_num\n assert_raises SystemExit do\n assert_output 'Line 2: Invalid block number 1, should be 2\\nBLOCKCHAIN INVALID' do\n block_no = '1'\n line_no = '2'\n @verify.check_num(block_no, line_no)\n end\n end\n end", "def test_validate_pass_0d321d14653d0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"0-321-14653-0\"))\r\n\tend", "def test_validate_pass_0d321d14653d0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"0-321-14653-0\"))\r\n\tend", "def test_validate_file\n file_list = [\n '0|0|SYSTEM>569274(100)|1553184699.650330000|288d',\n '1|288d|569274>735567(12):735567>561180(3):735567>689881(2):SYSTEM>532260(100)|1553184699.652449000|92a2',\n '2|92a2|569274>577469(9):735567>717802(1):577469>402207(2):SYSTEM>794343(100)|1553184699.658215000|4d25'\n ]\n assert validate_file file_list, [0, 0], '0'\n end", "def verify\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def test_check_block_num_unequal\r\n assert_nil nil, @g.check_block_num(1, 0)\r\n end", "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def assert_page_ref_correctness page_ref, site=page_ref.site\n assert_equal site, page_ref.site, 'Site not associated with page_ref'\n # The page_ref has a site\n assert_not_nil site\n # The site's page_refs includes the page_ref\n assert site.page_refs.include?(page_ref), \"Site misses a page_ref that refers to it\"\n end", "def verify?\n retval = false\n unless self.lead_in == 0x55\n Ted::Recorder.logger \"Lead in value is not correct! Got #{self.lead_in} expected 0x55.\"\n # Don't return here, so we can get all of the errors\n end\n\n retval = super\n return retval\n end", "def verify\n end", "def test_number_15\n\t\t\t\t\n\t\t\tassert_equal(\"Mined Minds\",mineminds_array[14])\n\t\t\t\n\t\tend", "def test_check_first_bad_address_non_num\n assert_raises SystemExit do\n assert_output 'Line 1: Invalid address 1ab4c67\\nBLOCKCHAIN INVALID' do\n add = %w[1ab4c67 123456]\n line_num = 1\n @verify.check_addresses(add, line_num)\n end\n end\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def check_against(unit_test)\n grade_sheet = unit_test.execute(src_code) \n Feedback.on(grade_sheet)\n end", "def verify_prev_hash_match(maps)\n # special case for first line\n return false if maps[0][:id].to_i != 0\n\n # now start at the 1st line\n (1...maps.length).each do |i|\n prev_hash = maps[i][:prev_hash]\n curr_hash = maps[i - 1][:hash]\n # check that they match\n if prev_hash != curr_hash\n puts \"Line #{i}: Previous hash was #{prev_hash}, should be #{curr_hash}.\\nBLOCKCHAIN INVALID\"\n return false\n end\n # check that the length of each is not more than 4\n if prev_hash.length > 4\n puts \"Line #{i}: Previous hash #{prev_hash} is too long.\\nBLOCKCHAIN INVALID\"\n return false\n end\n if curr_hash.length > 4\n puts \"Line #{i}: Current hash #{curr_hash} is too long.\\nBLOCKCHAIN INVALID\"\n return false\n end\n # check the formatting of the hash\n prev_hash.delete!('abcdef0123456789')\n curr_hash.delete!('abcdef0123456789')\n unless prev_hash.empty?\n puts \"Line #{i}: Previous hash #{prev_hash} contains invalid characters.\\nBLOCKCHAIN INVALID\"\n return false\n end\n unless curr_hash.empty?\n puts \"Line #{i}: Current hash #{curr_hash} contains invalid characters.\\nBLOCKCHAIN INVALID\"\n return false\n end\n end\n\n # If nothing wrong, return true\n true\nend", "def test_validation\n \n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-')\n pcba_pn = '500-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No - PCB, PCBA part numbers are not unique.\n pcba_pn = '600-123-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert( pn.error_message)\n assert_equal('The PCB part number (600-123-a0 a) and the PCBA part number ' +\n \"(600-123-00 b) must be unique - YOUR PART NUMBER WAS NOT CREATED\",\n pn.error_message)\n \n\n # Valid? - No - Format bad, short prefix\n pcb_pn = '12-123-a0'.split('-')\n pcba_pn = '34-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No - Format bad, illegal characters in the prefix\n pcb_pn = '12e-123-a0'.split('-')\n pcba_pn = 'pcb-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, wrong number of characters in the number\n pcb_pn = '127-3-a0'.split('-')\n pcba_pn = '128-21-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the number\n pcb_pn = '127-###-a0'.split('-')\n pcba_pn = '128-JPA-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the dash number\n pcb_pn = '127-714-*'.split('-')\n pcba_pn = '128-755-!&'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert(!pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes\n pcb_pn = '127-714-01'.split('-')\n pcba_pn = '128-755-a0'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n\n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No, pcb pn exists.\n pcb_pn = '252-700-b0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n \n # Valid? - No, pcb pn duplicates pcba pn \n pcb_pn = '259-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'b'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n # Valid? - No, pcb pn prefix contains the wrong number of characters \n pcb_pn = '12-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No, pcb pn prefix contains illegal characters \n pcb_pn = '12e-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains wrong number of characters \n pcb_pn = '127-3-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n #assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains illegal characters \n pcb_pn = '127-#*@-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn dash number contains wrong number of, and illegal, characters \n pcb_pn = '127-714-@'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes \n pcb_pn = '127-714-01'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n \n assert(!pn.exists?)\n assert_nil(pn.error_message)\n pn.save\n assert(pn.exists?)\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n\n assert(PartNumber.valid_prefix?('100'))\n assert(!PartNumber.valid_prefix?('1'))\n assert(!PartNumber.valid_prefix?('a'))\n assert(!PartNumber.valid_prefix?('10'))\n assert(!PartNumber.valid_prefix?('a7'))\n assert(!PartNumber.valid_prefix?('1aa'))\n assert(!PartNumber.valid_prefix?('a00'))\n assert(!PartNumber.valid_prefix?('1776'))\n assert(!PartNumber.valid_prefix?('a345'))\n \n assert(PartNumber.valid_number?('100'))\n assert(!PartNumber.valid_number?('1'))\n assert(!PartNumber.valid_number?('a'))\n assert(!PartNumber.valid_number?('10'))\n assert(!PartNumber.valid_number?('a7'))\n assert(!PartNumber.valid_number?('1aa'))\n assert(!PartNumber.valid_number?('a00'))\n assert(!PartNumber.valid_number?('1776'))\n assert(!PartNumber.valid_number?('a345'))\n \n assert(PartNumber.valid_dash_number?('a0'))\n assert(PartNumber.valid_dash_number?('0a'))\n assert(!PartNumber.valid_dash_number?('a'))\n assert(!PartNumber.valid_dash_number?('4'))\n assert(!PartNumber.valid_dash_number?('aa33'))\n assert(!PartNumber.valid_dash_number?('333'))\n \n # Create known part numbers for testing.\n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-802-00'.split('-')\n pcba_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-01'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n\n pn = PartNumber.initial_part_number\n pcb_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert(!pn.valid_components?('not'=='new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n pcba_pn = '700-900-90'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n \n pcba_pn = '000-000-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n end", "def test_validate_pass_978s0s471s48648s0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"978 0 471 48648 0\"))\r\n\tend", "def test_validate_pass_978s0s471s48648s0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"978 0 471 48648 0\"))\r\n\tend", "def test_check_for_num_or_x\r\n\t\tisbn_number = '123456789x'\r\n\t\tassert_equal(true, check_for_x(isbn_number))\r\n\tend", "def test_true\n\t\tassert_equal(true, winning_numbers(4,[1,2,3,4]))\n\tend", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def test_seqence_valid21\n result = engine(\"Trump123%\")\n refute(result, \"'Trump123%' should not be valid because it contains a sequence.\")\n end", "def test_standard_credit_results\n @standard_credit_Value.each { |key, value| assert_in_delta @calc_standard[@row_number][key], value, 0.03 }\n check_count @calc_standard\n end", "def verify\n\n end", "def verify_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data record! -- sample #{id}\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[0]} --\", \"#{dose_unit_text(values[values.keys[0]])}/day,\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[1]} --\", \"#{dose_unit_text(values[values.keys[1]])}/day.\", \"|\"]\n puts \"%s%7s\" % [\"| Sample #{id} will not include in the analysis!\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n data.delete(id)\n end\n end\n data\n end", "def test_seqence_valid14\n result = contains_password?(\"password1\")\n refute(result, \"'passwrd123*' should not be valid because it contains a sequence\")\n end", "def test_annuity_credit_results\n @annuity_credit_Value.each { |key, value| assert_in_delta @calc_annuity[@row_number][key], value, 0.03 }\n check_count @calc_annuity\n end", "def test_tip\n \n assert_equal(@check_test.tip, @check_test.tip.to_i)\n end", "def verify_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[UseOfCollections::LOCATION.name], element_value(location_input index)) }\n end", "def verify_previous_hash(previous_hash, target_hash, line_no)\n unless previous_hash.eql? target_hash\n raise BlockFormatError, \"Line #{line_no}: Previous hash was #{target_hash}, should be #{previous_hash}\"\n end\n\n previous_hash\nend", "def test_37\n customer_hash = {\n 'orderId' => '37',\n 'amount' => '3001',\n 'orderSource'=>'telephone',\n 'billToAddress'=>{\n 'firstName' => 'Tom',\n 'lastName' => 'Black'},\n \n 'echeck'=>{\n 'accNum' =>'10@BC99999',\n 'accType' => 'Checking',\n 'routingNum' => '053100300'}\n }\n hash = customer_hash.merge(@@merchant_hash)\n echeck_response = CnpOnlineRequest.new.echeck_verification(hash)\n assert_equal('301', echeck_response.echeckVerificationResponse.response)\n assert_equal('Invalid Account Number', echeck_response.echeckVerificationResponse.message)\n end", "def test_valid_block_number\n assert check_block_number('0', 0)\n end", "def test_is_valid\n\t\ttest_main = Main.new(3, 4, 6)\n\t\tassert_equal test_main.valid_location(\"Enumberable Canyon\"), 0\n\tend", "def test_valid_10_digit_isbn767\n assert_equal(true, valid_isbn?(\"0-321 14 6530\")) \n end", "def test_not_same_value_as\n #G\n white_pair = PAIR_OF_4\n black_value = VALUE_2\n\n #W\n result = white_pair.same_value? black_value\n\n #T\n assert_false result\n end", "def enter_reference_nbr(test_data)\n hide_notifications_bar\n wait_for_options_and_type(reference_nbr_input, reference_nbr_options, test_data[UseOfCollections::REFERENCE_NBR.name])\n end", "def test_numbers\n\n # landline, beijing\n [\n ['(+8610)5992 7396', '59927396'],\n ['(+8610) 5992 0000', '59920000'],\n ['08610 5992 0000', '59920000'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :landline, x.type, \"failed on #{test}\"\n assert_equal 'Beijing', x.city\n assert_equal expected, x.number\n assert x.is_valid?, \"failed on #{test}\"\n end\n\n # landline, shanghai\n [\n ['021 61711150', '61711150'],\n ['021 51879217', '51879217'],\n ['021 51863213', '51863213'],\n # SMS spammer\n ['021 10655755', '10655755'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :landline, x.type, \"failed on #{test}, expected #{expected}\"\n assert_equal 'Shanghai', x.city\n assert_equal expected, x.number\n assert x.is_valid?, \"failed on #{test}\"\n end\n\n # mobile, china_unicom\n [\n ['18612345678', '12345678'],\n ['15692164005', '92164005'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :mobile, x.type, \"failed on #{test}\"\n assert_equal :china_unicom, x.provider, \"failed on #{test}\"\n assert_equal expected, x.number\n assert x.is_valid?, \"failed on #{test}\"\n end\n [\n # all short 1 digit\n ['1861234567', ''],\n ['1569216400', ''],\n ].each do | test, expected|\n x = CnPhoneNumber.new test\n assert ! x.is_valid?, \"failed on #{test}\"\n end\n\n # mobile, china_mobile\n [\n ['13636509747', '36509747'],\n ['18321012693', '21012693'],\n ['13439500544', '9500544'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert_equal :mobile, x.type, \"failed on #{test}\"\n assert_equal :china_mobile, x.provider, \"failed on #{test}\"\n assert_equal expected, x.number \n assert x.is_valid?, \"failed on #{test}\"\n end\n [\n # short 1 digit\n ['1363650974', '36509747'],\n ].each do | test, expected |\n x = CnPhoneNumber.new test\n assert ! x.is_valid?, \"failed on #{test}\"\n end\n\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_check_bad_prev_hash\n assert_raises SystemExit do\n assert_output 'Line 1: Previous hash was 1, should be 0\\nBLOCKCHAIN INVALID' do\n p_hash = '0'\n line_num = '1'\n block_p_hash = ['1']\n hash = '1'\n @verify.check_prev_hash(p_hash, block_p_hash, hash, line_num)\n end\n end\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def test_number_correct_still_equals_1\n card_1 = Card.new(\"3\", \"Hearts\")\n card_2 = Card.new(\"4\", \"Clubs\")\n deck = Deck.new([card_1, card_2])\n round = Round.new(deck)\n new_guess_1 = round.record_guess({value: \"3\", suit: \"Hearts\"})\n new_guess_2 = round.record_guess({value: \"Jack\", suit: \"Diamonds\"})\n assert_equal 50.0, round.percent_correct\nend", "def verify_locations(test_data)\n locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[CoreUseOfCollectionsData::LOCATION.name], element_value(location_input index)) }\n end", "def test_check_good_time\n assert_output '' do\n time = '1553188611.560418000'\n prev_time = '1553188612.100418000'\n line_num = 0\n @verify.check_time(time, prev_time, line_num)\n end\n end", "def check_solution(test_number, string, expected)\n actual = compress_string(string)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def check_solution(test_number, string, expected)\n actual = compress_string(string)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end" ]
[ "0.8212068", "0.6081907", "0.6033673", "0.597357", "0.5970292", "0.59285074", "0.5892478", "0.58428234", "0.5833653", "0.58187497", "0.58135235", "0.5802544", "0.5802495", "0.58012086", "0.5772549", "0.57659805", "0.5756517", "0.5742261", "0.57177", "0.5711213", "0.56960005", "0.5684742", "0.56805766", "0.5678865", "0.5677044", "0.56749874", "0.5668445", "0.5662286", "0.56550527", "0.5653236", "0.56492764", "0.56477505", "0.56442124", "0.5637637", "0.5631031", "0.5631031", "0.5623547", "0.56089795", "0.5608847", "0.5584745", "0.5560337", "0.55588615", "0.55588615", "0.55533963", "0.55533963", "0.55511636", "0.5550409", "0.55458856", "0.55328345", "0.55248237", "0.552405", "0.552405", "0.5522643", "0.55169886", "0.5512932", "0.55113804", "0.5505262", "0.54989296", "0.54969525", "0.54891324", "0.5469941", "0.5461527", "0.54534817", "0.54534817", "0.54534817", "0.54534817", "0.5447282", "0.5435577", "0.54326576", "0.5431125", "0.5431125", "0.54274964", "0.5426329", "0.5421532", "0.54136324", "0.54106724", "0.54091954", "0.5400246", "0.53930646", "0.53902894", "0.53892285", "0.53825706", "0.53767425", "0.5373882", "0.5372592", "0.53693545", "0.53568125", "0.5355867", "0.53503066", "0.5350013", "0.53497887", "0.53486943", "0.53418016", "0.5332614", "0.53297466", "0.53277993", "0.5326825", "0.5317403", "0.5317403", "0.5312876" ]
0.8157735
1
PROJECT ID Selects the autogenerated project ID and returns it. If a test data set is given, inserts the ID.
def select_auto_project_id(test_data=nil) hide_notifications_bar id = select_id_generator_option(project_id_input, project_id_options) logger.info "Selected auto-generated project ID '#{id}'" test_data.merge!({CoreUseOfCollectionsData::PROJECT_ID.name => id}) if test_data id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_auto_project_id(test_data=nil)\n hide_notifications_bar\n id = select_id_generator_option(project_id_input, project_id_options)\n test_data.merge!({ UseOfCollections::PROJECT_ID.name => id}) if test_data\n id\n end", "def project_id=(value)\n @project_id = value\n end", "def project_id\n project_id = @options[:project_id] || Git.get_config(KEY_PROJECT_ID, :inherited)\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n PivotalTracker::Project.all.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Git.set_config(KEY_PROJECT_ID, project_id, :local)\n puts\n end\n\n project_id\n end", "def select_project_id(test_data)\n hide_notifications_bar\n logger.info \"Entering project ID '#{test_data[CoreUseOfCollectionsData::PROJECT_ID.name]}'\"\n wait_for_options_and_select(project_id_input, project_id_options, test_data[CoreUseOfCollectionsData::PROJECT_ID.name])\n end", "def project_id\n data[:project_id]\n end", "def project_id\n project_id = Util::Git.get_config KEY_PROJECT_ID, :inherited\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n client = TrackerApi::Client.new(:token => api_token)\n\n client.projects.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Util::Git.set_config KEY_PROJECT_ID, project_id, :local\n puts\n end\n\n project_id\n end", "def select_project_id(test_data)\n hide_notifications_bar\n wait_for_options_and_select(project_id_input, project_id_options, test_data[UseOfCollections::PROJECT_ID.name])\n end", "def project_id\n @gapi[\"datasetReference\"][\"projectId\"]\n end", "def project_id project_name\n if @version < \"1.0\"\n project = projects.find { |project| project[:name] == project_name }\n else\n project = project_by_name(project_name).first\n end\n\n project.nil? ? nil : project[:id].to_i\n end", "def project_id(project_key)\n project_info(project_key)['id']\n end", "def project_id\n return @project_id\n end", "def set_project\n @project = Project.includes(cases: :tester_user, suites: {cases: :tester_user}).find(params[:id])\n end", "def project_id\n service.project\n end", "def project_id\n service.project\n end", "def project_id\n service.project\n end", "def set_project\n @project = params[:id].present? ?\n Project.find(params[:id]) :\n Project.find(params[:project_id])\n end", "def project_id\n return @project_id unless @project_id.nil?\n project_number = self.project_number || @workforce_pool_user_project\n\n # if we missing either project number or scope, we won't retrieve project_id\n return nil if project_number.nil? || @scope.nil?\n\n url = \"#{CLOUD_RESOURCE_MANAGER}#{project_number}\"\n response = connection.get url do |req|\n req.headers[\"Authorization\"] = \"Bearer #{@access_token}\"\n req.headers[\"Content-Type\"] = \"application/json\"\n end\n\n if response.status == 200\n response_data = MultiJson.load response.body, symbolize_names: true\n @project_id = response_data[:projectId]\n end\n\n @project_id\n end", "def set_project_and_project_id\n @project_id = params[:project_id]\n @project = Project.find_by(id: @project_id)\n end", "def project\n @project ||= DataStore.find_project_by_id(project_id)\n end", "def project_id\n return @project_id unless @project_id.nil?\n project_number = self.project_number || @workforce_pool_user_project\n\n # if we missing either project number or scope, we won't retrieve project_id\n return nil if project_number.nil? || @scope.nil?\n\n url = \"#{CLOUD_RESOURCE_MANAGER}#{project_number}\"\n\n response = connection.get url do |req|\n req.headers[\"Authorization\"] = \"Bearer #{@access_token}\"\n req.headers[\"Content-Type\"] = \"application/json\"\n end\n\n if response.status == 200\n response_data = MultiJson.load response.body, symbolize_names: true\n @project_id = response_data[:projectId]\n end\n\n @project_id\n end", "def getProjectId(project_name)\n\tprojects = $client.Project.all\n\tid = \"\"\n\tprojects.each do |project|\n\t\tif project.name == project_name\n\t\t\tid = project.id\n\t\t\twrite_to_file(\"Project id #{id} was successfully found for #{project_name}\", \"info\")\n\t\tend \n\tend\n\treturn id\nend", "def verify_project_id(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_ID.name], element_value(project_id_input))\n end", "def verify_project_id(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_ID.name], element_value(project_id_input))\n end", "def set_project\n @project = Project.find(params[:id] || params[:project][:id])\n end", "def set_project\n @project = Project.find(params[:id] || params[:project][:id])\n end", "def set_project\n id = params[:id] || params[:project_id]\n @project = Project.find(id)\n end", "def set_project\n @project = params[:id].blank? ? Project.new : Project.find(params[:id])\n end", "def id\n \"#{project.id}-#{current_user.id}\"\n end", "def find_project\n @project = InitializeProject.call id: params[:id]\n end", "def set_project\n id = params[:project_id] || params[:project]\n @project = Project.find(id)\n end", "def set_project\n # find project using id\n @project = Project.find(params[:id])\n end", "def project\n get_or_make_reference('Project', @data, 'project_id')\n end", "def project\n get_or_make_reference('Project', @data, 'project_id')\n end", "def set_project\n @project = Project.find(params[:id] || params[:project_id])\n end", "def project_id\n @attributes[:project_id]\n end", "def set_project\n @project = TaskTracker::Project.find(params[:id])\n end", "def project_id\n service.project_id\n end", "def get_project_identifier\n identifier = params[:project_id] || params[:repository_name]\n raise ActiveRecord::RecordNotFound, 'Project identifier not specified' if identifier.nil?\n return identifier\n end", "def set_project\n @project = Project.find(params[:id]) if params[:id]\n @project = Project.find(params[:project_id]) unless @project\n end", "def set_project\n @project = Project.where(url: params[:project_id]).first\n end", "def project_id\n @service.project_id\n end", "def project_id\n return self.project_id\n end", "def set_project\n if params[:project_id].present?\n @project = Project.find(params[:project_id])\n end\n end", "def set_project\n begin\n @project = Project.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n not_found\n end\n end", "def set_project\n if params[:id].to_i > 0\n @project = Project.find(params[:id])\n session[:selected_project] = params[:id]\n else\n @project = Project.find(session[:selected_project])\n end\n end", "def get_identifier\n identifier = get_project_name\n fail(\n ActiveRecord::RecordNotFound,\n \"Project identifier not specified\"\n ) if identifier.nil?\n identifier.to_s\n end", "def set_project\n if params[:project_id]\n @project = current_user.projects.find(params[:project_id])\n else\n @project = current_user.projects.find(params[:id])\n end\n end", "def set_project\n @project = Project.find Project.decode_id(params[:id])\n end", "def set_project\n @project = FortyTwo::Project.find(params[:id])\n end", "def project_id_or_name=(project_id_or_name)\n if project_id_or_name.is_i?\n self.project_id = project_id_or_name\n else\n self.project_id = Project.find_or_create_by(name: project_id_or_name).id\n end\n end", "def set_project\n @project = Project.find_by_id(params[:id])\n end", "def set_project\n @project = Project.find_by_id(params[:id])\n end", "def with_project_id\n if project_id.present?\n table[:project_id].eq_any(project_id)\n else\n nil\n end\n end", "def set_project\n @project = Project.find(params[:project_id]) if params[:project_id]\n end", "def set_project\n\t\t@project = Project.find(params[:id])\n\tend", "def set_project\n \t@project = Project.find(params[:id])\n end", "def get_project_id\n unless project_id = self.project_id\n if self.preference5_id\n project_id = self.preference5_id\n elsif self.preference4_id\n project_id = self.preference4_id\n elsif self.preference3_id\n project_id = self.preference3_id\n elsif self.preference2_id\n project_id = self.preference2_id\n elsif self.preference1_id\n project_id = self.preference1_id\n end\n end\n project_id\n end", "def selected_project\n if @task and @task.project_id.to_i > 0\n selected_project = @task.project_id\n else\n selected_project = current_user.projects.find(:first, :order => 'name').id\n end\n \n\n return selected_project\n end", "def set_project\n begin\n @project = current_institute.projects.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to projects_path\n end\n end", "def assign_project\n if !session[:project_id].nil?\n find_project=Project.find_by_id(session[:project_id])\n if find_project.nil?\n project=Project.assign_project_id(session[:admin_id])\n\n if !project.empty?\n session[:project_id]=project[0].id\n end\n end\n else\n project=Project.assign_project_id(session[:admin_id])\n if !project.empty?\n session[:project_id]=project[0].id\n end\n end\n end", "def set_project\n @project_id = params[:project_id]\n if @project_id=='ALL'\n @projects = current_user.is_support? ? Project.all : Project.where(user_id: current_user.id).to_a\n else\n @project = current_user.is_support? ? Project.where(id: @project_id).first : Project.where(user_id: current_user.id, id: @project_id).first\n @projects = [@project]\n end\n end", "def create_project(name)\n response = @db.exec_params(%Q[\n INSERT INTO projects(name)\n VALUES ($1)\n RETURNING id;\n ], [name])\n\n response.first[\"id\"]\n end", "def set_target_project\n @project = Project.find(params[:id])\n end", "def set_project\r\n @project = Project.find(params[:id])\r\n end", "def set_project\r\n @project = Project.find(params[:id])\r\n end", "def find_project\n\t\t@project = Project.find(params[:project_id] || params[:id])\n\tend", "def set_project\n @project = Concourse::Project.unscoped.friendly.find(params[:id])\n end", "def project(id)\n self.projects(\"all\").detect { |p| p.id == id }\n end", "def set_project\n\t @project = Project.find(params[:id])\n\t end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n end" ]
[ "0.79203147", "0.7268741", "0.71865326", "0.71851313", "0.7110384", "0.70827234", "0.70095074", "0.6907711", "0.6833138", "0.68052846", "0.6702941", "0.66431975", "0.6634928", "0.6634928", "0.6634928", "0.6630542", "0.6628057", "0.6624162", "0.6620479", "0.66204554", "0.6609891", "0.65968066", "0.65836126", "0.6558179", "0.6558179", "0.65549177", "0.6533878", "0.65099317", "0.6509191", "0.6508931", "0.64777106", "0.64476955", "0.64476955", "0.6443734", "0.64390695", "0.6432493", "0.6429257", "0.6417414", "0.64155406", "0.6405896", "0.6395552", "0.6393559", "0.63825196", "0.63817185", "0.6380095", "0.6371865", "0.63705", "0.6357828", "0.6355261", "0.63533306", "0.6315417", "0.6315355", "0.6313063", "0.6312818", "0.6311211", "0.6300286", "0.62957287", "0.62824506", "0.6266144", "0.6262561", "0.62597734", "0.6257262", "0.6238129", "0.62310374", "0.62310374", "0.62275195", "0.62161624", "0.6213717", "0.62136215", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587", "0.62129587" ]
0.78171176
1
Enters a project ID per a given set of test data
def select_project_id(test_data) hide_notifications_bar logger.info "Entering project ID '#{test_data[CoreUseOfCollectionsData::PROJECT_ID.name]}'" wait_for_options_and_select(project_id_input, project_id_options, test_data[CoreUseOfCollectionsData::PROJECT_ID.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_auto_project_id(test_data=nil)\n hide_notifications_bar\n id = select_id_generator_option(project_id_input, project_id_options)\n test_data.merge!({ UseOfCollections::PROJECT_ID.name => id}) if test_data\n id\n end", "def select_project_id(test_data)\n hide_notifications_bar\n wait_for_options_and_select(project_id_input, project_id_options, test_data[UseOfCollections::PROJECT_ID.name])\n end", "def select_auto_project_id(test_data=nil)\n hide_notifications_bar\n id = select_id_generator_option(project_id_input, project_id_options)\n logger.info \"Selected auto-generated project ID '#{id}'\"\n test_data.merge!({CoreUseOfCollectionsData::PROJECT_ID.name => id}) if test_data\n id\n end", "def verify_project_id(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_ID.name], element_value(project_id_input))\n end", "def verify_project_id(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_ID.name], element_value(project_id_input))\n end", "def set_project\n @project = Project.includes(cases: :tester_user, suites: {cases: :tester_user}).find(params[:id])\n end", "def listprojects()\n #loading array of all projects\n projects = Array.new(GoodData::Project.all)\n\n puts \"\"\n puts \"\"\n puts \"Listing GoodData projects available under provided credentials\"\n puts \"\"\n\n counter = 0\n #loop through projects and print their title and PID\n projects.each do |pr|\n counter += 1\n puts \"#{counter}. \"+pr.title+\" - \"+pr.pid\n end\n puts \"\"\n puts \"\"\n\n #get the number of the project from the user\n print \"Choose project:\"\n\n pnum = gets.chomp.to_i - 1\n\n wrkproj = projects[pnum]\n project_detail(wrkproj)\nend", "def set_project_and_project_id\n @project_id = params[:project_id]\n @project = Project.find_by(id: @project_id)\n end", "def project_id=(value)\n @project_id = value\n end", "def create_project(project_name)\n visit(\"/webapp/author/authorproject.html\")\n project_id = -1\n within_frame(\"authorfrm\") do\n click_on(\"Create a New Project\")\n\n within('.ui-dialog') do\n page.should have_selector(\"#projectInput\")\n fill_in(\"projectInput\", :with => project_name)\n click_on(\"Submit\")\n end\n \n find('#projectTitleInput').value.should eq(project_name)\n project_id = find('#projectIdDisplay').text.to_i\n end\n return project_id\nend", "def define_project_name_and_id(git_service, user_token)\n puts \"\\nPlease enter the name of the current project :\"\n puts '----------------------------------------------'\n\n begin\n input = STDIN.gets.chomp\n exit! if input == 'quit'\n\n url = \"#{git_service.routes[:search_projects]}#{input}\"\n\n response = get(url: url, headers: { git_service.token_header => user_token })\n\n if response[:status] == '200' && !response[:body].empty?\n puts \"\\nFound #{response[:body].count} match(es):\"\n response[:body].each_with_index do |project, index|\n puts \"#{index + 1} - #{project['name_with_namespace']}\"\n end\n\n puts \"\\nPlease insert the number of the current project :\"\n puts '-------------------------------------------------'\n input = validate_choice(response[:body])\n {\n project_slug: response[:body][input - 1]['path_with_namespace'],\n project_id: response[:body][input - 1]['id']\n }\n\n else\n puts \"\\nOops, we couldn't find a project called #{input}. Try again or quit (quit) :\"\n puts '-------------------------------------------------------------------' + ('-' * input.length) # Don't be upset, i'm a perfectionist <3\n define_project_name_and_id(git_service, user_token)\n end\n rescue Interrupt\n exit!\n end\n end", "def test_create_project\n login\n sleep 10\n begin\n @driver.find_element(:xpath, \"//a[@ui-sref='projects']\").displayed?\n puts \"project available\"\n sleep 5\n customer_Name = create_customer\n sleep 5\n @driver.find_element(:xpath, \"//div[@class='create-shortcut dropdown ng-scope']/a\").click\n @driver.find_element(:link_text, \"New Project\").click\n sleep 10\n @driver.find_element(:xpath, \"//i[@class='glyphicon glyphicon-remove']\").click\n @driver.find_element(:xpath, \"//span[@class='ui-select-placeholder text-muted ng-binding']\").click\n sleep 4\n @driver.find_element(:xpath, \"//input[@placeholder='Select customer']\").send_keys customer_Name\n sleep 2\n @driver.find_element(:xpath, \"//a[@class='ui-select-choices-row-inner']/span/div\").click \n time = get_Present\n project_Name = \"Project for \"+customer_Name+\" \"+time\n @driver.find_element(:xpath, \"//input[@placeholder='Name']\").send_keys project_Name\n @driver.find_element(:xpath, \"//textarea[@placeholder='About this Project']\").send_keys \"This project is created through Selenium Automation\"\n \n leadSource = \"//select[@name='leadSource']\"\n leadSource_index = \"2\"\n getSelect_by_index(leadSource,leadSource_index)\n sleep 2\n\n salesrep = \"//select[@name='salesRepId']\"\n salesrep_index = \"1\"\n getSelect_by_index(salesrep,salesrep_index)\n \n @driver.find_element(:xpath, \"//button[@class='submit-button button']\").send_keys :enter \n sleep 2\n puts \"Created \"+project_Name\n sleep 5 \n rescue => e\n puts \"Project not available\"\n @driver.find_element(:xpath, \".//*[@id='main-header']/div/div[3]/div[1]/a/span\").click\n @driver.find_element(:xpath, \".//*[@id='main-header']/div/div[3]/div[1]/ul/li[4]/a\").click\n sleep 5\n end\n end", "def prepare_test\n\n u = User.order(:id).first\n if u.nil?\n u = FactoryGirl.create(:valid_user, id: 1)\n end\n $user_id = u.id\n\n p = Project.order(:id).first\n if p.nil?\n p = FactoryGirl.create(:valid_project, id: 1)\n end\n $project_id = p.id\n\nend", "def create_project(name, description, client)\n\n\tproject = create(:project,\n\tname: name,\n\tstart_date: Date.today - rand(0..60),\n\tdeadline: Date.today + rand(30..60), \n\tdescription: description,\n\tclient: client)\n\n\t# Assign all three users to the project\n\tproject.users << User.all\n\n\t# Tasks\n\tget_tasks.each do |task|\n\t\tcreate(:project_task, project: project, task: task, hours_planned: rand(10..120))\n\tend\n\t\n\t# Some inputs\n\tinputs_count = rand(20..40)\n\tinputs_count.times do\n\t\tproject_task = project.project_tasks.all.sample\n\t\tuser = User.all.sample\n\t\tinput_date = Date.today - rand(-2..20)\n\t\thours = rand(1..24)\n\n\t\tcreate(:input, project_task: project_task, user: user , input_date: input_date, hours: hours)\n\tend\nend", "def projects_for_client\n @tasksheet = Tasksheet.new\n @key = params[:id]\n #find the project based on the client id\n @projects = Project.where(client_id: \"#{params[:client][\"#{params[:id]}\"]}\").collect{ |u| [u.name, u.id] }\n end", "def project_id\n project_id = Util::Git.get_config KEY_PROJECT_ID, :inherited\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n client = TrackerApi::Client.new(:token => api_token)\n\n client.projects.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Util::Git.set_config KEY_PROJECT_ID, project_id, :local\n puts\n end\n\n project_id\n end", "def update_project(project, ptProject)\n project.title = ptProject.name\n project.current_iteration_id = ptProject.current_iteration_number\n project.save\n end", "def set_project\n puts params[:uuid]\n @project = Project.find(params[:uuid])\n end", "def set_project\n @project_id = params[:project_id]\n if @project_id=='ALL'\n @projects = current_user.is_support? ? Project.all : Project.where(user_id: current_user.id).to_a\n else\n @project = current_user.is_support? ? Project.where(id: @project_id).first : Project.where(user_id: current_user.id, id: @project_id).first\n @projects = [@project]\n end\n end", "def project_id\n project_id = @options[:project_id] || Git.get_config(KEY_PROJECT_ID, :inherited)\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n PivotalTracker::Project.all.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Git.set_config(KEY_PROJECT_ID, project_id, :local)\n puts\n end\n\n project_id\n end", "def get_project_info()\n print \"\\n--------------------------------------------------------\\n\"\n print \"04) Searching for project: '#{$my_testrail_project}'...\\n\"\n my_proj_info = nil\n\n # First, get all projects...\n uri = 'get_projects'\n begin\n all_PROJECTs = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"\\tEXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to get information about all TestRail projects'\\n\"\n exit ERR_EXIT_GETPROJS\n end\n\n # Try to find our desired project from the list of projects...\n if all_PROJECTs.length > 0\n all_PROJECTs.each do |item|\n if item['name'] == $my_testrail_project\n @tr_proj_info = item\n break\n end\n end\n else\n print \"ERROR: No projects found in TestRail.'\\n\"\n exit ERR_EXIT_NOPROJS\n end\n if @tr_proj_info == nil\n print \"ERROR: Could not find project named: '#{$my_testrail_project}'\\n\"\n exit ERR_EXIT_PROJNF\n end\n p = @tr_proj_info\n print \"\\tfound project:\\n\"\n print \"\\t id = #{p['id']}\\n\"\n print \"\\t name = #{p['name']}\\n\"\n print \"\\t suite_mode = #{p['suite_mode']}\\n\"\n print \"\\t is_completed = #{p['is_completed']}\\n\"\n print \"\\t url = #{p['url']}\\n\"\n if p['announcement'].nil?\n str = 'nil'\n else\n str = p['announcement'].gsub(/\\n/,\"\\n\\t\\t\\t\")\n end\n print \"\\t announcement = #{str}\\n\"\n\n # Get all suites in our project...\n @tr_proj_id = @tr_proj_info['id']\n uri = \"get_suites/#{@tr_proj_id}\"\n begin\n @tr_suites = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"\\tEXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to get information about all TestRail suites in project.\\n\"\n exit ERR_EXIT_SUITES\n end\n suiteids = Array.new # Build an array of suite ID's for display...\n @tr_suites.each_with_index do |this_suite, index_suite|\n suiteids.push(this_suite['id'])\n end\n print \"\\n\\tFound '#{@tr_suites.length}' suites in the project: '#{suiteids}'\\n\"\n\n return @tr_proj_info, @tr_suites\nend", "def test_plan_id(project_name, plan_name)\n if @version < \"1.0\"\n project_id = project_id project_name\n test_plans = test_plans(project_id)\n\n test_plan = test_plans.first.values.find do |project_test_plan|\n project_test_plan[:name] == plan_name\n end\n else\n test_plan = test_plan_by_name(project_name, plan_name).first\n end\n\n test_plan.nil? ? nil : test_plan[:id].to_i\n end", "def createRun(projectId, suiteId, name, desc, caseids)\r\n\t#{}\"http://testrailgw.jupiter.bbc.co.uk/?action=add_run&project_id=#{projectId}&suite_id=#{suiteId}&name=#{name}&desc={words+to+describe+the+run}&case_ids=1,2,32\"\r\n\tif !(caseids == \"\")\r\n\t\turi = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_run&project_id=#{projectId}&suite_id=#{suiteId}&name=#{name}&desc=#{desc}&case_ids=#{caseids}&sharedSecret=thI5iSourSHAREDsecret\"\r\n\telse\r\n\t\turi = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_run&project_id=#{projectId}&suite_id=#{suiteId}&name=#{name}&desc=#{desc}&sharedSecret=thI5iSourSHAREDsecret\"\r\n\t\t#uri = \"http://testrailgw.jupiter.bbc.co.uk/?action=add_run&project_id=154&suite_id=4176&name=BigTed Active X v2.5.2.7206 - 25/08/2015 16:27&desc=This is a test report for BigTed Active X v2.5.2.7206&sharedSecret=thI5iSourSHAREDsecret\"\r\n\tend\r\n\turi = uri.gsub(\" \", \"%20\")\r\n\r\n\txml_data = open(uri).read\r\n\tif(xml_data.include? '{\"id\":')\r\n\t\trun = xml_data.split('{\"id\":')[1]\r\n\t\trunId = run.split(',\"suite_id\"')[0]\r\n\t\tputs runId\r\n\telse\r\n\t\tputs xml_data\r\n\t\tfail \"Cannot create RUN in Testrail, check Webservice\"\r\n\tend\r\n\r\n\tfiles = \"//zgbwcfs3005.jupiter.bbc.co.uk/QA/Jenkins/Jupiter/ICETEArunid.txt\"\r\n\tf = File.open(files,'w')\r\n\tf.write(runId)\r\n\tf.close\r\nend", "def edit_project\n @driver.find_element(:xpath,(\"//li[@class='list-group-item ng-binding ng-scope'][#min]\")).click # chose first project from the list\n sleep 1\n @driver.find_element(:xpath,(\"//button[@class='btn btn-axa-default'][1]\")).click # click edit button\n sleep 1\n @driver.find_element(:xpath,(\"//li[@class='list-group-item list-resources-item ng-scope']\")).click # click project to expand\n sleep 1\n @driver.find_element(:xpath,(\"//input[@class='form-control ng-pristine ng-untouched ng-valid ng-isolate-scope ng-valid-date']\")).click # click to see choose month\n @driver.find_element(:xpath,(\"//button[@class='btn btn-default']\")).click\n sleep 1\n @driver.find_element(:xpath,(\"//div/div/div[1]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).clear\n sleep 1\n @driver.find_element(:xpath,(\"//div/div/div[1]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).send_keys \"#{random_number}\"\n @driver.find_element(:xpath,(\"//div/div/div[2]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).clear\n sleep 1\n @driver.find_element(:xpath,(\"//div/div/div[2]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).send_keys \"#{random_number}\"\n @driver.find_element(:xpath,(\"//div/div/div[3]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).clear\n sleep 1\n @driver.find_element(:xpath,(\"//div/div/div[3]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).send_keys \"#{random_number}\"\n @driver.find_element(:xpath,(\"//div/div/div[4]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).clear\n sleep 1\n @driver.find_element(:xpath,(\"//div/div/div[4]/input[@class='form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required']\")).send_keys \"#{random_number}\"\n sleep 1\n @driver.find_element(:xpath,(\"//button[@class='btn btn-modal'][2]\")).click # click save button on edit popup\n sleep 1\nend", "def set_project\n @project = Project.find(params[:id] || params[:project][:id])\n end", "def set_project\n @project = Project.find(params[:id] || params[:project][:id])\n end", "def create_projects\n @driver.find_element(:link, \"CREATE NEW PROJECT\").click #click button \"create new project\"\n @driver.find_element(:name, \"name\").clear # select field \"name\"\n @driver.find_element(:name, \"name\").send_keys \"project#@min\" # fill field \"name\"\n @driver.find_element(:name, \"wbs\").clear # select field \"wbs\"\n @driver.find_element(:name, \"wbs\").send_keys \"wbs#@min\" # fill field \"wbs\"\n @driver.find_element(:xpath, \"(//input[@type='text'])[3]\").click # select calendar(from) select 1 January 2015\n @driver.find_element(:xpath, \"(//button[@type='button'])[2]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[4]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[8]\").click\n @driver.find_element(:xpath, \"(//input[@type='text'])[4]\").click # select calendar(to) select 31 December 2015\n @driver.find_element(:xpath, \"(//button[@type='button'])[50]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[63]\").click\n @driver.find_element(:xpath, \"(//button[@type='button'])[84]\").click\n @driver.find_element(:name, \"description\").click # select field \"description\"\n @driver.find_element(:name, \"description\").send_keys \"description - #@min\" # fill field \"description\"\n @driver.find_element(:xpath, \"//div[4]/button[2]\").click # click button \"create\"\nend", "def set_project\n id = params[:project_id] || params[:project]\n @project = Project.find(id)\n end", "def select_project\n project_list.map { |id, hash| [hash['name'], id] }\n end", "def seed_data_for_project_voting(prof, student)\n course = Course.create!(name: \"Capstone Project (Project Voting)\",\n pin: Faker::Number.number(digits: 6),\n professor_id: prof.id,\n minimum_group_member: 3,\n maximum_group_member: 4,\n has_group: false,\n is_voting: false,\n state: \"choose_algo\",\n withProject: true)\n students = []\n 19.times do\n first = Faker::Name.first_name\n last = Faker::Name.last_name\n s = User.create!(firstname: first,\n lastname: last,\n email: last + Faker::Number.number(digits: 6).to_s + \"@brandeis.edu\",\n password: \"password\", type: \"Student\", time_zone: seed_time_zone)\n students << s\n Taking.create!(student_id: s.id, course_id: course.id, state: \"created\")\n end\n Taking.create!(student_id: student.id, course_id: course.id, state: \"created\")\n students << student\n projects = []\n 5.times do\n active_project = Project.create!(project_name: Faker::Team.name, course_id: course.id, description: Faker::Game.genre,\n is_active: true, number_of_likes: 0, added_by: students.sample)\n projects << active_project.id\n end\n 3.times do\n inactive_project = Project.create!(project_name: Faker::Team.name, course_id: course.id, description: Faker::Game.genre,\n is_active: false, number_of_likes: 0, added_by: students.sample)\n end\n seed_voting(students, course, projects)\n puts \"seed project voting\"\nend", "def project_id\n data[:project_id]\n end", "def set_project\n @host = request.host\n\n if @host == 'localhost'\n @prid=64\n @pr_name = 'MEC'\n @pr_desc = 'Eastern Wolf Survey - Searching for Eastern Wolves in Southern Ontario and Quebec'\n return '64'\n end\n\n if @host =~ /7/ \n @prid = 7\n @pr_name = 'CAN'\n @pr_desc = 'Wolf and Coyote DNA Bank'\n return '7' \n else\n if @host =~ /64/\n @prid = 64\n @pr_name = 'MEC'\n @pr_desc = 'Eastern Wolf Survey - Searching for Eastern Wolves in Southern Ontario and Quebec'\n return '64'\n else\n @prid = 0\n @pr_desc = 'unknown project zero'\n return ''\n end\n end\nend", "def set_project\n @project = Project.find Project.decode_id(params[:id])\n end", "def set_project\n # find project using id\n @project = Project.find(params[:id])\n end", "def set_project\n id = params[:id] || params[:project_id]\n @project = Project.find(id)\n end", "def set_project\n @project = TaskTracker::Project.find(params[:id])\n end", "def set_test_plan\n @test_plan = TestPlan.where(project_id: @project.id).find(params[:id])\n end", "def getProjectId(project_name)\n\tprojects = $client.Project.all\n\tid = \"\"\n\tprojects.each do |project|\n\t\tif project.name == project_name\n\t\t\tid = project.id\n\t\t\twrite_to_file(\"Project id #{id} was successfully found for #{project_name}\", \"info\")\n\t\tend \n\tend\n\treturn id\nend", "def fetch_project(input)\n input[:project] = { name: 'Fancy project', owner: { name: 'John Smith' } }\n Success(input)\n end", "def set_project\n @projects = Project.find(params[:id])\n end", "def set_project\n if params[:id].to_i > 0\n @project = Project.find(params[:id])\n session[:selected_project] = params[:id]\n else\n @project = Project.find(session[:selected_project])\n end\n end", "def set_project\n @project = Project.find(params[:project_id]) if params[:project_id]\n end", "def set_project\n @project = params[:id].present? ?\n Project.find(params[:id]) :\n Project.find(params[:project_id])\n end", "def set_project\n # pp params[:list][:project_id]\n @project = current_user.projects.get_project(params[:project_id]).first\n if @project.nil?\n redirect_to root_path\n end\n end", "def set_project\n # pp params[:list][:project_id]\n @project = current_user.projects.get_project(params[:project_id]).first\n if @project.nil?\n redirect_to root_path\n end\n end", "def set_project\n @project = Project.find_by_id(params[:project_id])\n end", "def set_project\n @project = Project.find_by(key: params[:project_id])\n end", "def set_gooddata_project\n @gooddata_project = GooddataProject.find(params[:id])\n end", "def create\n @project = Project.new(params[:project])\n\n if @project.save\n task1 = ProjectTask.create!(:project_id => @project.id,\n :taskType => \"Pre-Sales\",\n :task_name => \"Pre-Sales\")\n task2 = ProjectTask.create!(:project_id => @project.id,\n :taskType => \"Project\",\n :task_name => \"Project\")\n task3 = ProjectTask.create!(:project_id => @project.id,\n :taskType => \"Support\",\n :task_name => \"Support\")\n task4 = ProjectTask.create!(:project_id => @project.id,\n :taskType => \"Fault Fixing\",\n :task_name => \"Fault Fixing\")\n task5 = ProjectTask.create!(:project_id => @project.id,\n :taskType => \"Out-Of-Hours\",\n :task_name => \"Out-Of-Hours\")\n flash[:notice] = \"Successfully created project.\"\n redirect_to projects_path\n else\n render :action => 'new'\n end\n end", "def set_project\n @project = Project.find(params[:id] || params[:project_id])\n end", "def set_project\n @project = params[:id].blank? ? Project.new : Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id]) # Recupera el proyecto correspondiente al ID que le llego\n end", "def set_project\n \t@project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id])\n\n \n end", "def set_project\n @project = Project.find params[:project_id]\n end", "def set_project\n #TODO: check if project is ownned by current user\n @project = Project.find_by_id(params[:id])\n end", "def set_project\n # @project = Project.find(params[:project_id])\n @project = Project.find_by(:id => params[:project_id])\n end", "def set_target_project\n @project = Project.find(params[:id])\n end", "def set_project\n @project = Project.find(params[:id]) if params[:id]\n @project = Project.find(params[:project_id]) unless @project\n end", "def add_extra_projects\n users = User.all\n n = 0\n users.each do |u|\n n += 1\n next if n < 20 || rand < 0.2 || u.projects.count.positive?\n\n u.projects.create(title: \"Project #{n}: #{Faker::Company.catch_phrase}\",\n source_code_url: Faker::Internet.url,\n deployed_url: Faker::Internet.url,\n description: \"Description #{n}: #{Faker::Lorem.paragraph(10)}\",\n created_at: 11.minutes.ago,\n updated_at: 10.minutes.ago)\n end\nend", "def import_projects\n Project.unrestrict_primary_key\n iterate_lines(@directory + 'projects.json') do |idx, line|\n print \"\\rImporting Projects #{idx}...\"\n Project.create(JSON.parse(line))\n end\n print \"Done\\n\"\n Project.restrict_primary_key\n end", "def assign_projects\n assigned_projects = []\n team_index = 0\n PROJECTS.each do |project_name|\n team = @teams[team_index]\n project = Project.new(project_name, team.lead, team.all_members)\n assigned_projects << project\n next unless assigned_projects.size == 2\n\n team.assign_projects(assigned_projects)\n assigned_projects = []\n if (team_index += 1) > (@teams.size - 1)\n team_index = 0\n end\n end\n end", "def generate_id\n test = nil\n caller.each do |s|\n if s =~ /in `test_(.+)'/\n test = $1\n break\n end\n end\n\n if test\n prefix = \"#{test}_\"\n else\n prefix = \"\"\n end\n\n i = 1\n while File.exists?(File.join(BUILDDIR, \"clipp_test_#{prefix}#{i}.clipp\"))\n i += 1\n end\n\n \"#{prefix}#{i}\"\n end", "def set_project\n @project = Project.find_by_id(params[:id])\n end", "def set_project\n @group = Group.find(params[:group_id]) if params[:group_id]\n @project = Project.find(params[:id])\n @group = @project.group if @group.nil?\n @office = Office.find(params[:office_id]) if params[:office_id]\n\n @groups = Group.all\n @offices = Office.all\n @projects = Project.all\n\n @people = User.on_project(@project).in_office(@office).of_group(@group)\n end", "def get_spec_and_project_id(base_path)\n goodfile_path = GoodData::Helpers.find_goodfile(Pathname(base_path))\n fail 'Goodfile could not be located in any parent directory. Please make sure you are inside a gooddata project folder.' if goodfile_path.nil?\n goodfile = JSON.parse(File.read(goodfile_path), :symbolize_names => true)\n spec_path = goodfile[:model] || fail('You need to specify the path of the build spec')\n fail \"Model path provided in Goodfile \\\"#{spec_path}\\\" does not exist\" unless File.exist?(spec_path) && !File.directory?(spec_path)\n\n spec_path = Pathname(spec_path)\n\n content = File.read(spec_path)\n spec = if (spec_path.extname == '.rb')\n eval(content)\n elsif (spec_path.extname == '.json')\n JSON.parse(spec_path, :symbolize_names => true)\n end\n [spec, goodfile[:project_id]]\n end", "def set_project\n @project = Project\n .find(params[:project_id])\n end", "def set_project\n @project = current_user.whole_projects.find(params[:project_id])\n end", "def set_project\n @project = Project.find(params[:project_id])\n end", "def set_project\n @project = Project.find(params[:project_id])\n end", "def set_project\n @project = Project.find(params[:project_id])\n end", "def set_project\n @project = Project.find(params[:project_id])\n end", "def set_project\n @project = Project.find(params[:project_id])\n end", "def assign_project_use\n if !session[:project_id].nil?\n find_project=Project.find_by_id(session[:project_id])\n if find_project.nil?\n project=Project.assign_project_id(session[:admin_id])\n if !project.empty?\n session[:project_id]=project[0].id\n end\n end\n else\n project=Project.assign_project_id(session[:admin_id])\n if !project.empty?\n session[:project_id]=project[0].id\n end\n end\n end", "def project_id_or_name=(project_id_or_name)\n if project_id_or_name.is_i?\n self.project_id = project_id_or_name\n else\n self.project_id = Project.find_or_create_by(name: project_id_or_name).id\n end\n end", "def project_id project_name\n if @version < \"1.0\"\n project = projects.find { |project| project[:name] == project_name }\n else\n project = project_by_name(project_name).first\n end\n\n project.nil? ? nil : project[:id].to_i\n end", "def test_ut_da10b_t1_15\n p \"Test 15\"\n # gets a list of pjs belong to selected pu\n pjs = @pu.get_pjs_belong_to_pu\n expected_pj = [[\"\", 0], [\"SamplePJ1\", 1], [\"SamplePJ2\", 2]]\n assert_equal expected_pj, pjs\n end", "def set_project\n @project = Project.find_by_hashid(params[:id])\n end", "def set_project\n @project = Project.find_by_hashid(params[:id])\n end", "def project_number=(value)\n @project_number = value\n end", "def set_project\n\t @project = Project.find(params[:id])\n\t end", "def set_project\n\t\t@project = Project.find(params[:id])\n\tend", "def project_id(project_key)\n project_info(project_key)['id']\n end", "def set_project\n # @project = Project.find(params[:id])\n end", "def pending_test_prod_tr_ids\r\n prods = Product.find(1, 2)\r\n assert_equal 2, prods.length\r\n assert_equal \"first-product\", prods[0].code\r\n assert_equal \"second-product\", prods[1].code\r\n assert_equal \"these are the specs for the first product\",\r\n prods[0].specs \r\n assert_equal \"This is a description of the first product\",\r\n prods[0].description \r\n assert_equal \"these are the specs for the second product\",\r\n prods[1].specs\r\n end", "def enter_project_desc(test_data)\n hide_notifications_bar\n logger.info \"Entering project description '#{test_data[CoreUseOfCollectionsData::PROJECT_DESC.name]}'\"\n wait_for_element_and_type(project_desc_text_area, test_data[CoreUseOfCollectionsData::PROJECT_DESC.name])\n end", "def set_project\n if params[:project_id].present?\n @project = Project.find(params[:project_id])\n end\n end", "def find_project\n @project = InitializeProject.call id: params[:id]\n end", "def set_project\n @project = FortyTwo::Project.find(params[:id])\n end", "def set_project\r\n @project = Project.find(params[:id])\r\n end", "def set_project\r\n @project = Project.find(params[:id])\r\n end", "def enter_project_desc(test_data)\n hide_notifications_bar\n wait_for_element_and_type(project_desc_text_area, test_data[UseOfCollections::PROJECT_DESC.name])\n end", "def set_project\n begin\n @project = current_institute.projects.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to projects_path\n end\n end", "def set_project_code\n @project_code = ProjectCode.find(params[:id])\n end", "def set_project\n @project = Project.find_by_id(params[:id])\n end", "def set_project\n @project = Project.where(url: params[:project_id]).first\n end", "def set_project\n @project = Project.find_by_key(params[:project_key])\n end", "def submit_control_numbers(project)\n unless project.control_number.nil?\n pgtr = project.project_grid_table_row\n pgtr.asin = project.control_number.asin\n pgtr.paperback_isbn = project.control_number.paperback_isbn\n pgtr.epub_isbn = project.control_number.epub_isbn\n pgtr.save\n end\n end", "def test_003\n\n # login\n login\n @@pu = 1\n @@pj = 1\n open\"/devgroup/pj_index/#{@@pu}/#{@@pj}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu}/#{@@pj}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # select uploading method in the master tab\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n #Select \"uploading a file individually\"\n click \"file_upload_upload_way_upload_each\"\n assert is_text_present(_(\"Uploaded individually.\"))\n #Click button Read tree\n click $xpath[\"task\"][\"read_tree\"]\n assert !60.times{ break if (is_text_present(_(\"Directory structure\")) rescue false); sleep 2 }\n #It will return, if a check is returned for uploading collectively (F2-003)\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # logout\n logout\n\n end", "def assign_new_projects\n # IMPLEMENTUJTE TUTO METODU\n # Pro kazdeho volneho programatora hledejte projekt k prideleni nasledovne:\n # - Pokud existuje nejaky projekt v @projects_waiting, vyberte prvni takovy.\n # (Nezapomente mu zmenit stav a presunout jej do @projects_current.)\n # - Pokud ne, vyberte takovy projekt z @projects_current, na kterem zbyva\n # nejvice nedodelane prace.\n @programmers.each_with_index do |prg,i|\n if @programmers[i].project == nil #programator bez projektu\n if @projects_waiting.length > 0\n cur_prj=@projects_waiting.shift\n cur_prj.state=:current\n @programmers[i].project=cur_prj\n @projects_current << cur_prj\n else\n if @projects_current.length >0\n #p \"vyber ten kde je nejvic prace\"\n #p @projects_current\n @projects_current.sort! { |a,b| (a.man_days-a.man_days_done) <=> (b.man_days-b.man_days_done) }\n # @projects_current.sort_by! {|rem| -(rem.man_days - rem.man_days_done) }\n @programmers[i].project=@projects_current[0] if @projects_current.length >0\n end\n end\n end\n end\n end" ]
[ "0.70523965", "0.6975713", "0.68460196", "0.6595247", "0.6561248", "0.636094", "0.63221335", "0.60930926", "0.6076015", "0.6063935", "0.6032345", "0.5850612", "0.5850452", "0.5807385", "0.58002424", "0.57622015", "0.5726558", "0.57243687", "0.56805694", "0.5672121", "0.56565374", "0.5652924", "0.5648892", "0.5628403", "0.5620386", "0.5620386", "0.56161094", "0.5600763", "0.5589757", "0.5578925", "0.5568982", "0.5568094", "0.5548888", "0.55355144", "0.55281603", "0.5486304", "0.54837984", "0.5482142", "0.5480979", "0.5477855", "0.5477842", "0.54756063", "0.54739404", "0.5456391", "0.5456391", "0.544514", "0.54404134", "0.5439914", "0.54309875", "0.5429001", "0.5418367", "0.5415006", "0.5412796", "0.54106283", "0.5409391", "0.54063004", "0.5399206", "0.5396272", "0.53947794", "0.53917927", "0.5387674", "0.5383369", "0.538264", "0.5380362", "0.53787684", "0.5375952", "0.53719246", "0.53675896", "0.5366833", "0.5366833", "0.5366833", "0.5366833", "0.5366833", "0.5363511", "0.53623885", "0.5361199", "0.53572446", "0.5355583", "0.5355583", "0.5353579", "0.53486985", "0.5343044", "0.53421503", "0.5340342", "0.53399485", "0.53363687", "0.5330233", "0.5317026", "0.5313955", "0.5313448", "0.5313448", "0.53120124", "0.5310039", "0.53053784", "0.53051543", "0.53047526", "0.5300703", "0.52990746", "0.52905136", "0.52894783" ]
0.7086459
0
Verifies a project ID matches test data
def verify_project_id(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_ID.name], element_value(project_id_input)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_project_id(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_ID.name], element_value(project_id_input))\n end", "def verify_project_desc(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def compare_to(project_name)\n compare_contents @project_path, project_fixture(project_name)\n end", "def test_ut_t4_mtv_pu_004\n pu = Pu.find(1)\n pj_id = 5\n assert_equal FALSE, pu.check_pj_belong_to_pu?(pj_id)\n end", "def test_show_if_contains_valid_transaction_id\n assert_equal @order.contains_valid_transaction_id?, false\n assert @order.update_attributes(:auth_transaction_id => 123)\n assert_equal @order.contains_valid_transaction_id?, true\n end", "def validate_project_id\n if Project.find_by(id: project_id).nil?\n errors.add(:project_id, \"must correspond to a valid project.\")\n end\n end", "def test_crud_project\n #create\n @project= create_project\n assert_equal @project.name, R3c.project.find(@project.id).name \n size= R3c.project.all.size\n #update\n @project.name=\"replaced\"\n @project.save!\n assert_equal \"replaced\", R3c.project.find(@project.id).name \n #delete\n delete_project(@project.id)\n assert_equal (size-1), R3c.project.all.size\n end", "def test_game_id\n assert_equal(10000, @mygame.game_id)\n end", "def validate_project\n file = ProjectFile.find_by(id: project_file_id)\n comment = Comment.find_by(id: comment_id)\n if file.project.id != comment.project.id\n errors.add(:project_file_id, \n \"must be part of the same project as the comment\")\n end\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def test_project_checkboxes\n proj1 = projects(:eol_project)\n proj2 = projects(:bolete_project)\n obs1 = observations(:minimal_unknown_obs)\n obs2 = observations(:detailed_unknown_obs)\n img1 = images(:in_situ_image)\n img2 = images(:commercial_inquiry_image)\n assert_users_equal(mary, obs1.user)\n assert_users_equal(mary, obs2.user)\n assert_users_equal(mary, img1.user)\n assert_users_equal(rolf, img2.user)\n assert_obj_arrays_equal([], obs1.projects)\n assert_obj_arrays_equal([proj2], obs2.projects)\n assert_obj_arrays_equal([proj2], img1.projects)\n assert_obj_arrays_equal([], img2.projects)\n assert_obj_arrays_equal([rolf, mary, katrina], proj1.user_group.users)\n assert_obj_arrays_equal([dick], proj2.user_group.users)\n\n # NOTE: It is impossible, apparently, to get edit_image to fail,\n # so there is no way to test init_project_vars_for_reload().\n\n login(\"rolf\")\n get(:new, params: { id: obs1.id })\n assert_response(:redirect)\n get(:new, params: { id: obs2.id })\n assert_response(:redirect)\n get(:edit, params: { id: img1.id })\n assert_response(:redirect)\n get(:edit, params: { id: img2.id })\n assert_project_checks(proj1.id => :unchecked, proj2.id => :no_field)\n\n login(\"mary\")\n get(:new, params: { id: obs1.id })\n assert_project_checks(proj1.id => :unchecked, proj2.id => :no_field)\n get(:new, params: { id: obs2.id })\n assert_project_checks(proj1.id => :unchecked, proj2.id => :checked)\n get(:edit, params: { id: img1.id })\n assert_project_checks(proj1.id => :unchecked, proj2.id => :checked)\n get(:edit, params: { id: img2.id })\n assert_response(:redirect)\n\n login(\"dick\")\n get(:new, params: { id: obs2.id })\n assert_project_checks(proj1.id => :no_field, proj2.id => :checked)\n get(:edit, params: { id: img1.id })\n assert_project_checks(proj1.id => :no_field, proj2.id => :checked)\n get(:edit, params: { id: img2.id })\n assert_response(:redirect)\n proj1.add_image(img1)\n get(:edit, params: { id: img1.id })\n assert_project_checks(proj1.id => :checked_but_disabled,\n proj2.id => :checked)\n end", "def test_user_can_edit_project\n\t\tlogin_as(:can_edit)\n\t\tget :show, :id=>projects(:three)\n\t\tassert_select \"a\",:text=>/Edit Project/,:count=>1\n\n\t\tget :edit, :id=>projects(:three)\n\t\tassert_response :success\n\n\t\tput :update, :id=>projects(:three).id,:project=>{}\n\t\tassert_redirected_to project_path(assigns(:project))\n\tend", "def test_should_destroy_lonely_project\n assert_difference(\"Project.count\", -1) do \n delete :destroy, :id => 3\n end\n assert_redirected_to current_iterations_path\n end", "def test_ut_t4_mtv_pu_003\n pu = Pu.find(1)\n pj_id = 1\n assert_equal TRUE, pu.check_pj_belong_to_pu?(pj_id)\n pj_id = 3\n assert_equal FALSE, pu.check_pj_belong_to_pu?(pj_id)\n end", "def test_creating_a_valid_project\n project = Project.new(:name => \"My Project\",\n :start_date => \"12/01/2007\",\n :end_date => \"12/01/2008\",\n :total_budget => 100000 )\n \n assert project.valid?\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def test_user_can_edit_project\n login_as(:can_edit)\n get :show, :id=>projects(:three)\n assert_select \"a\",:text=>/Edit Project/,:count=>1\n assert_select \"a\",:text=>/\\[Change\\]/,:count=>1\n\n get :edit, :id=>projects(:three)\n assert_response :success\n\n put :update, :id=>projects(:three).id,:project=>{}\n assert_redirected_to project_path(assigns(:project))\n end", "def test_idempotency_validation\n FootballData::Scrape.get_team_year(1, '1999-2000')\n assert_equal FootballData::RawGame.count, @count\n end", "def validateProject(data, isSocialGood = false)\n fails = []\n # Check if project is private\n if data.private\n fails.push(\"Project is either private or doesn't exist!\")\n end \n # Check if project has license\n if data.license == nil\n fails.push(\"Project doesn't have a license\")\n end\n # Check if project has atleast 100 stars\n if data.stargazers_count < 100 && !isSocialGood\n fails.push(\"Project has less than 100 stars\")\n end\n return fails\nend", "def test_when_time_entries_have_no_issue_associated\n assert_equal false , @project.has_time_entries_with_no_issue\n end", "def check_solution(test_number, argument, expected)\n actual = fields(argument)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def test_checklist_for_project\n login\n project = projects(:one_genus_two_species_project)\n expect = Name.joins(observations: :project_observations).\n where({ observations: { project_observations:\n { project_id: project.id } } }).\n with_rank(\"Species\").distinct\n\n get(:show, params: { project_id: project.id })\n assert_match(/Checklist for #{project.title}/, css_select(\"title\").text,\n \"Wrong page\")\n\n prove_checklist_content(expect)\n end", "def test_project\n project\n @browser.find_element(:id, 'tab-versions').click\n sleep (2)\n @browser.find_element(:xpath, \"//*[@id='tab-content-versions']/p[2]/a\").click\n version = rand(999).to_s + 'version'\n @browser.find_element(:id, 'version_name').send_keys version\n @browser.find_element(:name, 'commit').click\n #expected = 'Successful creation.'\n expected = 'Создание успешно.'\n assert_equal(expected, @browser.find_element(:id, 'flash_notice').text)\n end", "def matches_expected? pi\n pi.patient_identifier == expected.patient_identifier &&\n pi.affinity_domain == expected.affinity_domain\n end", "def test_ut_da10b_t1_15\n p \"Test 15\"\n # gets a list of pjs belong to selected pu\n pjs = @pu.get_pjs_belong_to_pu\n expected_pj = [[\"\", 0], [\"SamplePJ1\", 1], [\"SamplePJ2\", 2]]\n assert_equal expected_pj, pjs\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def test_equals\n result = Person.new(\"Fred\", \"Jones\", 34) == Person.new(\"Fred\", \"Jones\", 34)\n assert_equals(true, result, \"The same person was not found to be equal.\")\nend", "def dataset_field_match?(domo_client, dataset_id, expected_data)\n data = export_dataset(domo_client, dataset_id)\n return false unless data\n\n if expected_data.is_a? Array\n expected_data_row = expected_data[0]\n else\n expected_data_row = expected_data\n end\n if data.is_a? Array\n data_row = data[0]\n else\n data_row = data\n end\n\n unmatched_fields = Array.new\n expected_data_row.each do |name, v|\n unless data_row.include? name\n unmatched_fields << name\n end\n end\n\n unmatched_fields.length <= 0\n end", "def check(id_string)\n set_done(id_string, true)\n #checking all other tasks with same name/description as the newly checked task which id is id_string\n id = id_string.to_i\n @tasks.each { |project_name, project_tasks|\n project_tasks.each { |task|\n if task.id == id\n @tasks.each do |project_name, project_tasks|\n project_tasks.each do |t|\n if t.description == task.description\n set_done(t.id.to_s, true)\n end\n end\n end\n end\n }\n }\n end", "def test_existing_file\n assert verify_parameters(['verifier_tests.rb'])\n end", "def verify\n new_rb_id_list = @rb_bmet.redbox_ids - @ds_bmet.redbox_ids\n update_rb_id_list = @rb_bmet.redbox_ids - new_rb_id_list\n if DEBUG\n puts\n puts \"@ds_bmet.redbox_ids=#{@ds_bmet.redbox_ids.inspect}\"\n puts \"@rb_bmet.redbox_ids=#{@rb_bmet.redbox_ids.inspect}\"\n puts\n puts \"new_rb_id_list=#{new_rb_id_list.inspect}\"\n puts \"update_rb_id_list=#{update_rb_id_list.inspect}\"\n puts\n end\n end", "def test_legacy_codes_unique\n spods = Person.find(:all, :limit => 2)\n person1 = spods[0]\n person2 = spods[1]\n \n new_leg_code = \"AAAA\"\n assert person1.legacy4d_identity_code !=person2.legacy4d_identity_code\n person1.legacy4d_identity_code = new_leg_code\n person2.legacy4d_identity_code = new_leg_code\n assert !person1.save\n assert !person2.save\n \n end", "def assert_team_ids_reassigned(team_set)\n team_ids = team_set.thinkspace_team_teams.pluck(:id)\n get_assessment.thinkspace_peer_assessment_team_sets.each do |ts|\n assert_include team_ids, ts.team_id\n end\nend", "def pending_test_prod_tr_ids\r\n prods = Product.find(1, 2)\r\n assert_equal 2, prods.length\r\n assert_equal \"first-product\", prods[0].code\r\n assert_equal \"second-product\", prods[1].code\r\n assert_equal \"these are the specs for the first product\",\r\n prods[0].specs \r\n assert_equal \"This is a description of the first product\",\r\n prods[0].description \r\n assert_equal \"these are the specs for the second product\",\r\n prods[1].specs\r\n end", "def test_ut_t4_mtv_pj_001\n pj = Pj.find(1)\n assert_equal TRUE, pj.has_analyzed_task?\n end", "def test_ut_diff_source_code_o1\n assert @diff_source_code_1.save\n diff_source_code_copy = DiffSourceCode.find(@diff_source_code_1.id)\n assert_equal @diff_source_code_1.diff_file_id, diff_source_code_copy.diff_file_id \n assert @diff_source_code_1.valid?\n assert @diff_source_code_1.destroy\n end", "def test_person_validity\n assert people(:valid_person).valid?\n end", "def test_ut_t4_mtv_pu_002\n pj = Pj.find(3)\n assert_equal FALSE, pj.has_analyzed_task?\n end", "def is_project_in_workspace(project, workspace)\n test_project_oid = project[\"ObjectID\"]\n this_workspace_oid = workspace[\"ObjectID\"]\n\n object_id_matches = false\n these_projects = @workspace_hash_of_projects[this_workspace_oid]\n these_projects.each do | this_project |\n this_project_oid = this_project[\"ObjectID\"]\n if test_project_oid == this_project_oid then\n object_id_matches = true\n end\n end\n return object_id_matches\n end", "def check_project_exists\n\n # if latitude is within +/- 2 ten-thounsandths of another project's latitude it is the same\n (Project.select{ |proj| proj.project_type == self.project_type }.count > 0 && Project.select{ |proj| proj.street1.to_f.between?((self.street1.to_f - 0.002), (self.street1.to_f + 0.002))}.count > 0 && Project.select{ |proj| proj.street2.to_f.between?((self.street2.to_f - 0.02), (self.street2.to_f + 0.02))}.count > 0)\n end", "def test_existence\n\n # Define and store a new part number.\n pn = PartNumber.initial_part_number\n pn.pcb_prefix = '600'\n pn.pcb_number = '123'\n pn.pcb_dash_number = 'a0'\n pn.pcba_prefix = '600'\n pn.pcba_number = '233'\n pn.pcba_dash_number = 'a0'\n \n assert(!pn.exists?)\n assert(!pn.entry_exists?)\n assert_nil(pn.error_message)\n pn.get_id\n assert_nil(pn.id)\n assert_nil(PartNumber.get_part_number(pn))\n pn.save\n \n assert(pn.exists?)\n assert_not_nil(PartNumber.get_part_number(pn))\n assert_equal(@msg_pcb_pcba_exists, pn.error_message)\n assert_equal(pn.id, PartNumber.get_part_number(pn).id)\n \n assert(!pn.entry_exists?)\n board_design_entry = BoardDesignEntry.new(:part_number_id => pn.id,\n :lead_free_device_names => '',\n :originator_comments => '',\n :input_gate_comments => '')\n board_design_entry.save\n assert(pn.entry_exists?)\n assert_equal('The entry already exists', pn.error_message)\n \n \n # Try the same part number that was just created.\n new_pn = PartNumber.initial_part_number\n new_pn.pcb_prefix = '600'\n new_pn.pcb_number = '123'\n new_pn.pcb_dash_number = 'a0'\n new_pn.pcba_prefix = '600'\n new_pn.pcba_number = '233'\n new_pn.pcba_dash_number = 'a0'\n\n assert_equal(pn.id, new_pn.get_id)\n assert(new_pn.exists?)\n assert_equal(@msg_pcb_pcba_exists, new_pn.error_message)\n assert(new_pn.pcb_pn_exists?)\n assert_equal(@msg_pcb_exists_pcb, new_pn.error_message)\n assert(new_pn.pcba_pn_exists?)\n assert_equal(@msg_pcba_exists_pcba, new_pn.error_message)\n \n \n # Try a new part number with a PCBA that is the same as an existing\n # part number PCBA component\n new_pn = PartNumber.initial_part_number\n new_pn.pcb_prefix = '700'\n new_pn.pcb_number = '123'\n new_pn.pcb_dash_number = 'b0'\n new_pn.pcba_prefix = '600'\n new_pn.pcba_number = '233'\n new_pn.pcba_dash_number = 'a0'\n\n assert(new_pn.exists?)\n assert_equal(@msg_pcba_exists_pcba, new_pn.error_message)\n assert(!new_pn.pcb_pn_exists?)\n assert_equal(nil, new_pn.error_message)\n assert(new_pn.pcba_pn_exists?)\n assert_equal(@msg_pcba_exists_pcba, new_pn.error_message)\n\n\n # Try a new part number with a PCBA that is the same as an existing\n # part number PCB component\n new_pn = PartNumber.initial_part_number\n new_pn.pcb_prefix = '600'\n new_pn.pcb_number = '888'\n new_pn.pcb_dash_number = 'a0'\n new_pn.pcba_prefix = '600'\n new_pn.pcba_number = '123'\n new_pn.pcba_dash_number = 'a0'\n\n assert(new_pn.exists?)\n assert_equal(@msg_pcba_exists_pcb, new_pn.error_message)\n assert(!new_pn.pcb_pn_exists?)\n assert_equal(nil, new_pn.error_message)\n assert(new_pn.pcba_pn_exists?)\n assert_equal(@msg_pcba_exists_pcb, new_pn.error_message)\n\n\n # Try a new part number with a PCB that is the same as an existing\n # part number PCBA component\n new_pn = PartNumber.initial_part_number\n new_pn.pcb_prefix = '600'\n new_pn.pcb_number = '233'\n new_pn.pcb_dash_number = 'a0'\n new_pn.pcba_prefix = '600'\n new_pn.pcba_number = '923'\n new_pn.pcba_dash_number = 'a0'\n\n assert(new_pn.exists?)\n assert_equal(@msg_pcb_exists_pcba, new_pn.error_message)\n assert(new_pn.pcb_pn_exists?)\n assert_equal(@msg_pcb_exists_pcba, new_pn.error_message)\n assert(!new_pn.pcba_pn_exists?)\n assert_equal(nil, new_pn.error_message)\n\n \n # Try a new part number with a PCB that is the same as an existing\n # part number PCB component\n new_pn = PartNumber.initial_part_number\n new_pn.pcb_prefix = '600'\n new_pn.pcb_number = '123'\n new_pn.pcb_dash_number = 'a0'\n new_pn.pcba_prefix = '666'\n new_pn.pcba_number = '999'\n new_pn.pcba_dash_number = 'f8'\n\n assert(new_pn.exists?)\n assert_equal(@msg_pcb_exists_pcb, new_pn.error_message)\n assert(new_pn.pcb_pn_exists?)\n assert_equal(@msg_pcb_exists_pcb, new_pn.error_message)\n assert(!new_pn.pcba_pn_exists?)\n assert_equal(nil, new_pn.error_message)\n \n eco_pn = part_numbers(:eco_number)\n retrieved_eco_pn = PartNumber.get_part_number(eco_pn)\n\n end", "def verifierCorrect()\n return @solution.equals(@partie.getCurrentGrid())\n end", "def package_project_valid?\n Project.first(:code => metadata[\"dmd-project\"], :account => {:code => metadata[\"dmd-account\"]}) != nil\n end", "def check_by_project\n _r = false\n # global_project_breakdown returns multidimensional array containing different project in each line\n # Each line contains 5 elements: Project Id, max_order_total, max_order_price, Net amount sum by project & Item net price\n a = global_project_breakdown(purchase_order_items.order(:project_id))\n d = a.detect { |f| (f[1] > 0 && (f[3] > f[1])) || (f[2] > 0 && (f[4] > f[2])) }\n _r = d.nil? ? false : true\n end", "def test_check_hash_equal\r\n assert_equal true, @g.check_hash(1, 1)\r\n end", "def test_correct_custom_child_id_validates\n child = children(:custom_child_id)\n assert child.valid?\n assert_match /63([0-9]{4})/, child.child_id.to_s\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def test_ok_to_delete\n assert_equal(false, Studio.ok_to_delete?(11))\n end", "def test_can_return_id_of_item\n assert_equal 263515158, item.id\n end", "def test_values_unique\n\n #Arrange\n @user3 = User.new\n @user4 = User.new\n\n # Act\n @user3.name = \"fede\"\n @user3.surname = \"guti\"\n @user3.username = \"fede3\"\n @user3.email = \"fede3@gmail.com\"\n @user3.password = \"123456789\"\n\n @user4.name = \"fede\"\n @user4.surname = \"guti\"\n @user4.username = \"luca\"\n @user4.email = \"luca@gmail.com\"\n @user4.password = \"123456789\"\n\n\n # Assert\n @user3.save\n @user4.save\n all_ok = assert_equal @user3.valid? && @user4.valid? , true\n\n # Act\n @user4.email = \"fede3@gmail.com\"\n @user4.save\n\n # Assert\n email_check = assert_equal @user4.valid?, false\n\n # Act\n @user4.email = \"luca@gmail.com\"\n @user4.username = \"fede3\"\n @user4.save\n\n # Assert\n user_check = assert_equal @user4.valid?, false\n\n # Assert\n assert_equal (all_ok || email_check || user_check) , true\n\n end", "def validate_project\n\n # project name should be 10 to 30 length, and 5 words or fewer\n validate_length_words 'Project Name', self.project_name, 10, 30, 0, 5\n\n # vision should be 1 sentence\n validate_sentences_length 'Vision', self.vision, 30, 100, 1\n\n # goal should be 1 sentence\n validate_sentences_length 'Goal', self.goal, 30, 100, 1\n\n # description, and scope should be 5 sentences!\n validate_sentences_length 'Description', self.description, 100, 500, 5\n validate_sentences_length 'Scope', self.scope, 100, 500, 5\n\n # advice needed\n validate_sentences_length 'Advice Required', self.advice_required, 50, 200, 3\n\n # randomize program and train complaints!\n validate_random_day 'Program', self.program.name\n validate_random_day 'Train', self.train.name\n end", "def test_scenario1\n puts \"\\nTesting projects REST api calls\\n\" \n name = \"my project\"\n new_name = \"my new project\"\n\n puts \"Given I create a project with name \"+ name\n project = @api.create_project({'name' => name})\n\n puts \"And I wait until project is ready\"\n assert_equal(@api.ok(project), true)\n\n puts \"Then I check project name is \" + project[\"object\"][\"name\"]\n assert_equal(name, project[\"object\"][\"name\"])\n\n puts \"And I update the project with new name \"+new_name\n project = @api.update_project(project[\"resource\"], {\"name\" => new_name})\n assert_equal(BigML::HTTP_ACCEPTED, project[\"code\"])\n\n puts \"Then I check the project name is a new name \"+new_name\n assert_equal(new_name, project[\"object\"][\"name\"]) \n\n puts \"And i delete the project\"\n project = @api.delete_project(project[\"resource\"])\n assert_equal(BigML::HTTP_NO_CONTENT, project[\"code\"])\n\n end", "def test_ut_t5_sef_pj_010\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n email_settings = EmailSetting.find_all_by_pj_id(new_pj.id)\n email_settings.each do |setting|\n assert_equal TCANA_ADMIN_ID.to_s, setting.user_ids\n end\n end", "def pending_test_prod_tr_ids\n prods = Product.find(1, 2)\n assert_equal 2, prods.length\n assert_equal \"first-product\", prods[0].code\n assert_equal \"second-product\", prods[1].code\n assert_equal \"these are the specs for the first product\",\n prods[0].specs\n assert_equal \"This is a description of the first product\",\n prods[0].description\n assert_equal \"these are the specs for the second product\",\n prods[1].specs\n end", "def verify()\n # TODO\n end", "def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def select_project_id(test_data)\n hide_notifications_bar\n wait_for_options_and_select(project_id_input, project_id_options, test_data[UseOfCollections::PROJECT_ID.name])\n end", "def test_should_not_create_project_via_API_XML\r\n get \"/logout\", :api_key=>'testapikey'\r\n post \"/projects.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end", "def test_duplicate_transaction_id\n spaccount = create_new_account(:transaction_id => 1)\n spaccount.save\n assert_equal 1, spaccount.errors.size, \"The errors array should have one error when adding with a duplicate transaction id\" \n end", "def compare_product_tests(test1, test2)\n # compare relevant details\n test1.save\n test2.save\n assert_performed_jobs 2\n\n test1.reload\n test2.reload\n compare_results(test1, test2)\n\n # compare records\n test1.patients.each_index do |x|\n patient1 = test1.patients.fetch(x)\n patient2 = test2.patients.fetch(x)\n compare_records(patient1, patient2)\n end\n end", "def verify(app_id)\n # Chapter 4.3 in\n # http://fidoalliance.org/specs/fido-u2f-raw-message-formats-v1.0-rd-20141008.pdf\n data = [\n \"\\x00\",\n ::U2F::DIGEST.digest(app_id),\n ::U2F::DIGEST.digest(client_data_json),\n key_handle_raw,\n public_key_raw\n ].join\n\n begin\n parsed_certificate.public_key.verify(::U2F::DIGEST.new, signature, data)\n rescue OpenSSL::PKey::PKeyError\n false\n end\n end", "def test_can_have_apikey\n @test1 = CinePassion.new()\n assert_equal(@test1.apikey, \"test-api-key\")\n @test2 = CinePassion.new(\"fake-7945cb-fake\")\n assert_equal(@test2.apikey, \"test-api-key\")\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def test_is_valid\n\t\ttest_main = Main.new(3, 4, 6)\n\t\tassert_equal test_main.valid_location(\"Enumberable Canyon\"), 0\n\tend", "def test_correct_file_found\n @setup_issue_show.current_version = '2.3.1'\n assert_equal '2.3.1', @setup_issue_show.show_file.redmine_version, 'Did not find the exact match.'\n\n @setup_issue_show.current_version = '2.3.2'\n assert_equal '2.3.1', @setup_issue_show.show_file.redmine_version, 'Did not find the most recent match.'\n\n @setup_issue_show.current_version = '0.0.0'\n assert_nil @setup_issue_show.show_file\n end", "def with_project_id\n if project_id.present?\n table[:project_id].eq_any(project_id)\n else\n nil\n end\n end", "def test_parse_id_valid\n assert_equal 19, parse_id(\"19\")\n end", "def test_001\n # delete all existed projects\n delete_all_pus\n begin\n # there is no project\n open_pu_management_page\n wait_for_text_present(_(\"No PU has been registered\"))\n logout\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n # return the original data (2 pus)\n make_original_pus\n end", "def test_get_id\n assert_equal(1234,@book1.get_id())\n end", "def test_plan_id(project_name, plan_name)\n if @version < \"1.0\"\n project_id = project_id project_name\n test_plans = test_plans(project_id)\n\n test_plan = test_plans.first.values.find do |project_test_plan|\n project_test_plan[:name] == plan_name\n end\n else\n test_plan = test_plan_by_name(project_name, plan_name).first\n end\n\n test_plan.nil? ? nil : test_plan[:id].to_i\n end", "def verify_commits expected_commits\n expected_commits.diff! commits_in_current_repo(expected_commits.headers)\nend", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_document\n add_test_judgement\n assert(@gold_standard.contains_document? :id => \"doc1\")\n end", "def select_project_id(test_data)\n hide_notifications_bar\n logger.info \"Entering project ID '#{test_data[CoreUseOfCollectionsData::PROJECT_ID.name]}'\"\n wait_for_options_and_select(project_id_input, project_id_options, test_data[CoreUseOfCollectionsData::PROJECT_ID.name])\n end", "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[UseOfCollections::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def invisible_testSuccess(c, ci, cv, state)\n @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == c and terms[1] == ci}\nend", "def test_ut_t4_mtv_pu_002\n pu = Pu.find(2)\n assert_equal FALSE, pu.has_analyzed_task?\n end", "def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} has the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left != right, message)\n end", "def test_only_one_invitation_per_team\n duplicate_invitation = ImFreeAgentInvitation.new(:im_free_agent_id => im_free_agent_invitations(:invitation_from_division_team).im_free_agent_id,\n :im_team_id => im_free_agent_invitations(:invitation_from_division_team).im_team_id)\n assert !duplicate_invitation.save\n assert_equal \"has already been taken\" , duplicate_invitation.errors.on(:im_free_agent_id)\n #change team number and should save\n duplicate_invitation.im_team_id = 10\n assert duplicate_invitation.save\n end", "def test_create\n assert_equal 1, @sitem.id\n end", "def test_check_player_in__true\n result = @team.check_player_in(\"Valentina\")\n assert_equal(true,result)\n end", "def test_single_user_should_keep_test_results_under_c1\n test_target_instance = get_new_test_target_instance(\"example4\", \"2012112804\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 1, 1, 2)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_2', 1, 1, 2)\n #TODO assert view\n end", "def test_002\n # delete all existed projects\n delete_all_pus\n begin\n # there is no project\n open_pu_management_page\n assert is_element_not_present(xpath[\"pu_management\"][\"search_box\"])\n assert is_element_not_present(xpath[\"pu_management\"][\"pu_table\"])\n logout\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n # return the original data (2 pus)\n make_original_pus\n end", "def test_validation\n \n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-')\n pcba_pn = '500-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No - PCB, PCBA part numbers are not unique.\n pcba_pn = '600-123-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert( pn.error_message)\n assert_equal('The PCB part number (600-123-a0 a) and the PCBA part number ' +\n \"(600-123-00 b) must be unique - YOUR PART NUMBER WAS NOT CREATED\",\n pn.error_message)\n \n\n # Valid? - No - Format bad, short prefix\n pcb_pn = '12-123-a0'.split('-')\n pcba_pn = '34-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No - Format bad, illegal characters in the prefix\n pcb_pn = '12e-123-a0'.split('-')\n pcba_pn = 'pcb-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, wrong number of characters in the number\n pcb_pn = '127-3-a0'.split('-')\n pcba_pn = '128-21-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the number\n pcb_pn = '127-###-a0'.split('-')\n pcba_pn = '128-JPA-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the dash number\n pcb_pn = '127-714-*'.split('-')\n pcba_pn = '128-755-!&'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert(!pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes\n pcb_pn = '127-714-01'.split('-')\n pcba_pn = '128-755-a0'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n\n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No, pcb pn exists.\n pcb_pn = '252-700-b0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n \n # Valid? - No, pcb pn duplicates pcba pn \n pcb_pn = '259-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'b'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n # Valid? - No, pcb pn prefix contains the wrong number of characters \n pcb_pn = '12-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No, pcb pn prefix contains illegal characters \n pcb_pn = '12e-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains wrong number of characters \n pcb_pn = '127-3-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n #assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains illegal characters \n pcb_pn = '127-#*@-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn dash number contains wrong number of, and illegal, characters \n pcb_pn = '127-714-@'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes \n pcb_pn = '127-714-01'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n \n assert(!pn.exists?)\n assert_nil(pn.error_message)\n pn.save\n assert(pn.exists?)\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n\n assert(PartNumber.valid_prefix?('100'))\n assert(!PartNumber.valid_prefix?('1'))\n assert(!PartNumber.valid_prefix?('a'))\n assert(!PartNumber.valid_prefix?('10'))\n assert(!PartNumber.valid_prefix?('a7'))\n assert(!PartNumber.valid_prefix?('1aa'))\n assert(!PartNumber.valid_prefix?('a00'))\n assert(!PartNumber.valid_prefix?('1776'))\n assert(!PartNumber.valid_prefix?('a345'))\n \n assert(PartNumber.valid_number?('100'))\n assert(!PartNumber.valid_number?('1'))\n assert(!PartNumber.valid_number?('a'))\n assert(!PartNumber.valid_number?('10'))\n assert(!PartNumber.valid_number?('a7'))\n assert(!PartNumber.valid_number?('1aa'))\n assert(!PartNumber.valid_number?('a00'))\n assert(!PartNumber.valid_number?('1776'))\n assert(!PartNumber.valid_number?('a345'))\n \n assert(PartNumber.valid_dash_number?('a0'))\n assert(PartNumber.valid_dash_number?('0a'))\n assert(!PartNumber.valid_dash_number?('a'))\n assert(!PartNumber.valid_dash_number?('4'))\n assert(!PartNumber.valid_dash_number?('aa33'))\n assert(!PartNumber.valid_dash_number?('333'))\n \n # Create known part numbers for testing.\n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-802-00'.split('-')\n pcba_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-01'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n\n pn = PartNumber.initial_part_number\n pcb_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert(!pn.valid_components?('not'=='new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n pcba_pn = '700-900-90'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n \n pcba_pn = '000-000-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n end", "def verify_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def test_same_tv_show\n result = same_tv_show(@people)\n assert_equal({\"Pokemon\" => [\"Keith\", \"Val\"]}, result)\nend", "def test_user\n add_test_judgement\n assert(@gold_standard.contains_user? :id => \"John Doe\")\n end", "def equal_list(expected)\n message = \"#{Helpers.inspect_records(@object)} does not have the same records as #{Helpers.inspect_records(expected)}\"\n \n left = @object.map(&:id)\n right = expected.map(&:id)\n \n test_case.assert(left == right, message)\n end", "def assert_code_and_desc_ok(object)\n cloned = object.clone\n assert_presence_required(object,:code)\n assert_presence_required(object,:description)\n assert object.save,\"Failed to save object first time in uniqueness test; pass unique record first\"\n assert !cloned.save,\"Saved object twice while testing for uniqueness of :code and :description\"\n assert(cloned.errors[:code].to_s =~ /taken/, \"Missing or wrong error message for duplicate code\" )\n assert(cloned.errors[:description].to_s =~ /taken/, \"Missing or wrong error message for duplicate description\") \n end", "def test_codes\n @resources.each do |x|\n assert_not_nil x.resourcecode, \"#{x.id} has no resourcecode\"\n end\n end" ]
[ "0.82428104", "0.606331", "0.6037059", "0.600743", "0.5998955", "0.58873504", "0.58233535", "0.58202916", "0.5815638", "0.5767355", "0.5765058", "0.5727829", "0.57093954", "0.57072514", "0.5702081", "0.5693344", "0.56857747", "0.56680983", "0.5664844", "0.56332624", "0.5622702", "0.56016904", "0.5594586", "0.5588795", "0.55742735", "0.5571835", "0.55365705", "0.55027306", "0.54952574", "0.54935366", "0.5488228", "0.5432755", "0.54306155", "0.54298884", "0.5423385", "0.5419396", "0.54183507", "0.540555", "0.53773963", "0.5370268", "0.53653306", "0.536404", "0.5361535", "0.5357265", "0.5352384", "0.5329558", "0.53252", "0.5316338", "0.52954316", "0.52848125", "0.5283838", "0.52826375", "0.52740216", "0.5269865", "0.52669615", "0.5265521", "0.5264826", "0.5261666", "0.52587456", "0.5256444", "0.52499175", "0.5240904", "0.5239762", "0.52289355", "0.5226899", "0.5226758", "0.52091974", "0.5201245", "0.5194446", "0.5190583", "0.5179845", "0.51743054", "0.51726365", "0.5169753", "0.51683223", "0.516744", "0.5164652", "0.51627976", "0.516186", "0.5158131", "0.5155065", "0.51548296", "0.5149126", "0.51484764", "0.5145989", "0.5140938", "0.51406777", "0.51339704", "0.5122531", "0.5122399", "0.51206636", "0.51204216", "0.511632", "0.5114905", "0.5114652", "0.5111557", "0.5111407", "0.5101116", "0.50996155", "0.50976926" ]
0.824223
1
METHODS Selects or removes UoC methods per a given set of test data
def select_methods(test_data) test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name] hide_notifications_bar test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::METHOD_LIST.name)], test_methods) test_methods.each_with_index do |method, index| logger.info "Entering method data set at index #{index}: #{method}" wait_for_options_and_select(method_input(index), method_options(index), method[CoreUseOfCollectionsData::METHOD.name]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::METHOD_LIST.name)], test_methods)\n\n test_methods.each_with_index do |method, index|\n wait_for_options_and_select(method_input(index), method_options(index), method[UseOfCollections::METHOD.name])\n end\n end", "def verify_methods(test_data)\n test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name]\n test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[CoreUseOfCollectionsData::METHOD.name], element_value(method_input index)) }\n end", "def verify_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[UseOfCollections::METHOD.name], element_value(method_input index)) }\n end", "def delete_testds(testds)\n not_found = []\n testds.each do |testd_td|\n descriptor = Testd.where({ 'testd.name' => testd_td['name'],\n 'testd.vendor' => testd_td['vendor'],\n 'testd.version' => testd_td['version'] }).first\n if descriptor.nil?\n logger.error 'Test Descriptor not found ' + testd_td.to_s\n not_found << testd_td\n else\n if descriptor['pkg_ref'] == 1\n descriptor.destroy\n del_ent_dict(descriptor, :testd)\n else descriptor.update_attributes(pkg_ref: descriptor['pkg_ref'] - 1)\n end\n end\n end\n not_found\n end", "def doTests( *tests )\n tests.find_all {|name,data|\n ! doTest(name)\n }\nend", "def test_methods(patterns=[])\n return @test_methods if !@test_methods.nil?\n\n @test_methods = create.public_methods.find_all { |m|\n m.to_s =~ /^test_/\n }\n\n if !(patterns.nil? or patterns.empty?) then\n # filter\n @test_methods.reject!{ |m|\n patterns.find{ |t| m.to_s.include?(t.to_s) }.nil?\n }\n end\n\n @test_methods\n end", "def delete(*methods)\n @yuuki_methods ||= {}\n methods.each do |method|\n @yuuki_methods[method] ||= {}\n @yuuki_methods[method][:enabled] = false\n end\n end", "def unselect; end", "def test_035\n\n login\n\n # Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Selection for filtering\n assert_equal [_(\"PU name\"), _(\"Registration date\")], get_select_options(\"find_box\")\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n\n end", "def cleanupTestFiles\n ('A' .. 'F').each { |del| FileUtils.rm(\"#{folder}HR3-Room#{del}.csv\", force: true) } \n end", "def generalise\n Mutiny::Tests::TestSet.new(tests.map(&:generalise))\n end", "def _remove_all_method\n :\"_remove_all_#{self[:name]}\"\n end", "def _remove_all_method\n :\"_remove_all_#{self[:name]}\"\n end", "def eliminate_methods(methods, matcher)\n eliminated = []\n i = 0\n while i < methods.size\n method_info = methods[i]\n method_name = method_info.full_name\n if matcher === method_name\n raise \"can't eliminate root method\" if method_info.root?\n eliminated << methods.delete_at(i)\n method_info.eliminate!\n else\n i += 1\n end\n end\n eliminated\n end", "def remove_methods *ary\n ary.each do |methd|\n eval \"class << self; remove_method :'#{methd}'; end\"\n end\n end", "def test_execute\n #Adds a set in the pool that will be removed later.\n set = ResourceSet.new('SemanticExpression.new().spo(\\'<http://www.w3.org/2000/01/rdf-schema#Class>\\',\\'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>\\',\\'<http://www.w3.org/2000/01/rdf-schema#Class>\\')') \n #test refresh\n post :execute, :exp=> 'refresh(\\'' +set.rsid+ '\\')'\n assert @controller.resourceset.resources.size > 0 #assert that set was remove\n assert_response :success #assert that the request was executed successful\n #test remove \n post :execute, :exp=> 'remove(\\'' +set.rsid+ '\\')'\n assert Application.is_set?(set.rsid) #assert that set was remove\n assert_response :success #assert that the request was executed successful\n end", "def execute(input_set = nil)\n resp = super(input_set)\n results = RemoveCollaboratorResultSet.new(resp)\n return results\n end", "def testmethods\n @test_methods ||= []\n end", "def delete_operations; end", "def remove_all_method\n :\"remove_all_#{self[:name]}\"\n end", "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def remove_all_method\n :\"remove_all_#{self[:name]}\"\n end", "def setup_test_plates(operations:, method: nil)\n operations.each do |op|\n setup_test_plate(collection: op.input(PLATE).collection, method: method)\n end\n end", "def test_036\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n filtering('1')\n assert is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def update_test_cases\n unless test_case_ids.nil?\n self.plan_cases.each do |p|\n p.destroy unless test_case_ids.include?(p.test_case_id.to_s)\n test_case_ids.delete(p.test_case_id.to_s)\n end \n test_case_ids.each do |c|\n self.plan_cases.create(:test_case_id => c) unless c.blank?\n end\n reload\n self.test_case_ids = nil\n end\n end", "def test_032\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # Sort by name\n pus = Pu.find(:all,:order => 'name')\n\n # Click PU name\n\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'name')\n pus_second = Pu.find(:all,:order => 'name DESC')\n else\n pus = Pu.find(:all,:order => 'name DESC')\n pus_second = Pu.find(:all,:order => 'name')\n end\n\n for l in 1..@@no_pu\n assert_equal pus[l-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{l}.1\")\n end\n # secondly, sort by PU's name\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n for m in 1..@@no_pu\n assert_equal pus_second[m-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{m}.1\")\n end\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu.destroy\n @@pu2.destroy\n\n # Logout\n logout\n make_original_pus\n end", "def clear!\n \n # Removes old files in the test directory\n ['to', 'from'].each do |folder|\n Dir.glob(File.expand_path(File.dirname(__FILE__) + \"/data/#{folder}/*\")).each do |file|\n FileUtils.rm(file)\n end\n end\n \n {'some_zip_files.zip' => 'zip_real', 'test_package.rar' => 'rar_real'}.each_pair do |first, last|\n\n # Removes old files in the test directory\n Dir.glob(File.expand_path(File.dirname(__FILE__) + \"/data/#{last}/*\")).each do |file|\n FileUtils.rm(file) if Mimer.identify(file).text?\n end\n\n src = File.expand_path(File.dirname(__FILE__) + \"/data/o_files/#{first}\")\n dest = File.expand_path(File.dirname(__FILE__) + \"/data/#{last}/#{first}\")\n FileUtils.copy_file(src, dest)\n end\n\n # Removes old files in the test directory\n Dir.glob(File.expand_path(File.dirname(__FILE__) + \"/data/movie_to/*\")).each do |file|\n FileUtils.rm(file) if Mimer.identify(file).text?\n end\n \n {'test_package.rar' => 'to', 'some_zip_files.zip' => 'to'}.each do |first,last|\n src = File.expand_path(File.dirname(__FILE__) + \"/data/o_files/#{first}\")\n dest = File.expand_path(File.dirname(__FILE__) + \"/data/from/#{first}\")\n FileUtils.copy_file(src, dest)\n end\nend", "def select_by_class_clear(class_name)\n select_by_class(class_name).clear\nend", "def tests\n @tests ||= begin\n require \"m/test_collection\"\n require \"m/test_method\"\n # With each suite and array of tests,\n # and with each test method present in this test file,\n # shove a new test method into this collection.\n suites.each_with_object TestCollection.new do |(suite_class, test_methods), collection|\n test_methods.each do |test_method|\n collection << TestMethod.create(suite_class, test_method)\n end\n end\n end\n end", "def chkout_handling_method_buttons\n $tracer.trace(__method__)\n #unit_test_no_generate: chkout_handling_method_buttons, table.id(\"standard_handling_method_select\").find.tbody; GameStopMobileHandlingMethodRadioButtons\n return GameStopMobileHandlingMethodRadioButtons.new(\n ToolTag.new(table.id(\"standard_handling_method_select\").find.tbody, __method__, self), self)\n end", "def remove_case_from_test_run(testcase,run_id)\n testcase_id = get_id(testcase)\n run = get_run(run_id)\n unless run['include_all']\n case_ids = get_tests_in_a_run(run_id).map{|h| h['case_id']} - [testcase_id]\n update_run(run_id,{'case_ids'=>case_ids})\n end\n end", "def delete_tables\n delete_characters\n delete_kiosks\n delete_traps\n delete_buttons\n end", "def test_038\n\n login\n\n # Create some PUs\n\n for i in 1..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to date.\n select \"find_box\", \"label=#{_('Registration date')}\"\n assert_equal _(\"Registration date\"), get_selected_label(\"find_box\")\n\n # filtering\n filtering(@@year)\n assert is_text_present(\"2009-05-08\")\n assert !is_text_present(\"2008-05-08\")\n # you have no relevance\n filtering(@@year+'a')\n assert !is_text_present(\"2009-05-08\")\n assert !is_text_present(\"2008-05-08\")\n filtering(@@hour)\n assert is_text_present(\"2008-05-08\")\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def test_002\n # delete all existed projects\n delete_all_pus\n begin\n # there is no project\n open_pu_management_page\n assert is_element_not_present(xpath[\"pu_management\"][\"search_box\"])\n assert is_element_not_present(xpath[\"pu_management\"][\"pu_table\"])\n logout\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n # return the original data (2 pus)\n make_original_pus\n end", "def test_031\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n pu_name_a = 'puA'\n pu_name_b = 'puB'\n create_pu(pu_name_a)\n create_pu(pu_name_b)\n\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # firtly, sort by ID\n pus = Pu.find(:all,:order => 'id')\n\n # click ID link\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'id')\n pus_second = Pu.find(:all,:order => 'id DESC')\n else\n pus = Pu.find(:all,:order => 'id DESC')\n pus_second = Pu.find(:all,:order => 'id')\n end\n for j in 1..@@no_pu\n assert_equal pus[j-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{j}.1\")\n end\n # Click PU ID\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n for k in 1..@@no_pu\n assert_equal pus_second[k-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{k}.1\")\n end\n\n # Delete created data\n\n @@pu= Pu.find_by_name('puA')\n @@pu2= Pu.find_by_name('puB')\n @@pu.destroy\n @@pu2.destroy\n\n\n # Logout\n logout\n make_original_pus\n end", "def final_test_methods\n return []\n end", "def sample_csds_remove(facturama)\n puts \"===== Eliminar CSD asociado con un RFC- Inicio =====\"\n\n facturama.csds.remove(\"EKU9003173C9\")\n puts \"Se ha eliminado el CSD asociado al Rfc\"\n\n puts \"===== Eliminar CSD asociado con un RFC- Inicio =====\"\n end", "def test_code(flight_planner_instance)\n planner = flight_planner_instance\n tests = [\n [:can_i_fly?, [\"MIA\", \"JFK\"], true],\n [:can_i_fly?, [\"MIA\", \"ORD\"], false],\n [:can_i_fly?, [\"MIA\", \"XXX\"], false]\n]\n puts \"All tests passing? Yes!\" if tests.all? {|t| planner.send(t[0], *t[1]) == t[2]}\n #the 'send' method calls the method on the flight planner instance at the first index of tests array\n #with the arguments at the second index of tests, and checks if it's true to the third index\n\n failed_tests = tests.reject {|t| planner.send(t[0], *t[1]) == t[2]}\n response = \"All tests passing? No...\\n\"\n response << \"tests fail for: #{failed_tests.map{|t| t[1]}}\"\n puts response if failed_tests != []\n \nend", "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def clean_up\n reset_items_unit1\n reset_items_unit2\n end", "def update_test_suites_data(test_suite_data)\n return if $debug\n\n test_suite_data.each do |test_data|\n saved_test_suite = get_test_suite_from_test_data(test_data)\n suite_id = get_suite_id_from_saved_test_suite(saved_test_suite, test_data)\n test_data[:suite][:cases].each do |test_case|\n labels = get_labels_from_suite_and_case(test_data[:suite][:labels], test_case[:labels])\n label_ids = insert_and_return_label_ids(labels)\n update_test_case_and_test_case_label(suite_id, test_case, label_ids)\n end\n end\n @connector.disconnect\n end", "def execute(input_set = nil)\n resp = super(input_set)\n results = RemoveResultSet.new(resp)\n return results\n end", "def test_033\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n #Open PU management page\n open_pu_management_page_1\n\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # firtly, sort by PU's registration date\n pus = Pu.find(:all,:order => 'created_at')\n\n #Click registration date link\n click $xpath[\"misc\"][\"registration_link\"]\n\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'created_at')\n pus_second = Pu.find(:all,:order => 'created_at DESC')\n else\n pus = Pu.find(:all,:order => 'created_at DESC')\n pus_second = Pu.find(:all,:order => 'created_at')\n end\n\n for n in 1..@@no_pu\n assert_equal pus[n-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{n}.1\")\n end\n\n # secondly, sort by PU's registration date\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n for p in 1..@@no_pu\n assert_equal pus_second[p-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{p}.1\")\n end\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu.destroy\n @@pu2.destroy\n\n # Logout\n logout\n make_original_pus\n end", "def test_034\n #login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n sleep 2\n\n # register a pu\n create_pu('SampleC')\n\n sleep 2\n\n #Sort by ID\n pus = Pu.find(:all)\n\n click $xpath[\"misc\"][\"PU_link\"]\n sleep 2\n\n #Click ID link\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'id')\n pus_second = Pu.find(:all,:order => 'id DESC')\n else\n pus = Pu.find(:all,:order => 'id DESC')\n pus_second = Pu.find(:all,:order => 'id')\n end\n\n for j in 1..@@no_pu\n assert_equal pus[j-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{j}.1\")\n end\n\n # secondly, sort by ID\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n for k in 1..@@no_pu\n assert_equal pus_second[k-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{k}.1\")\n end\n\n # Sort by name\n pus = Pu.find(:all,:order => 'name')\n\n # Click PU name link\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'name')\n pus_second = Pu.find(:all,:order => 'name DESC')\n else\n pus = Pu.find(:all,:order => 'name DESC')\n pus_second = Pu.find(:all,:order => 'name')\n end\n\n for l in 1..@@no_pu\n assert_equal pus[l-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{l}.1\")\n end\n sleep 2\n # secondly, sort by PU's name\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n for m in 1..@@no_pu\n assert_equal pus_second[m-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{m}.1\")\n end\n\n # firtly, sort by PU's registration date\n pus = Pu.find(:all,:order => 'created_at')\n\n #Click registration date link\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'created_at')\n pus_second = Pu.find(:all,:order => 'created_at DESC')\n else\n pus = Pu.find(:all,:order => 'created_at DESC')\n pus_second = Pu.find(:all,:order => 'created_at')\n end\n for n in 1..@@no_pu\n assert_equal pus[n-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{n}.1\")\n end\n\n # secondly, sort by PU's registration date\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n for p in 1..@@no_pu\n assert_equal pus_second[p-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{p}.1\")\n end\n\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu3=Pu.find_by_name('SampleC')\n @@pu.destroy\n @@pu2.destroy\n @@pu3.destroy\n\n # Logout\n logout\n make_original_pus \n end", "def get_tests\n t = []\n\n defmod = Module.new{self.name='default'}\n\n selection = [@selection].flatten ; selection = [defmod] if selection.empty?\n crossover = [@crossover].flatten ; crossover = [defmod] if crossover.empty?\n mutator = [@mutator].flatten ; mutator = [defmod] if mutator.empty?\n\n selection.each{|s|\n crossover.each{|c| \n mutator.each{|m|\n t << [s,c,m]\n }\n }\n }\n t\n end", "def test_cases; end", "def test_037\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n\n # you have no relevance\n filtering('3')\n assert !is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n assert is_text_present(_('A PU does not exist.'))\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def test_039\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n #Open PU management page\n open_pu_management_page_1\n\n filtering(\"\")\n assert is_text_present('sample_pu1')\n assert is_text_present('sample_pu2')\n\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def delete_before_data(tests, object, test, rrefs)\n cust_before = @provider.get_code_multiline(tests, test[:path])\n if cust_before.nil?\n get = \"expect_network_get_#{test[:exists] ? 'success' : 'failed'}\"\n get_line = create_expectation(get, test[:has_name], object, 12)\n code = [get_line]\n\n if test[:exists]\n has_rrefs = !object.uri_properties\n .select { |p| p.is_a? Api::Type::ResourceRef }\n .empty?\n # Delete specifies name as a parameter, not as part of data\n params = []\n params = ['nil'] if test[:has_name] && has_rrefs\n params = ['\\'title0\\''] unless test[:has_name]\n\n code << create_expectation('expect_network_delete',\n true, object, 12, params, 1)\n\n unless object.async.nil?\n code << create_expectation('expect_network_get_async',\n test[:has_name], object, 12, [],\n 1)\n end\n end\n\n rrefs.each do |ref|\n next if ref.object == object\n name = Google::StringUtils.underscore(ref.object.name)\n # Puppet style refs include a seed\n code << create_expectation(\"expect_network_get_success_#{name}\",\n true, ref.object, 12, [],\n (ref.seed % MAX_ARRAY_SIZE) + 1)\n end\n\n code.flatten.uniq\n else\n # rubocop:disable Security/Eval\n eval(\"\\\"#{cust_before}\\\"\", binding, __FILE__, __LINE__)\n # rubocop:enable Security/Eval\n end\n end", "def delete_data(data_to_delete)\n if data_to_delete\n for data in data_to_delete do\n case data\n when \"todos\"\n self.todos.each{|todo| todo.destroy}\n when \"fittings\"\n self.fittings.each{|fitting| fitting.destroy}\n when \"services\"\n self.services.each{|service| service.destroy}\n when \"accessories\"\n self.accessories.each{|accessory| accessory.destroy if accessory.typ == :accessory}\n end\n end\n else\n return\n end\n end", "def remove_from_recommendations!\n sets = [] # SREM needed\n zsets = [] # ZREM needed\n keys = [] # DEL needed\n\n # Remove from other users' similarity ZSETs\n zsets += Recommendations.redis.keys(Recommendations::Helpers::RedisKeyMapper.similarity_set_for('*'))\n\n # Remove this user's similarity ZSET\n keys << Recommendations::Helpers::RedisKeyMapper.similarity_set_for(id)\n\n # For each ratable class...\n Recommendations.config.ratable_classes.each do |klass|\n # Remove this user from any class member's liked_by\n sets += Recommendations.redis.keys(Recommendations::Helpers::RedisKeyMapper.liked_by_set_for(klass, '*'))\n\n # Remove this user's liked/recommended sets for the class\n keys << Recommendations::Helpers::RedisKeyMapper.liked_set_for(klass, id)\n keys << Recommendations::Helpers::RedisKeyMapper.recommended_set_for(klass, id)\n end\n\n Recommendations.redis.pipelined do |redis|\n sets.each { |set| redis.srem(set, id) }\n zsets.each { |zset| redis.zrem(zset, id) }\n redis.del(*keys)\n end\n end", "def test_methods()\n tests = []\n stack = [@contexts.first]\n until stack.empty? do\n item = stack.pop\n stack += item.tests_and_subcontexts.reverse if item.is_a?(Context)\n tests << item if item.is_a?(String)\n end\n tests\n end", "def generate_alltestc\n\n end", "def apply(methods, suite)\n methods.find_all do |method|\n metadata = metadata_from_suite(suite, method)\n test_tags = test_tags_from_metadata(metadata)\n test_tags_include_all_filter_tags?(test_tags)\n end\n end", "def clean(paths)\n paths.uniq!\n paths.compact!\n populate_test_files\n paths = paths.select { |p| test_file?(p) }\n clear_tests_files_list\n paths\n end", "def remove_removal_item(list, c_list, klass)\n if list.present?\n if klass == DataGroupCountry\n # destroy list of countries\n self.aggregate_customs.only_countries.where(removable_id: list).delete_all\n # find and destroy all removed item is gateway children\n gateway_ids = DataGateway.where(country_id: list).select(\"id\").map(&:id)\n self.aggregate_customs.only_gateways.where(removable_id: gateway_ids).delete_all if gateway_ids.present?\n # find and destroy all removed item is entryway children\n entryway_ids = DataGateway.where(id: gateway_ids).joins(:data_entryways).select(\"data_entryway.id\").uniq.map(&:id)\n self.aggregate_customs.only_entryways.where(removable_id: entryway_ids).delete_all if entryway_ids.present?\n end\n\n if klass == DataGateway\n # destroy list of gateways\n self.aggregate_customs.only_gateways.where(removable_id: list).delete_all\n # find and destroy all removed item is entryway children\n entryway_ids = DataGateway.where(id: list).joins(:data_entryways).select(\"data_entryway.id\").uniq.map(&:id)\n self.aggregate_customs.only_entryways.where(removable_id: entryway_ids).delete_all if entryway_ids.present?\n end\n\n AggregateCustom.by_type(klass.to_s).where(removable_id: list).delete_all if(klass == DataEntryway)\n end\n end", "def test_029\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n #Register a new PU\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n\n # Get total rows in PU table\n total_rows = get_xpath_count($xpath[\"misc\"][\"result_list_PU_row\"])\n\n # for all table...\n (1..total_rows).each do |row_index|\n row_xpath = $xpath[\"misc\"][\"result_list_PU_row\"] + \"[#{row_index}]\"\n result_link_xpath = row_xpath + \"/td[5]/a[2]\"\n result_name_xpath = row_xpath + \"/td[2]\"\n get_text(result_name_xpath)\n\n if row_index == 1\n choose_cancel_on_next_confirmation()\n else\n # PU name is deleted.\n choose_ok_on_next_confirmation()\n end\n\n # clicks on link to delete PU\n click(result_link_xpath)\n\n pj_name = get_text(result_name_xpath)\n strmsg1 = _(\"All information of \")\n strmsg2 = _(\" will be deleted.\\n<PJ,master, analysis task, analysis result, analysis log>\\n\")\n strmsg3 = _(\"Really\")\n strmsg4 = _(\"Are you sure you want to delete\")\n strmsg = ''\n if $lang == 'ja'\n strmsg = \"#{pj_name}\" +strmsg1 + strmsg2 + strmsg3 + \"#{pj_name}\" + strmsg4 +\"?\"\n else\n strmsg = strmsg1 + \"#{pj_name}\" + strmsg2 + strmsg4 + \" #{pj_name}\" +\"?\"\n end\n\n # The dialog which checks deletion comes out.\n assert_equal( strmsg,get_confirmation)\n\n @@pu.destroy\n\n end\n # logout\n logout\n make_original_pus\n end", "def clear_comparisons\n\t\t@selected_timepoints = params[:selected_timepoints]\n\t\t@selected_tp_array = @selected_timepoints.split(\"_\")\n\t\t@outcome_id = params[:outcome_id]\n\t\t@subgroup_id = params[:subgroup_id]\n\t\t@study_id = params[:study_id]\n\t\t@extraction_form_id = params[:extraction_form_id]\n\t\tcomparison_type = params[:comparison_type]\n\t\t@outcome = Outcome.find(@outcome_id)\n\t\t@is_diagnostic = ExtractionForm.is_diagnostic?(@extraction_form_id)\n\t\tif OutcomeDataEntry.remove_comparison_data(comparison_type, @outcome_id, @subgroup_id, @study_id, @extraction_form_id)\n\t\t #flash[:notice] = \"Comparisons were successfully deleted.\"\n\t\telse\n\t\t\t\n\t\tend\n\t\t\n\t\tunless params[:subgroup_id].nil?\n\t\t\t@subgroup = OutcomeSubgroup.find(params[:subgroup_id])\n\t\telse\n\t\t\t@subgroup = nil\n\t\tend\n\t\t\n\t\t@checkbox_timepoints = @outcome.outcome_timepoints\n\t\t\n\t\t# If this extraction form deals with RCT data...\n\t\tif !@is_diagnostic\n\t \t\t@selected_timepoints = OutcomeDataEntry.get_selected_timepoints(@outcome,@subgroup)\n\n\t \t\t@outcome_id, @study_id,@extraction_form_id, @selected_tp_array, @timepoints, @OCDEs, \n\t\t\t@measures, @datapoints, @arms, @comparisons, @comparison_measures, @comparators, \n\t\t\t@all_comparators, @num_comparators, @comparison_datapoints, @wa_comparisons, @wa_measures, \n\t\t\t@wa_comparators, @wa_all_comparators, @wa_datapoints, @footnotes = OutcomeDataEntry.get_information_for_entry_table(@outcome,@subgroup,@selected_timepoints)\n\n\t\t# Otherwise, gather the diagnostic test comparison data.\n\t\telse\n\t\t\tall_tps = @outcome.outcome_timepoints.collect{|x| x.id.to_s}.join(\"_\")\n\t\t\t@selected_timepoints = {1=>all_tps, 2=>all_tps, 3=>all_tps}\n\n\t\t\t@outcome_id, @study_id, @extraction_form_id, @selected_tp_array, @timepoints, @comparisons, \n\t\t\t@comparators, @all_comparators, @comparison_measures, @comparison_datapoints, @index_tests, \n\t\t\t@reference_tests, @thresholds, @footnotes = OutcomeDataEntry.get_diagnostic_test_results(@outcome,@subgroup,@selected_timepoints)\n\n\t\t\t@index_test_options, @reference_test_options = DiagnosticTest.get_select_options(@index_tests,@reference_tests,@thresholds)\n\t\tend\n\t\t#----------------\n\t\t\tef = ExtractionForm.find(@extraction_form_id)\n\t\t\t@project_id = ef.project_id \n\t \trender \"/outcome_data_entries/show_timepoints\"\n\tend", "def clear_tests_files_list\n @tests_files = nil\n end", "def setup_test(operations, ot_type_name)\n operations.make\n operations.each do |op|\n output_collection = op.output('PCR Plate').collection\n rows = output_collection.dimensions[0]\n sample_names = ['RP', '2019-nCoVPC_N1', '2019-nCoVPC_N2']\n (rows/(sample_names.length)).times do\n sample_names.each do |name|\n collection = Collection.new_collection(ot_type_name)\n samples = Array.new(collection.dimensions[0], Sample.find_by_name(name))\n collection.add_samples(samples)\n end\n end\n end\n end", "def process_test_cases\n raise NotImplementedError, 'You must implement this'\n end", "def deletevalidation(api,field)\n if api == \"get-age\" && field == \"age\"\n @call=apivalidation(\"#{api}\",\"#{field}\")\n if @call.include? '100'\n return \"Mismatch\"\n else\n return \"Match\"\n end\n elsif ((api == \"get-country-state-mappings\" && field == \"state\") ||\n (api == \"get-regions\" && field == \"region\"))\n @call=apivalidationmul(\"#{api}\")\n @call.each do |call|\n if ((call.include? 'TestState') ||\n (call.include? 'Test Region'))\n return \"Mismatch\"\n else\n return \"Match\"\n end\n end\n\n else\n @call=apivalidation(\"#{api}\",\"#{field}\")\n if @call.include? 'Test New'\n return \"Mismatch\"\n else\n return \"Match\"\n end\n end\nend", "def deselect\n execute_only(:deselect)\n end", "def test_028\n\n # login\n login\n # Open PU management page\n open_pu_management_page\n # Get total rows in PU table\n total_rows = get_xpath_count($xpath[\"pu\"][\"pu_list_row\"])\n # delete pu\n row_xpath = $xpath[\"pu\"][\"pu_list_row\"] + \"[#{total_rows}]\"\n result_link_xpath = row_xpath + \"/td[5]/a[2]\"\n result_name_xpath = row_xpath + \"/td[2]\"\n # clicks on link to delete PU\n click(result_link_xpath)\n # The dialog which checks deletion comes out.\n pj_name = get_text(result_name_xpath)\n strmsg1 = _(\"All information of \")\n strmsg2 = _(\" will be deleted.\\n<PJ,master, analysis task, analysis result, analysis log>\\n\")\n strmsg3 = _(\"Really\")\n strmsg4 = _(\"Are you sure you want to delete\")\n strmsg = ''\n if $lang == 'ja'\n strmsg = \"#{pj_name}\" +strmsg1 + strmsg2 + strmsg3 + \"#{pj_name}\" + strmsg4 +\"?\"\n else\n strmsg = strmsg1 + \"#{pj_name}\" + strmsg2 + strmsg4 + \" #{pj_name}\" +\"?\"\n end\n assert_equal(strmsg , get_confirmation)\n # logout\n logout\n make_original_pus\n end", "def remove_via_api!\n QA::Runtime::Logger.debug(\"#{self.class.name} - deferring removal until after suite\")\n end", "def test_items()\n @items.select do |i|\n i.identifier =~ test_re\n end\n end", "def test_set_method_types\n end", "def generate_alltest\n\n end", "def test_source_getall()\n # 1. no sources\n assert_equal [], One::EmailDirect::Facade.source_getall(@credentials)\n\n\n # 2. one source\n One::EmailDirect::Facade.source_add(@credentials, @source_getall1[:name], @source_getall1[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 3. two sources\n One::EmailDirect::Facade.source_add(@credentials, @source_getall2[:name], @source_getall2[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }, {\n :element_name => @source_getall2[:name],\n :description => @source_getall2[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 4. three sources\n One::EmailDirect::Facade.source_add(@credentials, @source_getall3[:name], @source_getall3[:description])\n result = One::EmailDirect::Facade.source_getall(@credentials)\n expected = [{\n :element_name => @source_getall1[:name],\n :description => @source_getall1[:description]\n }, {\n :element_name => @source_getall2[:name],\n :description => @source_getall2[:description]\n }, {\n :element_name => @source_getall3[:name],\n :description => @source_getall3[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n end", "def delete_users_choices\n choices = get_choices\n choices.each do |choice|\n choice.delete\n end\n end", "def finder_methods=(_arg0); end", "def stest_method_1(test); end", "def _rh_do_control_remove(result, remove)\n remove.each { |element| result.delete(element) }\n end", "def run(test_methods)\n test_results = []\n\n test_methods.each do |test_method|\n runmethod(test_method.to_s, test_method, test_results)\n end\n\n dump_results(test_results) if @outputdir\n if (@command_line_output and not @connection_error)\n output_results(test_results)\n end\n test_results\n end", "def unStartedTests\n ret = Array.new\n @testCases.each { |t| ret << t.name unless t.ran? }\n ret\n end", "def clear_tests_for(tests_suite)\n @tests_suites[tests_suite].clear_tests\n end", "def remove(*)\n super.tap do\n submission.set_simulation(__method__) if simulating\n end\n end", "def uci(testrun)\n # get test suite\n suite = TestSuites.find(testrun.test_suites_id)\n\n # pull the uci suite data\n test_obj = GRTesting::UciTest.new(title: testrun['test name'], browser: testrun['driver'], validations: testrun.test_steps, id: testrun.id)\n # Add platform as a part of the campaign Hash object\n if(!suite.email_random)\n if(suite.emailnotification.include?(';'))\n conf_email_to_use = suite.emailnotification.split(';')[0].strip() \n else\n conf_email_to_use = suite.emailnotification\n end\n else\n conf_email_to_use = Time.now.to_i.to_s + \".73b4fc03@mailosaur.in\"\n end\n test_obj.email = conf_email_to_use\n\n # Add Metadata to report object\n test_obj.report.author = \"Automation\"\n test_obj.report.environment = testrun['Env']\n\n # Add the test settings to the test object\n test_obj.testtype = testrun['testtype']\n test_obj.platform = testrun['driverplatform']\n test_obj.browsertype = testrun['driver']\n \n begin\n test_obj.custom_settings = YAML.load(testrun['custom_settings'])\n rescue => e\n\n end\n\n # get the testrun url\n target = testrun.url\n\n # get test suite\n suite = TestSuites.find(testrun.test_suites_id)\n\n # update its status for running suite\n suite.Status = \"Running\"\n\n # save the record\n suite.save!\n\n\n # if the target url is not properly formatted with protocol for testing\n if(!target.include?(\"http\"))\n\n # prepend the default protocol and resume test\n url = \"http://#{target}\"\n\n else\n\n # set to url if correctly formatted\n url = target\n\n end\n\n # load the url into the test object\n test_obj.url = url\n\n # run the test case\n test_obj.run()\n\n # check for needed updates to suite\n update_suite(suite)\n\n # return completed object for debugging or testing\n return test_obj\n end", "def test_create\n #create a new resourceset\n post :create, :exp=> 'SemanticExpression.new.union(:s,Namespace.lookup(:rdf,:type),Namespace.lookup(:rdfs,:Class))'\n assert @controller.resourceset.resources.size > 0 #assert that set was remove\n assert_response :success #assert that the request was executed successful\n \n end", "def unchosen\n the_set = []\n self.itemlist.each { |k,v| the_set << self.object(k).unchosen }\n the_set\n end", "def test_delete_Module\n printf \"\\n@T:#{__method__}\\n\"\n @root = XMLParse.read(\"./tp/test001.xml\")\n golden = [\"D78F1070_EVA\",\n \"QLK0RCPUEVA0V3\",\n \"QLK0RCPUEVA0V3_ADR\",\n \"QLK0RCPUEVA0V3_ALU\",\n \"QLK0RCPUEVA0V3_EXE2\",\n \"QLK0RCPUEVA0V3_CLK\",\n \"QLK0RCPUEVA0V3_DEC\"]\n XMLParse::delete_Module(@root,\"QLK0RCPUEVA0V3_EXE\")\n assert_equal(golden,XMLParse::get_ModuleList(@root))\n\n end", "def clean(options)\n options[:softbin] ||= options.delete(:sbin) || options.delete(:soft_bin)\n options[:number] ||= options.delete(:test_number) || options.delete(:tnum) ||\n options.delete(:testnumber)\n options[:name] ||= options.delete(:tname) || options.delete(:testname) ||\n options.delete(:test_name)\n options[:index] ||= options.delete(:ix)\n end", "def test_io_category_selection\n \n categories = ['Board Preparation', 'Placement',\n 'Routing', 'Fabrication Drawing',\n 'Nomenclature', 'Assembly Drawing',\n 'Other']\n\n # Try accessing from an account that is not a PCB Designer and\n # verify that the user is redirected.\n get(:oi_category_selection, {:design_id => @mx234a.id}, pat_dfm_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n # Verify that a Teradyne PCB Designer can access the list.\n get(:oi_category_selection, { :design_id => @mx234a.id }, scott_designer_session)\n assert_response(:success)\n assert_not_nil(assigns(:design))\n assert_equal(@mx234a.id, assigns(:design).id)\n assert_equal('252-234-a0 g', assigns(:design).part_number.pcb_display_name)\n \n assert_not_nil(assigns(:oi_category_list))\n oi_category_list = assigns(:oi_category_list)\n assert_equal(categories.size, oi_category_list.size)\n categories.each_index do |i| \n assert_equal(categories[i], oi_category_list[i].name) \n end\n \n # Verify that a contractor PCB Designer can access the list.\n get(:oi_category_selection, { :design_id => @mx234a.id }, siva_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n end", "def remove_methods_etc\n initialize_methods_etc\n end", "def remove; end", "def remove; end", "def remove; end", "def remove; end", "def test_list\n list = []\n instance_methods.each do |m|\n next unless m.to_s =~ /^(ok|no)[_ ]/\n list << m\n end\n list\n end", "def selecionErr(method)\n\n tnTableCreation('tuple_node_test_result') if @is_new\n\n if @unwanted_tuple_count + @missing_tuple_count == 0\n p 'no failed rows found. There is no selection error'\n return\n end\n\n if @unwanted_tuple_count > 0\n # p \"Unwanted Pk count #{unWantedPK.count()}\"\n # create unwanted_tuple_branch table\n # binding.pry\n\n # whereErrList = whereCondTest(@unWantedPK, 'U')\n where_cond_test('U')\n # joinErrList = jointypeErr(query,'U')\n end\n\n if @missing_tuple_count > 0\n # p \"Missing PK count #{missinPK.count()}\"\n # binding.pry\n # whereErrList = whereCondTest(@missingPK, 'M')\n where_cond_test('M')\n # joinErrList = jointypeErr(query,'M')\n end\n # create aggregated tuple_suspicious_nodes\n pk = @pkFullList.map { |pk| pk['alias'] }.join(',')\n query = 'create materialized view tuple_node_test_result_aggr as '\\\n \"select #{pk}, string_agg(branch_name||'-'||node_name, ',' order by node_name,branch_name) as suspicious_nodes from tuple_node_test_result group by #{pk}\"\n pp query\n DBConn.exec(query)\n\n unless @predicateTree.nil?\n suspicious_score_upd(@predicateTree.branches)\n end\n # exnorate algorithm\n # binding.pry\n @column_combinations = method.start_with?('o') ? Columns_Combination.new(@all_columns) : @all_columns\n case method\n # when 'o'\n # puts 'old exonerate algorithm'\n\n # true_query_PT_construct\n # constraint_query = constraint_predicate_construct\n # # column_combinations_construct\n # tuple_mutation_test(@missingPK, 'M', constraint_query, false)\n # tuple_mutation_test(@unWantedPK, 'U', constraint_query, false)\n when 'or'\n puts 'old exonerate algorithm with duplicate removal'\n # reset suspicious score\n query = \"update node_query_mapping set suspicious_score = 0 where type = 'f'\"\n res = DBConn.exec(query)\n\n true_query_PT_construct\n constraint_query = constraint_predicate_construct\n # allcolumns_construct()\n puts 'Missing starts'\n puts Time.now()\n tuple_mutation_test_with_dup_removal('M', constraint_query)\n puts 'Unwanted starts'\n puts Time.now()\n\n tuple_mutation_test_with_dup_removal('U', constraint_query)\n # when 'n'\n # puts 'new exonerate algorithm'\n # true_query_PT_construct\n # constraint_query = constraint_predicate_construct\n # tuple_mutation_test_reverse(@missingPK, 'M', constraint_query, false)\n # tuple_mutation_test_reverse(@unWantedPK, 'U', constraint_query, false)\n\n when 'b'\n puts 'baseline'\n else\n puts 'Unknown method'\n end\n # remove constraint_nodes in node_query_mapping\n query = \"delete from node_query_mapping where test_id = #{@test_id} and type = 't'\"\n DBConn.exec(query)\n\n # j = Hash.new\n # # j['JoinErr'] = joinErrList if joinErrList.count >0\n # j['WhereErr'] = whereErrList\n # j\n # whereErrList\n end", "def teardown_test_chamber\n if TestChamber::Config[:tc_partner_delete]\n TestChamber::Models::Partner.destroy_all(id: Array(TestChamber.created_partners))\n end\nend", "def test2ActionsDifferentTools\n executeTest(\n 'DummyUser',\n {\n 'DummyTool' => {\n 'DummyAction' => [\n []\n ]\n },\n 'DummyTool2' => {\n 'DummyAction2' => [\n []\n ]\n }\n }\n )\n end", "def unmock(*methods)\n do_unmock(methods)\n end", "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "def remove_all_diffs_and_tests\n UiChanged::Screenshot.remove_all_diffs_and_tests\n head :ok\n end", "def test_ut_da10b_t1_16\n p \"Test 16\"\n pu =Pu.new( :name => \"SamplePU3\" )\n # gets a list of pjs belong to selected pu\n pjs = pu.get_pjs_belong_to_pu\n assert_equal [], pjs\n end", "def unregister_capabilities(methods); end", "def test_replacements(tests, method, options = {})\n tests.each do |test|\n text = Ramparts.send(method, test[:text], options) do\n INSERTABLE\n end\n if text.casecmp(test[:filtered]) != 0\n raise \"Expected: #{test[:filtered]}\\nGot: #{text}\\nBlock '#{test[:filtered]}'\"\n end\n end\nend", "def teardown\n District.delete_all\n end" ]
[ "0.70495033", "0.5854722", "0.58523846", "0.54527867", "0.5427867", "0.53290844", "0.5313165", "0.52532786", "0.5209976", "0.52067477", "0.5191136", "0.5143307", "0.51115346", "0.50907755", "0.50867933", "0.5065239", "0.50629497", "0.5032853", "0.5029713", "0.50059325", "0.5001764", "0.4995924", "0.49899405", "0.49861175", "0.49753216", "0.4963521", "0.49564323", "0.49297082", "0.49265546", "0.49159896", "0.49130678", "0.49069297", "0.49068233", "0.48994285", "0.48968858", "0.4881602", "0.48806867", "0.48799622", "0.48740068", "0.48734733", "0.4872618", "0.487074", "0.4864872", "0.48425952", "0.48398775", "0.4838067", "0.48299265", "0.48243737", "0.48219743", "0.48187044", "0.4818674", "0.48020485", "0.4795365", "0.4789808", "0.47882712", "0.47879863", "0.47845268", "0.47843134", "0.47815627", "0.47727436", "0.47707522", "0.4766047", "0.47544912", "0.47491544", "0.47441924", "0.4709939", "0.47053504", "0.46994993", "0.46959856", "0.46768588", "0.46697494", "0.46631357", "0.46604478", "0.46530375", "0.4651089", "0.46509558", "0.46476978", "0.46474692", "0.46437472", "0.46362197", "0.46343434", "0.46301532", "0.462011", "0.46196246", "0.46191117", "0.46191117", "0.46191117", "0.46191117", "0.46168423", "0.4615888", "0.46125203", "0.4612261", "0.4608625", "0.46036837", "0.4603098", "0.46026632", "0.4601586", "0.45868453", "0.45804408", "0.4569367" ]
0.7028503
1
Verifies that the methods match test data
def verify_methods(test_data) test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name] test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods test_methods.each_with_index { |test_method, index| verify_values_match(test_method[CoreUseOfCollectionsData::METHOD.name], element_value(method_input index)) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[UseOfCollections::METHOD.name], element_value(method_input index)) }\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def assert_equality_of_methods( expected, actual, *methods )\n failed = false\n \n results_msg = {}\n results_msg[:expected] = \"The following methods were not equal: \\nExpected: #{mu_pp(expected)}\"\n results_msg[:actual] = \"\\n--------------------\\nActual: #{mu_pp(actual)}\"\n \n \n for method in methods\n no_error_on_method = true\n responses = {}\n \n for obj, response_sym in [[expected, :expected], [actual, :actual]]\n responses[response_sym] = begin\n obj.send( method )\n rescue StandardError => e\n e\n end\n \n if responses[response_sym].is_a?( StandardError )\n failed = true\n no_error_on_method = false\n results_msg[response_sym] << \"\\n\\t#{method}(): ERROR: #{responses[response_sym].class} #{responses[response_sym].message}\"\n end\n end\n \n if responses[:expected] != responses[:actual] && no_error_on_method\n failed = true\n \n for response_sym in [:expected, :actual]\n results_msg[response_sym] << \"\\n\\t#{method}(): #{responses[response_sym].inspect}\"\n end\n end\n end\n \n \n assert !failed, results_msg[:expected] + results_msg[:actual]\n end", "def make_assertions_on_tests( tests, method )\n assert_equal false, tests[:bad].__send__( method )\n assert_equal true, tests[:good].__send__( method )\n assert_equal true, tests[:extra_good].__send__( method )\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def test_exercise_1115\n verify_method :exercise_1115,\n :with => [{params: [[0], 1], expect: [1]},\n {params: [[0], 2], expect: [1, 0]},\n {params: [[1, 1], 2], expect: [0, 2]},\n {params: [[1, 2, 3, 3, 3, 4], 5], expect: [0, 1, 1, 3, 1]}]\n end", "def verify\n end", "def verify\n\n end", "def verify\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def test_exercise_1111\n verify_method :exercise_1111,\n :with => [{param: [[true]], expect: \" 1\\n1*\\n\"},\n {param: [[false]], expect: \" 1\\n1 \\n\"},\n {param: [[true, false]], expect: \" 12\\n1* \\n\"},\n {param: [[true, false], [true, false]], expect: \" 12\\n1* \\n2* \\n\"}]\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def verify()\n # TODO\n end", "def test_truth\n end", "def test_verify\n # Start out unavailabl\n assert_raise(Puppet::Network::InvalidClientRequest) do\n @obj.verify(@request)\n end\n class << @obj\n def available?(req)\n true\n end\n end\n assert_raise(Puppet::Network::InvalidClientRequest) do\n @obj.verify(@request)\n end\n class << @obj\n def authorized?(req)\n true\n end\n end\n assert_nothing_raised do\n @obj.verify(@request)\n end\n end", "def test_e121_point_distance\n (1..30).each {#Idempotence verification\n verify_method :e121_point_distance,\n :with => [{\n param: 2,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(2, points_pairs, shortest)\n }},\n {\n param: 3,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(3, points_pairs, shortest) }\n },\n {\n param: 5,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(5, points_pairs, shortest) }\n },\n {\n param: 9,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(9, points_pairs, shortest) }\n },\n {\n param: 30,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(30, points_pairs, shortest) }\n }]\n }\n end", "def compare_tests(test_a, test_b); end", "def compare_tests(test_a, test_b); end", "def valid? # :nodoc:\n return false unless respond_to?(@method_name)\n test_method = method(@method_name)\n if @internal_data.have_test_data?\n return false unless test_method.arity == 1\n else\n return false unless test_method.arity <= 0\n end\n owner = Util::MethodOwnerFinder.find(self, @method_name)\n if owner.class != Module and self.class != owner\n return false\n end\n true\n end", "def expected_method; end", "def asserttest(meth, arr)\n arr.each do |n|\n assert conv(n[0]).send(meth) == n[1],\n conv(n[0]).send(meth).inspect\n end\n end", "def verify_args(method, args)\n matches = Chassis.signatures[method].select do |key|\n args[key]\n end\n \n misses = Chassis.signatures[method] - matches\n \n unless misses.empty?\n raise \"Required arguments missing for '#{method}': #{misses.join(\", \")}\"\n end\n end", "def verify_functions(test_data)\n test_functions = test_data[Org::FUNCTIONS.name]\n errors = []\n test_functions = [{ Org::FUNCTION.name => ''}] unless test_functions\n test_functions.each_with_index do |test_function, index|\n text_values_match?(test_function[Org::FUNCTION.name], element_value(function_input(index)), errors)\n end\n errors\n end", "def test_magic_ball_methods\n magic_ball = Predictor.new\n assert_respond_to magic_ball, :ask\n assert_respond_to magic_ball, :shake\n refute_respond_to magic_ball, :roll\n end", "def test_validate_user_info\n data = {\n username: \"\",\n password: \"1234567890\",\n password_confirmation: \"1234567890\",\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n #Call function insert_user in model V1::User\n user = V1::User.insert_user(data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 1001\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def verify_stubbed_calls; end", "def test_exercise_1120\n verify_method :exercise_1120,\n :with => [{param: 1, expect: Math.log(1).truncate},\n {param: 2, expect: Math.log(2).truncate},\n {param: 4, expect: Math.log(4 * 3 * 2).truncate},\n {param: 3, expect: Math.log(3 * 2).truncate}]\n end", "def check_methods(methods, force=false)\n min_api = verify_min_sdk.to_i\n target_api = verify_target_sdk.to_i\n\n # Remove methods changed outside of the scope of the sdk versions\n methods = methods.select{|i| not i.attribute('api_added') or i.attribute('api_added').to_i <= target_api}\n methods = methods.select{|i| not i.attribute('deprecated') or i.attribute('deprecated').to_i > min_api}\n methods = methods.select{|i| not i.attribute('api_removed') or i.attribute('api_removed').to_i > min_api}\n\n # Inform and remove methods that do not exist in one of the sdk versions\n methods = methods.select do |i|\n if i.attribute('api_removed') and i.attribute('api_removed').to_i <= target_api\n puts \"Can't create #{i.method_signature} -- removed in #{i.attribute('api_removed')}\"\n false\n else\n true\n end\n end\n\n new_methods = methods\n unless force\n # Inform and remove methods changed inside the scope of the sdk versions\n new_methods = methods.select do |i|\n if i.attribute('api_added') and i.attribute('api_added').to_i > min_api\n puts \"Can't create #{i.method_signature} -- added in #{i.attribute('api_added')} -- exclude or force\" \n false\n elsif i.attribute('deprecated') and i.attribute('deprecated').to_i <= target_api\n puts \"Can't create #{i.method_signature} -- deprecated in #{i.attribute('deprecated')} -- exclude or force\" \n false\n else\n true\n end\n end\n\n abort(\"Aborting!\") if methods.count != new_methods.count\n end\n\n new_methods\nend", "def check_method_formals(ast_class_name, method, class_lut)\n\n\tformals = method.formals\n\tmethod_name = method.name\n\n\t# Check that no formal is named 'self' in this method\n\tfor formal in formals\n\t\tcheck_formal_self(ast_class_name, method_name, formal)\n\tend\n\n\t# Check that formals are uniquely defined in this method\n\tfor formal in formals\n\t\tcheck_formal_redefined(ast_class_name, method_name, formals, formal)\n\tend\n\n\t# Check that formals have valid types in this method\n\tfor formal in formals\n\t\tcheck_formal_type(ast_class_name, method_name, formal, class_lut)\n\tend\nend", "def check_method_formals(ast_class_name, method, class_lut)\n\n\tformals = method.formals\n\tmethod_name = method.name\n\n\t# Check that no formal is named 'self' in this method\n\tfor formal in formals\n\t\tcheck_formal_self(ast_class_name, method_name, formal)\n\tend\n\n\t# Check that formals are uniquely defined in this method\n\tfor formal in formals\n\t\tcheck_formal_redefined(ast_class_name, method_name, formals, formal)\n\tend\n\n\t# Check that formals have valid types in this method\n\tfor formal in formals\n\t\tcheck_formal_type(ast_class_name, method_name, formal, class_lut)\n\tend\nend", "def test_exercise_1114\n verify_method :exercise_1114,\n :with => [{param: 2, expect: Math.log2(2).truncate},\n {param: 3, expect: Math.log2(3).truncate},\n {param: 9, expect: Math.log2(9).truncate},\n {param: 90, expect: Math.log2(90).truncate}]\n end", "def test_Method_InstanceMethods_eql?\n\t\t# Inside eql?\n\t\tdef fred() return \"a\"+\"b\" end\n\t\talias bert fred\n\t\tm1 = method(:fred)\n\t\tm2 = method(:bert)\n\t\tassert_equal(true, m1.eql?(m2))\n\tend", "def check_method_existance!\n return false if defined?(Rake) && Rake.application.top_level_tasks.include?(\"db:migrate\")\n\n nonexist_groups = self.groups.select do |group|\n !self.methods.include?(group)\n end\n\n nonexist_payload_columns = self.payload_columns.select do |col|\n !self.instance_methods.include?(col) and !self.column_names.include?(col)\n end\n\n raise \"Doesn't find group methods in #{self.name}:#{nonexist_groups.inspect}\" if nonexist_groups.present?\n raise \"Doesn't find payload column methods in #{self.name}:#{nonexist_payload_columns.inspect}\" if nonexist_payload_columns.present?\n end", "def validate(curve)\n initialize # reset\n methods_matching(/^(verify|recommend)/).each do | method_name |\n method(method_name).call(curve)\n end\n @performed = true\n end", "def test_code(flight_planner_instance)\n planner = flight_planner_instance\n tests = [\n [:can_i_fly?, [\"MIA\", \"JFK\"], true],\n [:can_i_fly?, [\"MIA\", \"ORD\"], false],\n [:can_i_fly?, [\"MIA\", \"XXX\"], false]\n]\n puts \"All tests passing? Yes!\" if tests.all? {|t| planner.send(t[0], *t[1]) == t[2]}\n #the 'send' method calls the method on the flight planner instance at the first index of tests array\n #with the arguments at the second index of tests, and checks if it's true to the third index\n\n failed_tests = tests.reject {|t| planner.send(t[0], *t[1]) == t[2]}\n response = \"All tests passing? No...\\n\"\n response << \"tests fail for: #{failed_tests.map{|t| t[1]}}\"\n puts response if failed_tests != []\n \nend", "def check_values\n assert_equal 'foo', @test.name\n assert_equal 1, TestModel.count\n assert_equal 1, self.class.block_calls\n end", "def test_check_palindrome\n check = Palindrome.new\n assert_respond_to(check, :check_palindrome)\n end", "def verify\n if @count > 0\n flunk \"mocked method %p not called %d time(s)\" %\n [@meth, @count]\n end\n self\n end", "def test test_cases, f\n test_cases.each do |s, l, e|\n a = send(f, s, l)\n print \"#{f} #{s}, #{l} = #{a} ... \"\n if a == e\n puts 'PASS'\n else\n puts 'FAIL'\n end\n end\nend", "def test_function_check_username_and_password_existed\n username = \"ladywind\"\n password = \"1234567890\"\n actual = V1::User.check_username_and_password_existed(username,password)\n expected = true\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def verify(method_name, &block)\n internal_verify method_name, :instance, &block\n end", "def checks; end", "def test_two_valid_arguments\n\t\tc = Check.new\n\t\trefute c.check_arguments([1,1])\n\tend", "def test_function_update_user_unsuccessfully\n data = {\n firstname: \"\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n user_id = 28\n #Call function insert_user in model V1::User\n user = V1::User.update_user(user_id,data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 1001\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_Method_InstanceMethods_to_proc\n\t\tpass\n\tend", "def stest_method_1(test); end", "def test_added_methods\r\n assert_respond_to @default_user, :roles\r\n assert_respond_to @default_user, :has_role?\r\n \r\n assert_respond_to @default_user, :permissions\r\n assert_respond_to @default_user, :has_static_permission?\r\n end", "def test_function_get_all_post_user_successfully\n\n user_id = 28\n\n posts = V1::User.get_all_post_user(user_id,'id desc',1,10)\n\n actual = posts[:meta][:code]\n\n expected = 200\n \n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def method_missing(sym, *args, &block)\n m = sym.to_s\n if m =~ /^check$/ or m =~ /^check_.+$/\n new_method = m.gsub(/^check/, 'assert')\n begin\n self.send(new_method.to_sym, *args, &block)\n rescue AssertionFailedError => e\n add_failure(e.message, e.backtrace)\n false\n end\n else\n if sym == :setup\n return\n end\n if m !~ /(.*)__([A-Z_]+)$/\n super(sym, *args, &block)\n end\n test_name = self.class.modified_test_methods[m][0]\n param_key = self.class.modified_test_methods[m][1]\n test_params = self.class.testparameters[param_key]\n if test_params.nil?\n raise \"Could not find parameters for test '#{test_name}'\"\n end\n\n param_setup test_params\n send test_name\n end\n end", "def check_only_methods\n end", "def verify_sub; end", "def verify_sub; end", "def test_existing_file\n assert verify_parameters(['verifier_tests.rb'])\n end", "def verify#todo\n #if its a fault, then its a no for sure\n #otherwise make sure all the fields are the right type, and are initialized etc\n true\n end", "def check!\n self.normalize!\n __check_method\n __check_params\n end", "def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end", "def assertions; end", "def assertions; end", "def test_runnable_methods_random\n @assertion_count = 0\n\n random_tests_1 = sample_test_case 42\n random_tests_2 = sample_test_case 42\n random_tests_3 = sample_test_case 1_000\n\n assert_equal random_tests_1, random_tests_2\n refute_equal random_tests_1, random_tests_3\n end", "def test_func(dis, dat, func, expected)\n\tactual = send(func,dis, dat)\n\tputs (actual == expected ? \"Pass\" : \"Fail\") + \": \" + func.to_s + \" test\"\nend", "def verify_signatures?; end", "def verify_params\n Validate::params_match @func, @current_param\n end", "def test_method\n end", "def verify\n # nothing to do here, so just return\n end", "def verify(state) ; end", "def assert_methods(array, methods)\n methods = methods.map{ |m| m.to_s }\n assert_equal(array, methods)\n end", "def test_contains_four_eachface\n assert true == false\n end", "def test_is_set_56_true\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[1], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[0], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_is_set_21_true\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def method_check(compiler)\n ok_label = SlotMachine::Label.new(self,\"method_ok_#{self.object_id}\")\n compile_method = SlotMachine::Slotted.for( compiler.get_method )\n runtime_method = SlotMachine::Slotted.for( :message , [ :method] )\n check = SlotMachine::NotSameCheck.new(compile_method , runtime_method, ok_label)\n # TODO? Maybe create slot instructions for this\n #builder = compiler.builder(\"yield\")\n #Risc::Macro.exit_sequence(builder)\n #check << builder.built\n check << ok_label\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_method_features\n @providers = {:numbers => @features[:numeric], :letters => @features[:alpha]}\n @providers[:both] = @features[:numeric] + @features[:alpha]\n @providers[:mixed] = [:one, :b]\n @providers[:neither] = [:something, :else]\n\n @providers.each do |name, methods|\n assert_nothing_raised(\"Could not create provider #{name}\") do\n @type.provide(name) do\n methods.each do |name|\n define_method(name) {}\n end\n end\n end\n end\n\n resource = @type.new(:name => \"foo\")\n {:numbers => [:numeric], :letters => [:alpha], :both => [:numeric, :alpha], :mixed => [], :neither => []}.each do |name, should|\n should.sort! { |a,b| a.to_s <=> b.to_s }\n provider = @type.provider(name)\n assert(provider, \"Could not find provider #{name}\")\n assert_equal(should, provider.features, \"Provider #{name} has incorrect features\")\n\n inst = provider.new(resource)\n # Make sure the boolean methods work on both the provider and\n # instance.\n @features.keys.each do |feature|\n method = feature.to_s + \"?\"\n assert(inst.respond_to?(method), \"No boolean instance method for #{name} on #{feature}\")\n assert(provider.respond_to?(method), \"No boolean class method for #{name} on #{feature}\")\n\n if should.include?(feature)\n assert(provider.feature?(feature), \"class missing feature? #{feature}\")\n assert(inst.feature?(feature), \"instance missing feature? #{feature}\")\n assert(provider.send(method), \"class missing feature #{feature}\")\n assert(inst.send(method), \"instance missing feature #{feature}\")\n assert(inst.satisfies?(feature), \"instance.satisfy #{feature} returned false\")\n else\n assert(! provider.feature?(feature), \"class has feature? #{feature}\")\n assert(! inst.feature?(feature), \"instance has feature? #{feature}\")\n assert(! provider.send(method), \"class has feature #{feature}\")\n assert(! inst.send(method), \"instance has feature #{feature}\")\n assert(! inst.satisfies?(feature), \"instance.satisfy #{feature} returned true\")\n end\n end\n\n end\n\n Puppet[:trace] = true\n Puppet::Type.loadall\n Puppet::Type.eachtype do |type|\n assert(type.respond_to?(:feature), \"No features method defined for #{type.name}\")\n end\n end", "def test_is_set_6_true\n # Create card objects\n card1 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[0])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[1], @@shapes[0], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def assert_has_method(body, *methods)\n methods.each do |name|\n assert body =~ /^\\s*def #{name}(\\(.+\\))?\\n((\\n| .*\\n)*) end/, \"should have method #{name}\"\n yield(name, $2) if block_given?\n end\n end", "def test_is_set_4_true\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[2], @@shapes[1], @@numbers[1], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[2], @@shadings[1])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_method\n #==\n assert_operator(@m2,'==',@m5)\n #max y min\n assert_equal(5,@m4.max)\n assert_equal(4,@m6.max)\n assert_equal(1,@m6.min)\n #Operaciones\n assert_equal(Matriz.vector(2,2,[1,2,2,1]).to_s,(@m1+@m2).to_s)\n assert_equal(Matriz.vector(2,2,[1,0,0,1]).to_s,(@m2-@m1).to_s)\n assert_equal(Matriz.vector(2,2,[1,1,1,1]).to_s,(@m1*@m2).to_s)\n assert_equal(Matriz.vector(2,2,[2,2,2,2]).to_s,(@m2*2).to_s)\n end", "def test_is_set_76_true\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[2], @@numbers[0], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_is_set_15_true\n # Create card objects\n card1 = Card.new(@@colors[1], @@shapes[1], @@numbers[0], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[1], @@shapes[2], @@numbers[0], @@shadings[2])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_is_set_23_true\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_is_set_17_true\n # Create card objects\n card1 = Card.new(@@colors[1], @@shapes[0], @@numbers[2], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[2], @@numbers[2], @@shadings[2])\n card3 = Card.new(@@colors[1], @@shapes[1], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_function_update_user_successfully\n data = {\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n user_id = 28\n #Call function insert_user in model V1::User\n user = V1::User.update_user(user_id,data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 200\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_Hash_InstanceMethods_store\n\t\t# TODO, will be add some testcases\n\t\tassert_equal(true, true)\n\tend", "def assert_has_method(body, *methods)\n methods.each do |name|\n assert body =~ /^ def #{name}(\\(.+\\))?\\n((\\n| .*\\n)*) end/, \"should have method #{name}\"\n yield(name, $2) if block_given?\n end\n end", "def test_is_set_40_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[1], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_74_true\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[0], @@numbers[0], @@shadings[0])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[0])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def ok(*args)\n _define_check_method(args, caller, false)\n end", "def test_is_set_52_true\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[0], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[0])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def ptest_method_1(test); end", "def sniff\n # TODO: Only checks instance methods!\n actual = context.node_instance_methods.length\n return [] if actual <= max_allowed_methods\n\n [smell_warning(\n lines: [source_line],\n message: \"has at least #{actual} methods\",\n parameters: { count: actual })]\n end", "def test_is_set_70_true\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[0], @@numbers[1], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[2], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[1], @@shadings[0])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_just_to_show_we_can_make_it_fail\n assert_equal method('patrick'), 'Chuck'\n end", "def test_is_set_68_true\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[0], @@numbers[1], @@shadings[2])\n card2 = Card.new(@@colors[1], @@shapes[1], @@numbers[1], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[2], @@numbers[1], @@shadings[2])\n # Call method under test\n assert(@@table.is_set(card1, card2, card3))\n end", "def test_is_set_36_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[2], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[1], @@shadings[1])\n card3 = Card.new(@@colors[2], @@shapes[0], @@numbers[1], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_13_false\n # Create card objects\n card1 = Card.new(@@colors[0], @@shapes[0], @@numbers[1], @@shadings[2])\n card2 = Card.new(@@colors[0], @@shapes[1], @@numbers[0], @@shadings[2])\n card3 = Card.new(@@colors[0], @@shapes[0], @@numbers[2], @@shadings[0])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end", "def test_is_set_45_false\n # Create card objects\n card1 = Card.new(@@colors[2], @@shapes[2], @@numbers[0], @@shadings[1])\n card2 = Card.new(@@colors[1], @@shapes[0], @@numbers[2], @@shadings[2])\n card3 = Card.new(@@colors[2], @@shapes[1], @@numbers[2], @@shadings[2])\n # Call method under test\n assert(!@@table.is_set(card1, card2, card3))\n end" ]
[ "0.8013722", "0.7122673", "0.7068992", "0.6806825", "0.6743819", "0.6634731", "0.66051084", "0.65887034", "0.65598166", "0.65438324", "0.65086675", "0.6503619", "0.6463923", "0.64303386", "0.64132994", "0.6397789", "0.63871634", "0.63600063", "0.63037246", "0.62977415", "0.62483203", "0.62434614", "0.62434614", "0.6227376", "0.6216353", "0.6210078", "0.6141434", "0.61312", "0.6107272", "0.606158", "0.6043695", "0.6029569", "0.60228324", "0.60063845", "0.60063845", "0.59784365", "0.5946907", "0.59425193", "0.5940703", "0.5930082", "0.5900531", "0.58964604", "0.58923846", "0.58922374", "0.58690304", "0.5868918", "0.58622205", "0.5856861", "0.5839221", "0.5834167", "0.58328205", "0.58193815", "0.58065087", "0.5801201", "0.57885027", "0.5782768", "0.5782768", "0.5777039", "0.5775545", "0.57673645", "0.57668734", "0.5758031", "0.5758031", "0.5755692", "0.57538074", "0.574399", "0.5741693", "0.57378846", "0.5737401", "0.57245046", "0.5721776", "0.57167965", "0.5711156", "0.57109183", "0.5705322", "0.57050085", "0.5690623", "0.56904066", "0.5688316", "0.5683886", "0.5682838", "0.5682627", "0.56749296", "0.5673775", "0.5670612", "0.56687444", "0.56651115", "0.5664051", "0.56571126", "0.56518716", "0.5651264", "0.5646991", "0.5642875", "0.563996", "0.5636606", "0.56351894", "0.563239", "0.56317407", "0.5630939", "0.5629987" ]
0.80452883
0
COLLECTION TYPE Selects collection types per a given set of test data
def select_collection_types(test_data) types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name)], types) types.each_with_index do |type, index| logger.info "Entering collection type data set at index #{index}: #{type}" logger.debug "Hitting input at '#{collection_type_input(index)}'" wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[CoreUseOfCollectionsData::COLLECTION_TYPE.name]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::COLLECTION_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[UseOfCollections::COLLECTION_TYPE.name])\n end\n end", "def verify_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::COLLECTION_TYPE.name], element_value(collection_type_input index)) }\n end", "def verify_collection_types(test_data)\n types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::COLLECTION_TYPE.name], element_value(collection_type_input index)) }\n end", "def type\n \"collection\"\n end", "def collection_type\n Deprecation.warn(\"'##{__method__}' will be removed in Hyrax 4.0. \" \\\n \"Instead, use Hyrax::CollectionType.for(collection: collection).\")\n @collection_type ||= Hyrax::CollectionType.find_by_gid!(collection_type_gid)\n end", "def describe_metric_collection_types()\n request({\n 'Action' => 'DescribeMetricCollectionTypes',\n :idempotent => true,\n :parser => Fog::Parsers::AWS::AutoScaling::DescribeMetricCollectionTypes.new\n })\n end", "def collection(doc_or_type)\n\n @db.collection(\n doc_or_type.is_a?(String) ? doc_or_type : doc_or_type['type'])\n end", "def collections(what)\n list = []\n collections = what == 'all' ? all_collections() : local_collections()\n collections.each do |collection|\n model = collection.classify.constantize rescue nil\n next if model.nil?\n next unless model.respond_to?(:mongo_client)\n record = {'id' => collection, 'description' => I18n.t(\"helpers.label.#{collection}.tabletitle\") } \n list << [record, model_fields(collection)]\n end\n list\nend", "def type\n @type ||= @collection.nil? ? nil : @collection.label.to_sym\n end", "def collection_type\n components[0].to_sym rescue nil\n end", "def collection; @opts['collection'] end", "def assemble_collection_specific\n # TODO custom field text_type_k\n end", "def collection_names; end", "def collection\n Rails.logger.info \"XXXXX COLLECTION NAME #{collection_hash['collection name']}\"\n\n @collection ||= CollectionCreator.find_or_create_collection(\n collection_hash['collection name'],\n collection_hash['unit name'],\n collection_hash['collection description'],\n submitter_user_key\n )\n end", "def filter_collection(type, collection)\n # Ignore filtering if `where` is not in frontmatter.\n return collection unless cfg.dig(type, 'where')\n cfg.dig(type, 'where').each do |attr, value|\n # Resolve attribute if it is referencing object(s).\n attr = (attr.split('.').size > 1) ? attr.split('.') : attr\n # Resolve value if it is meant to be dynamic.\n value = page.data[value[1..-1]] if value.start_with?(':')\n # Filter the collection.\n collection = collection.select do |obj|\n # If the attribute is referencing a string we know the value is\n # either a string or an array. If it is a string, match exactly, but\n # if it is an array, look for inclusion.\n if attr.is_a?(String)\n v = obj.data[attr]\n v.is_a?(Array) ? v.include?(value) : v == value\n # If the attribute is an object or array of objects, dig into the\n # object(s) to find the appropriate value to match or be included,\n # as specified above.\n else\n v = obj.data[attr.first]\n v.is_a?(Array) ? v.collect{|x| x.dig(*attr[1..-1])}.include?(value) : v.dig(*attr[1..-1]) == value\n end\n end\n end\n collection\n end", "def test_ListPlatformTypes\n\t\tcolName = 'types'\n\t\tretClass = LeanTesting::PlatformType\n\t\tresp = rcol(colName, ['_id', 'name'])\n\t\t@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}\n\n\t\tcol = @client.platform.types.all\n\n\t\tassert_equal resp[colName], col.toArray\n\t\tassert_instance_of retClass, col.collection[0]\n\t\tassert_equal resp['meta']['pagination']['total'], col.total\n\t\tassert_equal resp['meta']['pagination']['total_pages'], col.totalPages\n\t\tassert_equal resp['meta']['pagination']['count'], col.count\n\tend", "def resource_type\n :collection if collection?\n end", "def resource_type\n :collection if collection?\n end", "def select_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::MATERIAL_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_options_and_select(material_type_input(index), material_type_options(index), type[UseOfCollections::MATERIAL_TYPE.name])\n end\n end", "def collection(collection, options = {})\n respond_with_object_and_type collection, options, :collection, false\n end", "def limit_by_collection_type(solr_params)\n collection_type_gid = @type == \"personal\" ? personal_gid : course_gid\n solr_params[:fq] ||= []\n solr_params[:fq] << \"collection_type_gid_ssim:\\\"#{collection_type_gid}\\\"\"\n end", "def select_material_types(test_data)\n types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n logger.info \"Entering material type data set at index #{index}: #{type}\"\n wait_for_options_and_select(material_type_input(index), material_type_options(index), type[CoreUseOfCollectionsData::MATERIAL_TYPE.name])\n end\n end", "def collection include_object_type=false, &block\n ASObj.generate :collection, !include_object_type, &block\n end", "def collection(data)\n @_collection_name = data.values.first if data.respond_to?(:each_pair)\n self.object(data_object(data).to_a) if data\n end", "def collections; end", "def enter_types(test_data)\n test_types = test_data[Org::ORG_RECORD_TYPES.name]\n test_types = [{ Org::ORG_RECORD_TYPE.name => ''}] unless test_types\n prep_fieldsets_for_test_data([fieldset(Org::ORG_RECORD_TYPES.name)], test_types)\n\n test_types.each_with_index do |test_type, index|\n wait_for_options_and_select(org_record_type_input(index), org_record_type_options(index), test_type[Org::ORG_RECORD_TYPE.name])\n end\n end", "def types(types); end", "def fill_default_collection(classtype, dummy_name='[Alle]', show_id=true)\n colls = []\n dummy = classtype.new :name => dummy_name\n dummy.id = nil\n colls << dummy\n dbcolls = classtype.all :order => (show_id ? 'id' : 'name')\n dbcolls.each { |d| colls << d }\n colls\n end", "def test_type_for(org_num)\n\ttest_type = OrderType.create(title: \"Template-#{org_num}-#{rand(1000)+1}\", organization_id: org_num)\n\tcats = {1 => [1,2,3], 2 => [1,2,3], 3 => [1,2,3]}\n\tcats.each_pair do |key, values|\n\t\tcat = Category.create(name: \"Category #{org_num}-#{key}\", order_type_id: test_type.id)\n\t\tvalues.each do |t|\n\t\t\tTask.create(description: \"Task #{org_num}-#{key}-#{t}\", category_id: cat.id)\n\t\tend\n\tend\nend", "def source_collections\n # The determination of which collections are considered Source Collections\n # is based solely on the Collection's CollectionType deposit_only_collection\n # attribute. This logic can be changed, but the simplest determination is the\n # CollectionType.\n Collection.all.select { |c| !c&.collection_type&.deposit_only_collection? }\n end", "def find_types_and_all_collections(parent, polymorphic_association_name, type, collection_name)\n components = find_desired_components(parent, polymorphic_association_name, type.to_s.camelize.constantize)\n\n components_with_collection = {}\n\n components.each do |component|\n components_with_collection[component] = component.send(collection_name)\n\n components_with_collection[component].each do |collection_element|\n components_with_collection.merge!(find_types_and_all_collections(collection_element, polymorphic_association_name, type, collection_name))\n end\n end\n components_with_collection\n end", "def collection_name; end", "def collection_name; end", "def collection_name; end", "def collections\n return [] unless data.at_xpath(\"#{data_root}/context/collectionInfo/unittitle\") && data.at_xpath(\"#{data_root}/context/collectionInfo/unitid\")\n [{\n title: data.at_xpath(\"#{data_root}/context/collectionInfo/unittitle\").content,\n identifier: data.at_xpath(\"#{data_root}/context/collectionInfo/unitid\").content\n }]\n end", "def collection(model = name.to_s.classify.constantize)\n model\n end", "def generalise\n Mutiny::Tests::TestSet.new(tests.map(&:generalise))\n end", "def request_occi_collection(expected_entity_type = nil)\n if Rails.env.test?\n # turn off caching for tests\n @request_collection = parse_request(expected_entity_type)\n else\n @request_collection ||= parse_request(expected_entity_type)\n end\n end", "def collection\n raise(NotImplementedError, '#collection must be defined in the TypicalSituation implementation.')\n end", "def collection_name\n\t\t\t\t\"#{klass.model_name.to_s.classify.pluralize}Collection\".constantize\n\t\t\tend", "def collection_of(template)\n collection template.templateName\nend", "def test_collection?\n is_a?(Collection::TestCollection)\n end", "def available_collections\n api = API.new\n params = {:limit => 9999, :preserve_original => true}\n response = api.send_and_receive('collections', {:params => params})\n response.map {|n| [n['title'], n['identifier']]}\n end", "def subfield_x_collections\n return unless cocina_object.respond_to?(:structural) && cocina_object.structural\n\n collections = cocina_object.structural.isMemberOf\n collection_info = []\n\n collections.each do |collection_druid|\n collection = CocinaObjectStore.find(collection_druid)\n next unless ReleaseTags.released_to_searchworks?(cocina_object: collection)\n\n catalog_link = collection.identification&.catalogLinks&.find { |link| link.catalog == catalog }\n collection_info << { code: 'x', value: \"collection:#{collection.externalIdentifier.sub('druid:', '')}:#{catalog_link&.catalogRecordId}:#{Cocina::Models::Builders::TitleBuilder.build(collection.description.title)}\" }\n end\n\n collection_info\n end", "def make_and_populate_collection(samples, collection_type: nil,\n first_collection: nil,\n add_column_wise: false,\n label_plates: false)\n\n if collection_type.nil? && first_collection.nil?\n ProtocolError 'Either collection_type or first_collection must be given'\n end\n\n unless collection_type.nil? || first_collection.nil?\n ProtocolError 'Both collection_type and first_collection cannot be given'\n end\n\n capacity = nil\n if collection_type.nil?\n collection_type = first_collection.object_type.name\n capacity = first_collection.capacity\n remaining_space = first_collection.get_empty.length\n add_samples_to_collection(samples[0...remaining_space - 1],\n first_collection,\n label_plates: label_plates,\n add_column_wise: add_column_wise)\n samples = samples.drop(remaining_space)\n else\n obj_type = ObjectType.find_by_name(collection_type)\n capacity = obj_type.columns * obj_type.rows\n end\n\n collections = []\n collections.push(first_collection) unless first_collection.nil?\n grouped_samples = samples.in_groups_of(capacity, false)\n grouped_samples.each do |sub_samples|\n collection = make_new_plate(collection_type, label_plate: label_plates)\n add_samples_to_collection(sub_samples, collection, \n add_column_wise: add_column_wise)\n collections.push(collection)\n end\n collections\n end", "def make_and_populate_collection(samples, collection_type: nil,\n first_collection: nil,\n label_plates: false)\n\n if collection_type.nil? && first_collection.nil?\n ProtocolError 'Either collection_type or first_collection must be given'\n end\n\n unless collection_type.nil? || first_collection.nil?\n raise 'Both collection_type and first_collection cannot be given'\n end\n\n capacity = nil\n if collection_type.nil?\n collection_type = first_collection.object_type.name\n capacity = first_collection.capacity\n remaining_space = first_collection.get_empty.length\n add_samples_to_collection(samples[0...remaining_space - 1],\n first_collection)\n samples = samples.drop(remaining_space)\n else\n obj_type = ObjectType.find_by_name(collection_type)\n raise collection_type.to_s unless obj_type.present?\n capacity = obj_type.columns * obj_type.rows\n end\n\n collections = []\n collections.push(first_collection) unless first_collection.nil?\n grouped_samples = samples.in_groups_of(capacity, false)\n grouped_samples.each do |sub_samples|\n collection = make_new_plate(collection_type, label_plate: label_plates)\n add_samples_to_collection(sub_samples, collection)\n collections.push(collection)\n end\n collections\n end", "def collection_protocol\n specimen_collection_group.collection_protocol\n end", "def select_collection(name)\n\t\t@collection = @recommend_datadb.collection(name)\n\tend", "def proper_types\n Page.distinct(:_type).reject { |type| type.constantize.new.entry? }\n end", "def new_creatable_selection_list\n creatable_options = Seek::Util.user_creatable_types.collect { |c| [c.name.underscore.humanize, c.name.underscore] }\n creatable_options << [\"Data file with sample\", \"data_file_with_sample\"] if Seek::Config.sample_parser_enabled\n creatable_options\n end", "def collection_class\n OneToMany::Collection\n end", "def collection_class\n OneToMany::Collection\n end", "def types\n [\n { value: 'bus', name: 'Bus' },\n { value: 'coach', name: 'Coach' },\n { value: 'hgv', name: 'Heavy goods vehicle' },\n { value: 'van', name: 'Van' },\n { value: 'minibus', name: 'Minibus' },\n { value: 'private_car', name: 'Car' },\n { value: 'motorcycle', name: 'Motorcycle' }\n ]\n end", "def select_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::METHOD_LIST.name)], test_methods)\n\n test_methods.each_with_index do |method, index|\n wait_for_options_and_select(method_input(index), method_options(index), method[UseOfCollections::METHOD.name])\n end\n end", "def datatypes\n value.document.fetch(\"#{value.key}_type\", [])\n end", "def create_collections\n self.collections.each do |c|\n self.add_collection(c)\n end\n end", "def collection\n @options[:collection] if @options.key?(:collection)\n end", "def find_by_type(types); end", "def find_by_type(types); end", "def spec_type(desc, *additional); end", "def setup_test(operations, ot_type_name)\n operations.make\n operations.each do |op|\n output_collection = op.output('PCR Plate').collection\n rows = output_collection.dimensions[0]\n sample_names = ['RP', '2019-nCoVPC_N1', '2019-nCoVPC_N2']\n (rows/(sample_names.length)).times do\n sample_names.each do |name|\n collection = Collection.new_collection(ot_type_name)\n samples = Array.new(collection.dimensions[0], Sample.find_by_name(name))\n collection.add_samples(samples)\n end\n end\n end\n end", "def by_type\n return @by_type if @by_type\n\n @by_type = {}\n self.all.each do |set|\n next unless set[:types].count > 0\n\n set[:types].each do |t|\n @by_type[t] ||= []\n @by_type[t] << set\n end\n end\n\n @by_type\n end", "def collection_names\n case config[\"collections\"]\n when Hash\n config[\"collections\"].keys\n when Array\n config[\"collections\"]\n when nil\n []\n else\n raise ArgumentError, \"Your `collections` key must be a hash or an array.\"\n end\n end", "def should_have_collec_classics(singular, plural, options={})\n should_have_collec_refer_classics singular, plural, options\n should_have_collec_named_classics singular, plural, options\n end", "def create_collections\n @client[URLS_COLLECTION].create\n @client[DOCUMENTS_COLLECTION].create\n\n nil\n end", "def collections_coll\n settings.db['collections']\n end", "def test_create_collection\n with_a_collection do\n assert_instance_of QualityCenter::Defect::Collection, @coll\n refute @coll.empty?\n end\n end", "def test_cases_by_type\n test_cases.group_by(&:test_case_type)\n end", "def specializations\n @specializations ||= Specialization.from_models(self, @models)\n end", "def pool_types\n @pool_types.each\n end", "def type(types)\n types = [types] unless types.is_a?(Array)\n any_in(:_type => types)\n end", "def types; end", "def types; end", "def types; end", "def types; end", "def types; end", "def collection; end", "def collection; end", "def fixed_collection_data\n collection_data.to_enum.to_a\n end", "def is_collection\n return self.resource_type == Resource::LEARNING_COLLECTION;\n end", "def _default_type_name\n if to_s.end_with?('::Collection_')\n _name = to_s.gsub(\n 'Serializer', ''\n ).gsub(\n '::Collection_', ''\n ).downcase.split('::')[-1]\n\n \"#{_name}_collection\".to_sym\n else\n to_s.gsub('Serializer', '').downcase.split('::')[-1].to_sym\n end\n end", "def collection(options={})\n response = client.get(api_path, options)\n\n if response.success?\n collection = []\n\n response.body.each do |json|\n collection << new(json)\n end\n\n collection\n else\n []\n end\n end", "def types\n classifications.collect() do |c|\n c[\"classificationTypeName\"]\n end\n end", "def collection_list\n truncate_limit = (params[:truncate] || 60).to_i\n collections = {}\n registration_collection_ids_for_apo(params[:apo_id]).each do |col_id|\n col_druid = col_id.gsub(/^druid:/, '')\n col_title_field = SolrDocument::FIELD_TITLE\n\n # grab the collection title from Solr, or fall back to DOR\n solr_doc = Dor::SearchService.query(\"id:\\\"#{col_id}\\\"\",\n rows: 1,\n fl: col_title_field)['response']['docs'].first\n if solr_doc.present? && solr_doc[col_title_field].present?\n collections[col_id] = \"#{short_label(solr_doc[col_title_field].first, truncate_limit)} (#{col_druid})\"\n else\n Honeybadger.notify(\"Unable to find title of the collection #{col_id} in Solr. Checking Fedora, but this is slow.\")\n begin # Title not found in Solr, so check DOR\n collection = Dor.find(col_id)\n collections[col_id] = \"#{short_label(collection.label, truncate_limit)} (#{col_druid})\"\n rescue ActiveFedora::ObjectNotFoundError\n Honeybadger.notify(\"Unable to find the collection #{col_id} in Fedora, but it's listed in the administrativeMetadata datastream for #{params[:apo_id]}\")\n col_not_found_warning = \"#{params[:apo_id]} lists collection #{col_id} for registration, but it wasn't found in Fedora.\"\n Rails.logger.warning col_not_found_warning\n end\n end\n end\n\n # before returning the list, sort by collection name, and add a \"None\" option at the top\n collections = { '' => 'None' }.merge((collections.sort_by { |_k, col_title| col_title }).to_h)\n respond_to do |format|\n format.any(:json, :xml) { render request.format.to_sym => collections }\n end\n end", "def data_type\n ns_definition(:query_spec_datatypes)\n end", "def collections\n collection_names.map do |name|\n Collection.new(name, self)\n end\n end", "def elements_collection_type\n nil\n end", "def collections\n Collection.find(:all, :find_through => [N::DCT.hasPart, self])\n end", "def getData type\n\t\t# get collection\n\t\tthings = @@db.collection(\"saves\")\n\t\t# find everything in collection\n\t\tcursor = things.find()\n\t\t\n\t\t# go through all documents in collection and display data\n\t\tcursor.each { |row| \n\t\t\tif(row[type] != nil)\n\t\t\t\tfrm = row[\"form\"]\n\t\t\t\tif(frm == nil)\n\t\t\t\t\tfrm = \"N/A\"\n\t\t\t\tend\n\t\t\t\tputs row[type] + \" || Form: \" + frm\n\t\t\tend\n\t\t} \n\tend", "def build_collection_param(param, collection_format)\n case collection_format\n when :csv\n param.join(',')\n when :ssv\n param.join(' ')\n when :tsv\n param.join(\"\\t\")\n when :pipes\n param.join('|')\n when :multi\n # return the array directly as typhoeus will handle it as expected\n param\n else\n fail \"unknown collection format: #{collection_format.inspect}\"\n end\n end", "def build_collection_param(param, collection_format)\n case collection_format\n when :csv\n param.join(',')\n when :ssv\n param.join(' ')\n when :tsv\n param.join(\"\\t\")\n when :pipes\n param.join('|')\n when :multi\n # return the array directly as typhoeus will handle it as expected\n param\n else\n fail \"unknown collection format: #{collection_format.inspect}\"\n end\n end", "def build_collection_param(param, collection_format)\n case collection_format\n when :csv\n param.join(',')\n when :ssv\n param.join(' ')\n when :tsv\n param.join(\"\\t\")\n when :pipes\n param.join('|')\n when :multi\n # return the array directly as typhoeus will handle it as expected\n param\n else\n fail \"unknown collection format: #{collection_format.inspect}\"\n end\n end", "def build_collection_param(param, collection_format)\n case collection_format\n when :csv\n param.join(',')\n when :ssv\n param.join(' ')\n when :tsv\n param.join(\"\\t\")\n when :pipes\n param.join('|')\n when :multi\n # return the array directly as typhoeus will handle it as expected\n param\n else\n fail \"unknown collection format: #{collection_format.inspect}\"\n end\n end", "def build_collection_param(param, collection_format)\n case collection_format\n when :csv\n param.join(',')\n when :ssv\n param.join(' ')\n when :tsv\n param.join(\"\\t\")\n when :pipes\n param.join('|')\n when :multi\n # return the array directly as typhoeus will handle it as expected\n param\n else\n fail \"unknown collection format: #{collection_format.inspect}\"\n end\n end", "def collection_roles\n # Can create, read, edit/update, destroy, and change visibility (discovery) of all Collections\n models = [Hyrax::PcdmCollection, Hyrax.config.collection_class].uniq\n if collection_manager?\n models.each do |collection_model|\n # Permit all actions (same collection permissions as admin users)\n can :manage, collection_model\n can :manage, ::SolrDocument, &:collection?\n can :manage, ::String do |id|\n doc = permissions_doc(id)\n doc.collection?\n end\n can :create_collection_type, CollectionType\n end\n # Can create, read, and edit/update all Collections\n elsif collection_editor?\n models.each { |collection_model| can %i[edit update create create_any], collection_model }\n can %i[edit update], ::SolrDocument, &:collection?\n can %i[edit update], ::String do |id|\n doc = permissions_doc(id)\n doc.collection?\n end\n models.each { |collection_model| can %i[read read_any view_admin_show view_admin_show_any], collection_model }\n can %i[read read_any view_admin_show view_admin_show_any], ::SolrDocument, &:collection?\n can %i[read read_any view_admin_show view_admin_show_any], ::String do |id|\n doc = permissions_doc(id)\n doc.collection?\n end\n can :create_collection_type, CollectionType\n\n # Can read all Collections\n elsif collection_reader?\n models.each { |collection_model| can %i[read read_any view_admin_show view_admin_show_any], collection_model }\n can %i[read read_any view_admin_show view_admin_show_any], ::SolrDocument, &:collection?\n can %i[read read_any view_admin_show view_admin_show_any], ::String do |id|\n doc = permissions_doc(id)\n doc.collection?\n end\n end\n end", "def collection\n klass.collection\n end", "def pick_collection(string, user_name, selection)\r\n clear\r\n options = []\r\n # Pasting all required attributes to next method\r\n if string == 'Default'\r\n begin default_collections_array = @test.default[string]\r\n default_collections_array.each do |e|\r\n options.push({ name: \"Default collection #{e['Default_Id']} :#{e['Default_Name']}\\n\\n\", value: lambda {\r\n test_comfirm(string, e['Default_Name'], e, user_name, selection)\r\n } })\r\n end\r\n # In case the default file is corrupted, receive default content from test model\r\n rescue JSON::ParserError, NoMethodError, NoMemoryError, StandardError\r\n puts \"Sorry, couldn't read the content of Default_collection file.\\n\"\r\n puts \"Recreating the Default contetnt.\\n\\n\"\r\n new_default = @test.default_content_setter\r\n @test.reset_default(new_default)\r\n retry\r\n end\r\n elsif string == 'Custom'\r\n begin custom_collections_array = @custom.custom_load[string]\r\n custom_collections_array.each do |e|\r\n options.push({ name: \"Custom collection #{e['Custom_Id']} :#{e['Custom_Name']}\\n\\n\", value: lambda {\r\n test_comfirm(string, e['Custom_Name'], e, user_name, selection)\r\n } })\r\n end\r\n # In case counldn't read custom file prompt user to go back to add new custom content.\r\n rescue JSON::ParserError, NoMethodError, NoMemoryError, StandardError\r\n puts \"Sorry, couldn't read the content of Custom_collection file.\\n\"\r\n puts \"Please go back to custom menu and add new custom content.\\n\\n\"\r\n end\r\n\r\n end\r\n # Provide access to go back even if the reading file failed\r\n options.push([\r\n { name: 'Back', value: lambda {\r\n interface\r\n } }\r\n ])\r\n option = @prompt.select(\"Please select the quiz that you want to test or go back to main menu.\\n\\n\", options,\r\n help: \"(Pressing Enter to go back)\\n\\n\", show_help: :always, per_page: 10)\r\n end", "def collection_name\n 'string_fields'\n end", "def service_types_generated \n types = [ ServiceTypeValue[:fulltext], ServiceTypeValue[:holding], ServiceTypeValue[:table_of_contents], ServiceTypeValue[:relevant_link] ]\n \n return types\n end", "def member_of_collections_attributes\n # A ChildWork will never be a direct member of a Collection\n return if ['ChildWork', 'Page'].include?(metadata[\"Object Type\"]) || !metadata['Parent ARK']\n arks_array = metadata['Parent ARK'].split('|~|')\n collection = []\n\n arks_array.each_with_index do |current_ark, index|\n ark_string = Ark.ensure_prefix(current_ark.strip)\n collection[index] = Collection.find_or_create_by_ark(ark_string)\n\n unless collection[index].recalculate_size == false\n collection[index].recalculate_size = false\n collection[index].save\n end\n end\n\n collection_return = {}\n collection.each_with_index do |current_collection, index|\n collection_return[index] = { id: current_collection.id }\n end\n\n collection_return\n end" ]
[ "0.7981642", "0.73535734", "0.7240342", "0.6451149", "0.61875546", "0.6155347", "0.61327434", "0.6115007", "0.6094356", "0.5970014", "0.5865509", "0.58474404", "0.58366066", "0.5832844", "0.573668", "0.57352275", "0.57003826", "0.57003826", "0.56800413", "0.5589772", "0.55513775", "0.552288", "0.551978", "0.5504118", "0.54908025", "0.5488845", "0.548733", "0.54836386", "0.5476696", "0.54681456", "0.54528975", "0.54510355", "0.54510355", "0.54510355", "0.5448532", "0.5447508", "0.5416754", "0.5413779", "0.5377892", "0.53685695", "0.53469574", "0.53454655", "0.53453857", "0.5342152", "0.5340159", "0.5340116", "0.5323854", "0.53043336", "0.52958876", "0.52929944", "0.52848667", "0.52848667", "0.525316", "0.5251437", "0.52472323", "0.5246551", "0.5243593", "0.5233847", "0.5233847", "0.5224373", "0.5221256", "0.5221171", "0.5217595", "0.52144736", "0.51929986", "0.5189044", "0.51791066", "0.5171652", "0.5169206", "0.5159794", "0.51570445", "0.5155339", "0.5155339", "0.5155339", "0.5155339", "0.5155339", "0.5154978", "0.5154978", "0.5152087", "0.5147119", "0.5146043", "0.51444894", "0.51439047", "0.51369673", "0.5133864", "0.51301163", "0.51267815", "0.5117994", "0.51122344", "0.5110275", "0.5110275", "0.5110275", "0.5110275", "0.5110275", "0.51061845", "0.51050967", "0.50916934", "0.50912607", "0.50893956", "0.5079908" ]
0.7683633
1
Verifies collection types match test data
def verify_collection_types(test_data) types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}] types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::COLLECTION_TYPE.name], element_value(collection_type_input index)) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::COLLECTION_TYPE.name], element_value(collection_type_input index)) }\n end", "def verify_collection_data(expected_collection_data, actual_collection_data)\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expect(actual_collection_data).to match_with_type(expected_collection_data)\n end\n end", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def verify_types(test_data)\n test_types = test_data[Org::ORG_RECORD_TYPES.name]\n errors = []\n test_types = [{ Org::ORG_RECORD_TYPE.name => ''}] unless test_types\n test_types.each_with_index do |test_type, index|\n text_values_match?(test_type[Org::ORG_RECORD_TYPE.name], element_value(org_record_type_input(index)), errors)\n end\n errors\n end", "def verify_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::MATERIAL_TYPE.name], element_value(material_type_input index)) }\n end", "def verify_material_types(test_data)\n types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::MATERIAL_TYPE.name], element_value(material_type_input index)) }\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_truth\n assert_kind_of AssessedElementDatum, @assessed_element_datum\n end", "def test_truth\n assert_kind_of PupilSet, @pupil_set\n end", "def test_have_types\n @sources.each { |s| assert(!s['type'].blank?, \"No type for #{s['uri']}\") }\n end", "def test_values_are_arrays_of_hashes\n @result.values.each do |table|\n assert_instance_of( Array, table )\n table.each do |entry|\n assert_instance_of( Hash, entry )\n end\n end\n end", "def test_create_collection\n with_a_collection do\n assert_instance_of QualityCenter::Defect::Collection, @coll\n refute @coll.empty?\n end\n end", "def test_item_should_be_of_proper_type\n assert_kind_of Product, items(:uranium_portion)\n assert_kind_of Product, items(:lightsaber)\n assert_kind_of Product, items(:holy_grenade)\n assert_kind_of Product, items(:chinchilla_coat)\n assert_kind_of Product, items(:towel)\n assert_kind_of Product, items(:the_stuff)\n end", "def test_truth\n assert_kind_of ProductOptionValues, @product_option_values\n end", "def is_correct_data?(data, *expected_keys)\n return false until contains_expected_keys?(data, *expected_keys)\n filter_keys(data, *expected_keys)\n data.each do |key, value|\n return false until correct_type?(key, value)\n end\n data.each do |key, value|\n return false until corresponds_to_constraint?(key, value)\n end\n return true\nend", "def select_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::COLLECTION_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[UseOfCollections::COLLECTION_TYPE.name])\n end\n end", "def valid_sets; end", "def test_parser_valid_data\n \n assert Yay::PARSER_TESTS.kind_of? Hash\n\n Yay::PARSER_TESTS.each_pair { |input, expected| \n assert input.kind_of? String\n assert expected.kind_of? Array\n }\n\n end", "def test_truth\n assert_kind_of GroceryList, grocery_lists(:first)\n end", "def test_create_dict_set_is_a_set\n assert_kind_of Set, @grapher.create_dict_set('wordlist.txt')\n end", "def test_check_valid\n assert_equal check_valid([2, '1', '5']), [0, 2, 1, 5]\n end", "def test_array_subtype_shortform\n s = Schema.new do\n type :array, :integer\n end\n assert_nothing_raised { s.validate! [5] }\n assert_verr { s.validate! [nil] }\n assert_verr { s.validate! ['a'] }\n assert_verr { s.validate! [5, 'a'] }\n assert_verr { s.validate! [5, nil] }\n end", "def types_match?(api_map, expected, inferred); end", "def types_match?(api_map, expected, inferred); end", "def test_collection?\n is_a?(Collection::TestCollection)\n end", "def select_collection_types(test_data)\n types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n logger.info \"Entering collection type data set at index #{index}: #{type}\"\n logger.debug \"Hitting input at '#{collection_type_input(index)}'\"\n wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[CoreUseOfCollectionsData::COLLECTION_TYPE.name])\n end\n end", "def assert_type list, typ\n raise SexpTypeError, \"Expected type #{typ.inspect} in #{list.inspect}\" if\n not Array === list or list.sexp_type != typ\n end", "def test_truth\n assert_kind_of PropertyOccurrence, @property_occurrence\n end", "def test_truth\n assert_kind_of Listmember, listmembers(:first)\n end", "def verify_schema_hash\r\n expect(Schema.schema_hash_i).to be_instance_of(Hash)\r\n %w{person org}.each{|e| expect(Schema.schema_hash.keys).to include(e)}\r\n end", "def test_truth\n assert_kind_of Sample, @sample\n end", "def test_truth\n assert_kind_of UserItem, @user_item\n end", "def test_flatten\n with_a_collection do\n assert_equal 10, @coll.flatten!.size\n assert_instance_of QualityCenter::Defect::Item, @coll.last\n end\n end", "def validate_arrays(typeform_array, database_array, person)\n if database_array.size != typeform_array.size\n print_submission_arrays_info(typeform_array, database_array, person)\n return false\n end\n database_array.each_with_index do |element, index|\n if element != typeform_array[index]\n print_submission_arrays_info(typeform_array, database_array, person)\n return false\n end\n end\n true\n end", "def test_typecheck\n\t\tassert_raise( RuntimeError ) { PClass.new(\"1\", \"2\", \"3\", []) }\n\t\tassert_raise( RuntimeError ) { PClass.new(1, 2, \"3\", []) }\n\t\tassert_raise( RuntimeError ) { PClass.new(1, \"2\", 3, []) }\n\t\tassert_raise( RuntimeError ) { PClass.new(1, \"2\", \"3\", \"[]\") }\n\tend", "def test_check_invalid_prospectors\n assert_equal check_valid([2, 0, 1]), [1, nil, nil, nil]\n end", "def test_truth\r\n assert_kind_of Question, @question\r\n end", "def test_truth\n assert_kind_of Pet, @pet\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def test_truth\r\n assert_kind_of FaqCategory, @faq_category\r\n end", "def validate_data_value(value, &block)\n # The DataProvider.value_type is self recursive so further recursive check of collections is needed here\n unless value_is_validated? || DataProvider.value_type.instance?(value)\n actual_type = Types::TypeCalculator.singleton.infer(value)\n raise Types::TypeAssertionError.new(\"#{yield} has wrong type, expects Puppet::LookupValue, got #{actual_type}\", DataProvider.value_type, actual_type)\n end\n value\n end", "def validate_operations(context, types)\n context.operations.length.should == types.length\n context.operations.each_with_index do |op, i|\n op.type.should == types[i]\n end\nend", "def collection?\n if @xml_document\n validity = true\n missing = {}\n @proof.collections.each do |collection, locator_array|\n missing[collection] = locator_array.dup\n locator_array.each do |locator|\n namespace = locator[0]\n xpath = locator[1]\n REXML::XPath.each(@xml_document, xpath) do |element_or_attribute|\n missing[collection].delete([namespace, xpath]) if element_or_attribute.inherited_namespace == namespace\n end\n end\n end\n missing.each do |collection, locator_array|\n if not locator_array.empty?\n validity = false\n error = \"COLLECTION #{collection}\"\n @errors << [locator_array[0][0], locator_array[0][1], error]\n end\n end\n return validity\n else\n raise \"no XML document provided to validate collections against\"\n end\n end", "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def test_truth\n assert_kind_of SiLogs, @si_logs\n end", "def verify_objects(hash, expected)\n return [] unless expected.objects\n expected.objects.map do |expected|\n found = hash[expected.name.to_s]\n null_allowed = expected.respond_to?(:opts) && expected.opts[:null]\n if found.nil?\n null_allowed ? [] : something_is_missing_error(expected)\n else\n verify_element(found, expected, false) # don't verify nesting\n end\n end\n end", "def compare(data, spec)\n if spec.is_a?(Hash)\n check_keys(data.keys, spec.keys)\n end\n data.each do |k,v|\n context k do\n if spec == Array\n it \"#{k} should match Array\" do\n expect(v.class).to eq Array\n end\n\n elsif spec[k] == Hash\n it \"#{k} should match Hash\" do\n expect(v.class).to eq Hash\n end\n\n elsif spec == {String => Array} or\n spec == {String => String}\n it \"#{k}=>#{v} should match #{spec}\" do\n expect(k.class).to eq spec.keys.first\n expect(v.class).to eq spec[spec.keys.first]\n end\n\n elsif spec.has_key?(k)\n if v.is_a?(Hash)\n compare(v, spec[k]) # recurse.\n elsif spec[k].is_a?(Regexp)\n it \"#{k} should match #{spec[k]}\" do\n expect(v).to match spec[k]\n end\n elsif spec[k] == String\n\n # Actually, an Array of Strings joined by CloudFormation\n # is also okay.\n #\n it \"#{k} should match #{spec[k]}\" do\n expect([String, Array].include?(v.class)).to be true\n end\n elsif spec[k] == Fixnum\n it \"#{k} should match (or be cast to) #{spec[k]}\" do\n expect { v.to_i }.to_not raise_error\n end\n elsif [Array, TrueClass, FalseClass]\n .include?(v.class)\n it \"#{v} should be a #{spec[k]}\" do\n expect(v).to be_a spec[k]\n end\n end\n\n elsif v.is_a?(Hash)\n spec_key = spec.keys.first\n compare(v, spec[spec_key]) # recurse.\n\n else\n raise \"Something went wrong\"\n end\n end\n end\nend", "def expected_publications_data?(array_of_hash)\n expected_data=[]\n expected_data << array_of_hash\n expected_data.flatten!\n data_array = self.publications_data\n new_array = []\n key_map = { \"Main title:\"=>:main_title, \"Main author:\"=>:main_author,\n \"Co-author(s):\"=>:co_authors, \"Publisher:\"=>:publisher, \"Place of publication:\"=>:place,\n \"Volume title:\"=>:volume_title, \"Volume information:\"=>:volume_info,\n \"Year:\"=>:year, \"Number:\"=>:number, \"Series title:\"=>:series, \"URL:\"=>:url }\n data_array.each do |hash|\n fixed = Hash[hash.map { |k, v| [key_map[k], v ] } ]\n new_array << fixed\n end\n expected_data==new_array ? true : false\n end", "def verify_occasions(test_data)\n occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)) }\n end", "def test_conversion_types_should_be_different\n food_conversion = create\n assert food_conversion.valid?, \"The conversion was invalid:\\n #{food_conversion.to_yaml}\"\n food_conversion.conversion_units = food_conversion.equivalent_units\n assert !food_conversion.valid?, \"Conversion should have been invalid\"\n assert_not_nil food_conversion.errors.on(:conversion_units), \"conversion_units should have had an error\"\n end", "def verify_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[UseOfCollections::OCCASION.name], element_value(occasion_input index)) }\n end", "def assert_facets_have_values(facets)\n facets.size.should > 1\n # should have at least one value for each facet\n facets.each do |facet|\n facet.items.size.should >= 1\n end\nend", "def verify_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def test_truth\n assert_kind_of SiRevision, @si_revision\n end", "def test_truth\n assert_kind_of Cost, @cost\n end", "def test_associations\n\t\tassert check_associations(DocImage)\n\tend", "def verify_locations(test_data)\n locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[CoreUseOfCollectionsData::LOCATION.name], element_value(location_input index)) }\n end", "def test_truth\r\n assert_kind_of CptCategory, @categories\r\n assert_not_equal @mycategory.id, @categories.id\r\n assert_not_equal @mycategory.description, @categories.description\r\n assert_not_equal @mycategory.level, @categories.level\r\n end", "def test_multiples_of_other_objectable_types\n book1 = { title: 'Foobar', author: 'Mr. Foobar' }\n book2 = { title: 'Fiizbang', author: 'Miss Fizzbang' }\n books = [book1, book2]\n test_object = ObjTestClasses::TestObject.new(library: books)\n\n test_object.library.each do |library_book|\n assert_instance_of(ObjTestClasses::Book, library_book)\n end\n\n books.each do |book|\n assert_includes(test_object.library, ObjTestClasses::Book.new(book))\n end\n end", "def _conforming?\n @collection.each do |elt|\n return false if @wrapfunc_in.call(elt) != elt\n end\n true\n end", "def test_type_match(subject)\n if !is_well_formed_query_result?(subject)\n throw_no_match \"Can perform query matches only against a well formed query result subject\"\n end\n \n if (@golden_master.kind_of? Array) && !is_well_formed_query_result?(@golden_master)\n throw_no_match \"Cannot match against a non-well formed golden master array\"\n end\n end", "def verify_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[UseOfCollections::LOCATION.name], element_value(location_input index)) }\n end", "def verify_methods(test_data)\n test_methods = test_data[UseOfCollections::METHOD_LIST.name]\n test_methods = [{ UseOfCollections::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[UseOfCollections::METHOD.name], element_value(method_input index)) }\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def test_typecheck\n\t\tassert_raise( RuntimeError ) { FreeId.new(\"0\", [], 1) }\n\t\tassert_raise( RuntimeError ) { FreeId.new(0, \"[]\", 1) }\n\t\tassert_raise( RuntimeError ) { FreeId.new(0, [], \"1\") }\n\tend", "def test_truth\n assert_kind_of Author, @author\n end", "def validate_field_types\n database_field_names.each do |field|\n field_info = self.class.get_table_info.select {|hash| hash[\"name\"] == field}.first\n check_field_value_matches_data_type(field_info, field) \n end\n @errors\n end", "def verify_methods(test_data)\n test_methods = test_data[CoreUseOfCollectionsData::METHOD_LIST.name]\n test_methods = [{CoreUseOfCollectionsData::METHOD.name => ''}] unless test_methods\n test_methods.each_with_index { |test_method, index| verify_values_match(test_method[CoreUseOfCollectionsData::METHOD.name], element_value(method_input index)) }\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def validate_attributes_schema\n @attributes.keys.each do |key|\n value = read_attribute(key)\n next unless value\n # type validation\n if (column = column_for_attribute(key)) and !key.ends_with?(\":\")\n if column.collection?\n unless value.is_a?(Array)\n raise WrongAttributeDataType, \"#{human_attribute_name(column.name)} has the wrong type. Expected collection of #{column.klass}. Record is #{value.class}\"\n end\n value.each do |v|\n validate_attribute_type(v, column)\n end\n else\n validate_attribute_type(value, column)\n end\n else\n # Don't save attributes set in a previous schema version\n @attributes.delete(key)\n end\n end\n end", "def valid?(set); end", "def validate_user_list(users, user_ids)\n users.size.should == user_ids.length\n users.each_with_index do |user, i|\n user.should be_kind_of(User)\n user.id.should == user_ids[i]\n end\nend", "def test_typecheck\n\t\tassert_raise( RuntimeError ) { Player.new(\"1\", \"2\", \"3\", \"4\", 5, 6, 7, {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, 2, \"3\", \"4\", 5, 6, 7, {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", 3, \"4\", 5, 6, 7, {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", 4, 5, 6, 7, {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", \"4\", \"5\", 6, 7, {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", \"4\", 5, \"6\", 7, {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", \"4\", 5, 6, \"7\", {}, 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", \"4\", 5, 6, 7, \"{}\", 9, []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", \"4\", 5, 6, 7, {}, \"9\", []) }\n\t\tassert_raise( RuntimeError ) { Player.new(1, \"2\", \"3\", \"4\", 5, 6, 7, {}, 9, \"[]\") }\n\tend", "def validate_data_format\n unless data.is_a?(Array)\n raise DataFormatError, \"Data set(s) should be given as an array\"\n end\n end", "def all_ints?(collection)\n collection.each do |n|\n begin\n Integer(n)\n rescue\n return false\n end \n end\n true\n end", "def test_check_invalid_length\n assert_equal check_valid([2, 1]), [1, nil, nil, nil]\n end", "def check_keys(data_keys, spec_keys)\n context data_keys do\n if spec_keys == [String] or spec_keys.first.is_a?(Regexp)\n it \"should all match String\" do\n expect(data_keys.map{|k| k.is_a?(String)}.uniq).to eq [true]\n end\n else\n it \"should be a subset of #{spec_keys}\" do\n expect((data_keys - spec_keys).empty?).to be true\n end\n end\n end\nend", "def test_types\n # rec = SourceRecord.new\n source = make_dummy_source(\"http://www.newstuff.org/createtypes\", N::FOAFX.Person, N::FOAFX.Foe)\n assert_not_nil(source)\n assert_property(source.types, N::FOAFX.Person, N::FOAFX.Foe, source.rdf_selftype)\n end", "def test_all\n Post.create(:title => \"11222\")\n Post.create(:title => \"112ssd22\")\n posts = Post.all\n assert posts.is_a?(Array)\n assert posts[0].is_a?(Post)\n end", "def test_truth\n assert_kind_of LineItem, line_items(:first)\n end", "def fixed_collection_data\n collection_data.to_enum.to_a\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def test_type_check\n assert_raise(ArgumentError) {Complejo.new('1','1')}\n end", "def test_truth\n assert_kind_of UniqueProperty, @unique_property\n end", "def assert_size(expected_count, actual_collection)\n assert_equal expected_count, actual_collection.size, \"collection expected size was '#{expected_count}' but actually was '#{actual_collection.size}'\"\n end", "def test_validates_fail\n assert_equal validates(['1']), [1, nil, nil, nil] # return 1\n assert_equal validates(['1', '1']), [1, nil, nil, nil] # return 1\n assert_equal validates(['k', '1', '6']), [1, nil, nil, nil] # return 1\n assert_equal validates(['1', '-1', '1']), [1, nil, nil, nil] # return 1\n assert_equal validates(['-19', '4', '-1']), [1, nil, nil, nil] # return 1 \n end", "def test_collection_as_check_boxes\n actual = @builder.input(:choises, as: :check_boxes, collection: %w(a b))\n expected = <<-HTML\n <div class=\"form-group row check_boxes required form_choises\">\n <label class=\"col-sm-3 form-control-label check_boxes required\">Choises <abbr title=\"required\">*</abbr></label>\n <div class=\"col-sm-9\">\n <input name=\"form[choises][]\" type=\"hidden\" value=\"\"/>\n <div class=\"form-check\">\n <input class=\"form-check-input check_boxes required\" id=\"form_choises_a\" name=\"form[choises][]\" type=\"checkbox\" value=\"a\"/>\n <label class=\"collection_check_boxes\" for=\"form_choises_a\">a</label>\n </div>\n <div class=\"form-check\">\n <input class=\"form-check-input check_boxes required\" id=\"form_choises_b\" name=\"form[choises][]\" type=\"checkbox\" value=\"b\"/>\n <label class=\"collection_check_boxes\" for=\"form_choises_b\">b</label>\n </div>\n <small class=\"form-text text-muted\">Collection as check boxes example</small>\n </div>\n </div>\n HTML\n assert_xml_equal expected, actual\n end", "def verify#todo\n #if its a fault, then its a no for sure\n #otherwise make sure all the fields are the right type, and are initialized etc\n true\n end", "def check_descendent_array clazz, expected\n actual = TypeUtils.descendents(clazz)\n expected.each {|c| actual.should include(c)}\nend", "def test_truth\n assert_kind_of Standard, @standard\n end", "def test_truth\n assert_kind_of DesignReviewComment, @design_review_comment\n end", "def match_with_type?(expected, actual)\n if expected.is_a?(Hash) && expected.key?('$$type')\n case expected['$$type']\n when 'binData'\n expected_class = BSON::Binary\n expected_key = '$binary'\n when 'long'\n expected_class = BSON::Int64\n expected_key = '$numberLong'\n else\n raise \"Tests do not currently support matching against $$type #{v['$$type']}\"\n end\n\n actual.is_a?(expected_class) || actual.key?(expected_key)\n elsif expected.is_a?(Hash) && actual.is_a?(Hash)\n has_all_keys = (expected.keys - actual.keys).empty?\n\n same_values = expected.keys.all? do |key|\n match_with_type?(expected[key], actual[key])\n end\n\n has_all_keys && same_values\n elsif expected.is_a?(Array) && actual.is_a?(Array)\n same_length = expected.length == actual.length\n\n same_values = expected.map.with_index do |_, idx|\n match_with_type?(expected[idx], actual[idx])\n end.all?\n\n same_length && same_values\n elsif expected == 42\n actual.is_a?(Numeric) || actual.is_a?(BSON::Int32) || actual.is_a?(BSON::Int64)\n else\n expected == actual\n end\n end", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def test_predefined_answers_is_array\n assert_kind_of Array, Predictor::ANSWERS\n end", "def test_truth\n assert_kind_of Taxon, @taxon\n end", "def test_array_shortform_invalid\n assert_raises Exceptions::InvalidSchemaError do\n Schema.new do\n type(:array, %i[array integer], min: 2)\n end\n end\n end", "def ensure_allowed_in_collection!(*new_items)\n ensure_type_equality!(*new_items) and return if ensures_type_equality?\n\n invalid_items = new_items.flatten.reject { |item| allows_item?(item) }\n return if invalid_items.empty?\n\n raise Collectible::ItemNotAllowedError,\n \"not allowed: #{invalid_items.first(3).map(&:inspect).join(\", \")}#{\"...\" if invalid_items.length > 3}\"\n end", "def test_typecheck\n\t\tassert_raise( RuntimeError ) { Mob.new(\"1\", 2.0, 3) }\n\t\tassert_raise( RuntimeError ) { Mob.new(1, \"2.0\", 3) }\n\t\tassert_raise( RuntimeError ) { Mob.new(1, 2.0, \"3\") }\n\tend", "def assert_includes(expected_items, collection)\n expected_items = [ expected_items ] unless expected_items.respond_to? \"size\"\n expected_items.each { |item| assert collection.include?(item), \"#{item.inspect} should be contained in the collection\" }\n end" ]
[ "0.8485936", "0.72509843", "0.7112232", "0.69382584", "0.6560072", "0.6537137", "0.62807506", "0.62482685", "0.62462085", "0.62047637", "0.6187995", "0.61844355", "0.61744356", "0.61450964", "0.60818154", "0.607067", "0.6007147", "0.5998209", "0.59925616", "0.5934632", "0.59264946", "0.59248716", "0.5898535", "0.5898535", "0.58873254", "0.58823013", "0.58664864", "0.58263505", "0.5824423", "0.5797113", "0.5795611", "0.57890904", "0.5787012", "0.57706916", "0.57206583", "0.57135457", "0.56974626", "0.5686935", "0.5686062", "0.56850076", "0.56750154", "0.56739813", "0.56646246", "0.5660981", "0.56577206", "0.56451654", "0.56406057", "0.5637332", "0.56231344", "0.56104946", "0.5609602", "0.5607021", "0.5604058", "0.56025", "0.55983067", "0.55979663", "0.5589424", "0.5582041", "0.55773985", "0.5571892", "0.55717736", "0.5562986", "0.5559625", "0.555855", "0.5555578", "0.5543199", "0.5541269", "0.553364", "0.5533579", "0.553265", "0.55303043", "0.55285066", "0.5525298", "0.5518271", "0.5514532", "0.5512897", "0.5512027", "0.5506973", "0.5501724", "0.5499936", "0.549746", "0.54789", "0.5477233", "0.5474575", "0.5464637", "0.54592514", "0.5453912", "0.54468113", "0.5445569", "0.5440563", "0.5439035", "0.54359055", "0.5427045", "0.5422635", "0.54191685", "0.5412877", "0.5411696", "0.5405942", "0.5405905", "0.5395904" ]
0.84081537
1
MATERIAL TYPE Selects material types per a given set of test data
def select_material_types(test_data) types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name)], types) types.each_with_index do |type, index| logger.info "Entering material type data set at index #{index}: #{type}" wait_for_options_and_select(material_type_input(index), material_type_options(index), type[CoreUseOfCollectionsData::MATERIAL_TYPE.name]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def select_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::MATERIAL_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_options_and_select(material_type_input(index), material_type_options(index), type[UseOfCollections::MATERIAL_TYPE.name])\n end\n end", "def verify_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::MATERIAL_TYPE.name], element_value(material_type_input index)) }\n end", "def verify_material_types(test_data)\n types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::MATERIAL_TYPE.name], element_value(material_type_input index)) }\n end", "def material_type\n attributes['material_type']\n end", "def material_type\n attributes['material_type']\n end", "def get_material_types\n METADATA_RELATIONS_CONFIG['material_types']\n end", "def set_material_type\n @material_type = MaterialType.find(params[:id])\n end", "def set_material_type\n @material_type = MaterialType.find(params[:id])\n end", "def material_type_params\n params.require(:material_type).permit(:name_material_type, :desc_material_type)\n end", "def select_all_by_material\n model = Sketchup.active_model\n material = model.materials.current\n selector = MaterialSelector.new\n selector.select model, material\nend", "def material_for(value)\n org.bukkit.Material.match_material value.to_s\n end", "def material_for(value)\n org.bukkit.Material.match_material value.to_s\n end", "def material_use\n materials = []\n materials\n end", "def index\n @material_categories = MaterialCategory.all\n @material_categories = @material_categories.where(oftype: MaterialCategory.oftypes[params[:oftype]]) if params[:oftype].present?\n end", "def material_type_params\n params.require(:material_type).permit(:name)\n end", "def load_materials(materials)\n mt = 1\n materials.each do |material|\n case mt\n when 1\n self.mat_item1 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_1 = material.quantity\n when 2\n self.mat_item2 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_2 = material.quantity\n when 3\n self.mat_item3 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_3 = material.quantity\n when 4\n self.mat_item4 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_4 = material.quantity\n when 5\n self.mat_item5 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_5 = material.quantity\n when 6\n self.mat_item6 = material.item_key.to_s + \" - \" + material.item\n self.mat_qty_6 = material.quantity\n else\n #nothing\n end\n mt += 1\n end\n end", "def index\n @material_types = MaterialType.all\n end", "def mTargetTypes(inParams)\n retVal = @m_targetDefault\n\n case inParams[:colour]\n when 'red'\n retVal = 'kb+p,'\n when 'blue'\n retVal = 'kr'\n end\n retVal\n end", "def get_material_type_facets\n @get_material_type_facets ||= clean_facets_array(search(\"//genreform\").map(&:text))\n end", "def set_material(material)\n GL::Material(GL::FRONT_AND_BACK, GL::AMBIENT, material[AMBIENCE])\n GL::Material(GL::FRONT_AND_BACK, GL::SPECULAR, material[SPECULAR])\n GL::Material(GL::FRONT_AND_BACK, GL::DIFFUSE, material[DIFFUSE])\n GL::Material(GL::FRONT_AND_BACK, GL::SHININESS, material[SHININESS])\n GL::Material(GL::FRONT, GL::EMISSION, [0.3, 0.3, 0.3, 0.7])\n end", "def color(type, o={})\n type = type.to_s\n material = MATERIAL_TYPES[type]\n raise ArgumentError.new \"Invalid color/material type: #{type}\" if !material\n\n MS.new.tap do |ms|\n ms.set_color_material material if material\n ms.set_diffuse color_for(\"diffuse\", o[:diffuse]) if o[:diffuse]\n ms.set_ambient color_for(\"ambient\", o[:ambient]) if o[:ambient]\n ms.set_specular color_for(\"specular\", o[:specular]) if o[:specular]\n ms.set_emissive color_for(\"emissive\", o[:emissive]) if o[:emissive]\n set_render_state ms\n end\n end", "def set_tipo_material\r\n @tipo_material = TipoMaterial.find(params[:id])\r\n end", "def index\n @material_compositions = MaterialComposition.all\n @material_compositions.each do |mat_comp|\n mat_comp.type_name = ['Material', \"Alvenaria: Parede Simples\",\"Alvenaria: Parede Dupla\" ][mat_comp.mtype]\n end\n end", "def mType(inParams)\n retVal = @m_typeDefault\n\n case inParams[:colour]\n when 'red'\n retVal = 'kr'\n when 'blue'\n retVal = 'kb'\n end\n retVal += 'p' if inParams[:is_primary];\n retVal\n end", "def material\n end", "def materials\n @materials ||= materials_data[]\n .map { |material|\n { title: material[\"bib_data\"][\"title\"],\n barcode: barcode(material),\n call_number: material[\"holding_data\"][\"call_number\"],\n library: library_name_from_short_code(material.library),\n location: materials_location(material),\n raw_library: material[\"item_data\"][\"library\"][\"value\"],\n raw_location: material[\"item_data\"][\"location\"][\"value\"],\n availability: availability_status(material) }\n .with_indifferent_access }\n .uniq { |material| material.except(:barcode) }\n end", "def set_material\n begin\n @material = type.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to materials_path, alert: \"Could not find #{type.name.split(':').last} with ID #{params[:id]}!\"\n end\n end", "def material=(material)\n validator = EnumAttributeValidator.new('String', ['Clear', 'DkEdge', 'Flat', 'LegacyMatte', 'LegacyMetal', 'LegacyPlastic', 'LegacyWireframe', 'Matte', 'Metal', 'Plastic', 'Powder', 'SoftEdge', 'Softmetal', 'TranslucentPowder', 'WarmMatte', 'NotDefined'])\n unless validator.valid?(material)\n fail ArgumentError, 'invalid value for \"material\", must be one of #{validator.allowable_values}.'\n end\n @material = material\n end", "def add_material(material_name)\n # First check model and return material if it already exists\n self.getMaterials.each do |material|\n if material.name.get.to_s == material_name\n OpenStudio::logFree(OpenStudio::Debug, 'openstudio.standards.Model', \"Already added material: #{material_name}\")\n return material\n end\n end\n \n #OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.Model', \"Adding material: #{material_name}\")\n\n # Get the object data\n data = self.find_object(self.standards['materials'], {'name'=>material_name})\n if !data\n OpenStudio::logFree(OpenStudio::Warn, 'openstudio.standards.Model', \"Cannot find data for material: #{material_name}, will not be created.\")\n return false #TODO change to return empty optional material\n end\n \n material = nil\n material_type = data['material_type']\n\n if material_type == 'StandardOpaqueMaterial'\n material = OpenStudio::Model::StandardOpaqueMaterial.new(self)\n material.setName(material_name)\n\n material.setRoughness(data['roughness'].to_s)\n material.setThickness(OpenStudio.convert(data['thickness'].to_f, 'in', 'm').get)\n material.setConductivity(OpenStudio.convert(data['conductivity'].to_f, 'Btu*in/hr*ft^2*R', 'W/m*K').get)\n material.setDensity(OpenStudio.convert(data['density'].to_f, 'lb/ft^3', 'kg/m^3').get)\n material.setSpecificHeat(OpenStudio.convert(data['specific_heat'].to_f, 'Btu/lb*R', 'J/kg*K').get)\n material.setThermalAbsorptance(data['thermal_absorptance'].to_f)\n material.setSolarAbsorptance(data['solar_absorptance'].to_f)\n material.setVisibleAbsorptance(data['visible_absorptance'].to_f)\n\n elsif material_type == 'MasslessOpaqueMaterial'\n material = OpenStudio::Model::MasslessOpaqueMaterial.new(self)\n material.setName(material_name)\n material.setThermalResistance(OpenStudio.convert(data['resistance'].to_f, 'hr*ft^2*R/Btu', 'm^2*K/W').get)\n\n material.setConductivity(OpenStudio.convert(data['conductivity'].to_f, 'Btu*in/hr*ft^2*R', 'W/m*K').get)\n material.setDensity(OpenStudio.convert(data['density'].to_f, 'lb/ft^3', 'kg/m^3').get)\n material.setSpecificHeat(OpenStudio.convert(data['specific_heat'].to_f, 'Btu/lb*R', 'J/kg*K').get)\n material.setThermalAbsorptance(data['thermal_absorptance'].to_f)\n material.setSolarAbsorptance(data['solar_absorptance'].to_f)\n material.setVisibleAbsorptance(data['visible_absorptance'].to_f)\n\n elsif material_type == 'AirGap'\n material = OpenStudio::Model::AirGap.new(self)\n material.setName(material_name)\n\n material.setThermalResistance(OpenStudio.convert(data['resistance'].to_f, 'hr*ft^2*R/Btu*in', 'm*K/W').get)\n\n elsif material_type == 'Gas'\n material = OpenStudio::Model::Gas.new(self)\n material.setName(material_name)\n\n material.setThickness(OpenStudio.convert(data['thickness'].to_f, 'in', 'm').get)\n material.setGasType(data['gas_type'].to_s)\n\n elsif material_type == 'SimpleGlazing'\n material = OpenStudio::Model::SimpleGlazing.new(self)\n material.setName(material_name)\n\n material.setUFactor(OpenStudio.convert(data['u_factor'].to_f, 'Btu/hr*ft^2*R', 'W/m^2*K').get)\n material.setSolarHeatGainCoefficient(data['solar_heat_gain_coefficient'].to_f)\n material.setVisibleTransmittance(data['visible_transmittance'].to_f)\n\n elsif material_type == 'StandardGlazing'\n material = OpenStudio::Model::StandardGlazing.new(self)\n material.setName(material_name)\n\n material.setOpticalDataType(data['optical_data_type'].to_s)\n material.setThickness(OpenStudio.convert(data['thickness'].to_f, 'in', 'm').get)\n material.setSolarTransmittanceatNormalIncidence(data['solar_transmittance_at_normal_incidence'].to_f)\n material.setFrontSideSolarReflectanceatNormalIncidence(data['front_side_solar_reflectance_at_normal_incidence'].to_f)\n material.setBackSideSolarReflectanceatNormalIncidence(data['back_side_solar_reflectance_at_normal_incidence'].to_f)\n material.setVisibleTransmittanceatNormalIncidence(data['visible_transmittance_at_normal_incidence'].to_f)\n material.setFrontSideVisibleReflectanceatNormalIncidence(data['front_side_visible_reflectance_at_normal_incidence'].to_f)\n material.setBackSideVisibleReflectanceatNormalIncidence(data['back_side_visible_reflectance_at_normal_incidence'].to_f)\n material.setInfraredTransmittanceatNormalIncidence(data['infrared_transmittance_at_normal_incidence'].to_f)\n material.setFrontSideInfraredHemisphericalEmissivity(data['front_side_infrared_hemispherical_emissivity'].to_f)\n material.setBackSideInfraredHemisphericalEmissivity(data['back_side_infrared_hemispherical_emissivity'].to_f)\n material.setConductivity(OpenStudio.convert(data['conductivity'].to_f, 'Btu*in/hr*ft^2*R', 'W/m*K').get)\n material.setDirtCorrectionFactorforSolarandVisibleTransmittance(data['dirt_correction_factor_for_solar_and_visible_transmittance'].to_f)\n if /true/i.match(data['solar_diffusing'].to_s)\n material.setSolarDiffusing(true)\n else\n material.setSolarDiffusing(false)\n end\n\n else\n puts \"Unknown material type #{material_type}\"\n exit\n end\n\n return material\n \n end", "def material; end", "def material; end", "def material=(material)\n end", "def show\n @material_composition.type_name = ['Material', \"Alvenaria: Parede Simples\",\"Alvenaria: Parede Dupla\" ][@material_composition.mtype]\n @impacts = @material_composition.impacts\n end", "def all_selectable_materials\n categories = Category.order(\"depth ASC \")\n \n # MATERIAL = {\n # :steel => {\n # :value => 1, \n # :name => \"Steel\" \n # } ,\n # :copper => {\n # :value => 2, \n # :name => \"Tembaga\"\n # }, \n # :alumunium => {\n # :value => 3, \n # :name => \"Aluminium\"\n # }\n # }\n # \n \n result = []\n MATERIAL.each do |material| \n result << [ \"#{category.name}\" , \n category.id ] \n end\n return result\n end", "def artifact type \n cheeses=[\"Camembert\",\"Parmesan\",\"Cheddar\",\"Wisconsin\",\"Brie\",\"Stinky\",\"Blue\",\"Gorgonzola\",\"Goat\",\"Gouda\"]\n bones=[\"human\",\"neanderthal\",\"sasquatch\",\"velociraptor\",\"human child\",\"buffalo\",\"alien\"]\n civs=[\"Mayan\",\"Greek\",\"Chinese\",\"Collector's Edition\",\"Persian\",\"Roman\"]\n animals=[\"Aaron the Aardvark\",\"Wile E. Coyote\",\"killer rabbit\",\"Chupacabra\",\"Tobbits the Hobbit\",\"Pikachu\",\"Ling-Ling\"]\n if type==\"cheese\"\n return cheeses[rand(10)] #change to cheeses.length\n elsif type==\"bones\"\n return bones[rand(7)]\n elsif type==\"coin\"\n return civs[rand(6)]\n elsif type==\"animal\"\n return animals[rand(7)]\n end\nend", "def create\n @material_type = MaterialType.new(material_type_params)\n\n respond_to do |format|\n if @material_type.save\n format.html { redirect_to @material_type, notice: 'Material type was successfully created.' }\n format.json { render :show, status: :created, location: @material_type }\n else\n format.html { render :new }\n format.json { render json: @material_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @material_type = MaterialType.new(material_type_params)\n\n if @material_type.save\n render json: @material_type, status: :created, location: @material_type\n else\n render json: @material_type.errors, status: :unprocessable_entity\n end\n end", "def initMaterials\n @wall_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key = TextureKey.new('Textures/Terrain/BrickWall/BrickWall.jpg')\n key.setGenerateMips(true)\n tex = assetManager.loadTexture(key)\n @wall_mat.setTexture('ColorMap', tex)\n\n @stone_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key2 = TextureKey.new('Textures/Terrain/Rock/Rock.PNG')\n key2.setGenerateMips(true)\n tex2 = assetManager.loadTexture(key2)\n @stone_mat.setTexture('ColorMap', tex2)\n\n @floor_mat = Material.new(assetManager, 'Common/MatDefs/Misc/Unshaded.j3md')\n key3 = TextureKey.new('Textures/Terrain/Pond/Pond.jpg')\n key3.setGenerateMips(true)\n tex3 = assetManager.loadTexture(key3)\n tex3.setWrap(WrapMode::Repeat)\n @floor_mat.setTexture('ColorMap', tex3)\n end", "def material_category_params\n params.require(:material_category).permit(:oftype, :name)\n end", "def index\r\n @tipo_materials = TipoMaterial.all\r\n end", "def sample_names\n material.sample.name\n end", "def material_item?\n @itype_id == 4\n end", "def index\n @material_types = MaterialType.all\n\n render json: @material_types\n end", "def is_a_material_product_type?\n model_relationship.eql?(MaterialProductType.to_s)\n end", "def gather_materials(tot_num_stripwells)\n show do\n title \"Gather the Materials\"\n separator\n note \"Gather the following materials:\"\n REAGENTS_LOC.each do |mat, loc|\n if mat.include? 'Stripwell'\n check \"Gather <b>#{tot_num_stripwells}</b> - <b>#{mat}</b> at Location: <b>#{loc}</b>\"\n else\n check \"Gather <b>#{mat}</b> at Location: <b>#{loc}</b>\"\n end\n end\n separator\n check \"If item/reagent is frozen, let it thaw at room temperature while preparing samples in the next step.\"\n end\n end", "def unit_types\n [\"Subject\", \"Fragment\", \"Chapter\", \"Lesson\", \"Lab\"]\n end", "def gather_First_Second_cDNA_Synthesis_materials(op_type=nil)\n # Gather all materials and describe how much volume from each they will need for the following steps\n num_ops = operations.length\n # FSA and SSIIRev are at a 9:1 ratio, plus the total vol added is 8ul so 7.2:0.8\n reagents_hash = {\n \"First Strand Synthesis Act D Mix (FSA)\" => reagent_vol_with_extra(num_ops, FSA_VOL),\n \"SuperScript II Reverse Transcriptase\" => reagent_vol_with_extra(num_ops, REV_TRANS_VOL),\n \"End Repair Control (CTE) 1:50\" => reagent_vol_with_extra(num_ops, CTE_VOL),\n \"Second Strand Marking Master Mix (SMM)\" => SSM_VOL # Vol zero for this portion of the protocol\n }\n \n second_reagents_hash = {\n \"AMPure XP Beads\" => reagent_vol_with_extra(num_ops, AMP_BEAD_VOL),\n \"Freshly Prepared 80% Ethanol (EtOH)\" => reagent_vol_with_extra(num_ops, EtOH_80_VOL)\n }\n \n room_temp = { qty:25, units:\"#{DEGREES_C}\"}\n \n if !op_type.nil?\n case op_type.name\n when \"rRNA Deplete and Fragment RNA\"\n show do\n title \"Gather the following materials for the protocol after this one\"\n separator\n note \"Let the following reagents thaw at room temperature:\"\n second_reagents_hash.each {|k,v| check \"#{k}\"}\n check \"Make 80% EtOH => #{second_reagents_hash[\"Freshly Prepared 80% Ethanol (EtOH)\"] * 0.8}#{MICROLITERS} of 100% EtOH + #{second_reagents_hash[\"Freshly Prepared 80% Ethanol (EtOH)\"] * 0.2}#{MICROLITERS} of MG H2O\"\n note \"Let the following reagents thaw on ice until future use:\"\n reagents_hash.each {|k,v| check \"#{k}\"}\n end\n end\n else\n show do\n title \"Gather the following materials:\"\n separator\n note \"Let the following reagents thaw at #{qty_display(room_temp)}\"\n reagents_hash.each {|k, v| (check \"<b>#{v}ul</b> of #{k}\")}\n check \"<b>5</b> - Adhesive Seals\"\n check \"<b>2</b> - 96 Well MIDI 0.8mL Plate(s)\"\n end\n end\n end", "def musical_score_types\n types = []\n types << 'MS' if %w[c d].include?(record.leader[6])\n return types\n end", "def gathered_materials?(materials, number = 1)\n materials.each{|material|\n return false if item_number(material.item) < material.quantity * number\n }\n true\n end", "def enter_types(test_data)\n test_types = test_data[Org::ORG_RECORD_TYPES.name]\n test_types = [{ Org::ORG_RECORD_TYPE.name => ''}] unless test_types\n prep_fieldsets_for_test_data([fieldset(Org::ORG_RECORD_TYPES.name)], test_types)\n\n test_types.each_with_index do |test_type, index|\n wait_for_options_and_select(org_record_type_input(index), org_record_type_options(index), test_type[Org::ORG_RECORD_TYPE.name])\n end\n end", "def set_m_test_type\n @m_test_type = MTestType.find(params[:id])\n end", "def type\n %w[taxi PHV].sample\n end", "def types\n [\n { value: 'bus', name: 'Bus' },\n { value: 'coach', name: 'Coach' },\n { value: 'hgv', name: 'Heavy goods vehicle' },\n { value: 'van', name: 'Van' },\n { value: 'minibus', name: 'Minibus' },\n { value: 'private_car', name: 'Car' },\n { value: 'motorcycle', name: 'Motorcycle' }\n ]\n end", "def retrieve_materials(materials)\n return unless materials.present?\n\n show do\n title 'Retrieve Materials'\n note 'Please get the following items'\n table create_location_table(materials)\n end\n end", "def show\n render json: @material_type\n end", "def select_type_montant\n [\n \t['montant_ht', \"Montant Hors-Taxe\"],\n \t['montant_ttc', \"Montant TTC\"],\n \t['montant_net', \"Net à payer\"]\n ].in_select(id:'facture_montant_id', name:\"facture[montant_id]\")\nend", "def conf_media_type\n @conf_kit_media_types = Kitting::KitMediaType.where(:kit_type => \"configurable\",:customer_number => \"SYSTEM\")\n end", "def get_valid_data_type\r\n while true \r\n data_type = gets.chomp\r\n break if DATA_TYPES.include? data_type\r\n puts \"please choose one of the three listed data types. #{DATA_TYPES}\"\r\n end\r\n data_type\r\n end", "def sample_type\n ExtendedModule::Helpers.sample_type(type)\n end", "def get_style(type, id)\n if Weapon_style_by_attribute == true\n # BY ATTRIBUTE\n if type == 0\n item = $data_weapons[id]\n if item.element_set.include?(17)\n #this element means it requires the ability to wield swords\n return 'Sword'\n end\n if item.element_set.include?(18)\n #this element means it requires the ability to wield staffs\n return 'Staff'\n end\n \n end\n if type == 1\n item = $data_armors[id]\n if item.element_set.include?(17)\n #you can re-use elements for armour for example this can mean shield when tagged on armour\n return 'Shield'\n end\n if item.element_set.include?(19)\n #or to avoid confusion you can use differant ones\n return 'Armour'\n end\n end\n return nil\n else\n # BY ID\n if type == 0\n case id\n when 1\n return 'Sword'\n when 29\n return 'Staff' \n end\n end\n if type == 1\n case id\n when 1\n return 'Shield'\n end\n end\n return nil\n end\n end", "def get_movie_type( the_type_num )\n @typeInfos = TypeInfo.all\n @typeInfos.each{ |type_info|\n if type_info.type_id === the_type_num\n type_info.type_name\n end\n }\n end", "def fetch_type name\n exercises = []\n data.exercises.each do |exe|\n if exe.target === name\n exercises.push(exe.name)\n end\n end\n exercises\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def create\n @material_composition = MaterialComposition.new(material_composition_params)\n @rp = material_composition_params\n respond_to do |format|\n if @material_composition.save\n if(@rp[:mtype] == \"0\")\n material = BaseMaterial.find(@rp[:material_composition_add])\n puts material.inspect\n mjt = @material_composition.material_joins.new(base_material: material)\n mjt[:weight] = @rp[:weight]\n mjt[:width] = @rp[:width]\n mjt.save\n @material_composition[:lambda] = @material_composition.calcR\n @material_composition.save\n \n elsif (@rp[:mtype] == \"1\")\n material = BaseMaterial.find(@rp[:material_composition_add_0])\n mjt = @material_composition.material_joins.new(base_material: material)\n mjt.weight = @rp[:weight_0]\n mjt.width = @rp[:width_0]\n @material_composition[:lambda] = @rp[:lambda_0]\n mjt.save\n @material_composition.save\n \n elsif (@rp[:mtype] == \"2\")\n material_1 = BaseMaterial.find(@rp[:material_composition_add_1])\n mjt1 = @material_composition.material_joins.new(base_material: material_1)\n mjt1.weight = @rp[:weight_1]\n mjt1.width = @rp[:width_1]\n mjt1.save\n material_2 = BaseMaterial.find(@rp[:material_composition_add_2])\n mjt2 = @material_composition.material_joins.new(base_material: material_2)\n mjt2.weight = @rp[:weight_2]\n mjt2.width = @rp[:width_2]\n @material_composition[:lambda] = @rp[:lambda_1]\n mjt2.save\n @material_composition.save\n \n\n else\n puts '------------FALHOU-------'\n puts @rp[:mtype]\n\n\n end\n format.html { redirect_to @material_composition, notice: 'Material composition was successfully created.' }\n format.json { render :show, status: :created, location: @material_composition }\n else\n format.html { render :new }\n format.json { render json: @material_composition.errors, status: :unprocessable_entity }\n end\n end\n end", "def title_for(product, test_type, is_qrda_1_measure_test: true)\n case test_type\n when 'ChecklistTest'\n product.c3_test && product.eh_tests? ? 'C1 + C3 Sample' : 'C1 Sample'\n when 'MeasureTest'\n measure_test_title(product, is_qrda_1_measure_test:)\n when 'FilteringTest'\n 'C4 (QRDA-I and QRDA-III)'\n when 'MultiMeasureTest'\n 'MultiMeasureTest'\n when 'CMSProgramTest'\n 'CMSProgramTest'\n end\n end", "def select_type\n\t\t\t@select_all_type = TypeEquipament.all\n\t\tend", "def set_property_type\n properties_array = Array(meta_data['PropertiesV1'])\n room_type_hash = properties_array.find { |data_hash| data_hash['TypeNumber'] == code_for(:property_type) }.to_h\n room_type_number = Array(room_type_hash['TypeContents']).first\n\n # There are also hotel (130), mill (172), tent lodge (175)\n # we ignore them and filter them out during property validation\n case room_type_number\n when 20 # Castle\n property.type = 'house'\n property.subtype = 'chateau'\n when 30 # Cottage\n property.type = 'house'\n property.subtype = 'cottage'\n when 40 # Mansion\n property.type = 'house'\n when 50 # Villa\n property.type = 'house'\n property.subtype = 'villa'\n when 60 # Chalet\n property.type = 'house'\n when 80 # Bungalow\n property.type = 'house'\n property.subtype = 'bungalow'\n when 110, 112 # Studio, Duplex\n property.type = 'apartment'\n property.subtype = 'studio_bachelor'\n when 120 # Penthouse\n property.type = 'apartment'\n property.subtype = 'luxury_apartment'\n when 140 # Lodge\n property.type = 'house'\n property.subtype = 'cabin'\n when 160 # Apartment\n property.type = 'apartment'\n when 70, 90, 95, 100, 145, 150, 170 # Farmhouse, Boat, House Boat, Holiday Home, Riad, Mobile Home, Cave house\n property.type = 'house'\n end\n end", "def spec_type_params\n params[:spec_type]\n end", "def get_random_program_type\n DataUtility.select_random_from_options(@prng, ProgramType.all).key\n end", "def get_random_charter_status_type(random)\n DataUtility.select_random_from_options(random, [:OPEN_ENROLLMENT, :NOT_A_CHARTER_SCHOOL])\n end", "def test_get_raw_material_by_name\n assert_equal(\"flour\", @bakery.get_raw_material_by_name(\"flour\")[:name])\n end", "def select_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::COLLECTION_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[UseOfCollections::COLLECTION_TYPE.name])\n end\n end", "def set_material\n @material = Material.find(params[:id])\n end", "def show\n\t\tmaterial = nil\n\t\tmaterial = params[:material] if params[:material] != nil\n if material == nil then\n @questions = @exam.questions.where(\"material = 'md' or material = 'html'\")\n else\n @questions = @exam.questions.where(\"material = ?\", material)\n end\n\n end", "def add_material(face)\n\t\t\t\t\n\t\t\t\tmaterial = face.material\n\t\t\t\t\n\t\t\t\tindex = @materials_hash[material]\n\t\t\t\t\n\t\t\t\tif (index != nil)\n\t\t\t\t\treturn index\n\t\t\t\tend\n\n\t\t\t\tif (material == nil)\n\t\t\t\t\tif @defaultMaterial == -1\n\t\t\t\t\t\t#@defaultMaterial = add_material_node(\"default material\",0.5,0.5,0.75,1.0, 0.1,0.5,true,nil)\n\t\t\t\t\t\t@defaultMaterial = add_material_node(\"default material\",1,1,1,1.0, 0.1,0.5,true,nil) #Use white (not blue) as a default material\n\t\t\t\t\tend\n\t\t\t\t\treturn @defaultMaterial\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tdouble_sided = false\n\t\t\t\tif face.class == Sketchup::Face \t# 'face' might be an entity such as group or component\n\n\t\t\t\t\t#puts \"FRONT face material: \" + face.material.name\n\t\t\t\t\t#puts \"r:\" + face.material.color.red.to_s + \" g:\" + face.material.color.green.to_s + \" b:\" + face.material.color.blue.to_s + \" a:\" + face.material.alpha.to_s \n\n\t\t\t\t\tif face.back_material != nil\n\t\t\t\t\t\tdouble_sided = true\n\n\t\t\t\t\t\t#puts \"BACK face material: \" + face.back_material.name\n\t\t\t\t\t\t#puts \"r:\" + face.back_material.color.red.to_s + \" g:\" + face.back_material.color.green.to_s + \" b:\" + face.back_material.color.blue.to_s + \" a:\" + face.back_material.alpha.to_s \n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tmetallicFactor = get_material_attribute(material, 'pbr','metallicFactor',0.1)\n\t\t\t\troughnessFactor = get_material_attribute(material, 'pbr', 'roughnessFactor',0.9)\n\t\t\t\t\n\t\t\t\t@materials_hash[material] = @materials.length\n\t\t\t\t\n\t\t\t\tname = face.material.display_name\n\t\t\t\t#puts 'Material display name: ' + name\n\n\t\t\t\ta = material.alpha\n\t\t\t\tr = material.color.red / 255.0\n\t\t\t\tg = material.color.green / 255.0\n\t\t\t\tb = material.color.blue / 255.0\n\t\t\t\t\n\t\t\t\t# In future version have lookup into common materials table?\n\t\t\t\tif name != nil\n\t\t\t\t\tlname = name.downcase\n\t\t\t\t\tif name.include? 'gold'\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.0\n\t\t\t\t\tend\n\t\t\t\t\tif name.include? 'silver'\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.0\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tif (lname.include? 'metal') || (lname.include? 'steel')\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.0\n\t\t\t\t\tend\n\t\t\t\t\tif lname.include? 'aluminium'\n\t\t\t\t\t\tmetallicFactor = 0.75\n\t\t\t\t\t\troughnessFactor = 0.40\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif (material.texture != nil)\n\t\t\t\t\ttexture_id = @textures.add_texture(face)\n\t\t\t\t\treturn add_material_node(name, r,g,b,a, metallicFactor, roughnessFactor, double_sided, texture_id)\n\t\t\t\tend\n\n\t\t\t\treturn add_material_node(name, r,g,b,a, metallicFactor, roughnessFactor, double_sided, nil)\n\t\t\tend", "def set_material\n @material = Material.friendly.find(params[:id])\n end", "def valid?\n material_validator = EnumAttributeValidator.new('String', ['Clear', 'DkEdge', 'Flat', 'LegacyMatte', 'LegacyMetal', 'LegacyPlastic', 'LegacyWireframe', 'Matte', 'Metal', 'Plastic', 'Powder', 'SoftEdge', 'Softmetal', 'TranslucentPowder', 'WarmMatte', 'NotDefined'])\n return false unless material_validator.valid?(@material)\n true\n end", "def materials\n files\n end", "def dam_samples(type)\n if type == :group\n self.group_damage_samples\n elsif type == :elem\n self.damage_samples\n end\n end", "def test_type_for(org_num)\n\ttest_type = OrderType.create(title: \"Template-#{org_num}-#{rand(1000)+1}\", organization_id: org_num)\n\tcats = {1 => [1,2,3], 2 => [1,2,3], 3 => [1,2,3]}\n\tcats.each_pair do |key, values|\n\t\tcat = Category.create(name: \"Category #{org_num}-#{key}\", order_type_id: test_type.id)\n\t\tvalues.each do |t|\n\t\t\tTask.create(description: \"Task #{org_num}-#{key}-#{t}\", category_id: cat.id)\n\t\tend\n\tend\nend", "def run_mdc_content_tests\n assert_not_nil Strain.find(:all)\n # Check strains loaded, start with the first strain in the test file\n strain = Strain.find_by_mdc_id('MDC-03-08')\n assert_not_nil strain\n assert_equal 228, Strain.count\n \n # the last strain in the file\n strain2 = Strain.find_by_mdc_id('MDC-05-90')\n assert_not_nil strain2\n # make sure it loaded the data\n strain2_genotypes = Genotype.find_all_by_strain_id(strain2.id)\n assert_equal 9, strain2_genotypes.size\n \n snp = Snp.find_by_symbol('J500418')\n assert_not_nil snp\n assert_equal 'C/T', snp.target_allele\n \n assert_not_nil Genotype.count\n \n assert_equal (228*9), Genotype.count\n genotypes = Genotype.find_all_by_genotypable_id(snp.id)\n assert_not_nil genotypes\n assert_equal 228, genotypes.size\n \n # Get genotype data for J500418 in strain MDC-03-08\n last_genotype = Genotype.find_by_genotypable_id_and_strain_id(snp.id, strain.id)\n assert_not_nil last_genotype\n assert_equal 'TT',last_genotype.genotype_allele\n end", "def spec_type(desc, *additional); end", "def type\n read_attribute(:type) || Figaro.env.meal_types.split.first\n end", "def typeName\n case ftype\n when FTYPE_TEST\n return 'test'\n when FTYPE_SHEET\n return 'mathsheet'\n else # \n return 'generic'\n end\n end", "def material_params\n key = type.name.underscore.gsub('/', '_').to_sym # form will typically submit 'material/gemstone'\n params.require(key).permit(:type,\n :parent_id,\n :name_en,\n :name_zh,\n :name_pinyin,\n :description,\n :notes,\n :selectable,\n :inherit_display_name)\n end", "def test_test_type(test)\n test.type_name\n end", "def uri_data_machine_type(id)\n {\n project: GoogleTests::Constants::MT_PROJECT_DATA[(id - 1) \\\n % GoogleTests::Constants::MT_PROJECT_DATA.size],\n zone: GoogleTests::Constants::MT_ZONE_DATA[(id - 1) \\\n % GoogleTests::Constants::MT_ZONE_DATA.size],\n name: GoogleTests::Constants::MT_NAME_DATA[(id - 1) \\\n % GoogleTests::Constants::MT_NAME_DATA.size]\n }\n end", "def my_type(type)\n case type\n when /bond/i\n \"Bonds\"\n when /stock/i\n \"Stocks\"\n when /alternative/i\n \"Alternatives\"\n else\n \"Unclassified\"\n end\n end", "def food_types(category_name)\n case category_name\n when \"Fruit\"\n Faker::Food.fruit\n when \"Spice\"\n Faker::Food.herb_or_spice\n when \"Ingredient\"\n Faker::Food.ingredient\n when \"Meat\"\n Faker::Food.meat\n when \"Vegetable\"\n Faker::Food.vegetable\n else\n Faker::Product.product\n end\nend", "def type\r\n @type ||= 'Scene'\r\n end", "def type(resource_type)\n Cocina::Models::FileSetType.properties[resource_type.to_sym]\n end", "def types(types); end", "def verify_types(test_data)\n test_types = test_data[Org::ORG_RECORD_TYPES.name]\n errors = []\n test_types = [{ Org::ORG_RECORD_TYPE.name => ''}] unless test_types\n test_types.each_with_index do |test_type, index|\n text_values_match?(test_type[Org::ORG_RECORD_TYPE.name], element_value(org_record_type_input(index)), errors)\n end\n errors\n end", "def set_classe_material\n @classe_material = ClasseMaterial.find(params[:id])\n end", "def select_collection_types(test_data)\n types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n logger.info \"Entering collection type data set at index #{index}: #{type}\"\n logger.debug \"Hitting input at '#{collection_type_input(index)}'\"\n wait_for_options_and_select(collection_type_input(index), collection_type_options(index), type[CoreUseOfCollectionsData::COLLECTION_TYPE.name])\n end\n end" ]
[ "0.80065763", "0.7580582", "0.7498252", "0.6767219", "0.6767219", "0.658974", "0.6354749", "0.6354749", "0.6114087", "0.6076884", "0.60666686", "0.60666686", "0.601766", "0.5950648", "0.5894276", "0.5893818", "0.58537537", "0.58061254", "0.5797567", "0.579412", "0.5750425", "0.5748658", "0.57038665", "0.5687924", "0.5669926", "0.5649201", "0.56305045", "0.5608792", "0.56048137", "0.5581874", "0.5581874", "0.55454445", "0.549012", "0.54696393", "0.538706", "0.5382758", "0.53808945", "0.52798927", "0.52742743", "0.52493656", "0.5237322", "0.5235441", "0.5216479", "0.5201585", "0.5169421", "0.5158556", "0.5136681", "0.5119112", "0.51036125", "0.50971025", "0.50958306", "0.5032843", "0.50250113", "0.49962914", "0.49944854", "0.4972456", "0.4971377", "0.49642497", "0.49587455", "0.49576777", "0.4935924", "0.49346974", "0.49332547", "0.49332297", "0.49332297", "0.49332297", "0.49332297", "0.49332297", "0.49269587", "0.4914625", "0.49041456", "0.4889465", "0.48868394", "0.48737225", "0.48703724", "0.48678192", "0.48619184", "0.486009", "0.48549205", "0.4839629", "0.48365018", "0.48338708", "0.48336917", "0.4827885", "0.48221168", "0.48208857", "0.48116654", "0.4808394", "0.47954834", "0.47900087", "0.47893894", "0.47870603", "0.47861075", "0.4784168", "0.47828943", "0.47772574", "0.47753426", "0.4773387", "0.47664052", "0.47660396" ]
0.791595
1
Verifies material types match test data
def verify_material_types(test_data) types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}] types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::MATERIAL_TYPE.name], element_value(material_type_input index)) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::MATERIAL_TYPE.name], element_value(material_type_input index)) }\n end", "def verify_types(test_data)\n test_types = test_data[Org::ORG_RECORD_TYPES.name]\n errors = []\n test_types = [{ Org::ORG_RECORD_TYPE.name => ''}] unless test_types\n test_types.each_with_index do |test_type, index|\n text_values_match?(test_type[Org::ORG_RECORD_TYPE.name], element_value(org_record_type_input(index)), errors)\n end\n errors\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_type_match(subject)\n if !is_well_formed_query_result?(subject)\n throw_no_match \"Can perform query matches only against a well formed query result subject\"\n end\n \n if (@golden_master.kind_of? Array) && !is_well_formed_query_result?(@golden_master)\n throw_no_match \"Cannot match against a non-well formed golden master array\"\n end\n end", "def checkCompatibility(sampleTypes, expectedLengths) \n # can't run RNA and DNA together! error if attempted\n if(sampleTypes.uniq.length>1)\n return 0\n end\n end", "def test_validate_patient_name_and_account_number_by_giving_invalid_data\n image_type_record = ImageType.new\n image_type_record.patient_first_name = \"RAJ.jk*-9\"\n image_type_record.patient_last_name = \"C)C.9-\"\n image_type_record.patient_account_number= \"gh.gh-&&89\"\n image_type_record.image_type = \"EOB\"\n image_type_record.save\n assert !image_type_record.valid?, image_type_record.errors.full_messages.to_s\n end", "def test_mime_types\n assert_kind_of(DataTypes::SimpleText, @test_records[0])\n assert_kind_of(DataTypes::SimpleText, @test_records[1])\n assert_equal(\"text/plain\", @test_records[0].mime_type)\n assert_equal(\"text/plain\", @test_records[1].mime_type)\n end", "def select_material_types(test_data)\n types = test_data[UseOfCollections::MATERIAL_TYPE_LIST.name] || [{ UseOfCollections::MATERIAL_TYPE.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::MATERIAL_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n wait_for_options_and_select(material_type_input(index), material_type_options(index), type[UseOfCollections::MATERIAL_TYPE.name])\n end\n end", "def test_have_types\n @sources.each { |s| assert(!s['type'].blank?, \"No type for #{s['uri']}\") }\n end", "def valid?\n material_validator = EnumAttributeValidator.new('String', ['Clear', 'DkEdge', 'Flat', 'LegacyMatte', 'LegacyMetal', 'LegacyPlastic', 'LegacyWireframe', 'Matte', 'Metal', 'Plastic', 'Powder', 'SoftEdge', 'Softmetal', 'TranslucentPowder', 'WarmMatte', 'NotDefined'])\n return false unless material_validator.valid?(@material)\n true\n end", "def select_material_types(test_data)\n types = test_data[CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name] || [{CoreUseOfCollectionsData::MATERIAL_TYPE.name => ''}]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::MATERIAL_TYPE_LIST.name)], types)\n\n types.each_with_index do |type, index|\n logger.info \"Entering material type data set at index #{index}: #{type}\"\n wait_for_options_and_select(material_type_input(index), material_type_options(index), type[CoreUseOfCollectionsData::MATERIAL_TYPE.name])\n end\n end", "def verify_collection_types(test_data)\n types = test_data[CoreUseOfCollectionsData::COLLECTION_TYPE_LIST.name] || [{CoreUseOfCollectionsData::COLLECTION_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[CoreUseOfCollectionsData::COLLECTION_TYPE.name], element_value(collection_type_input index)) }\n end", "def verify_collection_types(test_data)\n types = test_data[UseOfCollections::COLLECTION_TYPE_LIST.name] || [{ UseOfCollections::COLLECTION_TYPE.name => ''}]\n types.each_with_index { |type, index| verify_values_match(type[UseOfCollections::COLLECTION_TYPE.name], element_value(collection_type_input index)) }\n end", "def verify#todo\n #if its a fault, then its a no for sure\n #otherwise make sure all the fields are the right type, and are initialized etc\n true\n end", "def test_mime_types\n assert_kind_of DataTypes::IipData, @test_record\n assert_equal 'image/tiff', @test_record.mime_type\n end", "def run_mdc_content_tests\n assert_not_nil Strain.find(:all)\n # Check strains loaded, start with the first strain in the test file\n strain = Strain.find_by_mdc_id('MDC-03-08')\n assert_not_nil strain\n assert_equal 228, Strain.count\n \n # the last strain in the file\n strain2 = Strain.find_by_mdc_id('MDC-05-90')\n assert_not_nil strain2\n # make sure it loaded the data\n strain2_genotypes = Genotype.find_all_by_strain_id(strain2.id)\n assert_equal 9, strain2_genotypes.size\n \n snp = Snp.find_by_symbol('J500418')\n assert_not_nil snp\n assert_equal 'C/T', snp.target_allele\n \n assert_not_nil Genotype.count\n \n assert_equal (228*9), Genotype.count\n genotypes = Genotype.find_all_by_genotypable_id(snp.id)\n assert_not_nil genotypes\n assert_equal 228, genotypes.size\n \n # Get genotype data for J500418 in strain MDC-03-08\n last_genotype = Genotype.find_by_genotypable_id_and_strain_id(snp.id, strain.id)\n assert_not_nil last_genotype\n assert_equal 'TT',last_genotype.genotype_allele\n end", "def is_correct_data?(data, *expected_keys)\n return false until contains_expected_keys?(data, *expected_keys)\n filter_keys(data, *expected_keys)\n data.each do |key, value|\n return false until correct_type?(key, value)\n end\n data.each do |key, value|\n return false until corresponds_to_constraint?(key, value)\n end\n return true\nend", "def test_spec_invalidity\n assert !@invalid_spec.valid?\n attributes = [:gender, :zip_code]\n attributes.each do |attr|\n assert @invalid_spec.errors.invalid?(attr)\n end\n end", "def test_truth\n assert_kind_of SiRevision, @si_revision\n end", "def test_item_should_be_of_proper_type\n assert_kind_of Product, items(:uranium_portion)\n assert_kind_of Product, items(:lightsaber)\n assert_kind_of Product, items(:holy_grenade)\n assert_kind_of Product, items(:chinchilla_coat)\n assert_kind_of Product, items(:towel)\n assert_kind_of Product, items(:the_stuff)\n end", "def test_appellation_invalidity\n assert !@invalid_appellation.valid?\n attributes = [:name, :apptype_id]\n attributes.each do |attribute|\n assert @invalid_appellation.errors.invalid?(attribute)\n end\n end", "def test_tipo\n assert_kind_of(Matriz_dispersa, @m3)\n assert_kind_of(Matriz_dispersa, @m4) #Matriz.vector siendo clase dispersa \n assert_kind_of(Matriz_densa, @m2)\n end", "def types_match?(api_map, expected, inferred); end", "def types_match?(api_map, expected, inferred); end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def new_material?\n codes[0..2] == %w[02 15 04]\n end", "def _validate_test_type(t)\n supported_test_types = Specification::DSL::SUPPORTED_TEST_TYPES.map(&:to_s)\n unless supported_test_types.include?(t.to_s)\n results.add_error('test_type', \"The test type `#{t}` is not supported. \" \\\n \"Supported test type values are #{supported_test_types}.\")\n end\n end", "def test_typecheck\n\t\tassert_raise( RuntimeError ) { Mob.new(\"1\", 2.0, 3) }\n\t\tassert_raise( RuntimeError ) { Mob.new(1, \"2.0\", 3) }\n\t\tassert_raise( RuntimeError ) { Mob.new(1, 2.0, \"3\") }\n\tend", "def result_types?(lab_test)\n lab_test.also_numeric? ||\n lab_test.ratio? || lab_test.range? || lab_test.fraction? || lab_test.text_length.present?\n end", "def check_create_lti_provider_data_validity(create_lti_provider_data)\n schema = {\n 'type' => 'object',\n 'required' => %w(LaunchPoint Secret UseDefaultTcInfo Key Name\n Description ContactEmail SendTcInfo\n SendContextInfo SendUserId SendUserName SendUserEmail\n SendLinkTitle SendLinkDescription SendD2LUserName\n SendD2LOrgDefinedId SendD2LOrgRoleId),\n 'properties' =>\n {\n 'LaunchPoint' => { 'type' => 'string' },\n 'Secret' => { 'type' => 'string' },\n 'UseDefaultTcInfo' => { 'type' => 'string' },\n 'Key' => { 'type' => 'string' },\n 'Name' => { 'type' => 'string' },\n 'Description' => { 'type' => 'string' },\n 'ContactEmail' => { 'type' => 'string' },\n 'IsVisible' => { 'type' => 'boolean' },\n 'SendTcInfo' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendContextInfo' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendUserId' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendUserName' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendUserEmail' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendLinkTitle' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendLinkDescription' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendD2LUserName' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendD2LOrgDefinedId' => { 'type' => 'boolean' }, # LE's 1.12+\n 'SendD2LOrgRoleId' => { 'type' => 'boolean' } # LE's 1.12+\n }\n }\n JSON::Validator.validate!(schema, create_lti_provider_data, validate_schema: true)\nend", "def test_types\n # rec = SourceRecord.new\n source = make_dummy_source(\"http://www.newstuff.org/createtypes\", N::FOAFX.Person, N::FOAFX.Foe)\n assert_not_nil(source)\n assert_property(source.types, N::FOAFX.Person, N::FOAFX.Foe, source.rdf_selftype)\n end", "def test_truth\n assert_kind_of Standard, @standard\n end", "def expected_type\n @data[\"expected_type\"]\n end", "def check_input_types\n inputfiles = {}\n inputfiles[:required] = %i{assembly mut_bulk}\n inputfiles[:optional] = %i{bg_bulk}\n if @options[:input_format] == 'bam'\n inputfiles[:required] << %i{mut_bulk_vcf}\n inputfiles[:optional] << %i{bg_bulk_vcf}\n end\n if @options[:polyploidy]\n inputfiles[:either] = %i{mut_parent bg_parent}\n end\n check_input_files(inputfiles)\n end", "def useful_validations_for_measure_type\n measure_types = selected_measure_types\n if measure_types[:discrete] == false\n Validation.all - Validation.all.measure_type('discrete')\n elsif measure_types[:continuous] == false\n Validation.all - Validation.all.measure_type('continuous')\n else\n Validation.all.to_a\n end\n end", "def gathered_materials?(materials, number = 1)\n materials.each{|material|\n return false if item_number(material.item) < material.quantity * number\n }\n true\n end", "def check_org_unit_updated_data_validity(org_unit_data)\n schema = {\n 'type' => 'object',\n 'required' => %w(Identifier Name Code Path Type),\n 'properties' => {\n 'Identifier' => { 'type' => 'string' },\n 'Name' => { 'type' => 'string' },\n 'Code' => { 'type' => 'string' },\n 'Path' => { 'type' => 'string' },\n 'Type' => {\n 'required' => %w(Id Code Name),\n 'properties' => {\n 'Id' => { 'type' => 'integer' },\n 'Code' => { 'type' => 'string' },\n 'Name' => { 'type' => 'string' }\n }\n }\n }\n }\n JSON::Validator.validate!(schema, org_unit_data, validate_schema: true)\nend", "def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def validate_field_types\n database_field_names.each do |field|\n field_info = self.class.get_table_info.select {|hash| hash[\"name\"] == field}.first\n check_field_value_matches_data_type(field_info, field) \n end\n @errors\n end", "def test_truth\n assert_kind_of AssessedElementDatum, @assessed_element_datum\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def check_org_unit_data_validity(org_unit_data)\n schema = {\n 'type' => 'object',\n 'required' => %w(Type Name Code Parents),\n 'properties' => {\n 'Type' => { 'type' => 'integer' },\n 'Name' => { 'type' => 'string' },\n 'Code' => { 'type' => 'string' },\n 'Parents' => {\n 'type' => 'array',\n 'items' => { 'type' => 'integer', 'minItems' => 1 }\n }\n }\n }\n JSON::Validator.validate!(schema, org_unit_data, validate_schema: true)\nend", "def test_for_format_of_iasxx_is_valid\n # test conditions\n a1_list = %W{ isa11 isa14 isa15 isa16 } \n a2_list = %W{ isa01 isa03 isa05 isa07 }\n a4_list = %W{ isa10 }\n a5_list = %W{ isa12 }\n a6_list = %W{ isa09 }\n a9_list = %W{ isa13 }\n a10_list = %W{ isa02 isa04 }\n a15_list = %W{ isa06 isa08 }\n list = a1_list + a2_list + a4_list + a5_list + a6_list + a9_list + a10_list + a15_list\n\n # Create object\n e = Editransaction.new\n\n # Test for > 0, 1, max +\n list.each do |x|\n # test for 0\n e[x] = 0 \n e.valid?\n assert e.errors.invalid?(x)\n assert_equal I18n.translate('activerecord.errors.messages.invalid'), e.errors.on(x)\n e.errors.clear\n\n # test for 1\n e[x] = 1\n e.valid?\n assert !e.errors.invalid?(x)\n\n # test for max +\n e[x] = '123456789101112131415'\n e.valid?\n assert e.errors.invalid?(x)\n end \n end", "def test_truth\n assert_kind_of Sample, @sample\n end", "def verify_with_schema(test_file)\n schema_file = '../json_schema/cr_metadata_api_format_corrected.json'\n schema = Pathname.new(schema_file)\n schemer = JSONSchemer.schema(schema)\n json_file = nil\n File.open(test_file,\"r\") do |f|\n json_file = JSON.parse(f.read)\n end\n if schemer.valid?(json_file)\n # puts test_file + \" matches \" + schema_file\n return true\n else\n # puts \"** \"+test_file + \" does not match \" + schema_file\n return false\n end\nend", "def test_validate_patient_name_and_account_number_with_consecutive_occurrence_of_valid_special_characters\n image_type_record = ImageType.new\n image_type_record.patient_first_name = \"RAJ..p\"\n image_type_record.patient_last_name = \"mek..ha\"\n image_type_record.patient_account_number= \"A89--990\"\n image_type_record.image_type = \"NOT\"\n image_type_record.save\n assert !image_type_record.valid?, image_type_record.errors.full_messages.to_s\n end", "def should_validate_attachment_content_type name, options = {}\n klass = self.name.gsub(/Test$/, '').constantize\n valid = [options[:valid]].flatten\n invalid = [options[:invalid]].flatten\n context \"Class #{klass.name} validating content_types on #{name}\" do\n valid.each do |type|\n context \"being assigned a file with a content_type of #{type}\" do\n setup do\n @file = StringIO.new(\".\")\n class << @file; attr_accessor :content_type; end\n @file.content_type = type\n @attachment = klass.new.send(name)\n @attachment.assign(@file)\n end\n should \"not have a :content_type validation error\" do\n assert ! @attachment.errors[:content_type]\n end\n end\n end\n invalid.each do |type|\n context \"being assigned a file with a content_type of #{type}\" do\n setup do\n @file = StringIO.new(\".\")\n class << @file; attr_accessor :content_type; end\n @file.content_type = type\n @attachment = klass.new.send(name)\n @attachment.assign(@file)\n end\n should \"have a :content_type validation error\" do\n assert @attachment.errors[:content_type]\n end\n end\n end\n end\n end", "def matched_item_and_model\n return unless equipment_item\n return unless equipment_model\n return unless equipment_item.equipment_model != equipment_model\n errors.add(:base, equipment_item.name + ' must be of type '\\\n + equipment_model.name + \".\\n\")\n end", "def check_magics(file)\r\n if file.respond_to? :read\r\n check_magics_type(file, @magics)\r\n else\r\n open(file) {|f| check_magics_type(f, @magics) }\r\n end\r\n end", "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def test_conversion_types_should_be_different\n food_conversion = create\n assert food_conversion.valid?, \"The conversion was invalid:\\n #{food_conversion.to_yaml}\"\n food_conversion.conversion_units = food_conversion.equivalent_units\n assert !food_conversion.valid?, \"Conversion should have been invalid\"\n assert_not_nil food_conversion.errors.on(:conversion_units), \"conversion_units should have had an error\"\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def material_type\n attributes['material_type']\n end", "def material_type\n attributes['material_type']\n end", "def verify_set?(set)\n is_set = false # keep track of valid set\n\n # get arrays of the cards' attributes\n colors = [set[0].color, set[1].color, set[2].color]\n numbers = [set[0].number, set[1].number, set[2].number]\n shapes = [set[0].shape, set[1].shape, set[2].shape]\n textures = [set[0].texture, set[1].texture, set[2].texture]\n\n # or any attribute, if the attribute is the same or different\n # across the cards then the cards are a set.\n # this checks that no attribute is the same for two cards\n # and different for another, because that is the only case\n # where the cards are not a set.\n if colors.uniq.length != 2 && numbers.uniq.length != 2 && shapes.uniq.length != 2 && textures.uniq.length != 2\n is_set = true\n end\n\n # make sure no cards are duplicates\n if set.uniq.length != 3\n is_set = false\n end\n\n is_set # return value\nend", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def verify_result()\n #puts \"{#@recode}\" \"return code\"\n #puts \"{#@expect_code}\" \"expect code\"\n # method to show object's type, include both basic type and class type.\n #puts @recode.class\n #puts @expect_code.class\n # to_i to interger\n # to_f to float\n # to_s to string\n \n if @recode == @expect_code.to_s\n @output.puts \"Verification Success\"\n puts \"Verification Success\"\n\n else\n @output.puts \"ERROR: Verification Failiure errorcode:\" + @recode + \" errormsg:\" + @remsg\n puts \"ERROR: Verification Failiure error code:\" + @recode + \" errormsg:\" + @remsg\n end\n\n end", "def test_parser_valid_data\n \n assert Yay::PARSER_TESTS.kind_of? Hash\n\n Yay::PARSER_TESTS.each_pair { |input, expected| \n assert input.kind_of? String\n assert expected.kind_of? Array\n }\n\n end", "def test_type_checks_work\n assert_raises(ArgumentError) {\n VLib.new.get_length(10)\n }\n assert_raises(ArgumentError) {\n VLib.new.get_str_length(10)\n }\n VLib.new.sum_3(10, 4, 2.0)\n assert_raises(ArgumentError) {\n VLib.new.sum_3(10, 4, 2)\n }\n assert_raises(ArgumentError) {\n VLib.new.sum_3(10.9, 4, 2.0)\n }\n end", "def test_type_checks_work\n assert_raises(ArgumentError) {\n VLib.new.get_length(10)\n }\n assert_raises(ArgumentError) {\n VLib.new.get_str_length(10)\n }\n VLib.new.sum_3(10, 4, 2.0)\n assert_raises(ArgumentError) {\n VLib.new.sum_3(10, 4, 2)\n }\n assert_raises(ArgumentError) {\n VLib.new.sum_3(10.9, 4, 2.0)\n }\n end", "def verify_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n errors = []\n test_terms.each_with_index do |test_term, index|\n text_values_match?(test_term[Org::TERM_DISPLAY_NAME.name], element_value(org_display_name_input index), errors)\n text_values_match?(test_term[Org::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[Org::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[Org::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[Org::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[Org::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[Org::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[Org::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[Org::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "def emma_data_valid?\n if emma_data.blank?\n error(:emma_data, :missing)\n else\n check_required(database_fields[:emma_data], emma_metadata)\n end\n errors.empty?\n end", "def valid_type?(data_type)\n object_type = @plural_form ||\n @object_instance.class.name.pluralize.underscore.dasherize\n unless data_type == object_type\n return set_failure_message(\n format(FailureMessages::DATA_TYPE_MISMATCH, data_type, object_type)\n )\n end\n true\n end", "def test_csv_table_match(subject)\n # Compare the fields\n if !subject.empty?\n subject_fields = subject[0].keys\n master_fields = @golden_master.headers\n\n if subject_fields.count != master_fields.count\n throw_no_match \"Expected #{master_fields.count} field(s), got #{subject_fields.count}\"\n end\n\n master_fields.each_with_index do |column, index|\n if column != subject_fields[index]\n throw_no_match \"Expected field \\\"#{column}\\\", got field \\\"#{subject_fields[index]}\\\"\"\n end\n end\n end\n\n # Compare the number of records\n subject_record_count = subject.count\n master_record_count = @golden_master.inject(0){|count| count += 1}\n if subject_record_count != master_record_count\n throw_no_match \"Expected #{master_record_count} record(s), got #{subject_record_count}\"\n end\n\n # Compare the values of the golden master with the subject\n current_row = 0\n @golden_master.each do |row|\n row.each do |field, master_string|\n subject_value = subject[current_row][field]\n if !match_values?(master_string, subject_value)\n throw_no_match \"Field \\\"#{field}\\\", Record #{current_row + 1}: Expected value #{master_string.nil? ? '<NULL>' : \"\\\"#{master_string}\\\"\"}, got #{subject_value.nil? ? '<NULL>' : \"\\\"#{subject_value}\\\"\"}\"\n end\n end\n current_row += 1\n end\n end", "def material_item?\n @itype_id == 4\n end", "def check_rr_data(rrset, sigrec)#:nodoc: all\n # Each RR MUST have the same owner name as the RRSIG RR;\n if (rrset.name.canonical != sigrec.name.canonical)\n raise VerifyError.new(\"RRSET should have same owner name as RRSIG for verification (rrsert=#{rrset.name}, sigrec=#{sigrec.name}\")\n end\n\n # Each RR MUST have the same class as the RRSIG RR;\n if (rrset.klass != sigrec.klass)\n raise VerifyError.new(\"RRSET should have same DNS class as RRSIG for verification\")\n end\n\n # Each RR in the RRset MUST have the RR type listed in the\n # RRSIG RR's Type Covered field;\n if (rrset.type != sigrec.type_covered)\n raise VerifyError.new(\"RRSET should have same type as RRSIG for verification\")\n end\n\n # #Each RR in the RRset MUST have the TTL listed in the\n # #RRSIG Original TTL Field;\n # if (rrset.ttl != sigrec.original_ttl)\n # raise VerifyError.new(\"RRSET should have same ttl as RRSIG original_ttl for verification (should be #{sigrec.original_ttl} but was #{rrset.ttl}\")\n # end\n\n # Now check that we are in the validity period for the RRSIG\n now = Time.now.to_i\n if ((sigrec.expiration < now) || (sigrec.inception > now))\n raise VerifyError.new(\"Signature record not in validity period\")\n end\n end", "def check_numericity\n check_patterns(@income.to_s)\n check_patterns(@age.to_s)\n end", "def validate_arrays(typeform_array, database_array, person)\n if database_array.size != typeform_array.size\n print_submission_arrays_info(typeform_array, database_array, person)\n return false\n end\n database_array.each_with_index do |element, index|\n if element != typeform_array[index]\n print_submission_arrays_info(typeform_array, database_array, person)\n return false\n end\n end\n true\n end", "def verify_schema_hash\r\n expect(Schema.schema_hash_i).to be_instance_of(Hash)\r\n %w{person org}.each{|e| expect(Schema.schema_hash.keys).to include(e)}\r\n end", "def validate_keys_are_correct\n raise InvalidAttributeError, \"#{EXPECTED_MODELS - json.keys} were not found in the mixtape.json file\" unless (EXPECTED_MODELS - json.keys).empty?\n end", "def test_truth\r\n assert_kind_of Question, @question\r\n end", "def propertyTypeCheck(output, prop_data, data_source)\r\n output[data_source.to_sym][:dataSource] << data_source.to_s\r\n output[data_source.to_sym][:metricsNames] << \"Property Use\"\r\n output[data_source.to_sym][:metricsUsage] << \"Property Type\"\r\n\r\n # Initialize comment\r\n comment = \"Has to be Single family Condominium or Townhouse\"\r\n\r\n # Check if value is present\r\n if prop_data[:propType].nil?\r\n output[data_source.to_sym][:metrics] << \"N/A\" \r\n output[data_source.to_sym][:metricsPass] << true\r\n output[data_source.to_sym][:metricsComments] << \"Data Not Available\"\r\n return\r\n end\r\n\r\n # If the property type field exists - perform the checks\r\n if !prop_data[:propType].nil?\r\n acceptable_props = [\"SingleFamily\", \"Condominium\", \"Townhouse\"] if data_source.to_s == \"Zillow\"\r\n acceptable_props = [\"singleFamily\", \"condominium\", \"loft\", \"apartmentBuilding\"] if data_source.to_s == \"MLS\"\r\n #acceptable_props = [\"SingleFamily\", \"Condominium\", \"Townhouse\"] if data_source.to_s == \"FA\"\r\n\r\n value = prop_data[:propType]\r\n pass = acceptable_props.include? prop_data[:propType]\r\n end\r\n\r\n # Save values\r\n output[data_source.to_sym][:metrics] << value\r\n output[data_source.to_sym][:metricsPass] << pass\r\n output[data_source.to_sym][:metricsComments] << comment\r\n end", "def verify_collection_data(expected_collection_data, actual_collection_data)\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expect(actual_collection_data).to match_with_type(expected_collection_data)\n end\n end", "def verify\n end", "def validate_claimant_type\n return unless claimant_type == 'veteran' && signing_appellant.claimant?\n\n source = '/data/attributes/claimantType'\n\n errors.add source, I18n.t('appeals_api.errors.sc_incorrect_claimant_type')\n end", "def matches?(actual)\n matches_type?(actual)\n end", "def test_has_teen\n\t\tassert_equal false, @m.has_teen?(1, 2, 3)\n\t\tassert_equal true, @m.has_teen?(0, 10, 14)\n\t\tassert_equal false, @m.has_teen?(21, 8, 8)\n\tend", "def test_truth\n assert_kind_of Tech, teches(:first)\n end", "def test_validation\n \n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-')\n pcba_pn = '500-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No - PCB, PCBA part numbers are not unique.\n pcba_pn = '600-123-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert( pn.error_message)\n assert_equal('The PCB part number (600-123-a0 a) and the PCBA part number ' +\n \"(600-123-00 b) must be unique - YOUR PART NUMBER WAS NOT CREATED\",\n pn.error_message)\n \n\n # Valid? - No - Format bad, short prefix\n pcb_pn = '12-123-a0'.split('-')\n pcba_pn = '34-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No - Format bad, illegal characters in the prefix\n pcb_pn = '12e-123-a0'.split('-')\n pcba_pn = 'pcb-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, wrong number of characters in the number\n pcb_pn = '127-3-a0'.split('-')\n pcba_pn = '128-21-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the number\n pcb_pn = '127-###-a0'.split('-')\n pcba_pn = '128-JPA-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the dash number\n pcb_pn = '127-714-*'.split('-')\n pcba_pn = '128-755-!&'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert(!pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes\n pcb_pn = '127-714-01'.split('-')\n pcba_pn = '128-755-a0'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n\n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No, pcb pn exists.\n pcb_pn = '252-700-b0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n \n # Valid? - No, pcb pn duplicates pcba pn \n pcb_pn = '259-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'b'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n # Valid? - No, pcb pn prefix contains the wrong number of characters \n pcb_pn = '12-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No, pcb pn prefix contains illegal characters \n pcb_pn = '12e-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains wrong number of characters \n pcb_pn = '127-3-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n #assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains illegal characters \n pcb_pn = '127-#*@-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn dash number contains wrong number of, and illegal, characters \n pcb_pn = '127-714-@'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes \n pcb_pn = '127-714-01'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n \n assert(!pn.exists?)\n assert_nil(pn.error_message)\n pn.save\n assert(pn.exists?)\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n\n assert(PartNumber.valid_prefix?('100'))\n assert(!PartNumber.valid_prefix?('1'))\n assert(!PartNumber.valid_prefix?('a'))\n assert(!PartNumber.valid_prefix?('10'))\n assert(!PartNumber.valid_prefix?('a7'))\n assert(!PartNumber.valid_prefix?('1aa'))\n assert(!PartNumber.valid_prefix?('a00'))\n assert(!PartNumber.valid_prefix?('1776'))\n assert(!PartNumber.valid_prefix?('a345'))\n \n assert(PartNumber.valid_number?('100'))\n assert(!PartNumber.valid_number?('1'))\n assert(!PartNumber.valid_number?('a'))\n assert(!PartNumber.valid_number?('10'))\n assert(!PartNumber.valid_number?('a7'))\n assert(!PartNumber.valid_number?('1aa'))\n assert(!PartNumber.valid_number?('a00'))\n assert(!PartNumber.valid_number?('1776'))\n assert(!PartNumber.valid_number?('a345'))\n \n assert(PartNumber.valid_dash_number?('a0'))\n assert(PartNumber.valid_dash_number?('0a'))\n assert(!PartNumber.valid_dash_number?('a'))\n assert(!PartNumber.valid_dash_number?('4'))\n assert(!PartNumber.valid_dash_number?('aa33'))\n assert(!PartNumber.valid_dash_number?('333'))\n \n # Create known part numbers for testing.\n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-802-00'.split('-')\n pcba_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-01'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n\n pn = PartNumber.initial_part_number\n pcb_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert(!pn.valid_components?('not'=='new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n pcba_pn = '700-900-90'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n \n pcba_pn = '000-000-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n end", "def check_course_template_updated_data_validity(course_template_data)\n schema = {\n 'type' => 'object',\n 'required' => %w(Name Code),\n 'properties' => {\n 'Name' => { 'type' => 'string' },\n 'Code' => { 'type' => 'string' }\n }\n }\n JSON::Validator.validate!(schema, course_template_data, validate_schema: true)\nend", "def check_course_template_data_validity(course_template_data)\n schema = {\n 'type' => 'object',\n 'required' => %w(Name Code Path ParentOrgUnitIds),\n 'properties' => {\n 'Name' => { 'type' => 'string' },\n 'Code' => { 'type' => 'string' },\n 'Path' => { 'type' => 'string' },\n 'ParentOrgUnitIds' => {\n 'type' => 'array',\n 'items' => { 'type' => 'integer', 'minItems' => 1 }\n }\n }\n }\n JSON::Validator.validate!(schema, course_template_data, validate_schema: true)\nend", "def test_input\n problems = []\n @app_spectra.each do |app_spectrum|\n problems << 'App spectrum has a nil target defined in its image set' if app_spectrum.image_set.target.nil?\n end\n problems\n end", "def unc_thesis_dissertation?\n rec_type_match = manuscript_lang_rec_type? || lang_rec_type?\n nature_contents_match = record.fields('008').find do |field|\n (field.value.byteslice(24..27) || '').split('').include?('m')\n end\n\n marc_006_match_results = record.fields('006').collect do |field|\n %w[a].include?(field.value.byteslice(0)) &&\n (field.value.byteslice(7..10) || '').split('').include?('m')\n end\n\n return true if (rec_type_match && nature_contents_match) ||\n marc_006_match_results.include?(true) ||\n rec_type_match && has_502?\n end", "def is_datatype?(); @type == GRT_DATATYPE; end", "def matched_object_and_model\n return unless equipment_object\n return unless equipment_model\n if equipment_object.equipment_model != equipment_model\n errors.add(:base, equipment_object.name + \" must be of type \" + equipment_model.name + \".\\n\")\n end\n end", "def test_type_of_room \n assert_equal(@room.type_of_room, \"Emperor Suite\")\n end", "def expected\n PatientIdentifier.new(test_type_data || {})\n end", "def valid?\n self.class.matcher.match? data\n end", "def validate(data_value, data_type=nil)\n #TODO: port from python runtime\n end", "def validate(data_value, data_type=nil)\n #TODO: port from python runtime\n end", "def assert_model_valid(instance)\n instance.value_attributes_for_avro\n expect(instance).to be_valid\n end", "def test_typecheck\n\t\tassert_raise( RuntimeError ) { FreeId.new(\"0\", [], 1) }\n\t\tassert_raise( RuntimeError ) { FreeId.new(0, \"[]\", 1) }\n\t\tassert_raise( RuntimeError ) { FreeId.new(0, [], \"1\") }\n\tend", "def test_truth\n assert_kind_of GameFile, @game_file\n end", "def test_truth\n assert_kind_of Taxon, @taxon\n end", "def validate_type(type, context:); end", "def check_file_type\n if self.is_pdf?\n {\n :square_thumb => ['200x200#', :png],\n :annotation_thumb => ['300x200#', :png],\n :medium => ['500x500>', :png]\n }\n\n elsif self.is_video?\n {\n :square_thumb => { \n :geometry => '200x200!',\n :format => 'jpg',\n :time => 1\n }, \n :annotation_thumb => {\n :geometry => '300x200!',\n :format => 'jpg',\n :time => 1\n },\n :medium => { \n :geometry => '500x500>',\n :format => 'jpg',\n :time => 1\n },\n :transcoded_video => {\n :geometry => '300x200!',\n :format => 'mp4'\n }\n }\n elsif self.is_audio?\n {\n :audio => {\n :format => 'mp3'\n }\n }\n elsif self.is_image?\n {\n :square_thumb => '200x200#', \n :annotation_thumb => '300x200#',\n :medium => '500x500>'\n }\n else\n {}\n end\n end", "def validate_type_conforms(obj, field, errors)\n errors << \"Dataset type conformity validation failed for obj: #{obj} against field: #{field}\" unless type_conforms?(obj, field)\n errors\n end" ]
[ "0.83487576", "0.70979154", "0.6338917", "0.62564254", "0.60257024", "0.598183", "0.59112257", "0.5895662", "0.5881709", "0.5857173", "0.5820585", "0.58130556", "0.58076584", "0.57677066", "0.57661945", "0.5734019", "0.5653002", "0.5621054", "0.5612898", "0.55921984", "0.55868316", "0.5580644", "0.55736107", "0.55736107", "0.55636984", "0.5526102", "0.55177647", "0.5516622", "0.5514997", "0.55134654", "0.5506896", "0.5496499", "0.5480298", "0.5461256", "0.54559445", "0.5451545", "0.5451465", "0.54190034", "0.540182", "0.5376224", "0.53744066", "0.5371853", "0.53639656", "0.53635365", "0.53626955", "0.5355353", "0.53543055", "0.5338064", "0.53297937", "0.532568", "0.5322252", "0.5309208", "0.5304425", "0.5302036", "0.52971", "0.5296317", "0.5296317", "0.5293523", "0.5292735", "0.52923775", "0.5290377", "0.5268574", "0.5268574", "0.52672654", "0.52557755", "0.52461296", "0.5233722", "0.5227755", "0.52171725", "0.5217098", "0.5211608", "0.52091545", "0.5206611", "0.5206049", "0.5203577", "0.51984245", "0.51973575", "0.51909727", "0.5187472", "0.5187372", "0.51871836", "0.51853925", "0.5183085", "0.5182602", "0.5180993", "0.5164303", "0.51488006", "0.5145937", "0.51441777", "0.5143759", "0.5142278", "0.51328623", "0.51328623", "0.5132481", "0.51266605", "0.5126443", "0.51254946", "0.5117704", "0.5116973", "0.51152843" ]
0.8319044
1
USERS Enters users data per a given set of test data
def enter_users(test_data) users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USER_GRP.name)], users) users.each_with_index do |user, index| logger.info "Entering user data set at index #{index}: #{user}" enter_auto_complete(user_name_input(index), user_name_options(index), user[CoreUseOfCollectionsData::USER.name], 'Local Persons') wait_for_options_and_select(user_type_input(index), user_type_options(index), user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name]) wait_for_options_and_select(user_role_input(index), user_role_options(index), user[CoreUseOfCollectionsData::USER_UOC_ROLE.name]) enter_auto_complete(user_institution_input(index), user_institution_options(index), user[CoreUseOfCollectionsData::USER_INSTITUTION.name], 'Local Organizations') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USER_GRP.name)], users)\n\n users.each_with_index do |user, index|\n enter_auto_complete(user_name_input(index), user_name_options(index), user[UseOfCollections::USER.name], 'Local Persons')\n wait_for_options_and_select(user_type_input(index), user_type_options(index), user[UseOfCollections::USER_INSTITUTION_ROLE.name])\n wait_for_options_and_select(user_role_input(index), user_role_options(index), user[UseOfCollections::USER_UOC_ROLE.name])\n enter_auto_complete(user_institution_input(index), user_institution_options(index), user[UseOfCollections::USER_INSTITUTION.name], 'Local Organizations')\n end\n end", "def verify_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[UseOfCollections::USER.name], element_value(user_name_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[UseOfCollections::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def update_users\n\tusers = [['adoni','Biwi'],\n\t['biwi','Biwi'],\n\t['dyton','Biwi'],\n\t['bwalo','Bwalo 1'],\n\t['bwalo2','Bwalo 2'],\n\t['bwatha','Bwatha'],\n\t['zunguzeni','Bwatha'],\n\t['chagamba','Chagamba'],\n\t['kelvin','Chagamba'],\n\t['chakale','Chakala'],\n\t['chalasa','Chalasa'],\n\t['chaonya','Chaonya'],\n\t['kenivasi','Chaonya'],\n\t['chidalanda','Chidalanda'],\n\t['gilbert','Chidalanda'],\n\t['chembekezo','Chidzele'],\n\t['chigo','Chikamba'],\n\t['chikamba','Chikolokoto'],\n\t['abisoni','Chimphepo'],\n\t['chimphepo','Chimphepo'],\n\t['salimoni','Chimphepo'],\n\t['chisomba','Chisomba'],\n\t['rose','Chisomba'],\n\t['biliyati','Chitawa'],\n\t['liana','Chitawa'],\n\t['rihanna','Chitawa'],\n\t['chithengo','Chithengo'],\n\t['yoki','Chithengo'],\n\t['chitululu','Chitululu'],\n\t['chizumba','Chizumba'],\n\t['chule','Chule 1'],\n\t['kathumba','Chule 1'],\n\t['rodiwelo','Chule 1'],\n\t['chule2','Chule 2'],\n\t['kambizeni','Chule 2'],\n\t['dongo','Dongolosi'],\n\t['dongolosi','Dongolosi'],\n\t['fainda','Fainda'],\n\t['yolamu','Fainda'],\n\t['beatrice','Kabzyoko'],\n\t['kabzoko','Kabzyoko'],\n\t['kacheche','Kacheche'],\n\t['esawo','Kalulu'],\n\t['kamadzi','Kamadzi'],\n\t['steve','Kamadzi'],\n\t['kambira','Kambiri'],\n\t['kambulire','Kambulire 1'],\n\t['kambulire2','Kambulire 2'],\n\t['sankhani','Kambulire 2'],\n\t['kamphinga','Kamphinga'],\n\t['kaninga','Kaninga'],\n\t['kondwani','Kaninga'],\n\t['kanyoza','Kanyoza'],\n\t['bazale','Kanyoza'],\n\t['lotale','Kazinkambani'],\n\t['kholongo','Kholongo'],\n\t['david',\"M’maso\"],\n\t['davie',\"M’maso\"],\n\t['mayikolo','Malenga'],\n\t['mankhwazi','Mankhwazi'],\n\t['jenet','Maole'],\n\t['maole','Maole'],\n\t['maselero','Maselero'],\n\t['charles','Masumba'],\n\t['masumba','Masumba'],\n\t['weluzani','Masumba'],\n\t['matchakaza','Matchakaza'],\n\t['william','Matchakaza'],\n\t['mawunda','Maunda'],\n\t['mazira','Mazira'],\n\t['kazimkambani','Mbalame'],\n\t['mbalame','Mbalame'],\n\t['mblame','Mbalame'],\n\t['mbewa','Mbewa'],\n\t['mbulachisa','Mbulachisa'],\n\t['kasakula','Mchena'],\n\t['mchena','Mchena'],\n\t['nchazime','Mchezime'],\n\t['henry','Mdzoole'],\n\t['mdzoole','Mdzoole'],\n\t['mfuti','Mfuti'],\n\t['mgwadula','Mgwadula'],\n\t['misewu','Misewo'],\n\t['mkupeta','Mkupeta'],\n\t['mmaso','Mmaso'],\n\t['brino','Mndele'],\n\t['mphandu','Mphandu'],\n\t['mphonde','Mphonde'],\n\t['mseteza','Mseteza'],\n\t['jackson','Mtema 1'],\n\t['makombe','Mtema 1'],\n\t['mtema1','Mtema 1'],\n\t['fredrick','Mtema 2'],\n\t['mtsukwachikupa','Mtsukwa Chikupa'],\n\t['mtsukwakalonje','Mtsukwa Kalonje'],\n\t['mutu','Mutu'],\n\t['mwaza','Mwaza'],\n\t['mtsatsula','Mzingo'],\n\t['hezekia','Mzumanzi 1'],\n\t['mzumazi2','Mzumanzi 2'],\n\t['nzumazi2','Mzumanzi 2'],\n\t['nzumazi','Mzumazi 1'],\n\t['ndalama','Ndalama'],\n\t['ngoza','Ngoza'],\n\t['sitima','Ngoza'],\n\t['nkhadani1','Nkhadani 1'],\n\t['nkhadani2','Nkhadani 2'],\n\t['nkhanamba','Nkhanamba'],\n\t['konkha','Nkhonkha'],\n\t['amosi','Nkhutchi'],\n\t['chisisi','Nkhutchi'],\n\t['andrew','Nkhutchi'],\n\t['ezala','Nsanda'],\n\t['ezara','Nsanda'],\n\t['nsanda','Nsanda'],\n\t['pheleni','Pheleni'],\n\t['laston','Suntche 1'],\n\t['suntche1','Suntche 1'],\n\t['jonathani','Suntche 1'],\n\t['boston','Suntche 2'],\n\t['suntche2','Suntche 2'],\n\t['jonas','Taiza'],\n\t['kwimbayani','Taiza'],\n\t['taiza','Taiza'],\n\t['joseph','Wayakumseche']]\n\t\n\t#-----------------------------\n\t\n\t(users || []).each do |user|\n\t\tusername = user[0]\n\t\tvillage_name = user[1]\n\t\tuser_village = Village.find_by_name(village_name)\n\t\tif user_village.nil?\n\t\t\tputs \"#{user} failed to update. Moving on to next user\"\n\t\t\tnext\n\t\tend\n\t\t\n\t\tuser_district = District.find_by_name('Lilongwe')\n\t\t\n\t\tuser_update = User.find(username)\n\t\tnext if user_update.nil?\n\t\t\n\t\tuser_update.district_id = user_district.id\n\t\tuser_update.ta_id = user_village.ta_id\n\t\tuser_update.village_id = user_village.id\n\t\tuser_update.save\n\t\t\n\t\tputs \"Username #{user} updated successfully \\n\"\n\tend\nend", "def verify_users(test_data)\n users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def process_workshop_users(data)\n\t\tdata.each do |item|\n\t\t\tif item[:password] == \"local\"\n\t\t\t\titem[:password] = @user.password\n\t\t\tend\n\t\t\t@user.create_user(item)\n\t\tend\n\tend", "def update_user_data\n $users.each {|user| \n if $current_user[:username] == user[0]\n user[2] = $current_user[:balance]\n user[3] = $current_user[:streak]\n CSV.open(\"user_data.csv\", \"w\") do |csv|\n $users.each {|x| csv << x}\n end\n end\n }\nend", "def update_user_data!(owner_user_ids)\n owner_user_ids.each do|user_id|\n ::User.recalculate_item_count_of!(user_id)\n end\n end", "def set_users\n\n end", "def sync_all_active_users\n prepare_sis_user_import\n get_canvas_user_report_file\n load_active_users\n process_updated_users\n process_new_users\n Canvas::MaintainUsers.handle_changed_sis_user_ids(@sis_user_id_updates)\n import_sis_user_csv\n end", "def process_updated_users\n CSV.foreach(get_canvas_user_report_file, :headers => :first_row) do |canvas_user|\n uid = canvas_user['login_id']\n\n # process only if found in campus data\n if @active_sis_users[uid]\n active_campus_user = canvas_user_from_campus_row(@active_sis_users[uid])\n\n # if SIS User ID has changed\n if canvas_user['user_id'] != active_campus_user['user_id']\n @sis_user_id_updates[\"sis_login_id:#{canvas_user['login_id']}\"] = active_campus_user['user_id']\n end\n\n unless Canvas::MaintainUsers.provisioned_account_eq_sis_account?(canvas_user, active_campus_user)\n logger.debug(\"Updating user #{canvas_user} with #{active_campus_user}\")\n add_user_to_import(active_campus_user)\n end\n @active_sis_users.delete(uid)\n end\n end\n end", "def set_users\n \n columns=params[:columns]\n order=params[:order][\"0\"]\n search_list=User.attribute_names.select do |item|\n !@model_config[item].nil? && @model_config[item][\"searchable\"]\n end\n @filteredUsers=User.all\n @filteredUsers=@filteredUsers.order(\"#{columns[order[\"column\"]][\"data\"]} #{order[\"dir\"]}\") #单项排序\n @users=@filteredUsers.offset(params[:start]).limit(params[:length])\n end", "def process_users(users)\n users.each do |element|\n user = User.new(element, @bot)\n @users[user.id] = user\n end\n end", "def bulk_update(users = [])\n Iterable.request(conf, '/users/bulkUpdate').post(users: users)\n end", "def test_user_update\n new_data = {\n 'OrgDefinedId' => 'ruby-test',\n 'FirstName' => 'Test-User',\n 'MiddleName' => 'changed',\n 'LastName' => 'Test',\n 'ExternalEmail' => nil, # Predefines user data, in the case that\n 'UserName' => 'test-ruby-user1234', # there is are variables left out in the JSON\n 'Activation' => {\n 'IsActive' => true\n }\n }\n user_id = get_user_by_username(new_data['UserName'])['UserId']\n update_user_data(user_id, new_data)\n end", "def users(count = 1, options = {}, is_admin = false)\n count.times do \n user = User.new({ email: random_unique_email,\n first_name: Faker::Name.first_name,\n last_name: Faker::Name.last_name, \n password: 'test1234', \n password_confirmation: 'test1234' }.merge(options))\n user.save\n if is_admin\n user.update_attribute(:role, 'admin')\n self.report.increment(:admins, 1)\n end\n end\n \n self.report.increment(:users, count)\n end", "def modify_user_data(data)\n @user_data.merge!(data)\n end", "def load_users\n user_set = Set[]\n @users_config.each_key do |provider|\n @users_config[provider].each do |a|\n add_user(a, user_set, provider)\n end\n end\n add_users_to_group(user_set)\n end", "def enter_pahma_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USER_GRP.name)], users)\n\n users.each_with_index do |user, index|\n enter_auto_complete(user_name_input(index), user_name_options(index), user[UseOfCollections::USER.name], 'PAHMA Persons')\n wait_for_options_and_select(user_type_input(index), user_type_options(index), user[UseOfCollections::USER_INSTITUTION_ROLE.name])\n wait_for_options_and_select(user_role_input(index), user_role_options(index), user[UseOfCollections::USER_UOC_ROLE.name])\n enter_auto_complete(user_institution_input(index), user_institution_options(index), user[UseOfCollections::USER_INSTITUTION.name], 'PAHMA Organizations')\n end\n end", "def test_multiple_users_should_update_test_result_under_c1_0\n test_target_instance = get_new_test_target_instance(\"example5\", \"2012112805\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_PASS, 'test_case_1')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b01, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b10, 0b11, 2)\n end", "def populate_judge_team_for_testing(judge_team, judge_user, attorneys)\n judge_team.users << judge_user\n attorneys.each do |u|\n judge_team.users << u\n end\n judge_orguser = OrganizationsUser.existing_record(judge_user, judge_team)\n judge_orguser.update!(admin: true)\n end", "def create_test_users\n Instrument.all.each do |instrument|\n u = User.new(email: \"#{instrument.display_name.gsub(' ', '-').downcase}@mmr.org\", test: true)\n u.password = \"mmr\"\n u.save!\n end\nend", "def create_test_users\n Instrument.all.each do |instrument|\n u = User.new(email: \"#{instrument.display_name.gsub(' ', '-').downcase}@mmr.org\", test: true)\n u.password = \"mmr\"\n u.save!\n end\nend", "def set_users\n @users = User.all.where(user_type: \"chw\")\n end", "def users=(value)\n @users = value\n end", "def extra_users_data_look_up\n return if @results.empty?\n\n tickets = DataStore.instance.tickets\n @results.each do |user|\n ticket_names = tickets.select { |t| t['assignee_id'] == user['_id'] }.map { |t| t['subject'] }\n user['tickets'] = ticket_names\n end\n end", "def test_multiple_users_should_update_test_results_under_c2\n test_target_instance = get_new_test_target_instance(\"example7\", \"2012112807\")\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b10, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b01, 0b11)\n end", "def users=(user_ids)\n self.users.delete_all # Not very pretty\n user_ids.each do |user_id|\n self.users << User.find(user_id) unless user_id.blank?\n end\n end", "def test_multiple_users_should_update_test_result_under_c1_1\n test_target_instance = get_new_test_target_instance(\"example6\", \"2012112806\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b10, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b10, 0b11, 2)\n end", "def test_mfu_set_stats_mfu1K\n \n user_id = 1\n db_idx = 0\n \n #update 100 users in database to set stats in order to add them in MFU\n for j in 1..10 do\n $test_logger.result_log(\"Adding user chunk='#{j}'\")\n exp_uid_stats = Hash.new\n for i in 1..10 do\n exp_uid_stats[user_id.to_s] = 5555\n user_id += 1\n end\n\n #Call API to load MFU stats\n @@cmd_proc.call_thrift{mfu_set_stats(db_idx, exp_uid_stats)}\n \n exp_uid_stats.clear\n\n end\n \n end", "def fill_users_items(item,exuser,users,items)\r\n\t\t@db.each { |u,i|\r\n\t\t\tnext if(u==exuser)\r\n\t\t\tif i == item\r\n\t\t\t\tusers[u] += 1\r\n\t\t\t\titems[i] += 1\r\n\t\t\tend\r\n\t\t\t}\r\n\tend", "def users=(params)\n @users = params.values.map { |r| UserImport::User.new(r.values) }\n end", "def process_new_users\n logger.warn(\"#{@active_sis_users.length} new user accounts detected. Adding to SIS User Import CSV\")\n @active_sis_users.values.each do |new_user|\n new_canvas_user = canvas_user_from_campus_row(new_user)\n add_user_to_import(new_canvas_user)\n end\n @active_sis_users = nil\n end", "def set_users\n @can_change_owner = policy(@run || Run).current_user_allowed_to_crud?\n @users = policy_scope(User).map{|u| [ u.name, u.id ] } if @can_change_owner\n end", "def execute_user!(team_count)\n # If we just updated all the available teams, then we don't have to\n # re-check again, because all the possibilities have already been\n # crossed.\n if team_count == Team.all_non_special.size\n User.not_portus.update_all(ldap_group_checked: User.ldap_statuses[:checked])\n else\n User.not_portus.where(ldap_group_checked: User.ldap_statuses[:unchecked])\n .find_each(&:ldap_add_as_member!)\n end\n end", "def users=(array)\r\n ids = array.map(&:id)\r\n UserAccess.where(['user_accesses.access_id = ? AND user_accesses.user_id NOT IN (?)', self.id, ids]).select(:id).each(&:destroy)\r\n user_access_ids = UserAccess.all(:conditions => {:access_id => self.id, :user_id => ids}, :select => 'user_id').map(&:user_id)\r\n (ids - user_access_ids).each{|i|\r\n UserAccess.create(:access_id => self.id, :user_id => i)\r\n }\r\n self.users.reload\r\n end", "def update_users\n User.all.each do |user|\n user.update_family_goal\n end\n end", "def set_edit_users(users, eligible_users)\n set_entities(:edit, :person, users, eligible_users)\n end", "def create_users\n @user_admin = User.create(:email => \"admin@test.tld\", :name => \"Admin user\", :password => \"testtest\", :password_confirmation => \"testtest\", :level => User::LEVEL_ADMINISTRATOR)\n @user_normal = User.create(:email => \"normal@test.tld\", :name => \"Normal user\", :password => \"testtest\", :password_confirmation => \"testtest\", :level => User::LEVEL_NORMAL)\n @user_guest = User.create(:email => \"guest@test.tld\", :name => \"Guest user\", :password => \"testtest\", :password_confirmation => \"testtest\", :level => User::LEVEL_GUEST)\n end", "def add_users(course_id, test_users, user_role)\n users = ''\n test_users.each do |id, user|\n if user['role'] == user_role\n users << \"#{user['uid'].to_s}, \"\n end\n end\n if users.empty?\n logger.warn \"No test users with role #{user_role}\"\n else\n logger.info \"Adding users with role #{user_role}\"\n load_users_page course_id\n WebDriverUtils.wait_for_page_and_click add_people_button_element.when_visible\n user_list_element.when_visible timeout=WebDriverUtils.page_update_wait\n self.user_list = users\n self.user_role = user_role\n next_button\n WebDriverUtils.wait_for_page_and_click add_button_element\n add_users_success_element.when_visible timeout=WebDriverUtils.page_load_wait\n done_button\n end\n end", "def test_update_users_batch()\n # Parameters for the API call\n\n metadata = JSON.parse('{'\\\n '\"email\": \"testrubyapi@user.com\",'\\\n '\"name\": \"ruby api user\",'\\\n '\"custom\": \"testdata\"'\\\n '}')\n\n user_model_A = UserModel.new()\n user_model_A.modified_time = Time.now.utc.iso8601\n user_model_A.user_id = \"12345\"\n user_model_A.company_id = \"67890\"\n user_model_A.metadata = metadata\n\n user_model_B = UserModel.new()\n user_model_B.modified_time = Time.now.utc.iso8601\n user_model_B.user_id = \"1234\"\n user_model_B.company_id = \"6789\"\n user_model_B.metadata = metadata\n\n users = [user_model_A, user_model_B]\n\n # Perform the API call through the SDK function\n self.class.controller.update_users_batch(users)\n\n # Test response code\n assert_equal(@response_catcher.response.status_code, 201)\n end", "def update_event_users(users, event)\n deleted_users = event.users - users\n deleted_users.each do |user|\n EventStatus.find_by(user_id: user.id, event_id: event.id).delete\n end\n users.each do |user|\n if EventStatus.find_by(user_id: user.id, event_id: event.id).blank?\n event.users << user\n end\n end\n end", "def augment\n @users = User.all\n @user = current_user\n if @user.update_attributes(user_params)\n flash[:success] = \"Welcome to Telmi!\"\n render 'index'\n else\n render 'nda_page'\n flash[:danger] = \"Unable to create user. Please try again.\"\n end\n end", "def reset_users\n @semaphore.synchronize do\n @users = []\n publish_json\n end\n end", "def delete_all_test_users\n\n if @appAccessToken.nil?\n _obtain_app_access_token\n end\n\n users = list_test_users()\n users.each do |user|\n delete_test_user(user['id'])\n end\n end", "def synchronize_users (access_token)\n Tibbr::User.access_token = access_token\n User.find_in_batches(:batch_size => 10, :conditions => [\"tenant_name = ?\", name]) do |ideation_users|\n ideation_users.each do |user|\n tibbr_user = Tibbr::User.find(user.tibbr_user_id)\n user.update_attributes({:display_name => tibbr_user.display_name, :login => tibbr_user.login, \n :profile_image_url => tibbr_user.profile_image_url, :locale => tibbr_user.locale, \n :time_zone => tibbr_user.time_zone\n })\n Rails.logger.debug \"User #{user.display_name}'s profile details updated.\"\n end\n end\n end", "def touch_users\n users.each {|u| u.touch}\n end", "def update_users\n @company = Company.find( params[:company_id])\n @training = @company.trainings.find( params[:training_id])\n @course = Course.find( params[:id])\n @users_to_add = params[:users]\n #@course.users.clear\n #if !@users_to_add.nil?\n # @users_to_add.each do |u_id|\n # @course.users << User.find( u_id)\n # end\n #end\n @course.course_signups.delete_all\n if !@users_to_add.nil?\n @users_to_add.each do |u_id|\n signup = @course.course_signups.build\n signup.user_id = u_id\n signup.status = 0\n signup.save\n end\n end\n redirect_to manage_company_trainings_path @company\n end", "def load_users\n\n $test_logger.log(\"Loading users...\")\n\n #Delete all users from terminal DB\n @@cmd_proc.delete_all_uers\n\n #Fetch finger images from resource\n finger1 = Resource.get_content(\"N1.pklite\", true)\n finger2 = Resource.get_content(\"N2.pklite\", true)\n\n #Create required user records on terminal DB\n user_map = {\n USER1_ID => User_DB_record.new({:name_UTF8 => \"Test MFU User 1\", :PIN_code_UTF8 => \"4455\",\n :first_finger_nb => 1,\n :templates => [User_templates.new(:template_type => Biofinger_template_type::Pklite,\n :template_data => finger1)]}),\n USER2_ID => User_DB_record.new({:name_UTF8 => \"Test MFU User 2\", :PIN_code_UTF8 => \"6677\",\n :first_finger_nb => 1,\n :templates => [User_templates.new(:template_type => Biofinger_template_type::Pklite,\n :template_data => finger2)]})\n }\n\n # USER_BAD_ID => User_DB_record.new({:name_UTF8 => \"Test bad quality id\",\n # :templates => [User_templates.new(:template_type => Biofinger_template_type::Pklite,\n # :template_data => bad_qual_finger)]})\n\n @@cmd_proc.call_thrift{user_DB_set_users(user_map, false)}\n \n end", "def create_users\n unless @users\n @users = {}\n @users[\"system\"] = User.automatic_creation(\"system\", \"system@toto.fr\", {:weight => 10})\n @users[\"administrator\"] = User.automatic_creation(\"administrator\", \"admin@toto.fr\", {:weight => 10})\n @users[\"blogger_1\"] = User.automatic_creation(\"blogger_1\", \"blogger_1@toto.fr\")\n @users[\"blogger_2\"] = User.automatic_creation(\"blogger_2\", \"blogger_2@toto.fr\")\n @users[\"blogger_expert\"] = User.automatic_creation(\"blogger_expert\", \"blogger_expert@toto.fr\", {:weight => 5})\n @users[\"manufacturer\"] = User.automatic_creation(\"manufacturer\", \"manufacturer@toto.fr\")\n \n assert User.get_user_system\n end\n end", "def get_all_users(spec)\n user = spec.or_contributors_to_spec\n if @users.include? user\n @numbers[user] = @numbers[user] + 1\n else\n @users.add user\n @numbers[user] = 1\n end\nend", "def update_users\n if @project.user_id == current_user.id\n success = []\n errors = []\n @users.each do |user|\n extract_user = extract_user_id(user)\n if extract_user.nil?\n errors << { error: 'User does not exist' }\n else\n project_user = ProjectUser.find_user_in_project(extract_user, @project).first\n if project_user.nil?\n errors << { error: 'User does not have an assigned role in the project' }\n else\n project_user.role = user[:role]\n project_user.valid? ? success << project_user : errors << project_user.errors\n end\n end\n end\n if errors.empty?\n # Save is bad and shouldnt work, but update wont so here it is.\n success.each { |user| user.save }\n render json: @project.project_users, status: :created\n else\n render json: { errors: errors }, status: :unprocessable_entity\n end\n else\n render json: { error: 'Only the project owner can edit project users' }, status: :unauthorized\n end\n end", "def users_import(new_users, domain = nil)\n # Diff users\n diff = GoodData::Membership.diff_list(users, new_users)\n\n # Create domain users\n GoodData::Domain.users_create(diff[:added], domain)\n\n # Create new users\n role_list = roles\n users_create(diff[:added], role_list)\n\n # Get changed users objects from hash\n list = diff[:changed].map do |user|\n user[:user]\n end\n\n # Join list of changed users with 'same' users\n list = list.zip(diff[:same]).flatten.compact\n\n new_users_map = Hash[new_users.map { |u| [u.email, u] }]\n\n # Create list with user, desired_roles hashes\n list = list.map do |user|\n {\n :user => user,\n :roles => new_users_map[user.email].json['user']['content']['role'].split(' ').map { |r| r.downcase }.sort\n }\n end\n\n # Update existing users\n set_users_roles(list, role_list)\n\n # Remove old users\n users_remove(diff[:removed])\n end", "def users=(users_hash)\n client_principal.users = Hash[users_hash.map { |k, v| [k, v.sort] } ]\n end", "def update_quota_override(users:)\n figshare = Figshare::Init.new(figshare_user: 'figshare_admin', conf_dir: \"#{__dir__}/../conf\" )\n users.each do |upi, quota|\n user_record_from_upi(figshare: figshare, upi: upi) do |u|\n # don't change, if they already have more quota than the override.\n users[upi] = u['quota'] >= quota ? nil : u['quota']\n end\n end\nend", "def test_add_mixedup_user\n num_users0 = count_users\n proto = User.new('oauth_id' => '566213105', 'name' => 'Avilay Parekh')\n proto.oauth_id = SecureRandom.uuid\n new_user = @ds.add_or_get_user(proto)\n user = get_user(proto.oauth_id)\n assert(user === new_user)\n assert_equal(num_users0 + 1, count_users)\n assert_equal(user.id, @ds.user_id)\n delete_user(user.oauth_id)\n end", "def create_users\n puts 'Creating Users'\n\n locations = Location.pluck(:id)\n\n #creates the default known users\n users = default_users\n\n used_names = Set.new\n while users.count < 1000 do\n random_first_name = Faker::Name.first_name\n random_last_name = Faker::Name.last_name\n random_location = locations.sample\n\n user_name = Faker::Internet.user_name(\"#{random_first_name} #{random_last_name}\")\n #ensures that there are only unique names\n next if used_names.include?(user_name)\n email = \"#{user_name}@#{Faker::Internet.domain_name}\"\n\n\n user = User.new(location_id: random_location, user_name: user_name,\n email: email, password: 'CS5200',\n first_name: random_first_name, last_name: random_last_name)\n\n next unless user.valid?\n\n users << user\n used_names.add(user_name)\n end\n #validate is false because secret validation with password prevents the import\n User.import(users, validate: false)\n end", "def loadUsers()\n @@userid_count+=1\n user1 = User.new(@@userid_count, \"Shweta\", \"Dublin 1\", 1, Array.new)\n @@userid_count+=1\n user2 = User.new(@@userid_count, \"Chirag\", \"Dublin 2\", 5, Array.new)\n @@userid_count+=1\n user3 = User.new(@@userid_count, \"Karishma\", \"Galway\", 5, Array.new)\n\n @users += [user1, user2, user3]\n end", "def _test_pages_available\n #execute this code x number of times\n @custom_number_of_users.times do |i|\n puts 'Running tests for user #'+i.to_s\n # assert_section nil\n end\n end", "def casespace_seed_config_add_users(config)\r\n users = [config[:users]].flatten.compact\r\n return if users.blank?\r\n seed_config_message('++Adding seed config users.', config)\r\n users.each do |hash|\r\n casespace_seed_config_add_user(hash)\r\n end\r\nend", "def handle_getting_names_for(users, user_role=\"contact\")\n @data.users = users\n @data.index = users.next_to_fill_in\n @data.user_role = user_role\n\n if @data.index\n user = @data.users[@data.index]\n collect_for(user)\n else\n @session.pop\n end\n end", "def addFakeUsers\n @match = Dota.match(params[:id])\n if @match.duration == nil\n redirect_to matches_url, :notice => \"Can't find that match m8 o7\"\n return\n end\n\n # Creating a list of general names to try\n names = [\"Maynard\", \"Laziki\", \"LDDota\", \"Purge\", \"Bulba\", \"Koikva\",\n \"Barbielover\", \"PPD\", \"Fear\", \"Kankei\", \"Nashi\", \"Goomba\"]\n\n @debug = []\n @match.players.each do |player|\n if player.id == 4294967295\n next\n end\n\n player_id_string = User.convertKeyTo64(player.id).to_s\n User.find_or_create_by(steamid: player_id_string) do |user|\n user.steamid = player_id_string\n user.nickname = names.first\n names.delete(names.first)\n end\n end\n # redirect_to matches_url, :notice => \"Added #{12-names.length} users\"\n end", "def setup_admins_users\n begin\n click_on('Logout')\n rescue\n print\n end\n\n Warden.test_reset!\n\n @a1 = admins(:elle_woods)\n @a2 = admins(:vivian_kensington)\n @a3 = admins(:emmett_richmond)\n\n @u1 = users(:connery)\n @u2 = users(:moore)\n @u3 = users(:brosnan)\nend", "def add_existing_users(users)\n users.map do |user|\n @current_course.course_users.build(user: user[:user], name: user[:name],\n workflow_state: :approved, creator: @current_user,\n updater: @current_user)\n end\n end", "def add_user(caption_length, num_users)\n\tif num_users == 0\n\t\tputs \"No Users added.\"\n\telse\n\t\tfile_exists? # Unless folder exists, creates folder\n\t\tstart_user = User.count\n\t\tuser = all_users = Hash.new\n\t\tBenchmark.benchmark(CAPTION, caption_length, FORMAT, \"total:\") do |x|\n\t\t\tuser_faker = x.report(\"user_faker\") {\n\t\t\t\tnum_users.times do |index|\n\t\t\t\t\tUser.transaction do\n\t\t\t\t\t\tnumbers = Faker::Internet.password(5, 10, true, true) # min_length, max_length, mix_case, special_characters\n\t\t\t\t\t\tuser = {\n\t\t\t\t\t\t\tuser_name: Faker::Internet.user_name + numbers,\n\t\t\t\t\t\t\temail: Faker::Internet.email(\"#{user[:user_name]} #{numbers}\"),\n\t\t\t\t\t\t\tpassword: Faker::Internet.password,\n\t\t\t\t\t\t\tfirst_name: Faker::Name.first_name,\n\t\t\t\t\t\t\tlast_name: Faker::Name.last_name\n\t\t\t\t\t\t}\n\t\t\t\t\t\tall_users.store(user, user)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t}\n\t\t\tuser_create = x.report(\"user_create\") {\n\t\t\t\tall_users.each_value do |value|\n\t\t\t\t\tUser.create(\n\t\t\t\t\t\tuser_name: value[:user_name],\n\t\t\t\t\t\temail: value[:email], \n\t\t\t\t\t\tpassword: value[:password],\n\t\t\t\t\t\tfirst_name: value[:first_name],\n\t\t\t\t\t\tlast_name: value[:last_name]\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\t}\n\t\t\tuser_write = x.report(\"user_write \") {\n\t\t\t\tfname = 'db/seed_files/users.txt'\n\t\t\t\tf = open(fname, 'a')\n\t\t\t\tunless File.size?(fname)\n\t\t\t\t\tf.puts \"user_name,email,password\"\n\t\t\t\tend\n\t\t\t\tall_users.each_value do |v|\n\t\t\t\t\tf.puts \"#{v[:user_name]},#{v[:email]},#{v[:password]}\"\n\t\t\t\tend\n\t\t\t}\n\t\t\t@user_time = user_faker + user_create + user_write\n\t\t\t[@user_time]\n\t\tend\n\t\tend_user = User.count\n\t\tdifference_user = end_user - start_user\n\t\tputs \"Added #{difference_user} users.\"\n\t\tputs \"See db/seed_files/users.txt\"\n\tend\nend", "def test_multiple_users_should_keep_test_results_under_c2\n test_target_instance = get_new_test_target_instance(\"example8\", \"2012112808\")\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 1)\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 1)\n end", "def create_users()\n del_rec = []\n @good_user_records.each do |rec|\n existing_user = @users[rec.fields[\"email\"]]\n # check if the user doesn't exist already\n if (existing_user.nil?)\n\t# check to see if business already exists\n\texisting_business = @businesses[rec.fields[\"businessname\"]]\n\tif (!existing_business.nil?)\n\t new_user = User.new\n\t new_user.create(rec)\n\t existing_business.add_user(new_user)\n\t @users[new_user.email] = new_user\n\telse\n\t rec.is_malformed = true\n\t rec.add_malformed_message(\"ERROR: COMPANY NAME DOESN'T EXIST\")\n\t @bad_user_records << rec\n\t del_rec << rec\n\tend\n #User Already Exists treat it as malformed\n else \n\trec.is_malformed = true\n\trec.add_malformed_message(\"ERROR: USER EMAIL ALREADY EXISTS\")\n\t@bad_user_records << rec\n\tdel_rec << rec\n end\n end\n\n del_rec.each do |rec|\n @good_user_records.delete(rec)\n end\n \n end", "def user_test(users, level)\n\tres = Array.new\n\tlength = users.length\n\tputs 'starting user_test, length is ' + length.to_s\n\ttest_i = 0\n\tusers.each do |person|\n\t\tleft = length - test_i\n\t\tputs left.to_s + ' left'\n\t\ttmp = person['id'].to_s\n\t\tresponse = TOKEN.get('/v2/users/' + tmp).parsed\n\t\tif ((response['cursus_users'].length > 0) && (response['cursus_users'][0]['level'] >= level))\n\t\t\tres.push(person)\n\t\tend\n\t\ttest_i += 1\n\tend\n\treturn res\nend", "def all_users\n @date = (params[:date])? Date.parse(params[:date]) : Date.today\n users_ungroup = User.all(:conditions => {:status => User::STATUS_ACTIVE}, :order => 'login').sort\n @user_counts = users_ungroup.size\n @reported = false\n @daily_todo_users_group = Array.new\n @daily_todo_groups = Group.all().sort\n @daily_todo_groups.each do |group|\n users_of_group = group.users.sort_by { |u| u.name }\n no_todo_users, todo_users = users_of_group.partition do |user|\n DailyTodo.first(:conditions => {:user_id => user.id, :date => @date}).nil?\n end\n\n hash_users_of_group = {:todo => todo_users, :no_todo => no_todo_users}\n @daily_todo_users_group.push(hash_users_of_group)\n # Check if the current user has written todo for this date\n @reported = @reported || todo_users.any? { |user|\n user.id == User.current.id\n }\n\n users_of_group.each do |user_of_group|\n users_ungroup.delete_if do |user_ungroup|\n user_ungroup.id == user_of_group.id\n end\n end\n end\n\n no_todo_ungroup_users, todo_ungroup_users = users_ungroup.partition do |user|\n DailyTodo.first(:conditions => {:user_id => user.id, :date => @date}).nil?\n end\n @daily_todo_users_ungroup = {:todo => todo_ungroup_users, :no_todo => no_todo_ungroup_users}\n @reported = @reported || todo_ungroup_users.any? do |user|\n user.id == User.current.id\n end\n end", "def import_user_data\n @page_title = _('Import_user_data')\n @page_icon = 'excel.png'\n @users = User.find(:all, :conditions => \"temporary_id >= 0\")\n @devices = Device.find(:all, :conditions => \"temporary_id >= 0 AND name not like 'mor_server_%'\")\n end", "def perform\n users = User.all\n\n users.each do |user|\n\n # Pull User status using Steam API\n url = \"http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=#{ENV[\"STEAM_WEB_API_KEY\"]}&steamids=#{user.steam_uid}\"\n parsed_data = JSON.parse(open(url).read)\n online_status = parsed_data[\"response\"][\"players\"][0][\"personastate\"]\n\n\n # Steam has many different status types, but anything above zero is indicative of the User having Steam open and being sign-in on at least one device\n if online_status > 0\n online_status = 1\n\n in_game_status = parsed_data[\"response\"][\"players\"][0][\"gameid\"]\n\n # If user is not in-game, in_game_status will be nil\n if in_game_status.nil?\n in_game_status = 0\n looking_to_play_status = 0\n else\n # Set Looking to play status based on game (Steamm returns app_id number when player is playing a game)\n current_game = user.owned_games.find_by(:app_id => in_game_status)\n looking_to_play_status = user.libraries.find_by(:game_id => current_game.id).default_looking_to_play_status\n end\n #If offline, player cannot be in a game and is not looking to play\n else\n in_game_status = 0\n looking_to_play_status = 0\n end\n\n # Store the user's last played game if they have played a game and this has been previously recorded in our database\n if user.in_game_status != 0 && in_game_status == 0\n user.last_played_game = user.in_game_status\n end\n\n #Update user entry\n user.online_status = online_status\n user.in_game_status = in_game_status\n user.looking_to_play_status = looking_to_play_status\n user.save\n end\n end", "def users\n \n end", "def update_uservalues user\n\n user = User.find(user)\n\n puts \"Update UserValues\"\n #Suche vorhanden Eintrag\n record = user_technologies.where(:user => user).first\n #Wenn Eintrag nicht leer, erhöhe Rang um 1, sonst erzeuge Eintrag mit Rang 1\n if !record.blank? then\n new_rank = record.rank + 1\n record.update_attribute :rank, new_rank\n else\n new_rank = 1\n user_technologies.create(:rank => new_rank, :user => user)\n end\n\n #Füge User Score hinzu\n user.add_score(score * new_rank)\n #Speichere neuen Faktor ab\n user.user_setting.update_attribute name, factor**new_rank\n\n #Setze User-Forschung auf 0 -> Ende, lösche Cache\n #clear_cache user\n user.user_setting.update_attribute :researching, 0\n user.system_notify( 'Forschung', title, ' Technologie: '+title+' Stufe '+new_rank.to_s+' erfolgreich erforscht.')\n end", "def add_existing_users(users)\n users.map do |user|\n @current_course.course_users.build(user: user[:user], name: user[:name],\n creator: @current_user,\n updater: @current_user)\n end\n end", "def quantify_edits\n\t\t@res.each_with_index do |changeset, index|\n\t\t\tthis_user = changeset['properties']['user']\n\t\t\t\n\t\t\t@users[this_user] ||= 0\n\t\t\t@users[this_user] += 1\n\n\t\t\tif (index%10000).zero?\n\t\t\t\tprint \"#{index}..\"\n\t\t\tend\n\t\tend\n\tend", "def set_api_response_data\n users_list = []\n @users.each do |u|\n ukd = @user_kyc_details[u.id]\n ukd_present = ukd.present?\n users_list << {\n user_id: u.id,\n case_id: ukd_present ? @user_kyc_details[u.id].id : 0,\n email: u.email,\n registration_timestamp: u.created_at.to_i,\n is_kyc_submitted: ukd_present.to_i,\n whitelist_status: ukd_present ? @user_kyc_details[u.id].whitelist_status : nil,\n action_to_perform: action_to_perform(ukd)\n }\n end\n\n meta = {\n page_number: @page_number,\n total_records: @total_filtered_users,\n page_payload: {\n },\n page_size: @page_size,\n filters: @allowed_filters,\n sortings: @sortings,\n }\n\n data = {\n meta: meta,\n result_set: 'users_list',\n users_list: users_list\n }\n\n @api_response_data = data\n\n end", "def invitable_users\n @title = \"Invitar usuario\"\n @invitable_users = GetInvitableUsers.call(@previa_group)\n end", "def update_user(user)\n @users[user]=Hash.new if !@users[user]\n \n vmpool=OpenNebula::VirtualMachinePool.new(@client, user)\n vmpool.info\n \n one_ids=vmpool.map {|vm| vm.id }\n vms=@users[user]\n user_ids=vms.keys\n \n deleted_vms=user_ids-one_ids\n added_vms=one_ids-user_ids\n \n deleted_vms.each {|vmid| vms.delete(vmid) }\n \n added_vms.each do |vmid|\n vm=OpenNebula::VirtualMachine.new(\n OpenNebula::VirtualMachine.build_xml(vmid), @client)\n vm.info\n \n usage=VmUsage.new(vm['TEMPLATE/CPU'].to_f,\n vm['TEMPLATE/MEMORY'].to_i)\n vms[vmid.to_i]=usage\n end\n end", "def save_authorized_users(users)\n if OPTIONS[\"users\"].sort != users.sort\n Logger.log \"updating authorized users list\"\n OPTIONS[\"users\"] = users\n begin\n File.open(FILES[:secrets], \"w+\") { |f| f.write(OPTIONS.to_yaml) }\n rescue Exception => e\n retry if fix_dir?\n Logger.log \"unable to save authorized users.\"\n Logger.log e\n end\n end\n end", "def add_new_itemized_users(users)\n user = users.first\n\n unless user.user_group.nil?\n user_group_select.type_text(user.user_group)\n page.driver.execute_script(\"document.querySelector('img[alt=\\\"Search-button-icon\\\"]').click()\")\n wait_until { !loading_img.visible? }\n find(:xpath,\"//li[text()='#{user.user_group}']\").click unless user.user_group == ''\n wait_until {!(find(:xpath, \"//li[text()='#{user.user_group}']\").visible?) }\n end\n\n # name/email section\n nu_name_tb.type_text(user.name) unless user.name.nil?\n nu_email_tb.type_text(user.email) unless user.email.nil?\n # quota/device section\n nu_devices_server_tb.type_text(user.devices_server) unless user.devices_server.nil?\n nu_quota_server_tb.type_text(user.quota_server) unless user.quota_server.nil?\n nu_devices_desktop_tb.type_text(user.devices_desktop) unless user.devices_desktop.nil?\n nu_quota_desktop_tb.type_text(user.quota_desktop) unless user.quota_desktop.nil?\n\n unless user.enable_stash.nil?\n if user.enable_stash.downcase.eql?('yes')\n nu_enable_stash_cb.check\n else\n nu_enable_stash_cb.uncheck\n end\n end\n\n # default quota for stash?\n unless user.stash_quota.nil?\n if user.enable_stash.downcase.eql?('yes')\n if user.stash_quota.downcase.eql?('default')\n #its default\n else\n nu_stash_quota_tb.type_text(user.stash_quota) unless user.stash_quota.nil?\n end\n else\n end\n end\n\n # send stash invite emails?\n unless user.send_invite.nil?\n if user.send_invite.downcase.eql?('yes')\n nu_send_stash_inv_cb.check\n else\n nu_send_stash_inv_cb.uncheck\n end\n end\n\n # finishing up\n nu_create_btn.click\n #wait_until_bus_section_load\n end", "def test_add_multiple_users\n quietly do\n assert_cmd_posts(\"add to #{id} #{users[0]} #{users[1]}\",\n \"/api/v2/usergroup/#{id}/addUsers\",\n users.to_json)\n end\n end", "def test_single_user_should_update_test_results_under_c1\n test_target_instance = get_new_test_target_instance(\"example3\", \"2012112803\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1', 'test_case_2')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 2, 3, 2)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_2', 2, 3, 2)\n end", "def create_demo_users!\n Team.demo_users.each do |email,other|\n user = self.create_demo_user!(email,other[:first_name],other[:last_name])\n puts \"User creation failed for #{email}\" if user.nil?\n end\n end", "def users_index\n\t\t@view.users_list($users)\n\t\t@view.second_view(@current_user, @current_user.actions)\n\tend", "def auto_assign_users(team_size)\n all_registrations = course.registrations.where(for_credit: true).\n includes(:user).all\n\n team_sets = []\n overflow = []\n all_registrations.group_by(&:for_credit?).each do |credit, registrations|\n students = registrations.map(&:user).shuffle!\n (0...students.length).step(team_size) do |i|\n team_set = students[i, team_size]\n if team_set.length == team_size\n team_sets << team_set\n else\n overflow += team_set\n if overflow.length >= team_size\n team_sets << overflow.shift(team_size)\n end\n end\n end\n end\n team_sets << overflow\n\n teams = team_sets.map.with_index do |members, i|\n team = Team.create! partition: self, name: \"Team #{i + 1}\"\n members.each do |member|\n TeamMembership.create! user: member, team: team, course: course\n end\n team\n end\n\n teams\n end", "def load_user_data(id = nil)\n if id\n @user_id = id.to_i\n users = [User.find(id)]\n else\n @user_id = nil\n users = User.all\n end\n\n # Prime @user_data structure.\n @user_data = {}\n users.each do |user|\n @user_data[user.id] = {\n id: user.id,\n name: user.unique_text_name,\n bonuses: user.sum_bonuses\n }\n add_language_contributions(user)\n end\n\n # Load record counts for each category of individual user data.\n (ALL_FIELDS - SITE_WIDE_FIELDS).each { |field| load_field_counts(field) }\n\n # Calculate full contribution for each user. This will also correct some\n # double-counting of versioned records.\n users.each do |user|\n contribution = calc_metric(@user_data[user.id])\n # Make sure contribution caches are correct.\n if user.contribution != contribution\n user.contribution = contribution\n user.save\n end\n end\n end", "def discover_users=(users)\n set_discover_users(users, discover_users)\n end", "def users\n reload!\n @users\n end", "def edit_users=(users)\n set_edit_users(users, edit_users)\n end", "def add_new_users(users)\n user = users.first\n wait_until_bus_section_load\n user_group_select.select(user.user_group) unless user.user_group.nil?\n storage_type_select.select(user.storage_type) unless user.storage_type.nil?\n storage_max_tb.type_text(user.storage_limit) unless user.storage_limit.nil?\n device_tb.type_text(user.devices) unless user.devices.nil?\n\n unless user.enable_stash.nil?\n if user.enable_stash.downcase.eql?('yes')\n enable_stash_cb.check\n else\n enable_stash_cb.uncheck\n end\n end\n\n users.each_index do |index|\n Log.debug \"##########adding the #{index} user\"\n find(:id, \"user#{index+1}_name\").type_text(users[index].name)\n find(:id, \"user#{index+1}_username\").type_text(users[index].email)\n add_user_btn.click if index != users.length-1\n end\n\n unless user.send_email.nil?\n if user.send_email.downcase.eql?('yes')\n send_emails_cb.check\n else\n send_emails_cb.uncheck\n end\n end\n\n submit_btn.click\n wait_until_bus_section_load\n end", "def update\n { users: object[:new_users] }\n end", "def scoring(users)\n # update_score of every user in the array unless the user is admin\n users.each do |user|\n user.update_score unless user.is_admin?\n end\nend", "def update_users\n log_message 'Updating registration dates for new Users'\n UpdateUsersWorker.set(queue: QUEUE).perform_async\n end", "def set_users\n @users = []\n \n if user_signed_in\n @users << current_user.tweets(:sort){:time_stamp}\n else\n User.all.each do |user|\n @users << user.tweets(:sort){:time_stamp}\n end\n end\n end", "def update_many\n if @users.update_all(user_params)\n render json: @users, status: :ok, location: users_url\n else\n render json: @users.errors, status: :unprocessable_entity\n end\n end", "def update_users\n\t@team = Team.find(params[:id])\n\tcurrent_user_ids = @team.members.collect { |u| u.user_id }\n\t\n\tif params[:members].nil?\n\t\t@msg = \"All members removed from team.\"\n\t\t@team.members.delete_all()\n\telse\n\t\tdesired_user_ids = params[:members].collect { |str| str.to_i }\n\t\tnew_user_ids = desired_user_ids - current_user_ids #this results in an array of user_ids that needs to be added\n\t\told_user_ids = current_user_ids - desired_user_ids #this results in an array of user_ids that need to be removed\n\t\t\n\t\tnew_user_ids.each do |user_id|\n\t\t\t@team.members.create( :team_id => params[:id], :user_id => user_id )\n\t\tend\n\t\t\n\t\t@team.members.each do |member|\n\t\t\tif old_user_ids.include?(member.user_id)\n\t\t\t\t@team.members.delete(member)\n\t\t\tend\n\t\tend\n\t\t\n\t\t@msg = \"Member list updated.\"\n\tend\n\t\n\tif !@team.save\n\t\t@msg = \"Member change failed.\"\n\tend\n\trender :partial => \"update_users\"\n end", "def modify_keys_to_use_individual_profiles(new_users)\n user_lines = []\n\n new_users.each do |u|\n u.public_keys.each do |k|\n user_lines << \"#{get_key_prefix(u.username, u.common_name, u.uuid, u.superuser, u.profile_data)} #{k}\"\n end\n end\n\n return user_lines.sort\n end", "def users(*params)\n puts \"Users:\"\n\n @users.each do |user|\n muted = @muted_users.include?(user)\n puts \"#{user}#{muted ? ' (muted)' : ''}\"\n end\n end", "def set_users\n if is_event_creator\n @user_1 = event_creator\n @user_2 = participant\n else\n @user_1 = participant\n @user_2 = event_creator\n end\n end", "def users(*params)\n puts \"Users:\"\n @users.each do |user|\n muted = @muted_users.include?(user)\n puts \"#{user}#{muted ? \" (muted)\" : \"\"}\"\n end\n end", "def save_user_data(content_keys, request_url_param, format_param, credential)\n content_keys.each do |content_key|\n data = content_key.values[0]\n extracted_key = content_key.keys[0]\n zendesk_user = ::Zendesk::User.find_or_initialize_by_target_id(extracted_key)\n zendesk_user.update_attributes({:request_url => request_url_param, :content => data, :format => format_param, :credential => extract_credential(credential), :target_id => extracted_key})\n end\n end" ]
[ "0.67769736", "0.66842794", "0.6639067", "0.6607368", "0.6545218", "0.65018505", "0.6457336", "0.6306099", "0.62721264", "0.6192115", "0.6191121", "0.6189597", "0.6107406", "0.610279", "0.60416794", "0.6029497", "0.60209984", "0.6008897", "0.5998435", "0.59935635", "0.59704626", "0.59702593", "0.5967059", "0.5958518", "0.5938139", "0.5921757", "0.5910305", "0.59060687", "0.5890225", "0.5887879", "0.5874391", "0.5824547", "0.58144116", "0.5814114", "0.5810648", "0.57887757", "0.5786964", "0.57801294", "0.5767707", "0.5752332", "0.57437164", "0.57334703", "0.57285523", "0.5724795", "0.5715469", "0.57127076", "0.5712206", "0.5711152", "0.57108945", "0.5703273", "0.5682148", "0.56615883", "0.56582034", "0.5656862", "0.5656828", "0.5649612", "0.5645733", "0.5630583", "0.5624314", "0.5623772", "0.5614343", "0.56063145", "0.55966973", "0.55877113", "0.55838364", "0.55714667", "0.5569055", "0.55633384", "0.5559972", "0.5553974", "0.5548946", "0.5547117", "0.5518339", "0.55043805", "0.55012333", "0.5500846", "0.5497922", "0.54963267", "0.54942936", "0.54929584", "0.547985", "0.54769915", "0.5471279", "0.54623055", "0.5443074", "0.5442215", "0.54383034", "0.54345125", "0.54224956", "0.5416259", "0.54150116", "0.54141676", "0.5410927", "0.5401141", "0.54008025", "0.53950477", "0.5372664", "0.536534", "0.5363024", "0.53566873" ]
0.70134825
0
Verifies that the users data matches test data
def verify_users(test_data) users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user] users.each_with_index do |user, index| verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index)) verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name], element_value(user_type_input index)) verify_values_match(user[CoreUseOfCollectionsData::USER_UOC_ROLE.name], element_value(user_role_input index)) verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION.name], element_value(user_institution_input index)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[UseOfCollections::USER.name], element_value(user_name_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[UseOfCollections::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def test_values_unique\n\n #Arrange\n @user3 = User.new\n @user4 = User.new\n\n # Act\n @user3.name = \"fede\"\n @user3.surname = \"guti\"\n @user3.username = \"fede3\"\n @user3.email = \"fede3@gmail.com\"\n @user3.password = \"123456789\"\n\n @user4.name = \"fede\"\n @user4.surname = \"guti\"\n @user4.username = \"luca\"\n @user4.email = \"luca@gmail.com\"\n @user4.password = \"123456789\"\n\n\n # Assert\n @user3.save\n @user4.save\n all_ok = assert_equal @user3.valid? && @user4.valid? , true\n\n # Act\n @user4.email = \"fede3@gmail.com\"\n @user4.save\n\n # Assert\n email_check = assert_equal @user4.valid?, false\n\n # Act\n @user4.email = \"luca@gmail.com\"\n @user4.username = \"fede3\"\n @user4.save\n\n # Assert\n user_check = assert_equal @user4.valid?, false\n\n # Assert\n assert_equal (all_ok || email_check || user_check) , true\n\n end", "def test_validate_user_info\n data = {\n username: \"\",\n password: \"1234567890\",\n password_confirmation: \"1234567890\",\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n #Call function insert_user in model V1::User\n user = V1::User.insert_user(data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 1001\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def verify_staff(test_data)\n staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def test_user\n add_test_judgement\n assert(@gold_standard.contains_user? :id => \"John Doe\")\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def validate_data\n raise Error, \"no user found associated with #{@database}\" unless @user\n raise Error, \"password not defined for #{@user}@#{@database}\" unless @password\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def verify\n end", "def verify_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def test_if_duplicate_false\n @login5 = User.new\n @login5.email = \"different@example.com\"\n @login5.first_name = \"Bryan\"\n @login5.last_name = \"Adams\"\n @login5.password = \"summerof69\"\n assert_equal(false, @login5.duplicate?)\n end", "def verify()\n # TODO\n end", "def checkData(iUserID, iComment)\n # Nothing to test\n end", "def verify\n end", "def test_function_check_username_and_password_existed\n username = \"ladywind\"\n password = \"1234567890\"\n actual = V1::User.check_username_and_password_existed(username,password)\n expected = true\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def verify\n\n end", "def test_function_update_user_unsuccessfully\n data = {\n firstname: \"\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n user_id = 28\n #Call function insert_user in model V1::User\n user = V1::User.update_user(user_id,data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 1001\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_edited\n user = User.find(980190962);\n user.update({\"user_name\" => 'abasd',\"user_password\" => '456789', \"user_email\"=>'abc@yahoo.com'})\n if assert_not_nil('user_name', nil)\n arrert false\n elsif assert_not_nil('user_password', nil)\n assert false\n elsif assert_not_nil('user_email', nil)\n arrert false\n else\n assert true\n end\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_if_duplicate_true\n @login4 = User.new\n @login4.email = \"test@example.com\"\n @login4.first_name = \"Cher\"\n @login4.last_name = \"Bone\"\n @login4.password = \"sonnyandcher\"\n assert_equal(true, @login4.duplicate?)\n end", "def test_truth\n assert groups(:teacher_group).has_user(users(:teacheruser))\n assert ! groups(:admin_group).has_user(users(:teacheruser))\n assert groups(:admin_group).has_user(users(:adminuser))\n end", "def test_compare_user_w_same_country\n get '/v1/compare_country?data1=eyJOYW1lIjogIkVkdWFyZG8iLCAiQ291bnRyeSI6ICJCcmF6aWwiIH0%3D&data2=eyJOYW1lIjogIkVkdWFyZG8iLCAiQ291bnRyeSI6ICJCcmF6aWwiIH0%3D'\n assert last_response.ok?\n assert last_response.body.include?('The users live in the same country')\n end", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def test_function_get_user_info_unsuccessfully\n user_id = \"wrong-id\"\n\n #Call function get_user_info in model V1::User\n user = V1::User.get_user_info(user_id)\n\n #Get value code which is returned when call function get_user_info\n actual = user[:meta][:code]\n\n expected = 2004\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def dataVerification(accounts)\r\n @insuredName = (account[\"accountName\"] + \"_\" + $accountID)\r\n \r\n accounts.each do |account| \r\n if account[\"accountName\"] != \"\" \r\n \r\n #run tests for individual tables, in this case, just the AccountInfo table\r\n accountInfo(account)\r\n\r\n puts \"\"\r\n puts \"Data Compare tests complete for account: \" + @insuredName + \".\"\r\n puts \"\"\r\n end\r\n end\r\nend", "def Same(userID, password)\n if userID != password\n puts \"true\"\n else\n puts \"false\"\n end\nend", "def test_user_handling\n (user1 = User.named(\"me\")).save\n (user2 = User.named(\"you\")).save\n\n assert(User.exists?(user1.name), \"user doesn't exist\")\n assert_equal(User.all, [user1, user2], \"users not in list\")\n\n user2.delete\n assert(!User.exists?(\"you\"), \"user doesn't exist\")\n end", "def test_person_invalidity\n assert !@invalid_person.valid?\n attributes = [:username, :email]\n attributes.each do |attribute|\n assert @invalid_person.errors[attribute].any?\n end\n end", "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def check_valid_user_with_regular_question(params)\n return false if !check_question_answer(params)\n # Check if user question is match\n return false if secret_question.secret_question_variant_id != params[:secret_question][:secret_question_variant_id].to_i\n true\n end", "def test_users_must_have_qualities\n u = User.new()\n refute u.save\n u2 = User.new(first_name: \"Ilan\", last_name: \"Man\")\n refute u2.save\n end", "def test_change_password_blocks_with_invalid_data_on_POST_when_logged_in\n set_user\n\n patches = [ \n [ :current_password => nil], [ :current_password => 'not the password' ],\n [ :password => nil], [ :password => 'not the password' ],\n [ :password_confirmation => nil], [ :password_confirmation => 'not the password' ]\n ]\n \n patches.each do |patch|\n key, value = patch\n \n invalid_data = @valid_data.dup\n \n post :change_password, invalid_data\n \n assert_response :success\n assert_template 'change_password'\n\n user = User.find(@zeus_user.id)\n assert user.password_equals?(@valid_data[:password])\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def test_ID_25847_edit_profile_name_limit\n login_as_user1\n go_to_edit_profile_page\n verify_user_names_are_not_required_to_be_unique \"Jame Smith\"\n end", "def test_ID_25847_edit_profile_name_limit\n login_as_user1\n go_to_edit_profile_page\n verify_user_names_are_not_required_to_be_unique \"Jame Smith\"\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_secondary_key\n assert_equal(@user.login_name, @user.key, 'Key incorrect')\n end", "def verify_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def test_function_update_token_unsuccessfully\n user_id = \"wrong-id\"\n #Get value boolean which is returned when call function update_token\n actual = V1::User.update_token(user_id)\n\n expected = false\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def validate_user_list(users, user_ids)\n users.size.should == user_ids.length\n users.each_with_index do |user, i|\n user.should be_kind_of(User)\n user.id.should == user_ids[i]\n end\nend", "def test_function_update_user_successfully\n data = {\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n user_id = 28\n #Call function insert_user in model V1::User\n user = V1::User.update_user(user_id,data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 200\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_compare_user_w_different_country\n get '/v1/compare_country?data1=eyJOYW1lIjogIkVkdWFyZG8iLCAiQ291bnRyeSI6ICJCcmF6aWwiIH0%3D&data2=eyJOYW1lIjogIkplcm9lbiIsICJDb3VudHJ5IjogIkhvbGxhbmQiIH0='\n assert last_response.ok?\n assert last_response.body.include?('The users live in different countries')\n end", "def test_password\n p1 = \"mypassword123\"\n p2 = \"mypassword1234\"\n s1 = Password.update(p1)\n assert_equal(true, Password.check(p1,s1), \"Password was not stored correctly\")\n assert_equal(false, Password.check(p2,s1), \"Password check is broken\")\n\tend", "def assert_validations_fail attrs\n put :update, :user => attrs\n assert_response :success\n assert @controller.current_user.errors.any?, \"Validation expected to fail\"\n end", "def test_ID_25825_invalid_password\n login $user_1_email, $master_password\n go_to_change_password_page\n verify_text \"Change your Password\", \"Old password\" , \"New password\", \"Confirm password\"\n \n $profile_old_pass.when_present().set $master_password\n assert !($profile_save_changes.enabled?)\n $profile_new_pass.when_present().set \"newValidPass\"\n assert !($profile_save_changes.enabled?)\n $profile_confirm_pass.when_present().set \"unMatchedPass\"\n assert !($profile_save_changes.enabled?)\n \n $profile_old_pass.when_present().set $master_password\n $profile_new_pass.when_present().set \"newValidPass\"\n $profile_confirm_pass.when_present().set \"newValidPass\"\n assert $profile_save_changes.enabled?\n \n $profile_old_pass.when_present().set $master_password\n $profile_new_pass.when_present().set \"newValidPass\"\n $profile_confirm_pass.when_present().set \"unMatchedPass\"\n sleep 3\n assert $browser.text.include? \"Please make sure that your passwords match\"\n $profile_confirm_pass.when_present().set newValidPass\n sleep 3\n assert !($browser.text.include? \"Please make sure that your passwords match\")\n \n $profile_old_pass.when_present().set oldWrongPass\n $profile_new_pass.when_present().set \"pass11\"\n $profile_confirm_pass.when_present().set \"pass11\"\n $profile_save_changes.when_present().click\n sleep 3 \"pass11\"\n verify_text \"Password incorrect\"\n \n $profile_old_pass.when_present().clear\n $profile_old_pass.when_present().set \"oldPassword\"\n $profile_new_pass.when_present().clear\n $profile_new_pass.when_present().set \"pass\"\n $profile_confirm_pass.when_present().clear\n $profile_confirm_pass.when_present().set \"pass\"\n $profile_save_changes.when_present().click\n sleep 3 \n \n verify_text \"Please check for errors\", \"Must be at least 7 characters\"\n end", "def test_username_with_invalid_examples\n person = @valid_person\n invalid_usernames = %w{rails/rocks web2.0 javscript:something ME}\n invalid_usernames.each do |username|\n person.username = username\n assert !person.valid?, \"#{username} shouldn't pass validation, but does\"\n end\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def check_test_user_params(params)\n params.require(:name, :email).permit(:name, :email, :data)\n end", "def test_email_with_invalid_examples\n user = @valid_user\n invalid_emails = %w{foobar@example.c @example.com f@com foo@bar..com\n foobar@example.infod foobar.example.com\n foo,@example.com foo@ex(ample.com foo@example,com}\n invalid_emails.each do |email|\n user.email = email\n assert !user.valid?, \"#{email} should be incorrect but he didn't\"\n assert_equal \"must be correct\", user.errors.on(:email)\n end\n end", "def validate_consistent_user\n return if course_user && course_user.user == creator\n\n errors.add(:experience_points_record, :inconsistent_user)\n end", "def validate_consistent_user\n return if course_user && course_user.user == creator\n\n errors.add(:experience_points_record, :inconsistent_user)\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def test_email_with_valid_examples\n user = @valid_user\n valid_endings = %w{com org net edu es jp info}\n valid_emails = valid_endings.collect do |ending|\n \"foo.bar_1-9@baz-quux0.example.#{ending}\"\n end\n \n valid_emails.each do |email|\n user.email = email\n assert user.valid?, \"#{email} must be correct\"\n end\n end", "def test_username_with_valid_examples\n person = @valid_person\n valid_usernames = %w{juho kusti juho_kusti enu}\n valid_usernames.each do |username|\n person.username = username\n assert person.valid?, \"#{username} should pass validation, but doesn't\"\n end\n end", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def test_invalid_with_empty_attributes\n user = User.new\n assert !user.valid?\n assert user.errors.invalid?(:uniqueid)\n assert user.errors.invalid?(:password)\n assert user.errors.invalid?(:first_name)\n assert user.errors.invalid?(:last_name)\n assert user.errors.invalid?(:email)\n end", "def save_and_verify\n expect(user.save(raise_on_failure: true)).to be_truthy\n end", "def validate_consistent_user\n return if course_user && course_user.user_id == creator_id\n errors.add(:experience_points_record, :inconsistent_user)\n end", "def verify\n # nothing to do here, so just return\n end", "def test_authenticate\n assert_equal users(:jordan), User.authenticate('jordan@test.com', 'test')\n end", "def test_contain_password12\n result = contains_password?(\"password1\")\n refute(result, \"'password1' should not be valid because it contains 'password'\")\n end", "def test_idempotency_validation\n FootballData::Scrape.get_team_year(1, '1999-2000')\n assert_equal FootballData::RawGame.count, @count\n end", "def verify_collection_data(expected_collection_data, actual_collection_data)\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expect(actual_collection_data).to match_with_type(expected_collection_data)\n end\n end", "def test_duplicate_user\n data = { 'email' => 'ace@base.se', 'password' => 'open1234' }\n post '/users', data.to_json\n assert last_response.status.eql?(400)\n json_data = JSON last_response.body\n assert json_data['errors'].present?\n end", "def test_check_hash_equal\r\n assert_equal true, @g.check_hash(1, 1)\r\n end", "def correct\n if @user_1_array.include? user_2\n correct == true\n else\n correct == false\n end\nend", "def test_basic_account_migration_step2_negative_points\n post :register, {:user => old_c2w_users(:janis).to_user.attributes.delete_if{|k,v| ![:username, :email,\n :gender, :date_of_birth, :address_line_1, :address_line_2, :state, :city, :country, :pin_code,\n :mobile_number, :phone_number].include?(k.to_sym)}.merge({:password_confirmation => 'janis', :password => 'janis'})},\n {:old_c2w_user => old_c2w_users(:janis)}\n assert assigns['user'].errors.empty?\n assert !session[:user]\n user = assigns['user']\n assert session[:old_c2w_user].nil?\n assert old_c2w_users(:janis).migrated?\n assert_equal AppConfig.migration_bonus_credits + AppConfig.sign_up_bonus_credits, user.prize_points\n assert_equal AppConfig.migration_bonus_credits > 0 ? 3:2, user.credit_transactions.count\n assert_equal user.id, old_c2w_users(:janis).new_user_id\n assert_equal old_c2w_users(:janis).date_of_registration.to_time, user.reload.created_on.to_time\n end", "def test_should_have_missing_fields\n assert ! roles(:missing_person_id).valid?\n assert ! roles(:missing_client_id).valid?\n assert ! roles(:missing_title).valid?\n end", "def verify_contact_names(test_data)\n test_names = test_data[Org::CONTACT_NAMES.name]\n errors = []\n test_names = [{ Org::CONTACT_NAME.name => ''}] unless test_names\n test_names.each_with_index do |test_name, index|\n text_values_match?(test_name[Org::CONTACT_NAME.name], element_value(contact_name_input(index)), errors)\n end\n errors\n end", "def test_invalid_with_empty_attributes\n\t user = User.new\n\t assert !user.valid?\n\t assert user.errors.invalid?(:login)\n\t assert user.errors.invalid?(:email)\n\t assert user.errors.invalid?(:password)\n\t assert user.errors.invalid?(:password_confirmation)\n end", "def test_multiple_users_should_update_test_result_under_c1_0\n test_target_instance = get_new_test_target_instance(\"example5\", \"2012112805\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_PASS, 'test_case_1')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b01, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b10, 0b11, 2)\n end", "def test_basic_account_migration_step2\n post :register, {:user => old_c2w_users(:jim).to_user.attributes.delete_if{|k,v| ![:username, :email,\n :gender, :date_of_birth, :address_line_1, :address_line_2, :state, :city, :country, :pin_code,\n :mobile_number, :phone_number].include?(k.to_sym)}.merge({:password_confirmation => 'jim277', :password => 'jim277'})},\n {:old_c2w_user => old_c2w_users(:jim)}\n assert assigns['user'].errors.empty?\n user = assigns['user']\n assert !session[:user]\n assert session[:old_c2w_user].nil?\n assert old_c2w_users(:jim).migrated?\n assert_equal AppConfig.migration_bonus_credits + AppConfig.sign_up_bonus_credits + old_c2w_users(:jim).points, user.prize_points\n assert_equal AppConfig.migration_bonus_credits > 0 ? 3:2, user.credit_transactions.count\n assert_equal user.id, old_c2w_users(:jim).new_user_id\n assert_equal old_c2w_users(:jim).date_of_registration.to_time.to_i, user.created_on.to_time.to_i\n end", "def test_person_validity\n assert people(:valid_person).valid?\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def test_function_search_user_successfully\n keyword = \"anh\"\n\n #Call function search_user_by_name in model V1::User\n user = V1::User.search_user_by_name(keyword,1,10)\n\n #Get value code which is returned when call function search_user_by_name\n actual = user[:meta][:code]\n\n expected = 200\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_members_companies\n @orgs.each do |org|\n org.members.each do |user|\n assert user.company == org.company, \"Member #{user.id} of organization #{org.id} does not belong to company #{org.company.id}\"\n end\n end\n end", "def test_function_get_user_info_successfully\n user_id = 28\n\n #Call function get_user_info in model V1::User\n user = V1::User.get_user_info(user_id)\n\n #Get value code which is returned when call function get_user_info\n actual = user[:meta][:code]\n\n expected = 200\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def verify(event_data)\n true\n end", "def test_CRUD\n # Create a user\n joe = User.new({\n\t\t\t\t\t\t:login => 'mylogin', \n\t\t\t\t\t\t:firstname => 'first', \n\t\t\t\t\t\t:lastname => 'last', \n\t\t\t\t\t\t:email => 'login@example.com'\n\t\t\t\t\t})\n # the model protects IP addr, so we must set it here\n joe[:ipaddr] = '12.23.34.45'\n\t\tjoe[:confirmed] = 0\n\n # save him\n\t\tassert !joe.save, \"shouldn t be saved, no password\"\n\t\tjoe.password = \"joejoe\"\n\n # save him\n\t\tassert joe.save, \"joe is saved because he's a good Xan\"\n\t\tassert_equal joe.cryptpassword, 'c16fbe5548b1cf4aaed8fdee5b5faecd546fbd48', 'password don t match'\n\n # read him back\n user_from_db = User.find(joe.id)\n\n\t\tassert user_from_db.domains.include?('USERS') \n\n # compare \n assert_equal joe[:login], user_from_db[:login], \"logins should be equal\"\n\n # change password\n user_from_db[:password] = \"newpass\"\n\n # save new password\n\t\tassert user_from_db.save, \"user should be saved\"\n\n # assert password changed\n updated_user = User.find(joe.id)\n\t\t#assert_not_equal updated_user[:cryptpassword],\n\t\t# UserPasswordCryptSHA.crypt(joe[:login],joe[:password]), \n\t\t#\t\"password should have been changed\"\n\n # destroy it\n assert user_from_db.destroy, \"user should be destroyed\"\n !assert updated_user.destroy, \"user should already be destroyed\"\n end", "def test_update_with_invalid_name\r\n @user = User.find(@testUser)\r\n # It will raise an error while execute render method in controller\r\n # Because the goldberg variables didn't been initialized in the test framework\r\n assert_raise (ActionView::TemplateError){\r\n post :update, :id => @testUser, :user => { :clear_password => \"\",\r\n :name => \"\" }\r\n }\r\n assert !assigns(:user).valid? \r\n assert_template 'users/edit'\r\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end" ]
[ "0.7462034", "0.6795422", "0.6402874", "0.6344402", "0.6316823", "0.61643094", "0.6157272", "0.61483634", "0.61266863", "0.6124156", "0.6095644", "0.6052236", "0.6044671", "0.6033212", "0.6024998", "0.59950775", "0.5969058", "0.5906203", "0.58998317", "0.58980805", "0.5854002", "0.5836109", "0.58341324", "0.5827421", "0.5811998", "0.5811415", "0.58111775", "0.57971334", "0.5792707", "0.5777447", "0.57720745", "0.5766045", "0.5756874", "0.57563967", "0.57475466", "0.57439953", "0.57360274", "0.5733366", "0.5715332", "0.5715332", "0.57003176", "0.56956893", "0.5694883", "0.5691578", "0.56882495", "0.5685041", "0.56813866", "0.5647191", "0.56377673", "0.5637596", "0.56372297", "0.56303084", "0.5606999", "0.56048286", "0.56043285", "0.559827", "0.559827", "0.55952704", "0.5595018", "0.5590005", "0.5588567", "0.5583585", "0.55795985", "0.5577966", "0.5576904", "0.5574367", "0.55709875", "0.5568271", "0.5559611", "0.55527145", "0.55346847", "0.55327755", "0.5529551", "0.55268204", "0.55264086", "0.5524608", "0.55206424", "0.55159163", "0.5514661", "0.5513979", "0.5512881", "0.55066055", "0.5505859", "0.5504775", "0.5503221", "0.55031925", "0.55001354", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937", "0.54969937" ]
0.740942
1
TITLE Enters or removes a title per a given set of test data
def enter_title(test_data) hide_notifications_bar logger.info "Entering title '#{test_data[CoreUseOfCollectionsData::TITLE.name]}'" wait_for_element_and_type(title_input, test_data[CoreUseOfCollectionsData::TITLE.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def removeDummyTitles(titleCount)\n\t\tif @oc[\"TitleString\"]==\"\"\n\t\t\tc=\"\"\n\t\t\t(1..titleCount).each do |i|\n\t\t\t\tc=c+\"@\" if i>1\n\t\t\t\tc=c+\"empty-notitle\"\n\t\t\tend\n\t\t\t@oc[\"TitleString\"]=c\n\t\tend\n\tend", "def verify_title(test_data)\n verify_values_match(test_data[UseOfCollections::TITLE.name], element_value(title_input))\n end", "def verify_title(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::TITLE.name], element_value(title_input))\n end", "def remove_title_if_present\n @doc.css('title').each { |node| node.remove }\n end", "def set_title(new_title, opts={})\n if self.datastreams.has_key?(\"descMetadata\")\n desc_metadata_ds = self.datastreams[\"descMetadata\"]\n if desc_metadata_ds.respond_to?(:title_values)\n desc_metadata_ds.title_values = new_title\n else\n desc_metadata_ds.title = new_title\n end\n end\n end", "def cleanup_page_titles\n pages.each do |p|\n new_title = p.title.sub(/^page\\s*/i, '').strip\n p.title = new_title\n end\n\n pages.each do |p|\n if p.title.empty?\n if p.image_filename # we need to be able to make the assumption this exists\n p.title = file_name(p.image_filename)\n end\n end\n end\n\n seen = {}\n sequence = 1\n problems = []\n pages.each do |p|\n if p.title.empty?\n p.title = sequence.to_s\n end\n if seen[p.title]\n p.title += \" (#{sequence})\"\n problems.push p.title\n end\n seen[p.title] = true\n sequence += 1\n end\n\n if not problems.empty?\n warning \"Some page labels were not unique; the sequence number was appended: '\" + problems.join(\"', '\") + \"'.\"\n end\n end", "def title=(text); end", "def title=(text); end", "def set_title\n unless self.title\n if self.parent\n if last_untitled_page = self.parent.children.where(:title => /Untitled /i).asc(:title).last\n last_untitled_number = last_untitled_page.title.split(\" \").last.to_i\n self.title = \"Untitled #{last_untitled_number+1}\"\n else\n self.title = \"Untitled 1\"\n end\n else\n self.title = \"Untitled 1\"\n end\n end\n end", "def title=(new_title)\n new_title.capitalize!\n arr = ['over', 'the', 'and', 'in', 'of', 'a', 'an']\n @title = new_title.split(' ').map! { |word| arr.include?(word) ? word : word.capitalize }.join(' ')\n end", "def uniquify\n super\n self.short_title = title\n end", "def cleanup_title(line)\n\n\t# title variable\n\ttitle = nil\n\n\t# splitting the line by \">\"\n\t# as the result should have 4 different strings\n\t# the tmp_4 war should contain title string\n\ttmp_1, tmp_2, tmp_3, tmp_4 = line.chomp.split(/>/)\n\n\t# ===============================================================\n\t# make the first letter of the string uppercase\n\tstr_up = tmp_4\n\tstr_up[0] = str_up[0].upcase\n\ttitle_tmp = str_up\n\t# ===============================================================\n\n\tif title_tmp.match(/^[\\A]/)\n\n\t\t# splitting up the title_tmp further\n\t\t# after splitting the first part of the title_tmp string should give back title\n\t\t# and the rest what left is the garbage string\n\t\ttitle_tmp_2, garbage = title_tmp.chomp.split(/[\\/\\()\\[\\]\\:\\_\\-\\+\\=\\*\\@\\![0-9]]/)\n\n\t\t# ===============================================================\n\t\t# Replace spaces within an empty char\n\t\tstr_no_sp = title_tmp_2.gsub(/\\s/,'')\n\t\tstr_no_sp = str_no_sp.gsub(/\\?/,'')\n\t\tstr_no_sp = str_no_sp.gsub(/\\!/,'')\n\t\tstr_no_sp = str_no_sp.gsub(/\\./,'')\n\t\tstr_no_sp = str_no_sp.gsub(/\\'/,'')\n\t\t\n\t\t# check if title matches the regular expression\n\t\treg_str = str_no_sp[/[a-zA-Z]+$/]\n\t\tis_equal = str_no_sp == reg_str # true or false\n\t\t# ================================================================\n\t\t\n\t\tif is_equal == true\n\t\t\tif title_tmp_2 != \"\"\n\t\t\t\t$counter_1 += 1\n\t\t\t\ttitle = title_tmp_2.downcase!.gsub(/\\s+$/,'')\n\t\t\t\ttitle = title.gsub(/\\.$/,'')\n\t\t\t\t#puts \"*********************\\n\"\n\t\t\t\t#puts \"[ENG][+]: #{title} ==> #{$counter_1}\"\n\t\t\t\t#puts \"*********************\\n\"\n\t\t\tend\t\n\t\telse\n\t\t\t$counter_2 += 1\n\t\t\t#puts \"*********************\\n\"\n\t\t\t#puts \"[NON-ENG][-]: #{title_tmp_2} ==> #{$counter_1}\"\n\t\t\t#puts \"*********************\\n\"\n\t\tend\n\tend\n\n\t# return cleaned up title string\n\treturn title;\n\nend", "def assert_title(title)\n assert_seen title, :within => \"head title\"\n end", "def set_title\n @title = File.basename(@absolute_path)\n @title.sub!(/^[0-9][0-9]-/, '')\n @title.gsub!(/_/, ' ')\n @title.gsub!(/-/, ', ')\n end", "def regulate_title\n self.title = self.title.strip\n self.title.downcase!\n end", "def enter_title(test_data)\n hide_notifications_bar\n wait_for_element_and_type(title_input, test_data[UseOfCollections::TITLE.name])\n end", "def titleTest(index,object,section)\n endline = \"\\n\"\n sep = \"=================================================================\\n\"\n test = \"TEST [#{index}] #{object} : #{section}\\n\"\n \n puts endline + sep + test + sep\n end", "def apply_updates_title(title)\n return if title.to_s.empty?\n\n wrap_length = MAX_LINE_LENGTH - WORD_WRAP_INDENT\n\n @control_string.sub!(\n /title\\s+(((\").*?(?<!\\\\)\")|((').*?(?<!\\\\)')|((%q{).*?(?<!\\\\)[}])|(nil))\\n/m,\n \"title %q{#{title}}\".word_wrap(wrap_length).indent(WORD_WRAP_INDENT)\n )\n end", "def title\n @title ||= Utilities.longest_common_substring_in_array(titles.values) \n @title = titles[:og_title] unless title_ok?\n @title = titles[:html_title] unless title_ok?\n @title = titles[:from_doc] unless title_ok?\n\n @title\n end", "def title=(title)\n\t\twords = title.split(\" \")\n\t\t\n\t\t@title = words.map.with_index {|word, idx|\n\t\t\tif cap?(word) || idx == 0\n\t\t\t\t# If a word isn't in the don't cap list, we capitalize it, but first we need to see if it has a hyphen and test the sub-words in the hypenated word. It will also capitalize any hyphenated word if that word is at the beginning of the title\n\t\t\t\t#\n\t\t\t\tif word.include?(\"-\")\n\t\t\t\t\tword.split(\"-\").map!.with_index {|w, i| w.capitalize if cap?(word) || i == 0 }.join(\"-\")\n\t\t\t\telse\n\t\t\t\t\tword.capitalize\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tword\n\t\t\tend\n\t\t}.join(\" \")\n\tend", "def populate_title\n if self.title.blank?\n self.title = self.file_file_name.blank? ? \"\" : self.file_file_name.gsub(/_/, \" \").capitalize\n end\n\tend", "def alternate_clean_title(title)\n title.\n # Take the part of the title before Bill or Act\n split(/Bill|Act/, 2)[0].\n # Remove any brackets\n gsub(/\\([a-zA-Z.\\s\\d'\",-]*\\)/, '').\n # Strip any trailing whitespace\n rstrip\nend", "def check_title\n if self.title.blank? && st = (url && Site.by_link(self.url))\n self.title = (st.yield :Title, st.sampleURL)[:Title] || \"\"\n self.title = self.trimmed_title\n else\n self.title\n end\n end", "def get_title(n)\n description = Nokogiri::HTML(@description_xpath[n].text).text\n if description.include?(\"IF YOU GO\")\n description = description.split(\"IF YOU GO\")[1]\n if description.include?(\"Where\")\n title = description.split(\"Where\")[0]\n # Title must fit on single line\n title.gsub!(\"\\n\", \" \").strip!\n title\n else\n super(n)\n end\n else\n super(n)\n end\n end", "def sync_titles\n # Title was submitted\n if self.title.blank?\n self.title = get_title_from_chartup(chartup) || 'Untitled'\n else\n set_chartup_title(self.title)\n end\n end", "def titleize(title)\n\n result = []\n\n excluded = ['a', 'and', 'of', 'over', 'the']\n arr = title.split\n\n arr.each_index {|i|\n if excluded.include?(arr[i]) && i != 0\n result << arr[i]\n else\n result << arr[i].capitalize\n end\n }\n\n result.join(\" \")\nend", "def extract_title(test_case)\n requirements_tags = all_tags(test_case).select{|tag| tag.name =~ /req_\\w+/}.map{|tag| /req_(\\w+)/.match(tag.name)[1]}.join(', ')\n if test_case.source.last.is_a?(Cucumber::Core::Ast::ExamplesTable::Row)\n title = test_case.source.select{|s| s.is_a?(Cucumber::Core::Ast::ScenarioOutline)}.first.name\n if ENV['OLD_STYLE_OUTLINE_NAMES'] \n title += ' :: ' + test_case.source.last.send(:data).map{|key,value| \"#{key}='#{value}'\"}.join(', ')\n else\n title += \" \" + test_case.source.last.send(:data).map{|key,value| \"#{key}=#{value}\"}.join(', ')\n end\n else\n title = test_case.source.last.name\n end\n [requirements_tags,title].compact.join(' ').strip\n end", "def set_fund_item_title\n return if @set_fund_item_title\n if title? && ( perspective == PERSPECTIVES.first )\n fund_item.title = title if title? && fund_item.title != title\n @set_fund_item_title = true\n fund_item.save\n @set_fund_item_title = false\n end\n end", "def generatetitles()\n merge(gadrgeneratetitles: 'true')\n end", "def title!(*titles)\n window_title!(*titles)\n page_title!(titles.last)\n end", "def title=(title)\n\t little_words = %w{a an and if in or of over the}\n\t split_str = title.split(\" \")\n\t#shortcut for creating arrays found in beginningruby\n\tsplit_str.map! do |x|\n\t\tif x == split_str.first\n\t\t\tx.capitalize\n\t\t\telsif little_words.include?(x)\n\t\t\t\tx\n\t\t\t\telse\n\t\t\t\t\tx.capitalize\n\t\t\t\tend\n\t\t\tend\n\t\t\t@title = split_str.join(\" \")\n\t\tend", "def retitle(retitle)\n @o_title = title\n @title = retitle.upcase\n conf_message(@o_title, \"retitled\")\n end", "def setTitle(title)\n if title\n DOM.setAttribute(@element, \"title\", title)\n else\n DOM.removeAttribute(@element, \"title\")\n end\n end", "def create_munged_title\n self.munged_title = \"#{title.parameterize}-#{rand(36**3).to_s(36)}\"\n end", "def create_munged_title\n self.munged_title = \"#{title.parameterize}-#{rand(36**3).to_s(36)}\"\n end", "def capitalize_title\n \t\tself.title = self.title.split(/\\s+/).map(&:downcase).\n map(&:capitalize).join(' ')\n end", "def title=(args)\n unless args.is_a?(String) || args.is_a?(Array)\n raise ArgumentError, \"You must provide a string or an array. You provided #{args.inspect}\"\n end\n args = Array(args)\n if args.first.is_a?(String)\n return if args == [''] \n args.each do |title_name|\n self.title_attributes = [{value: title_name, title_type: \"Program\"}]\n end\n else\n descMetadata.title=args\n end\n end", "def expected_title(expected_title)\n define_method(\"has_expected_title?\") do\n has_expected_title = expected_title.kind_of?(Regexp) ? expected_title =~ title : expected_title == title\n raise \"Expected title '#{expected_title}' instead of '#{title}'\" unless has_expected_title\n has_expected_title\n end\n end", "def title(new_title = nil, options = {})\n self.titles_pool ||= {}\n screen_name = options[:screen]\n if new_title\n screen_name ? self.titles_pool[screen_name] = new_title : self.titles_pool[:_common] = new_title\n else\n self.titles_pool[screen_name] || self.titles_pool[:_common] || to_s.gsub(/Grid/, \"\")\n end\n end", "def capitalize_title\n self.title = title.capitalize\n end", "def title=(value)\n\t\t\t@title = value\n\t\tend", "def titlecase\n title_case = []\n # titleize first word in title separately \n #(might contain exception words)\n title_case.push titleize_word @title.split[0], true \n\n @title.split.drop(1).each do |word|\n title_case.push titleize_word(word)\n end \n\n title_case.join(\" \")\n end", "def titleize!\n replace titleize\n end", "def title\n base_title = \"StkUp - Simple, Purposeful Comparisons\"\n @title.nil? ? base_title : \"#{base_title} | #{@title}\"\n end", "def title(value)\n merge(letitle: value.to_s)\n end", "def cleanup_title(string)\n\ttitle = \"\"\n\t#looking for the third <SEP> by looking for the <SEP> pattern 3 times, each time setting the new title to everything to the right of the pattern.\n\t#this effectively extracts just the song title from the line\n\tsep_pattern = /<SEP>/\n\tif string =~ sep_pattern\n\t\ttitle = \"#{$'}\"\n\tend\n\tif title =~ sep_pattern\n\t\ttitle = \"#{$'}\"\n\tend\n\tif title =~ sep_pattern\n\t\ttitle = \"#{$'}\"\n\tend\n\n\t#cleanup said title part 2\n\t#pat1 are regular expressions identifying superflous text as stated in the instructions\n\tpart2 = /[(\\[\\{\\/:\"`+\\-_=*\\\\]|feat./\n\t#if the title contains any superfluous text, we just want whatever comes before said text using: (#{$`})\n\tif title =~ part2\n\t\ttitle = \"#{$`}\"\n\tend\n\n\t#eliminate characters part 3\n\t#finding and deleting the following punctuation: ? ¿ ! ¡ . ; & @ % # |\n\tpunctuation = /[?¿!¡.;&@%#|]/\n\tif title =~ punctuation\n\t\ttitle.gsub!(punctuation, \"\") #replace with empty string to remove\n\tend\n\n\t#set to lower case part 5\n\ttitle.downcase!\n\treturn title\nend", "def title=(value)\n @title = value\n end", "def title=(value)\n @title = value\n end", "def title=(value)\n @title = value\n end", "def title=(value)\n @title = value\n end", "def title=(value)\n @title = value\n end", "def title=(value)\n @title = value\n end", "def title=(value)\n @title = value\n end", "def test_title\n @prefs.each do |x|\n if x.properties\n assert_equal x.properties.title, x.title\n if x.portlet\n assert_equal x.title, x.portlet.title\n end\n end\n end\n end", "def page_title!(title)\n @_page_title = title\n end", "def cleansed_title\n self.title.gsub(/[\\t\\r\\n\\f:@]/, '')\n end", "def test_title\n assert_equal(\"Today's Todos\", @list.title)\n end", "def title\n\t\tbase_title = \"RailsTest\"\n\t\tif @title.nil?\n\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{@title}\"\n\t\tend\n\tend", "def title_for(product, test_type, is_qrda_1_measure_test: true)\n case test_type\n when 'ChecklistTest'\n product.c3_test && product.eh_tests? ? 'C1 + C3 Sample' : 'C1 Sample'\n when 'MeasureTest'\n measure_test_title(product, is_qrda_1_measure_test:)\n when 'FilteringTest'\n 'C4 (QRDA-I and QRDA-III)'\n when 'MultiMeasureTest'\n 'MultiMeasureTest'\n when 'CMSProgramTest'\n 'CMSProgramTest'\n end\n end", "def title_folded_to_filename\n self[:title].gsub(/[^a-z0-9-]/) do |c|\n case c\n when /\\s+|\\./ then '-'\n when /[A-Z]+/ then c.downcase\n else ''\n end\n end.gsub(/\\-+/,'-')\n end", "def normalize_titles\n normalized_rt_title\n normalized_tz_title\n self\n end", "def title\n values = super\n values = MetadataHelper.ordered( ordered_values: self.title_ordered, values: values )\n return values\n end", "def title\n values = super\n values = MetadataHelper.ordered( ordered_values: self.title_ordered, values: values )\n return values\n end", "def titleize(title)\n results = []\n #get all the words\n bad_words = ['a', 'and', 'or', 'of', 'over', 'the']\n words = title.split(' ')\n # iterate over words with INDEX\n words.each_with_index do |word, i|\n word.downcase!\n if i == 0\n results << word.capitalize\n elsif bad_words.include?(word)\n results << word\n else\n results << word.capitalize\n end\n end\n #capitalize if first word\n #capitalize unless the included in the bad list\n results.join(' ')\nend", "def titlecase_title\n self.title=(title().titlecase())\n end", "def title_set(title)\n self.sirname.set title\n end", "def title=(value)\n if value\n @title = value if value.is_a? String\n end\n end", "def flatiron_title_descend_01\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n puts \"\"\n end", "def augmented_title\n return self.title\n end", "def fix_title\r\n # Remove quotes if the user thought they needed them\r\n self.title = self.title.gsub(/^(?:'|\")(.*)(?:'|\")$/, '\\1')\r\n end", "def title=(title)\n\t super(standardize_title(title))\n\t\t\t#self[:title] = title.strip\n\tend", "def fix_title\n # Remove quotes if the user thought they needed them\n self.title = self.title.gsub(/^(?:'|\")(.*)(?:'|\")$/, '\\1')\n end", "def title_processor\n\n column_titles = create_column_titles('../data/census_column_metadata.csv')\n\n processed_titles = column_titles.map { |o|\n\t\to.flatten.compact.reverse.join\n\t}\nend", "def set_titles\n DynamicUrl.all.each do |url|\n if request.host == url.url\n @title = url.title\n @subtitle = url.subtitle\n end\n end\n\n # set default title if title could not be fetched\n @title ||= MySettings.title\n @subtitle ||= MySettings.subtitle\n end", "def excludedtitle(value)\n merge(ggsgpexcludedtitle: value.to_s)\n end", "def remove(title)\n \t\tfounds = []\n\t\t(@titles.length-1).downto(0).each { |i|\n \t\t\tif @titles[i] == title\n \t\t\t\tfounds.push(i)\n\t\t\tend\n\t\t}\n\n\t\tif founds.length > 0\n\t\t\tfor i in founds\n \t\t\t\t@titleCount -= 1\n\t\t\t\t@titles.delete_at(i)\n\t\t\tend\n\t\tend\n\tend", "def title=(title)\n t = Title.new\n t.content = title\n self.dc_titles = [t]\n title\n end", "def title\n return [] unless unittitle_element\n [unittitle_element.text.gsub(/\\s+/, \" \")]\n end", "def capitalize_title\n self.title = title.capitalize if title.present?\n end", "def title=(v)\n if @title != v\n @needs_commit = true\n @title = v\n end\n end", "def title(expected_title)\n $LOG.info \"Verifying the expected title #{expected_title}\"\n #$driver.title\n begin\n expect($driver.title.to_s).to eq(expected_title)\n rescue Exception => e\n $LOG.error \"Error in getting the expected title #{expected_title} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Error in getting the expected title #{expected_title} \"+e.message\n end\n end", "def titlecase_title\n self.title = self.title.titlecase\n end", "def title(title = nil)\n @title = title if title\n @title\n end", "def set_title(title)\n @title = title\n end", "def clean_title(title)\n title.\n # Take the part of the title before Bill, Act or -\n split(/Bill|Act|-/, 2)[0].\n # Remove any brackets\n gsub(/\\([a-zA-Z.\\d\\s'\",]*\\)/, '').\n # Strip any trailing whitespace\n rstrip\nend", "def accurate_title\n nil\n end", "def title\n values = super\n values = Deepblue::MetadataHelper.ordered( ordered_values: title_ordered, values: values )\n return values\n end", "def title(title)\n @title = title\n end", "def duplicate_title\n\t\tif Contest.find_by title: title\n\t\t\terrors.add(:title, \"has already been taken\")\n\t\tend\n\tend", "def title\n if @data.attribute_names.include?(:title)\n @title ||= @data[:title].last\n else\n if @data.attribute_names.include?(:cmutitle)\n @title ||= @data[:cmutitle].last\n else\n @title ||= nil\n end\n end\n end", "def handle_title(name, attrs) \n \n end", "def titleize\n @collection.dictionary.each do |id, data|\n next unless File.basename(data['id']) =~ /^untitled/\n new_name = Ruhoh::StringFormat.clean_slug(data['title'])\n new_file = \"#{new_name}#{File.extname(data['id'])}\"\n old_file = File.basename(data['id'])\n next if old_file == new_file\n\n FileUtils.cd(File.dirname(data['pointer']['realpath'])) {\n FileUtils.mv(old_file, new_file)\n }\n Ruhoh::Friend.say { green \"Renamed #{old_file} to: #{new_file}\" }\n end\n end", "def titleize(title)\n #test\nend", "def setTitle(title)\r\n\t\t\t\t\t@title = title\r\n\t\t\t\tend", "def full_title\n ti = title_values&.first\n st = subtitle_values&.first\n if ti && st\n # Remove the automatically-appended subtitle (in the case of search\n # results entries).\n ti = ti.delete_suffix(st).rstrip.delete_suffix(':')\n # Append the subtitle only if it doesn't appear to already be included in\n # the base title itself.\n ti = \"#{ti}: #{st}\" unless significant(ti).include?(significant(st))\n end\n ti || st || '???'\n end", "def title\n\t\tlowers = %w(a an and but in of the)\n\t\ttitle_array = @title.split\n\t\ttitle_array.each do |word|\n\t\t\tif lowers.include?(title_array[0])\n\t\t\t\tword.capitalize!\n\t\t\telsif lowers.include?(word)\n\t\t\t\tword\n\t\t\telse\n\t\t\t\tword.capitalize!\n\t\t\tend\n\t\tend\n\t\ttitle_array.join(\" \")\n\tend", "def set_title(params)\n name, name_formula = process_names(params[:name], params[:name_formula])\n\n data_id = get_data_id(name_formula, params[:data])\n\n @title_name = name\n @title_formula = name_formula\n @title_data_id = data_id\n\n # Set the font properties if present.\n @title_font = convert_font_args(params[:name_font])\n end", "def title(title)\n @title=title\n end", "def citation_title(title_text)\n prepositions = [\"a\", \"about\", \"across\", \"an\", \"and\", \"before\", \"but\", \"by\", \"for\", \"it\", \"of\", \"the\", \"to\", \"with\", \"without\"]\n new_text = []\n title_text.split(\" \").each_with_index do |word, index|\n if (index == 0 and word != word.upcase) or (word.length > 1 and word != word.upcase and !prepositions.include?(word))\n # the split(\"-\") will handle the capitalization of hyphenated words\n new_text << word.split(\"-\").map! {|w| w.capitalize}.join(\"-\")\n else\n new_text << word\n end\n end\n new_text.join(\" \")\n end", "def dmpSetTitle(k,title) ;\n @title[k] = title ;\n end" ]
[ "0.68603224", "0.6850197", "0.68352836", "0.650551", "0.64567566", "0.64107186", "0.6375972", "0.6375972", "0.63110954", "0.6283459", "0.62795055", "0.62751764", "0.6249691", "0.6245936", "0.62413746", "0.6213181", "0.6205336", "0.6150767", "0.61251175", "0.6099708", "0.6093079", "0.6081898", "0.607543", "0.6060501", "0.60437053", "0.6042612", "0.60322326", "0.60169744", "0.60155046", "0.59997016", "0.5999221", "0.59719783", "0.5971184", "0.59545135", "0.59545135", "0.5932765", "0.5927992", "0.59230727", "0.5917505", "0.59163135", "0.59133655", "0.5909051", "0.5906126", "0.5901308", "0.59000444", "0.58997536", "0.5897599", "0.5897599", "0.5897599", "0.5897599", "0.5897599", "0.5897599", "0.5897599", "0.58881027", "0.58769345", "0.58681905", "0.5864477", "0.58622617", "0.58564395", "0.5854637", "0.5852129", "0.58507913", "0.58507913", "0.5842287", "0.58418006", "0.5834426", "0.5832004", "0.5831893", "0.5830166", "0.58263373", "0.5822794", "0.5822168", "0.5816591", "0.5815673", "0.5808209", "0.58053565", "0.5802627", "0.57944274", "0.5788015", "0.57793695", "0.57758766", "0.5774066", "0.5764177", "0.57620084", "0.57609034", "0.5759808", "0.57590413", "0.5758289", "0.5757615", "0.57563716", "0.574786", "0.5747605", "0.5747409", "0.57465404", "0.5746483", "0.5743971", "0.5741499", "0.57349145", "0.5733935", "0.57316" ]
0.63115764
8
Verifies that the title matches test data
def verify_title(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::TITLE.name], element_value(title_input)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_title(test_data)\n verify_values_match(test_data[UseOfCollections::TITLE.name], element_value(title_input))\n end", "def assert_title(title)\n assert_seen title, :within => \"head title\"\n end", "def title_check\n \n\n if self.title\n \n if !self.title.include? \"Believe\" || \"Won't\" || \"Secret\"\n true\n else\n false\n end\n else\n false\n end\n end", "def expected_title(expected_title)\n define_method(\"has_expected_title?\") do\n has_expected_title = expected_title.kind_of?(Regexp) ? expected_title =~ title : expected_title == title\n raise \"Expected title '#{expected_title}' instead of '#{title}'\" unless has_expected_title\n has_expected_title\n end\n end", "def check_title(title, test_case)\n page_title = get_page_title\n\n if test_case\n expect(page_title).to eq title\n else\n expect(page_title).to_not eq title\n end\nend", "def is_title_case\n if title.split.any?{|w|w[0].upcase != w[0]}\n errors.add(:title, \"Title must be in title case\")\n end\n end", "def page_title_is_correct\n ( text =~ self.class.page_title_validation_value ) !=nil\n end", "def expected_title expected_title\n define_method 'has_expected_title?' do\n has_expected_title = expected_title.kind_of?(Regexp) ? expected_title =~ @browser.title : expected_title == @browser.title\n raise \"Expected title '#{expected_title}' instead of '#{@browser.title}'\" unless has_expected_title\n end\n end", "def check_partial_title(partial_text_title, test_case)\n page_title = get_page_title\n\n if test_case\n expect(page_title).to include(partial_text_title)\n else\n expect(page_title).to_not include(partial_text_title)\n end\nend", "def eql?(other)\n title == other.title\n end", "def test_title\n assert_equal(\"Today's Todos\", @list.title)\n end", "def verify_page?(key, exit = true)\n base_title = wait_for_title(exit)\n puts \"Verify Title - Desired Prefix: #{site.get_title(key)} => Full Title: #{page_title}\" if exit\n if site.get_title(key) != base_title\n fail(\"Page title does not match expected result. EXPECTED: #{site.get_title(key)} FOUND: #{page_title}\") if exit\n return false\n end\n return true\n end", "def assert_title(title, params={})\n wait_for(params) do |context|\n actual = selenium.get_title\n context.message = \"Expected title '#{title}' but was '#{actual}'\"\n title == actual\n end\n end", "def check_page_title(text)\n $driver.title.should == text\n end", "def title_valid(title)\n if !title.empty?\n self.title = title\n return true\n else\n return false\n end\n end", "def test_search_by_title\n assert_equal 1, Book.search_by_title(\"Life of bob\").size, \"1 Book listed with title Life of bob\"\n assert_equal 1, Book.search_by_title(\"LiFe oF bOB\").size, \"1 Book listed with title LiFe oF bOB - capitalisation does not matter\"\n assert_equal 2, Book.search_by_title(\"Test\").size, \"2 Books listed by with a test in the title\"\n assert_equal 3, Book.search_by_title(\"\").size, \"Blank returns all 3 books\"\n assert_equal 3, Book.search_by_title(nil).size, \"Blank returns all 3 books\"\n assert_equal 0, Book.search_by_title(\"The Hobbit\").size, \"No Tolkien books expected\"\n end", "def existing_title\n valid = true\n existing_title = DATABASE.execute(\"SELECT * FROM anime_series WHERE title = '#{title}';\")\n \n if !existing_title.empty?\n valid = false\n end\n return valid\n end", "def is_title?(title)\n results = @client.find_game(title)\n title_names = results.collect{|game| game.name}\n title_names.uniq!\n title_names_downcase = title_names.map {|game| game.downcase}\n title_names_downcase.include? title.downcase\n end", "def validate_title\n if self.title.length < 3\n # throw error, a custom error would be nice\n errors.add :base, :invalid, message: \"The title is invalid, need at least 3 valid characters.\"\n end\n end", "def verifynavpagetitle(pagetitle)\n customizedwait\n displayedpagetitle = $and_mob_driver.find_element(:id, XEBIATIMEPICKERPAGE[:pagetitle_id]).text\n if displayedpagetitle==pagetitle\n puts \"Actual page title #{displayedpagetitle} and Expected page title #{pagetitle} match\"\n else\n raise \"Expected page title #{pagetitle} but found actual title to be #{displayedpagetitle}\"\n end\n end", "def title(expected_title)\n $LOG.info \"Verifying the expected title #{expected_title}\"\n #$driver.title\n begin\n expect($driver.title.to_s).to eq(expected_title)\n rescue Exception => e\n $LOG.error \"Error in getting the expected title #{expected_title} \"+e.message\n $driver.save_screenshot(\"log/webscreenshot/webScreenshot_#{$webscreenshot}.png\")\n $webscreenshot = $webscreenshot+1\n raise \"Error in getting the expected title #{expected_title} \"+e.message\n end\n end", "def validate_title\n if self.title.length < 3\n errors.add :base, :invalid, message: \"The title is invalid\"\n end\n end", "def test_should_have_invalid_role_title\n assert ! roles(:invalid_title).valid?, \"'Hangaround' shouldn't be a valid role title.\"\n end", "def bypass_title_validation?\n bypass_title_validation\n end", "def datacheck(title_content)\n\n\tif !(title_content.include?\"游玩\")\n\t\treturn false\n\tend\n\n\tif !(title_content.include?\"去\")\n\t\treturn false\n\tend\n\n\tif !(title_content.include?\"天\")\n\t\treturn false\n\tend\n\n\tif !(title_content.include?\"-\")\n\t\treturn false\n\tend\n\n\treturn true\nend", "def title_exist?(filename)\n test_file_existence(filename, Titles_Path, @title_data)\n end", "def duplicate_title\n\t\tif Contest.find_by title: title\n\t\t\terrors.add(:title, \"has already been taken\")\n\t\tend\n\tend", "def enter_title(test_data)\n hide_notifications_bar\n wait_for_element_and_type(title_input, test_data[UseOfCollections::TITLE.name])\n end", "def test_old\n assert_equal({\n \"shiva\"=>\"Shiva\",\n \"ganesha\"=>\"Ganesha\",\n \"surya\"=>\"Surya\",\n \"ganga\"=>\"Ganga\",\n \"shakti\"=>\"Shakti\",\n \"vishnu\"=>\"Vishnu\",\n \"shiva_desc\"=>\"Shiva is the god of transformation through destruction and the Lord of Dance.\",\n \"ganesha_desc\"=>\"Ganesha is the god of knowledge and beginnings, the Lord of Obstacles.\",\n \"surya_desc\"=>\"Surya is the god of the sun, courage and will.\",\n \"ganga_desc\"=>\"Ganga is the goddess of the sacred river, Ganges, who purifies and redeems.\",\n \"shakti_desc\"=>\"Shakti is the goddess of power and dynamic energy.\",\n \"vishnu_desc\"=>\"Vishnu is the all-pervading god who sustains the world.\",\n \"RV_NO_DEITY_TITLE\"=>\"No Current Deity.\",\n \"RV_NO_DEITY_DESC\"=>\"Hinduism allows you to select which god to follow as your main deity. Each deity will come with its own effects and last until your monarch changes.\",\n \"RV_PICK_DEITY_THIS\"=>\"Follow $NAME|Y$\",\n \"RV_PICK_DEITY\"=>\"Select Deity\",\n }, FakeYaml.load(sample(\"religion_l_english\")))\n end", "def test_edit_course_with_valid_title\r\n number_of_course = Course.count\r\n title = Course.find(1).title\r\n post :update_course,:id => 1, :course => { :title => 'Database'}\r\n assert_equal flash[:notice], 'Course was successfully updated.'\r\n assert_redirected_to :action => 'list_folders', :id =>1\r\n assert_equal Course.count, number_of_course\r\n assert Course.find(:all, :conditions => \"title = 'Database'\");\r\n assert_nil Course.find(:first, :conditions => \"title = '#{title}'\");\r\n end", "def test_find_by_title\n assert_equal(@todo1, @list.find_by_title(\"Buy milk\"))\n end", "def valid?\n return false if @title.nil? || @title == \"\"\n\n true\n end", "def title_unique?\n song = Song.find_by(title: self.title)\n if song && song.release_year == self.release_year\n errors.add(:title, \"Artist cannot release same song in one year.\")\n end\n end", "def test_rental_details_for_title\n rental_details = @library1.rental_details_for_title(\"lord_of_the_rings\")\n assert_equal({student_name: \"Jeff\", date: \"25/05/19\"}, rental_details)\n end", "def check_title\n if self.title.blank? && st = (url && Site.by_link(self.url))\n self.title = (st.yield :Title, st.sampleURL)[:Title] || \"\"\n self.title = self.trimmed_title\n else\n self.title\n end\n end", "def enter_title(test_data)\n hide_notifications_bar\n logger.info \"Entering title '#{test_data[CoreUseOfCollectionsData::TITLE.name]}'\"\n wait_for_element_and_type(title_input, test_data[CoreUseOfCollectionsData::TITLE.name])\n end", "def post_title\n if !self.title.nil?\n phrases = [\"Won\\'t Believe\", \"Secret\", \"Top\", \"Guess\"]\n if !phrases.any? {|phrase| self.title.include?(phrase)}\n errors.add(:title, \"Not enough!\")\n end\n else\n errors.add(:title, \"Not enough!\")\n end\n end", "def test_title\n @prefs.each do |x|\n if x.properties\n assert_equal x.properties.title, x.title\n if x.portlet\n assert_equal x.title, x.portlet.title\n end\n end\n end\n end", "def ensure_unique_board_title\n unless self.has_unique_title\n errors.add_to_base(\"please choose another title\")\n end\n end", "def test_find_movie_title_already_exists\n movies = Movies.new(@movies)\n result = movies.find_movie('Titanic')\n assert_equal(true, result)\n end", "def test_01login\n $objBasePage.setup()\n $objLoginPage.getUrl()\n actualTitle=$objLoginPage.getTitle()\n expectedTitle=\"OrangeHRM\"\n assert_equal(expectedTitle,actualTitle, \"Title of page doesn't match\")\n puts \"Login test pass\"\n end", "def hasTitle\n if @title then\n true\n else\n false\n end\n end", "def assert_page_title(text)\n assert_selector 'h2#page_title', text: text\n end", "def test_other_than_first_character\n %w( iTunes TitleCase ).each do |word|\n assert_equal word, word.titlecase\n end\n end", "def valid?\n return false if @title.nil?\n true\n end", "def test_task_should_not_be_valid_without_title\n @task.title = \"\"\n assert @task.invalid?\n end", "def datacheck(title_content)\n\n\tif !(title_content.include?\"天\")\n\t\treturn false\n\tend\n\n\tif !(title_content.include?\"月\")\n\t\treturn false\n\tend\n\n\tif !(title_content.include?\"日\")\n\t\treturn false\n\tend\n\n\treturn true\nend", "def isSeriesTitle(title)\n $titleCount[title] == 1 and return false\n ft = transliterate(title).downcase.gsub(/^[\\[\\(]|[\\)\\]]$/, '').gsub(/\\s\\s+/, ' ').gsub('’', '\\'').strip()\n return $seriesTitlesPat.match(ft)\nend", "def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def inferred_title?(document); end", "def validate_titles\n nested_ordered_title.select { |i| (i.instance_of? NestedOrderedTitle) && (i.index.first.present? && i.title.first.present?) && (i.index.first.instance_of? String) && (i.title.first.instance_of? String) }\n .map { |i| i.instance_of?(NestedOrderedTitle) ? [i.title.first, i.index.first] : [i] }\n .select(&:present?)\n end", "def check_title(name)\n # titleize without the botched 'S (apostrophe-s) issue\n name = name.humanize.strip.squeeze(' ').gsub(/\\b([a-z])/) { $1.capitalize }.gsub(/\\'S/, '\\'s')\n\n match = TITLE_CONVERSION_LIST.keys.select { |t| name.match(/#{Regexp.escape(t)}/i) }\n unless match.empty?\n match = match.sort.reverse[0] # select the longest match (most accurate)\n name = TITLE_CONVERSION_LIST[match]\n end\n\n log(\"checked display name is [#{name}]\", :debug)\n name\n end", "def test_song_has_track_name\n assert_equal(\"Can't get no Satisfaction\", @song1.track_name)\n end", "def test_case_insensitive\n ogg = dummy()\n assert_same ogg['GENRE'], ogg['genre']\n end", "def matches_query?\n self.title == query[:text]\n end", "def validate_title(item)\n error(msg: 'Title may not be blank', item: __method__.to_s) if blank?(item)\n end", "def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end", "def verify_if_keyword_present_inresultPage(keyword)\n\n puts \"Verifying if title contains \"+keyword\n @@search_result_information.each do |hash|\n if hash['title'].include? keyword\n puts hash['name']+\"'s title contains searched keyword \"+keyword\n else\n puts hash['name']+\"'s title' doesn't contain searched keyword \"+keyword\n end\n end\n end", "def verify_project_desc(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def test_add_course_with_duplicate_title\r\n number_of_course = Course.count\r\n assert Course.find(:all, :conditions => \"title = 'E-Commerce'\")\r\n post :create_course, :course => { :title => 'E-Commerce'}\r\n #assert_template 'course/new'\r\n #assert_equal Course.count, number_of_course\r\n assert_equal 1, Course.count(:all, :conditions => \"title = 'E-Commerce'\"), \r\n \"Find more than one record in database have the same title\"\r\n end", "def test_edit_course_with_duplicate_title\r\n number_of_course = Course.count\r\n post :update_course,:id => 2, :course => { :title => 'Object-Oriented Programming'}\r\n assert_equal Course.count, number_of_course\r\n assert_equal 1, Course.count(:all, :conditions => \"title = 'Object-Oriented Programming'\"),\r\n \"The duplicate title course save into database\" \r\n #assert !Course.find(:all, :conditions => \"title = 'E-Commerce'\");\r\n end", "def should_extract_title(doc)\n return true\n end", "def assert_valid_show_page(model, title: nil)\n ctrlr = controller_name(model)\n title = title ? sanitized_string(title) : property(ctrlr, :show, :title)\n heading = title ? { text: title } : {}\n body_css = property(ctrlr, :show, :body_css)\n assert_selector \"body#{body_css}\"\n assert_selector property(ctrlr, :show, :entry_css)\n assert_selector SHOW_HEADING_SELECTOR, **heading\n assert_title title if title\n end", "def test_edit_course_with_invalid_title\r\n number_of_course = Course.count\r\n post :update_course,:id => 1, :course => { :title => ''}\r\n assert_equal Course.count, number_of_course\r\n assert Course.find(:all, :conditions => \"title = 'E-Commerce'\")\r\n assert !Course.find(:all, :conditions => \"title = ''\"),\r\n \"The blank title course save into database\" \r\n end", "def equal?(other)\n return false unless other.is_a?(self.class)\n are_identical = false\n if self.title == other.title\n begin\n obj_id = self.object_id.to_s\n self.title += obj_id\n are_identical = (self.title == other.title)\n ensure\n self.title.sub(/#{obj_id}$/,'')\n end\n are_identical\n else\n false\n end\n end", "def matches_title?(q)\n search_regexp = /(\\b|[\\/\\._-])#{Regexp.escape(q)}/\n\n @result[:title].downcase =~ search_regexp ||\n # Break CamelCase words into their individual components and search\n @result[:title].gsub(/([a-z\\d])([A-Z])/,'\\1 \\2').downcase =~ search_regexp\n end", "def test_product_title\n assert_equal @productsController.product_title , \"Red Book\"\n end", "def test_lesson_must_have_names\n lesson = Lesson.new(name:\"Algebra Basics\", description: \"Basic intro into the wonderful world of Algebra\", outline: \"See math, do math\")\n lesson_two = Lesson.new(description: \"Lorem ipsum\")\n\n assert lesson.save\n refute lesson_two.save\n end", "def check_list_title_should_be_displayed(title)\n expect(page).to have_selector 'h1', text: title\n end", "def test_add_course_with_invalid_title\r\n number_of_course = Course.count\r\n post :create_course, :course => { :title => ''}\r\n # assert_template 'course/new'\r\n assert_equal number_of_course, Course.count\r\n assert !Course.find(:all, :conditions => \"title = ''\"), \r\n \"The blank title course save into database\"\r\n end", "def has_title?(library, title)\n\nend", "def validate_title\n errors.add(:title, :must_be_null_in_this_slide) if !self.allows_title? && !self.title.nil?\n end", "def title_is(title = nil)\n title_is_empty if title.nil? || title.empty?\n @title = title\n end", "def assert_equal(type,expected, actual)\n text1=get_text(type,expected)\n text2=$array1[\"#{actual}\"] \n puts text1\n puts text2\n if text1 == text2\n puts \"given text is available\"\n elsif \n $log.error \"given #{expected} text is not displayed\"\n raise(\"given #{expected} text is not displayed\")\n end\nend", "def verify_page(page_title=nil, page_url=nil)\n if page_title\n raise \"Title of the page is not #{page_title}\" unless self.title == page_title\n elsif page_url\n raise \"URL of the page does not contain #{page_url}\" unless self.current_url.to_s.include?(page_url.downcase)\n else\n raise \"Provide either title or part of url to verify page\"\n end\n end", "def test_ID_25846_edit_profile_name_validation\n login_as_user1\n go_to_edit_profile_page\n verify_name_change_is_saved \"test_ID_25835_edit_profile_desc\", \"Jamie Smith\", \"Temp name\"\n verify_name_validation \"test_ID_25835_edit_profile_desc\", \"Jamie Smith\", \"%$#%<html>\"\n end", "def test_should_require_title\n city = create(:name => nil)\n assert city.errors.invalid?(:name), \":title should be required\"\n assert_invalid city, \"city shouldn't be created\"\n end", "def test_ID_25846_edit_profile_name_validation\n login_as_user1\n go_to_edit_profile_page\n verify_name_change_is_saved \"test_ID_25835_edit_profile_desc\", \"Jame Smith\", \"Temp name\"\n verify_name_validation \"test_ID_25835_edit_profile_desc\", \"Jame Smith\", \"%$#%<html>\"\n end", "def titled?\n title.present? && (title != DEFAULT_TITLE)\n end", "def validate_title_and_body\n return true unless self[:title].blank?\n return errors.add(:validate_title_and_body, \"Title and Body are required\") if self[:body].blank?\n self[:title] = self[:body][0..29]\n end", "def title?\n !title.nil? && !title.empty?\n end", "def title?\n !title.nil? && !title.empty?\n end", "def test_uniqueness_of_username\n person_repeat = Person.new(:username => @valid_person.username.upcase)\n assert !person_repeat.valid?\n assert_equal @error_messages[:taken], person_repeat.errors[:username][0], \"Test must be case sensitive.\"\n end", "def valid?\n title_or_description.to_s != ''\n end", "def has_title?\n @title != nil\n end", "def title_create?(title)\n if create?\n not titles_create_exception.include? title\n else\n titles_create_exception.include? title\n end\n end", "def check_title\n @page_title = \"FauxTwitter\"\n end", "def test_same_tv_show\n result = same_tv_show(@people)\n assert_equal({\"Pokemon\" => [\"Keith\", \"Val\"]}, result)\nend", "def product_title_exists?(input_title)\n\t\ttitle_exists = self.class.find_by_title(input_title) ? true : false\t\t\n\tend", "def test_find_by_title\n book_info = {\n title: \"lord of the rings\",\n rental_details: {\n student_name: \"Jeff\",\n date: \"01/12/16\"\n }\n }\n assert_equal(book_info, @library.find_by_title(\"lord of the rings\"))\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def test_question_initalized\n assert_equal(\"Whats my name?\", @question.question)\n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def attester_title=(attester_title)\n if !attester_title.nil? && attester_title.to_s.length > 64\n fail ArgumentError, 'invalid value for \"attester_title\", the character length must be smaller than or equal to 64.'\n end\n\n if !attester_title.nil? && attester_title.to_s.length < 0\n fail ArgumentError, 'invalid value for \"attester_title\", the character length must be great than or equal to 0.'\n end\n\n @attester_title = attester_title\n end", "def title?\n !@title.to_s.empty?\n end", "def assert_code_and_desc_ok(object)\n cloned = object.clone\n assert_presence_required(object,:code)\n assert_presence_required(object,:description)\n assert object.save,\"Failed to save object first time in uniqueness test; pass unique record first\"\n assert !cloned.save,\"Saved object twice while testing for uniqueness of :code and :description\"\n assert(cloned.errors[:code].to_s =~ /taken/, \"Missing or wrong error message for duplicate code\" )\n assert(cloned.errors[:description].to_s =~ /taken/, \"Missing or wrong error message for duplicate description\") \n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def check_profile_attributes_match\n wait_for { displayed?(TITLES) }\n titles_array = get_array(TITLES)\n # @@n variable is a random integer that is used as index for selecting only one of the titles elements array\n @@n = rand(0...9)\n log \"STEP 9: Click on random freelancer's title.\"\n # For scrolling the page to the randomly selected title element it uses javascript executor instead of actions\n execute_script_on_element \"arguments[0].scrollIntoView(true);\", titles_array[@@n.to_i]\n # This fixed explicit sleep ensures reliability after scrolling and clicking on the element\n sleep 5\n log \"STEP 10: Get into that freelancer's profile (by clicking on desired Freelancer's title).\"\n # Following the same logic and strategy for scrolling, we use again this method for click\n execute_script_on_element \"arguments[0].click();\", titles_array[@@n.to_i]\n\n # After clicking on the freelancer's title we wait until the slide window is open and freelancer profile elements are present\n wait_for { displayed?(DESCRIPTION) }\n description = text_of(DESCRIPTION)\n log \"STEP 11: Check that each attribute value is equal to one of those stored in the structure created in STEPS 7 and 8.\"\n log \"STEP 12: Check whether at least one attribute contains #{$keyword}.\"\n\n if (description.to_s.eql? @@array[@@n.to_i][:description].to_s)\n $test_result = false\n error \"ERROR!!! => Description differs between profiles search results and freelancer profile for #{@@array[@@n.to_i][:name].to_s}.\"\n end\n wait_for { displayed?(TITLE) }\n description = text_of(TITLE)\n if (description.to_s.eql? @@array[@@n.to_i][:description].to_s)\n $test_result = false\n error \"ERROR: Title differs between profiles search results and freelancer profile for #{@@array[@@n.to_i][:name].to_s}.\"\n end\n end", "def test_show_playlist_titles\n expected = [\"White Christmas\", \"Ave Maria\"]\n @room1.add_song_to_playlist(@song1)\n @room1.add_song_to_playlist(@song5)\n actual_result = @room1.show_playlist_titles()\n assert_equal(expected, actual_result)\n end" ]
[ "0.8420171", "0.6995966", "0.6959363", "0.69580567", "0.69216394", "0.68472767", "0.6770389", "0.6705961", "0.66408145", "0.6490771", "0.6489154", "0.6463696", "0.64600486", "0.6415759", "0.6334921", "0.6272647", "0.62379944", "0.6235383", "0.6148467", "0.6126681", "0.61260986", "0.61219627", "0.6118885", "0.6060291", "0.6059132", "0.60529745", "0.6050954", "0.60452396", "0.6045223", "0.60295886", "0.6011988", "0.60045904", "0.5996737", "0.5994661", "0.59946084", "0.59893644", "0.59842116", "0.5978492", "0.59629023", "0.5934929", "0.5917844", "0.590934", "0.5902198", "0.58774143", "0.5867974", "0.58572775", "0.58534235", "0.58531564", "0.58507", "0.5847516", "0.58336747", "0.58327657", "0.5826343", "0.58231866", "0.58196145", "0.5805514", "0.5799557", "0.57980555", "0.57872194", "0.5786366", "0.5766505", "0.5756249", "0.57530916", "0.5735668", "0.57217187", "0.5718021", "0.571784", "0.56977296", "0.56885815", "0.5686703", "0.5685676", "0.56844074", "0.5682641", "0.56674415", "0.5663522", "0.5663511", "0.5662572", "0.56620765", "0.5659237", "0.56448096", "0.5639079", "0.5639079", "0.56377935", "0.5637588", "0.56290734", "0.5620619", "0.56189084", "0.5584257", "0.5582724", "0.5577609", "0.5566831", "0.5559451", "0.5546108", "0.5535723", "0.5532986", "0.55309653", "0.55293393", "0.5522991", "0.5510641", "0.550716" ]
0.8483728
0
DATE REQUESTED Enters date requested per a given set of test data
def enter_date_requested(test_data) hide_notifications_bar logger.info "Entering date requested '#{test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name]}'" wait_for_element_and_type(date_requested_input, test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name]) hit_enter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def enter_date_requested(test_data)\n hide_notifications_bar\n wait_for_element_and_type(date_requested_input, test_data[UseOfCollections::DATE_REQUESTED.name])\n hit_enter\n end", "def assign_date_coverage\n cov_interval = Dataset::DateCoverageService.params_to_interval params\n params[PARAMS_KEY]['date_coverage'] = cov_interval ? cov_interval.edtf : \"\"\n end", "def get_response( date )\r\n date_range = [parse_date( date ), parse_date( date.next_month )]\r\n puts \"Getting records modified from #{date_range.join(' to ')} ...\"\r\n \r\n response = ERP::ERPAgent.post(\r\n :url => AppConfig.SOAP_CU_SERV,\r\n :body => ERP::Customer.generate_xml( \"find_entity_key_list_customers\", :operator => \"Range\", :value1 => date_range.first, :value2 => date_range.last )\r\n )\r\nend", "def enter_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n wait_for_element_and_type(use_date_input(index), date[UseOfCollections::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[UseOfCollections::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[UseOfCollections::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[UseOfCollections::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[UseOfCollections::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def apply_date_params\n if (params[\"date\"] && (params[\"date\"][\"month\"] && params[\"date\"][\"year\"]))\n month = params[\"date\"][\"month\"]\n year = params[\"date\"][\"year\"]\n params[:exam_paper][:date_issued] = \"#{year}-#{month}\"\n end\n end", "def dates_requiring_data\n collected = Dir.glob(File.join(@config[:data_dir], \"*-*-*.{csv,espi}\")).map { |f| File.basename(f).split(\".\")[0] }\n all_days = []\n\n count_of_days = (Date.today - @config[:start_date]).to_i\n\n count_of_days.times do |i|\n all_days << (@config[:start_date] + i).strftime(\"%Y-%m-%d\")\n end\n\n (all_days - collected).map { |d| Date.parse(d) }\n end", "def enter_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n logger.info \"Entering use date data set at index #{index}: #{date}\"\n wait_for_element_and_type(use_date_input(index), date[CoreUseOfCollectionsData::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def updateDates(iDate, iResourcesInfo)\n if (@StartDate == nil)\n # First time there is an affectation\n @StartDate = iDate\n @EndDate = iDate\n @EndDateHours = 0\n iResourcesInfo.each do |iResource, iHours|\n @EndDateHours += iHours\n end\n elsif (@StartDate > iDate)\n # Different start date\n @StartDate = iDate\n elsif (@EndDate < iDate)\n # Different end date\n @EndDate = iDate\n @EndDateHours = 0\n iResourcesInfo.each do |iResource, iHours|\n @EndDateHours += iHours\n end\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def test_date_params\n params.require(:test_date).permit(:date, :deadline, :testing_id)\n end", "def response_dates_after_submission\n unless actl_submission.blank?\n xpcd_response_computed = ( xpcd_response || Date.today ) + xpcd_response_delta.to_i\n errors.add( :xpcd_response, I18n.t( 'dsr_submissions.msg.bad_resp_date')) \\\n unless xpcd_response_computed >= actl_submission\n end\n end", "def request_datum_params\n # params.require(:request_datum).permit(:date, :client_id, :agent_id)\n params.require(:request_datum).permit!\n end", "def setup_transaction_dates_step\n @lbtt_return.effective_date = @lbtt_return.effective_date&.to_date\n @lbtt_return.relevant_date = @lbtt_return.relevant_date&.to_date\n @lbtt_return.contract_date = @lbtt_return.contract_date&.to_date\n convert_lease_transaction_date\n end", "def update_start_date(expected_start_day)\n\t\t\tself.start_date = expected_start_day\n\tend", "def set_initial_date\n unless date_requested\n self.date_requested = Date.today\n end\n end", "def set_param_date\n # sets datas based on params or last transaction\n # if params include a date from/to converted to beginning and end of month\n # if only front will set from and to (or today of to missing)\n # if parmans not present will get last transaction and set from to beginning of its month\n # if from is in current month, may look back 7 days from from date\n @today = Date.today\n minus7 = @today.day < 8 ? 8 - @today.day : 0 # if in first week of month, look back 7 days\n if params[:date].present? # from month pulldown\n @date = Ledger.set_date(params[:date])\n @from = @date.beginning_of_month\n @to = @date.end_of_month\n elsif params[:from].present? # from date picker(from,to)\n @from = Ledger.set_date(params[:from])\n @to = params[:to].present? ? Ledger.set_date(params[:to]) : @today.end_of_month\n else\n last_tran = @account.last_entry_date ||= @today.beginning_of_year\n @from = last_tran.beginning_of_month\n @from -= minus7 if Ledger.dates_in_same_month(@today,@from)\n @to = @today.end_of_month\n end\n end", "def set_dates(spreadsheet, cal_date_row, cal_date_col, exp_date_row, exp_date_col)\r\n\r\n k = 0\r\n (cal_date_col+1...exp_date_col).each do |j|\r\n if spreadsheet.celltype(cal_date_row, j) == :date\r\n @calibration.caldate = spreadsheet.cell(cal_date_row, j)\r\n k = j + 1\r\n break\r\n end\r\n end\r\n\r\n #look for expiration date\r\n if (k != 0)\r\n\r\n (k..spreadsheet.last_column).each do |j|\r\n if spreadsheet.celltype(cal_date_row, j) == :date\r\n @calibration.expdate = spreadsheet.cell(cal_date_row, j)\r\n break\r\n end\r\n end\r\n end\r\n\r\n end", "def requests_for_date(date)\r\n #find all requests in this zip on this date\r\n s = Schedule.for(self.location, date)\r\n puts \"generated schedule\", s\r\n requests = []\r\n s.stops.each do |stop|\r\n puts stop\r\n requests << stop.requests if stop\r\n puts \"requests: \" + requests.to_s\r\n end\r\n requests.flatten.sort_by{|r| r.order.address.addr1}\r\n end", "def dates\n end", "def process_date_params\n \n puts \"processing data params\"\n \n # Checks start and end dates. Likewise if there is an error the default\n # is to send the entire timeseries\n begin\n puts \"date time found\"\n params[:start_date] = DateTime.parse(params[:start_date]) unless params[:start_date].nil?\n params[:end_date] = DateTime.parse(params[:end_date]) unless params[:end_date].nil?\n params[:start_date] = Interaction.order('count_date asc').first.count_date if params[:start_date].nil?\n params[:end_date] = DateTime.now if params[:end_date].nil?\n rescue\n puts \"no date_time found\"\n params[:start_date] = Interaction.order('count_date asc').first.count_date\n params[:end_date] = DateTime.now\n end\n end", "def set_date_request\n @date_request = DateRequest.find(params[:id])\n end", "def test_date\n if test_execution_date and test_delivery_date\n if test_execution_date > test_delivery_date\n errors.add(:test_delivery_date, \"should be greater then test date.\")\n end\n end\n end", "def set_test_date\n @test_date = TestDate.find(params[:id])\n end", "def valid_dates\n device_request = DeviceRequest.find(device_request_id)\n current_date = Date.today\n if self.on_date.present?\n self.errors.add :on_date, \"Quotation date can't be future\" if self.on_date > current_date\n self.errors.add :on_date, \"Quotation date should be onwards #{device_request.on_date}\" if self.on_date < device_request.on_date\n end\n end", "def setup_earning_tests\n start_date = Date.today\n i = 0\n Order.find(:all).each do |o|\n o.update_attributes({\n :created_on => start_date - i.months,\n :order_status_code_id => 7,\n :affiliate => @jm\n })\n i += 1\n end\n end", "def handle_date\n today = DateTime.now.beginning_of_day.to_date\n @max_end = today + 400.days\n @inv_start = today\n @master_rates_start = today\n @agoda_rates_start = today\n @expedia_rates_start = today\n @bookingcom_rates_start = today\n @gta_travel_rates_start = today\n @orbitz_rates_start = today\n @ctrip_rates_start = today\n\n begin\n # set the date in inventory table\n @inv_start = Date.strptime(params[:inv_start]) unless params[:inv_start].blank?\n @inv_start = today if @inv_start < today\n @inv_start = @max_end if @inv_start > @max_end\n\n # set the date in master rate table\n @master_rates_start = Date.strptime(params[:master_rates_start]) unless params[:master_rates_start].blank?\n @master_rates_start = today if @master_rates_start < today\n @master_rates_start = @max_end if @master_rates_start > @max_end\n\n # set the date in agoda rates table\n @agoda_rates_start = Date.strptime(params[:agoda_rates_start]) unless params[:agoda_rates_start].blank?\n @agoda_rates_start = today if @agoda_rates_start < today\n @agoda_rates_start = @max_end if @agoda_rates_start > @max_end\n\n # set the date in expedia rates table\n @expedia_rates_start = Date.strptime(params[:expedia_rates_start]) unless params[:expedia_rates_start].blank?\n @expedia_rates_start = today if @expedia_rates_start < today\n @expedia_rates_start = @max_end if @expedia_rates_start > @max_end\n\n # set the date in booking.com table\n @bookingcom_rates_start = Date.strptime(params[:bookingcom_rates_start]) unless params[:bookingcom_rates_start].blank?\n @bookingcom_rates_start = today if @bookingcom_rates_start < today\n @bookingcom_rates_start = @max_end if @bookingcom_rates_start > @max_end\n\n # set the date in gta travel\n @gta_travel_rates_start = Date.strptime(params[:gta_travel_rates_start]) unless params[:gta_travel_rates_start].blank?\n @gta_travel_rates_start = today if @gta_travel_rates_start < today\n @gta_travel_rates_start = @max_end if @gta_travel_rates_start > @max_end\n\n # set the date in orbitz\n @orbitz_rates_start = Date.strptime(params[:orbitz_rates_start]) unless params[:orbitz_rates_start].blank?\n @orbitz_rates_start = today if @orbitz_rates_start < today\n @orbitz_rates_start = @max_end if @orbitz_rates_start > @max_end\n\n # set the date in ctrip\n @ctrip_rates_start = Date.strptime(params[:ctrip_rates_start]) unless params[:ctrip_rates_start].blank?\n @ctrip_rates_start = today if @ctrip_rates_start < today\n @ctrip_rates_start = @max_end if @ctrip_rates_start > @max_end\n \n rescue => ex\n flash[:alert] = ex.message\n end\n end", "def test_dates_in_query_params_treated_as_strings\n response = Typhoeus.get(\"http://127.0.0.1:9080/api/hello\", log_http_options.deep_merge({\n :params => {\n :date_field => \"2010-05-01\",\n },\n }))\n assert_response_code(200, response)\n record = wait_for_log(response)[:hit_source]\n assert_equal(\"2010-05-01\", record[\"request_query\"][\"date_field\"])\n\n response = Typhoeus.get(\"http://127.0.0.1:9080/api/hello\", log_http_options.deep_merge({\n :params => {\n :date_field => \"2010-05-0\",\n },\n }))\n assert_response_code(200, response)\n record = wait_for_log(response)[:hit_source]\n assert_equal(\"2010-05-0\", record[\"request_query\"][\"date_field\"])\n\n response = Typhoeus.get(\"http://127.0.0.1:9080/api/hello\", log_http_options.deep_merge({\n :params => {\n :date_field => \"foo\",\n },\n }))\n assert_response_code(200, response)\n record = wait_for_log(response)[:hit_source]\n assert_equal(\"foo\", record[\"request_query\"][\"date_field\"])\n end", "def set_formatted_dates\n @clienttransaction.update_attribute(:duedate, formatted_date(clienttransaction_params[:duedate])) if clienttransaction_params[:duedate].present?\n @clienttransaction.update_attribute(:transaction_date, formatted_date(clienttransaction_params[:transaction_date])) if clienttransaction_params[:transaction_date].present?\n end", "def search_by_modified_date( start_date, end_date )\r\n \r\n # Start Date Adjustment\r\n start_date -= @options[:time_adjustment]\r\n \r\n output_log \"Querying customer master records modified during #{parse_date(start_date)} and #{parse_date(end_date)} ...\"\r\n \r\n post_xml = ERP::Customer.generate_xml(\r\n \"find_list_customers\",\r\n :operator => \"Range\", :value1 => parse_date( start_date ), :value2 => parse_date( end_date )\r\n )\r\n \r\n tried_times = 0\r\n begin\r\n response = ERP::ERPAgent.post :url => AppConfig.SOAP_CU_SERV, :body => post_xml\r\n rescue => e\r\n if tried_times < @options[:max_try_times]\r\n tried_times += 1\r\n retry\r\n else\r\n output_log \" !!! FAILED TO INITIALIZE DATA, PLEASE TRY AGAIN LATER !!!\"\r\n raise e\r\n end\r\n end\r\n \r\n nodes = Hpricot.XML( response.body )/'CustTable_1'\r\n output_log \"#{parse_date(start_date)} to #{parse_date(end_date)}, #{nodes.size} returned.\"\r\n \r\n # Block is given\r\n yield nodes if block_given?\r\n \r\n return nodes\r\n end", "def convert_to_est\n self.start_date += 18000\n self.end_date += 18000\n end", "def calculate_dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n end", "def request_datestamp\n request_time.strftime(\"%Y%m%d\")\n end", "def convert_epochs_to_dates\n if params['event']['start_date']\n params['event']['start_date'] = Time.zone.at(params['event']['start_date'].to_i / 1000)\n end\n if params['event']['end_date']\n params['event']['end_date'] = Time.zone.at(params['event']['end_date'].to_i / 1000)\n end\n end", "def date_set(date_from, date_to)\n # if the first parameter is empty, default to using second date instead\n date_from = date_overwrite(date_from, date_to)\n date_to = date_overwrite(date_to, date_from)\n\n # after date potentially duplicated above, use first/last entry years\n # and first/last day of year to cover missing year, month, and day\n date_from = date_default(date_from, [DATE_FIRST[0], \"01\", \"01\"])\n date_to = date_default(date_to, [DATE_LAST[0], \"12\", \"31\"])\n\n date_from = date_format(date_from, default_year: DATE_FIRST[0].to_i)\n date_to = date_format(date_to, default_year: DATE_LAST[0].to_i)\n\n # Set parameters so form populated with calculated dates\n params[:date_from] = date_from.split(\"-\")\n params[:date_to] = date_to.split(\"-\")\n\n [date_from, date_to]\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def enter_acquisition_dates(data_set)\n acquis_dates = data_set[Acquisition::ACQUIS_DATE_GRP.name]\n acquis_dates && acquis_dates[0..1].each do |date|\n inputs = elements acquis_date_input_locator\n input = acquis_dates[0..1].index(date).zero? ? inputs[0] : inputs[1]\n input.clear\n sleep Config.click_wait\n input.send_keys date[Acquisition::ACQUIS_DATE.name]\n hit_enter\n hit_tab\n end\n end", "def set_date_options\n @date_start = !@params[:date_start].blank? ? DateTime.parse(@params[:date_start]).to_date : Order.first_datetime.to_date\n @date_end = !@params[:date_end].blank? ? DateTime.parse(@params[:date_end]).to_date : Date.today\n @date_unit = @params[:date_unit] || 'month'\n @date_start_db = @date_start.to_datetime.to_s(:db)\n @date_end_db = @date_end.to_datetime.to_s(:db)\n\n case @date_unit\n when 'day'\n @date_values = date_range_to_single_dates(@date_start, @date_end)\n when 'week'\n @date_values = date_range_to_weeks(@date_start, @date_end).map { |d| d[0] }\n when 'month'\n @date_values = date_range_to_months(@date_start, @date_end)\n end\n end", "def enter_acquisition_dates(data_set)\n acquis_dates = data_set[CoreAcquisitionData::ACQUIS_DATE_GRP.name]\n acquis_dates && acquis_dates.each do |date|\n index = acquis_dates.index date\n logger.debug \"Entering acquisition date '#{date}' at index #{index}\"\n add_button_locator = add_button_locator([fieldset(CoreAcquisitionData::ACQUIS_DATE_GRP.name)])\n hit_escape\n wait_for_element_and_click add_button_locator unless index.zero?\n wait_for_element_and_type(acquis_date_input_locator(index), date[CoreAcquisitionData::ACQUIS_DATE.name])\n hit_enter\n end\n end", "def test_send_date_array()\n # Parameters for the API call\n dates = APIHelper.json_deserialize(\n '[\"1994-02-13\",\"1994-02-13\"]'\n ).map { |element| Date.iso8601(element) }\n\n # Perform the API call through the SDK function\n result = @controller.send_date_array(dates)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def test_send_date_array()\n # Parameters for the API call\n dates = APIHelper.json_deserialize(\n '[\"1994-02-13\",\"1994-02-13\"]'\n ).map { |element| Date.iso8601(element) }\n\n # Perform the API call through the SDK function\n result = @controller.send_date_array(dates)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def test_send_date()\n # Parameters for the API call\n date = Date.parse('1994-02-13')\n\n # Perform the API call through the SDK function\n result = @controller.send_date(date)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def test_send_date()\n # Parameters for the API call\n date = Date.parse('1994-02-13')\n\n # Perform the API call through the SDK function\n result = @controller.send_date(date)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def date_validation\n #get a new session_id that is valid\n pastValidHold = PrecisionInput.count(:all, :group => 'session_id')\n if pastValidHold\n if pastValidHold.count()>0\n sessionID = pastValidHold.max[0] + 1\n else\n sessionID = 1\n end\n else\n sessionID = 1\n end\n statID = Statistic.all.pluck(:id).max\n\n #send a random sample of events and associated precision_inputs\n\n\n\n @validateEvents = Event.all.sample(10)\n\n @precInputs = []\n @validateEvents.each do |event|\n precinput = PrecisionInput.new\n precinput.event_id = event.id\n precinput.field_name = \"pdate\"\n precinput.session_id = sessionID\n precinput.statistic_id = statID\n precinput.save\n @precInputs << precinput\n end\n end", "def test_get_date_objects\n response = get_transactions_with_retries(access_token,\n START_DATE,\n END_DATE)\n refute_empty(response.accounts)\n refute_empty(response.transactions)\n\n account_id = response.accounts[0].account_id\n response = get_transactions_with_retries(access_token,\n START_DATE,\n END_DATE,\n account_ids: [account_id])\n refute_empty(response.transactions)\n end", "def date; end", "def date; end", "def date; end", "def date; end", "def set_dates \n if self.date_entered.nil?\n self.date_entered = Date.current\n end \n if self.shopping_date.nil?\n self.shopping_date = self.date_entered\n end\n return true\n end", "def enter_accession_date(data_set)\n access_date = data_set[CoreAcquisitionData::ACCESSION_DATE_GRP.name]\n if access_date\n logger.debug \"Entering accession date '#{access_date}'\"\n wait_for_element_and_type(access_date_input_locator, access_date)\n hit_enter\n end\n end", "def date_request_params\n params.require(:date_request).permit(:sender_id, :recipient_id, :acceptance, :weekly_rose)\n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def set_termination_date\n if effective_date and approved_details.try(:duration) and (effective_date_changed? or approved_details_id_changed?)\n self.termination_date = Date.new(\n effective_date.year + approved_details.duration,\n effective_date.month,\n effective_date.day )\n end\n end", "def appeal_location_date_reset\n test_appeal_id = params[\"DISPATCH_ME\"][:vacols_id]\n if full_grant_ids.include?(test_appeal_id)\n decision_type = :full\n elsif partial_and_remand_ids.include?(test_appeal_id)\n decision_type = :partial\n else\n flash[:error] = \"#{test_appeal_id} is not a testable appeal!\"\n redirect_to action: \"index\"\n return\n end\n\n # Cancel existing EPs and reset the dates\n cancel_eps = params[\"DISPATCH_ME\"][:cancel_eps] == \"Yes\" ? true : false\n @dispatch_appeal = Appeal.find_or_create_by_vacols_id(test_appeal_id)\n TestDataService.prepare_claims_establishment!(vacols_id: @dispatch_appeal.vacols_id,\n cancel_eps: cancel_eps,\n decision_type: decision_type)\n redirect_to establish_claims_path\n end", "def enter_botgarden_action_date(data_set)\n action_date = data_set[BOTGARDENCurrentLocationData::ACTION_DATE.name]\n if action_date\n logger.debug \"Entering accession date '#{action_date}'\"\n enter_simple_date(botgarden_acton_date_input_locator, action_date)\n end\n end", "def requests_per_day\n group_by_day.map { |date, ents|\n [date, ents.size]\n }.sort { |a,b|\n a[0] <=> b[0]\n }\n end", "def setDate _args\n \"setDate _args;\" \n end", "def by_date(year, month, day)\n request = @client.call(:recupera_tc_dia, message: {\n Ano: year,\n Mes: month,\n Dia: day\n })\n\n request.body[:recupera_tc_dia_response][:recupera_tc_dia_result]\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def set_dates(start_date = nil, end_date = nil)\n\n\t if (start_date.nil? and not end_date.nil?)\n\n\t\t start_date = (@utils.get_date_object(end_date)) - (MAX_HISTORICAL_DAYS * (24 * 60 * 60))\n\n\t\t @start_date = start_date.to_s\n\t\t @end_date = end_date.to_s\n\n\t elsif (not start_date.nil? and end_date.nil?)\n\n\t\t end_date =(@utils.get_date_object(start_date)) + (MAX_HISTORICAL_DAYS * (24 * 60 * 60))\n\n\t\t if end_date > Time.new.utc\n\t\t\tend_date = nil #Let API default to Now.\n\t\t end\n\n\t\t @start_date = start_date.to_s\n\t\t @end_date = end_date.to_s if not end_date.nil?\n\n\t end\n end", "def spent_on=(date)\n super\n self.tyear = spent_on ? spent_on.year : nil\n self.tmonth = spent_on ? spent_on.month : nil\n self.tweek = spent_on ? Date.civil(spent_on.year, spent_on.month, spent_on.day).cweek : nil\n self.spent_from = date\n self.spent_to = self.spent_from.advance(:hours=>hours) if self.spent_from && hours\n end", "def combine_dates\n tmpdate = date\n tmpdate << date_available\n tmpdate << date_created\n tmpdate << date_updated\n tmpdate << date_copyrighted\n tmpdate << date_collected\n tmpdate << date_valid\n self.date = tmpdate\n end", "def open_on_date(date)\r\n todays_assignments = Assignment.find_all_by_truck_id_and_date(self, date)\r\n num_requests = 0\r\n todays_assignments.each do |a|\r\n num_requests += a.requests.count\r\n end\r\n self.capacity.to_i - num_requests\r\n end", "def pro_rata_start_date\n # \n # Tue Nov 23 00:53:04 IST 2010, ramonrails\n # * we will never use \"installation_datetime\"\n # * installation_datetime is the \"desired\" installation datetime\n # * Pro-rata is charged from the date a panic button is received making user ready to install\n #\n # * check panic button press\n _date = panic_received_at\n # * no panic? check shipping date\n _date ||= (shipped_at + 7.days) unless shipped_at.blank? # if ( _date.blank? && !shipped_at.blank? )\n # * no panic or shipping? nothing returned\n # # \n # # Wed Mar 30 03:46:04 IST 2011, ramonrails\n # # * https://redmine.corp.halomonitor.com/issues/4253\n # # * pick local values that were copied\n # # * when missing?, pick from device_model_prices\n # unless (order.blank? || order.product_cost.blank? || _date.blank?)\n # _date += ( order.cc_monthly_recurring || order.product_cost.recurring_delay).to_i.months\n # end\n # # \n # # Tue May 24 20:07:41 IST 2011, ramonrails\n # # * https://redmine.corp.halomonitor.com/issues/4486\n # # * https://redmine.corp.halomonitor.com/attachments/3294/invalid_prorate_start_dates.jpg\n # _date ||= Date.today\n # _date = Date.today if _date > Date.today\n # \n # Thu May 26 19:32:15 IST 2011, ramonrails\n # * https://redmine.corp.halomonitor.com/issues/4486#note-47\n _date = _date.to_date unless _date.blank?\n _date\n end", "def adjust_admission_date(options ={})\n if options[:days_to_adjust]\n days_to_adjust = options[:days_to_adjust]\n d = Date.strptime(Time.now.strftime('%Y-%m-%d'))\n my_set_date = ((d - days_to_adjust).strftime(\"%d-%b-%y\").upcase).to_s\n end\n Database.connect\n if options[:set_date] # adjust date for specific date\n q = \"update SLMC.TXN_ADM_ENCOUNTER set ADM_DATETIME = '#{options[:set_date]}' where PIN = '#{options[:pin]}'\"\n elsif options[:with_discharge_date]\n q = \"update SLMC.TXN_ADM_ENCOUNTER set ADM_DATETIME = '#{my_set_date}', CREATED_DATETIME = '#{my_set_date}' where PIN = '#{options[:pin]}'\"\n else # adjust date based on days to adjust\n q = \"update SLMC.TXN_ADM_ENCOUNTER set ADM_DATETIME = '#{my_set_date}', UPDATED_DATETIME = '#{Time.now.strftime('%d-%b-%y').upcase}' where PIN = '#{options[:pin]}' and VISIT_NO = '#{options[:visit_no]}'\"\n end\n Database.update_statement q\n Database.logoff\n return my_set_date\n end", "def test_date_a_variable_matches_index\n skip\n engine = Engine.new\n assert_equal [6, 2, 2, 5], engine.date_assignment\n end", "def set_default_values\n\t\tself.month = init_date.split(\"/\")[1]\n\t\tself.year = init_date.split(\"/\")[2]\n\t\tif !self.test\n\t\t\tself.paid = true\n\t\tend\n\tend", "def on_sale\n all.select {|event| (event.starts..event.ends) === (@date_for_test || Date.today)}\n end", "def send_email_after_change_start_date\n\n #Do nothing if start_date not change\n return if(!self.start_date_changed?)\n\n contestants = self.users\n\n #Send email to creator\n UserMailer.start_date_change_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.start_date_change_contestant(c, self).deliver\n end\n\n end", "def index\n @date_requests = DateRequest.all\n end", "def set_api_by_date(startdate, enddate, hostname)\n\n\t\t# setup date range\n\t\tdate_range = @analytics::DateRange.new(start_date: startdate, end_date: enddate)\n\n\t\t# set metircs data. 10 metrices are allowed per one request\n\t\tmetrics = ['ga:pageviews', 'ga:users', 'ga:bounces', 'ga:sessions',\n\t\t\t\t 'ga:avgTimeOnPage', 'ga:newUsers', 'ga:goal1ConversionRate', 'ga:goal1Completions'\n\t\t\t\t ]\n\n\t\t# make new array and put metric type data in the array\n\t\tmetric_type = Array.new\n\t\tmetrics.each do |m|\n\t\t\tmetric = @analytics::Metric.new\n\t\t\tmetric.expression = m\n\t\t\tmetric_type.push(metric)\n\t\tend\n\n\t\t\n\t\t# if startdate == enddate then\n\t\t# \tdimension = @analytics::Dimension.new(name: 'ga:hour')\n\t\t# \torder_by = @analytics::OrderBy.new(field_name: 'ga:hour', sort_order: 'ASCENDING')\n\t\t# else\n\t\t# \tdimension = @analytics::Dimension.new(name: 'ga:date')\n\t\t# \torder_by = @analytics::OrderBy.new(field_name: 'ga:date', sort_order: 'ASCENDING')\n\t\t# end\n\n\n\t \t# set dimensions, dimension_filters by hostname. if hostname is total, then set only hour or date in dimension\n\n\t \tif hostname == 'total'\n\t\t\tif startdate == enddate then\n\t\t\t\tdimensions = ['ga:hour']\n\t\t\telse\n\t\t\t\tdimensions = ['ga:date']\n\t\t\tend\t \t\t\n\t \telse\n\t \t\tif startdate == enddate then\n\t\t\t\tdimensions = ['ga:hour', 'ga:hostname']\n\t\t\telse\n\t\t\t\tdimensions = ['ga:date', 'ga:hostname']\n\t\t\tend\t\n\t \t\tdimension_filters = @analytics::DimensionFilterClause.new(\n\t\t filters: [\n\t\t @analytics::DimensionFilter.new(\n\t\t dimension_name: 'ga:hostname',\n\t\t not: false,\n\t\t operator: \"IN_LIST\",\n\t\t expressions: [hostname]\n\t\t )\n\t\t ]\n\t\t )\n\t \tend\n\n\t \tdimension_type = Array.new\n\t\tdimensions.each do |d|\n\t\t\tdimension = @analytics::Dimension.new\n\t\t\tdimension.name = d\n\t\t\tdimension_type.push(dimension)\n\t\tend\t\t\t\n\n\t\t#set order_bys\n\t\torder_by = @analytics::OrderBy.new(field_name: dimensions[0], sort_order: 'ASCENDING')\n\n\n\t\t# setup request with the data i set up above to google analytics server\n\t\trequest = @analytics::GetReportsRequest.new(\n \t\t\treport_requests: [@analytics::ReportRequest.new(\n \t\t\tview_id: @view_id, \n \t\t\tmetrics: metric_type,\n \t\t\tdimensions: dimension_type,\n \t\t\tdimension_filter_clauses: [dimension_filters],\n \t\t\tdate_ranges: [date_range],\n \t\t\torder_bys: [order_by]\n \t\t\t)]\n\t\t)\n\n\t\t# send request and get the result in the response\n\t\tresponse = @client.batch_get_reports(request)\n\n\t\t# make new array for the total data. it will has datahash and dropdwnhash, datahash is for total data and\n\t\t# the other is for hourly/daily data. key would be time(00,01,02,...) or date(i.e. 5/20.5/21,...). \n\t\tset_total_array = Array.new\n\n\t\t# this data is mcv and it is from database\n\t\ttotal_clicks_count = set_total_article(startdate, enddate)\n\n\n\t\t# getting total data part start\n\n\t\ttotal_data = response.reports.first.data.totals\n\t\tkey_array = metrics\n\t\t# get rid of 'ga:'\n\t\tkey_array.each_with_index do |k, index| \n\t\t\tkey_array[index] = k.gsub(\"ga:\",\"\")\n\t\tend\n\n\t\ttotal_data.each do |t|\n\t\t\tdatahash = {}\n\n\t\t\tt.values.each_with_index do |v, index|\n\t\t\t\tdatahash[key_array[index]] = v\t\n\t\t\tend\n\t\t\tdatahash['mcv'] = total_clicks_count\n\t\t\tset_total_array.push(datahash)\n\t\tend\n\t\t# datahash sample -> { \"pageviews\": \"11\", \"users\": \"22\", \"bounces\": \"33\", ... , \"mcv\": 0 }\n\n\t\t# getting total data part end\n\n\t\t# getting daily or hourly data part start\n\t\tdropdwnhash = {}\n\n\t\tdata_from_google = response.reports.first.data.rows\n\t\t\n\t\tdata_from_google.each do |r|\n\t\t\tvhash = {}\n\t\t\t# key would be hour or date\n\t\t\tkey = r.dimensions.first\n\n\t\t\t# vhash is the data such as pageview, users and so on for specific time or date\n\t\t\tr.metrics.first.values.each_with_index do |v, index|\n\t\t\t\tvhash[key_array[index]] = v\n\t\t\tend\n\n\t\t\tif startdate == enddate\n\t\t\t\tkey = key + \":00\"\n\t\t\tend\n\t\t\t\n\t\t\tdropdwnhash[key.to_sym] = vhash\n\t\tend\n\n\t\t# dropdwnhash sample (hour) -> \"00:00\": { \"pageviews\": \"534\", \"users\": \"478\", \"bounces\": \"432\", ... }, \"01:00\": { ... }\n\t\t# dropdwnhash sample (date) -> \"20200608\": { \"pageviews\": \"534\", \"users\": \"478\", \"bounces\": \"432\", ... }, \"20200609\": { ... }\n\n\t\tset_total_array.push(dropdwnhash)\n\n\t\t# getting daily or hourly data part end\n\n\t\treturn set_total_array\n\tend", "def dateselection\nend", "def determine_date\n if !params[:date_start].blank? && !params[:date_end].blank?\n @date_start = params[:date_start]\n @date_end = params[:date_end]\n else\n determine_date_now\n end\n end", "def set_formatted_dates\n @vendortransaction.update_attribute(:duedate, formatted_date(vendortransaction_params[:duedate])) if vendortransaction_params[:duedate].present?\n @vendortransaction.update_attribute(:transaction_date, formatted_date(vendortransaction_params[:transaction_date])) if vendortransaction_params[:transaction_date].present?\n end", "def enter_foundation_date(test_data)\n test_date = test_data[Org::FOUNDING_DATE.name]\n hide_notifications_bar\n enter_simple_date(foundation_date_input, test_date)\n end", "def data_requests_year_to_date\n data_requests = @organization.data_requests\n @dataset = @organization.datasets.find_by_param(params[:dataset])\n data_requests = data_requests.joins(:requests).merge(Request.where(dataset: @dataset)) if @dataset\n @year = (params[:year].to_i.positive? ? params[:year].to_i : Time.zone.today.year)\n @chart_title = \"#{\"#{@dataset.slug.upcase} \" if @dataset} Data Requests for #{@year}\"\n @chart_subtitle = @organization.name\n @series = []\n max = 100\n (series, max) = add_average_submitted(data_requests, max)\n @series << series\n (series, max) = add_submitted_data_requests(data_requests, max)\n @series << series\n (series, max) = add_approved_data_requests(data_requests, max)\n @series << series\n\n @x_axis = { categories: Date::ABBR_MONTHNAMES.last(12), title: { text: \"\" } }\n @y_axis = { title: { text: \"Data Requests\" }, max: max }\n end", "def request_data(code)\n request_data = {\n \"request\" => {\n \"passengers\" => {\n \"adultCount\" => \"1\"\n },\n \"slice\" => [\n {\n \"origin\" => \"OMA\",\n \"destination\" => code,\n \"date\" => (Date.today + 1).to_s\n }\n ],\n \"solutions\" => \"1\"\n }\n }\nend", "def simulate_test_running_on_different_days\n travel_to Time.parse(ENV['SPEC_DATE'] || \"26-#{rand(9..12)}-2019 14:33:20'\")\n end", "def task_set_issue_date\n errata.issue_date = Time.now\n errata.save!\n info \"Updated Issue date\"\n end", "def date()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Date::DateRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def date() updated; end", "def loadDcTest\n $dc = dcs(:two)\n $shirt_deadline = ($dc.start_time - 17.days).end_of_day\n $registration_deadline = ($dc.start_time - 4.days).end_of_day\n $registration_starts = true\n $report_deadline = ($dc.start_time + 1.month).end_of_day\n end", "def get_response_by_specified_parameters(start_date, end_date, state_id, case_id, employer_name, visa_class_id, h1b_data_series)\r\n icert_request_url = \"https://icert.doleta.gov/index.cfm?event=ehLCJRExternal.dspQuickCertSearchGridData\" \\\r\n \"&&startSearch=1\" \\\r\n \"&case_number=#{case_id}\" \\\r\n \"&employer_business_name=#{employer_name}\" \\\r\n \"&visa_class_id=#{visa_class_id}\" \\\r\n \"&state_id=#{state_id}\" \\\r\n \"&location_range=10\" \\\r\n \"&location_zipcode=\" \\\r\n \"&job_title=\" \\\r\n \"&naic_code=\" \\\r\n \"&create_date=undefined\" \\\r\n \"&post_end_date=undefined\" \\\r\n \"&h1b_data_series=#{h1b_data_series}\" \\\r\n \"&start_date_from=#{start_date}\" \\\r\n \"&start_date_to=#{end_date}\" \\\r\n \"&end_date_from=mm/dd/yyyy\" \\\r\n \"&end_date_to=mm/dd/yyyy\" \\\r\n \"&page=1\" \\\r\n \"&rows=60\" \\\r\n \"&sidx=create_date\" \\\r\n \"&sord=desc\" \\\r\n \"&nd=1445285016948\" \\\r\n \"&_search=false\"\r\n\r\n uri = URI.parse(icert_request_url)\r\n http = Net::HTTP.new(uri.host, uri.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n response = http.get(uri.request_uri)\r\n\r\n return response\r\nend", "def set_date(date)\n param = date[:year]\n if date.key? :month\n param << \":\" << date[:month]\n param << \":\" << date[:day] if date.key? :day\n end\n Jhead.call(\"-ds\" << param, @match, @pattern)\n end", "def test_ID_25840_edit_profile_resident_since\n login_as_user1\n go_to_edit_profile_page\n verify_day_can_only_be_selected_from_1_to_31 \"test_ID_25835_edit_profile_desc\", 1, 31\n verify_month_can_only_be_selected_from_Jan_to_Dec \"test_ID_25835_edit_profile_desc\", 1, 12\n time = Time.new\n verify_year_can_only_be_selected_from_1900_to_current_year \"test_ID_25835_edit_profile_desc\", \"1900\", \"#{time.year}\"\n verify_user_can_save_date \"March\",\"18\",\"1981\"\n verify_user_can_return_date_to_the_default \"Month\",\"Day\",\"Year\"\n verify_user_is_not_able_to_specify_only_the_month_drop_down \"March\",\"Day\",\"Year\"\n verify_user_is_not_able_to_specify_only_the_day_drop_down \"Month\",\"12\",\"Year\"\n #verify_user_is_not_able_to_specify_only_the_year_drop_down \"Month\",\"Day\",\"1970\" Bug\n end", "def enter_botgarden_action_date(data_set)\n action_date = data_set[InventoryMovement::LOCATION_DATE.name]\n if action_date\n enter_simple_date(botgarden_acton_date_input_locator, action_date)\n end\n end", "def read_date; end", "def record_estimate_change(status, modified_date, estimate_diff)\n if status.is_relevant?\n add_estimated_days_on_date(@planned, modified_date, estimate_diff)\n if status.is_signed_off?\n add_estimated_days_on_date(@signed, modified_date, estimate_diff)\n if status.is_tested?\n add_estimated_days_on_date(@tested, modified_date, estimate_diff)\n end\n end\n end\n end", "def adjust_dates(date)\n first_date = planned.minimum(:actual_date)\n if first_date && first_date < date\n gap = date - first_date\n planned.each do |repetition|\n repetition.increment!(:actual_date, gap)\n end\n end \n end", "def edate()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Edate::EdateRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def recordAttendance\n @provider = Provider.find(params[:provider_id])\n @children = @provider.children.order('lName')\n @date = params[:date] \n @date = Date.parse(\"#{params[:date]['day']}-#{params[:date]['month']}-#{params[:date]['year']}\") if params[:date]\n @date ||= Date.current\nend", "def shipping_report\n @data.start_date = DionDate.new(\"start\", Time.now)\n @data.end_date = DionDate.new(\"end\", Time.now)\n shipping_report_common\n end", "def f_start_date\n\t\tself.expected_start_date.strftime(\"%d / %m / %Y\")\n\tend", "def setSearchDate\n @searchDate = params[:requestDate];\n\n if @searchDate.to_s.empty?\n @searchDate=Time.now.strftime(\"%d-%m-%Y\");\n end\n end", "def set_date_infected\n @date_infected = DateInfected.find(params[:id])\n end" ]
[ "0.69345003", "0.6905148", "0.6390723", "0.6099584", "0.5985273", "0.59790194", "0.59706354", "0.5935033", "0.5909702", "0.5871551", "0.58661664", "0.58104175", "0.5780501", "0.57795286", "0.57478637", "0.5746177", "0.57028973", "0.57023907", "0.5670102", "0.5664096", "0.56632495", "0.5661145", "0.565868", "0.5654836", "0.56520295", "0.5643919", "0.5627466", "0.5613526", "0.5600953", "0.55990654", "0.5589487", "0.5581116", "0.55757654", "0.5557036", "0.55404794", "0.5539445", "0.5529564", "0.5504971", "0.5497816", "0.5479067", "0.54630834", "0.5449973", "0.5445577", "0.5445577", "0.54353076", "0.54353076", "0.5427327", "0.5418255", "0.540937", "0.54058367", "0.54058367", "0.54058367", "0.54058367", "0.5402368", "0.53881454", "0.5387294", "0.5384311", "0.5380377", "0.5378698", "0.5365532", "0.5360735", "0.5344472", "0.53441846", "0.534356", "0.5343174", "0.5334515", "0.53215", "0.53189546", "0.5316126", "0.5310494", "0.5292843", "0.5285145", "0.52846646", "0.5281954", "0.52781856", "0.5277932", "0.5274893", "0.5267805", "0.52557546", "0.5254305", "0.5240501", "0.52398896", "0.5239218", "0.5238941", "0.523825", "0.5233005", "0.5231871", "0.52306414", "0.52137494", "0.52104557", "0.5209765", "0.52091134", "0.5200692", "0.51974785", "0.5195385", "0.5189333", "0.5186378", "0.5184698", "0.5183837", "0.51796323" ]
0.6471673
2
Verifies date requested matches test data
def verify_date_requested(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def test_if_correct_date\n skip\n potluck = Potluck.new(\"7-13-18\")\n expected =\n actual = potluck\n\n assert_equal expected, actual\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[Org::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "def verify_patchset_9141024_created_date\n patchset = PatchSet.where(code_review_id: 9141024, patchset: 3004).first\n #convert dates to strings for comparison\n if patchset.created.to_s.eql?(\"2012-01-20 23:53:25 UTC\") then \n pass()\n else\n fail(\"Wrong created date on patchset 9141024.\")\n end\n end", "def test_date\n if test_execution_date and test_delivery_date\n if test_execution_date > test_delivery_date\n errors.add(:test_delivery_date, \"should be greater then test date.\")\n end\n end\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def date_valid?(date)\n valid_dates = Date.parse(DATA_START_DATE)..Date.today\n if valid_dates.cover?(date)\n return true\n else\n puts \"\\nDate must be after #{DATA_START_DATE} and before today.\"\n return false\n end\nend", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def verifyCalendarDate\n # Make sure the given year is not less than 1900.\n if @year < 1900\n @year = 1900\n end\n\n # Make sure the month is within range.\n if @month > 12\n @month = 12\n end\n if @month < 1\n @month = 1\n end\n\n # Make sure the day given is within range of the month.\n month_length = CDK::CALENDAR.getMonthLength(@year, @month)\n if @day < 1\n @day = 1\n end\n if @day > month_length\n @day = month_length\n end\n end", "def test_date_value\n assert_match /\"2012-01-01T00:00:00.*/, value(Date.parse('2012-01-01'))\n end", "def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend", "def check_fixed_date_requirements(date)\n return true unless release_fixed_date? && release_date.present?\n date == release_date\n end", "def test_validate_valid_date\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: 1.day.from_now,\n is_hidden: false)\n assert g.valid?\n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def check_dates\n # TODO the init_time must be less then the end_time\n true\n end", "def test_simple_valid_datetime\n assert_equal [11, 0], verify_and_return_datetime([10, 100], '11.0', 10)\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def test_raises_error_with_invalid_dates\n assert_raises DataWrangler::Configuration::Error do\n _new_validator(\n {\n \"from\" => @invalid_date_string,\n \"to\" => Date.today.to_s\n }\n )\n end\n end", "def date_combination_valid\n\n # just make sure we work on something valid and existing\n\n return false unless date_from?\n\n set_nil_default( :date_until, date_from )\n\n if date_until < date_from\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_period' ))\n return false\n end\n\n if date_from.year != date_until.year\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_years' ))\n return false\n end\n\n # all tests passed\n\n write_attribute( :year_period, date_from.year )\n return true\n end", "def test_valid_with_attributes\r\n fee_schedule = FeeSchedule.new\r\n fee_schedule.start_date = fee_schedules(:fee_schedule_00001).start_date\r\n fee_schedule.end_date = fee_schedules(:fee_schedule_00001).end_date\r\n assert fee_schedule.valid?, fee_schedule.errors.full_messages \r\n end", "def check_date()\n event = Event.find_by(id: self.event_id) \n if Time.now > event.start_date then\n halt msg: 'check_date() fail' \n false\n else\n true\n end\n end", "def test_date_a_variable_matches_index\n skip\n engine = Engine.new\n assert_equal [6, 2, 2, 5], engine.date_assignment\n end", "def check_date(source_file)\n avhrr_file = Dir.glob('*.avhrr').first\n fail 'No avhrr file found, the processing must have failed' unless avhrr_file\n\n # Catch exception in case of wierd dates, like for example \"n19.17366.2352.avhrr\"\n begin\n # time of processed data\n time_of_data = get_time(avhrr_file)\n # time of recieved pass\n time_of_source = get_time(source_file)\n rescue ArgumentError => e\n puts('ERROR: An error occured parsing the source or processed filenames.')\n puts(\"ERROR: \\t#{e.to_s}\")\n raise 'Processed data has a strange time'\n end\n\n # if the time of the processed data and the source data is different by more than 10 minutes, report as bad\n if ((time_of_data - time_of_source) > 600)\n puts('ERROR: Processed data seems to have a strange time')\n puts(\"ERROR: Source: #{source_file}, time => #{time_of_source.to_s}\")\n puts(\"ERROR: Data: #{avhrr_file}, time => #{time_of_data.to_s}\")\n fail 'Processed data has a strange time'\n end\n\n # If the date of the data is more than 4 days in the future, report as bad.\n if ((time_of_data - DateTime.now).to_f > 2.0 )\n puts('ERROR: Processed data is in the future')\n puts(\"ERROR: Source: #{source_file}, time => #{time_of_source.to_s}\")\n puts(\"ERROR: Data: #{avhrr_file}, time => #{time_of_data.to_s}\")\n fail 'Processed data has a date in the future'\n end\n end", "def test_dates_with_exact_attributes_are_equal\n assert_equal CarbonDate::Date.new(1988, 7, 11, 6, 43, 3, precision: :second), CarbonDate::Date.new(1988, 7, 11, 6, 43, 3, precision: :second)\n end", "def has_valid_date?\n self.time_event < Time.now.advance(days: 1)\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def check_date\n\t\tif self.hasError\n\t\t\terrors.add(\"\", \"You entered Invalid date: \\n - \"+self.interviewer.name)\n\t\t\t# puts \"===================CHECKDATE===================\"\n\t\telsif Time.at(self.sched_end.to_i) <= Time.at(self.sched_start.to_i)\n\t\t\terrors.add(\"\", \"Start time cannot be greater than end time \\n - \"+self.interviewer.name)\n\t\tend\n\tend", "def attested_for?(date)\n last_attested_on && last_attested_on > date.to_time\n end", "def test_validate_invalid_date\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: '2009-',\n is_hidden: false)\n assert !g.valid?\n end", "def valid_release_date?(date)\n # Validate date against all release date requirements\n check_no_delay_requirements(date) && check_before_date_requirements(date) && check_fixed_date_requirements(date)\n end", "def correct?\n starts_at < ends_at && starts_at.to_date == ends_at.to_date\n end", "def test_validate_date_in_the_past\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: 1.day.ago,\n is_hidden: false)\n assert g.valid?\n end", "def date_verify\n if end_date && start_date.nil?\n errors.add(:end_date, \"cannot only specify end date\")\n elsif all_day && start_date.nil?\n errors.add(:all_day, \"cannot specify without date\")\n elsif (start_date && end_date) && (start_date > end_date)\n errors.add(:start_date, \"cannot larger than end date\")\n end\n end", "def team_registration_passed?\n d = @data_object\n today = Date.today\n d.aff_team_reg_end.to_date < today\n end", "def validate_date?(start_date,end_date)\n\t\tstart_date <= end_date\n\tend", "def test_date_of_today\n skip\n engine = Engine.new\n\n assert engine.date\n end", "def correct_dates?(object)\n object.date_from <= object.date_to\n end", "def test_registration_date\n value = DateTime.now\n @reg.registration_date = value\n assert_equal(value.to_s, @reg.registration_date.to_s, \"Registration date incorrect\")\n end", "def validate_date(spreadsheet_id)\n date = get_date_array(spreadsheet_id)\n if date[0].to_i >= 1 and date[0].to_i <= 12 and date[1].to_i == 1 and date[2].to_i >= 2016 and get_start_day(date[3]) != nil\n return true\n else\n return false\n end\nend", "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "def validateDate(date)\n\n year = '[1-2][90][0-9][0-9]'\n month = '0[1-9]|10|11|12'\n day = '[1-9]|0[1-9]|1[0-9]|2[0-9]|3[0-1]'\n hour = '[0-1][0-9]|2[0-3]|[1-9]'\n minute = '[0-5][0-9]'\n second = '[0-5][0-9]'\n case date\n when /^(#{year})(#{month})(#{day})$/\n identifiedDate = $1 + ':' + $2 + ':' + $3 + ' 00:00:00'\n when /^(#{year})(#{month})(#{day})(#{hour})(#{minute})(#{second})$/\n identifiedDate = $1 + ':' + $2 + ':' + $3 + ' ' + $4 + ':' + $5 + ':' + $6\n when /^(#{year})[\\:|\\.|\\-](#{month})[\\:|\\.|\\-](#{day})\\s(#{hour})[\\:](#{minute})[\\:](#{second})$/\n identifiedDate = $1 + ':' + $2 + ':' + $3 + ' ' + $4 + ':' + $5 + ':' + $6\n when /^(#{year})[\\:|\\.|\\-](#{month})[\\:|\\.|\\-](#{day})$/\n day = \"%02d\" % $3\n month = \"%02d\" % $2\n\n # Return the identified string\n $1 + ':' + month + ':' + day + ' 00:00:00'\n\n else\n\n # This wasn't a date we recognize\n false\n\n end\n end", "def check_result_has_date(li_arr)\n puts \"#{@@info_indicate} start checking post date\"\n li_arr.each do |li|\n assert_not_nil(get_post_time(li),\"#{@@warning_indicate}Could not found time tag//n\")\n end\n end", "def dates_are_correct\n errors.add(:begins, _(\"%{fn} can't be blank\")) if begins.nil?\n errors.add(:finishes, _(\"%{fn} can't be blank\")) if finishes.nil?\n\n dates_in_order?(begins, finishes) or\n errors.add(:begins, _('Conference must end after its start date'))\n\n dates_in_order?(cfp_open_date, cfp_close_date) or\n errors.add(:cfp_open_date, _('Call for papers must end after its ' +\n 'start date'))\n dates_in_order?(cfp_close_date, begins) or\n errors.add(:cfp_close_date, _('Call for papers must finish before ' +\n 'the conference begins'))\n\n dates_in_order?(reg_open_date, reg_close_date) or\n errors.add(:reg_open_date, _('Registration must end after its ' +\n 'start date'))\n dates_in_order?(reg_close_date, finishes) or\n errors.add(:reg_close_date, _('Registration must finish before the ' +\n 'conference ends'))\n end", "def is_valid_flight_date(value)\n # init\n return_value = { correct: false, reason: [] }\n\n # rule 1 - check if date is valid ISO8601 format (using standard library Date)\n begin\n # convert an ISO8601 date into UTC\n parsed_date = Date.iso8601(value)\n rescue ArgumentError => exc\n return_value = { correct: false, reason: exc.to_s }\n else\n return_value = { correct: true, reason: [] }\n # ensure\n end\n\n # rule 2 - check if date is not out of range...\n\n # validation results are returned as a simple hash like: {correct: false, reason: exc.to_s}\n return_value\n end", "def test_get_date\n assert_equal(0,@day_count.get_date())\n end", "def test_response_valid_in_this_phase\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n #resubmission_time3 after the response time\n #but it is after the current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def test_should_retun_every_set_of_days_of_month\n assertion = Month.august(2006).every!(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Hash)\n # monday assertions\n assert_equal assertion[:monday].size, 4\n assert_equal assertion[:monday], [Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n # wednesday assertions\n assert_equal assertion[:wednesday].size, 5\n assert_equal assertion[:wednesday],\n [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30)]\n end", "def validate_date(input_date) \n too_early = Date.parse(\"31 December 2019\")\n too_late = (Date.today)+1\n raise DateError unless ((input_date > too_early) && (input_date < too_late))\n end", "def test_nanak_550_is_not_leap_year\n assert Nanakshahi.new(550, 10, 12).leap? == false\n end", "def check_now_date(dt, field_name = \"date\", now = DateTime.now)\n now = now.utc\n assert fuzzy_compare_datetime(dt, now, 1), # 1 for testing, not real-world.\n field_name + \" and now are not equal: \" + normalize_date(dt) + \", \" + normalize_date(now)\n end", "def test_ID_25840_edit_profile_resident_since\n login_as_user1\n go_to_edit_profile_page\n verify_day_can_only_be_selected_from_1_to_31 \"test_ID_25835_edit_profile_desc\", 1, 31\n verify_month_can_only_be_selected_from_Jan_to_Dec \"test_ID_25835_edit_profile_desc\", 1, 12\n time = Time.new\n verify_year_can_only_be_selected_from_1900_to_current_year \"test_ID_25835_edit_profile_desc\", \"1900\", \"#{time.year}\"\n verify_user_can_save_date \"March\",\"18\",\"1981\"\n verify_user_can_return_date_to_the_default \"Month\",\"Day\",\"Year\"\n verify_user_is_not_able_to_specify_only_the_month_drop_down \"March\",\"Day\",\"Year\"\n verify_user_is_not_able_to_specify_only_the_day_drop_down \"Month\",\"12\",\"Year\"\n #verify_user_is_not_able_to_specify_only_the_year_drop_down \"Month\",\"Day\",\"1970\" Bug\n end", "def test_check_good_time\n assert_output '' do\n time = '1553188611.560418000'\n prev_time = '1553188612.100418000'\n line_num = 0\n @verify.check_time(time, prev_time, line_num)\n end\n end", "def test_validation_expiration_dates\n an_account = OrderAccount.new\n #an_account.cc_number = '1234567890'\n \n # An order account must have valid expiration month and year.\n assert !an_account.valid?\n assert an_account.errors.invalid?(:expiration_month), \"Should have an error in expiration_month\"\n assert an_account.errors.invalid?(:expiration_year), \"Should have an error in expiration_year\"\n \n assert_same_elements [\"is not a number\", \"Please enter a valid expiration date.\"], an_account.errors.on(:expiration_month)\n assert_equal \"is not a number\", an_account.errors.on(:expiration_year)\n\n an_account.expiration_month = 1.month.ago.month\n an_account.expiration_year = 1.year.ago.year\n \n an_account.errors.clear\n assert !an_account.valid?\n \n assert an_account.errors.invalid?(:expiration_month), \"Should have an error in expiration_month\"\n assert_equal \"Please enter a valid expiration date.\", an_account.errors.on(:expiration_month)\n end", "def check_date_consistency(date_from_timepicker)\n\t\tparams_ok = true\n\t\tbegin\n\t\t\tdate_from_timepicker.to_datetime\n\t\trescue ArgumentError\n\t\t\tparams_ok = false\n\t\tend\n\n\t\tif date_from_timepicker == \"\"\n\t\t\tparams_ok = false\n\t\tend\n\t\tparams_ok\n\tend", "def registration_passed?\n d = @data_object\n today = Date.today\n d.aff_reg_end.to_date < today\n end", "def is_date_valid?\n\t\tunless self.date_of_booking >= Time.zone.now.beginning_of_day \n\t\t\tself.errors[:date_validation] << \"=> You can't book resource for previous day\"\n\t\tend\n\tend", "def same_date\n return unless start_at? && end_at?\n return unless start_at.to_date != end_at.to_date\n\n errors.add(:start_at, :same_date)\n errors.add(:end_at, :same_date)\n end", "def include? date\n @resolution = nil\t\n return true if check_anchor? && date == @anchor \n return mismatch(:day) unless day_of_week_matches?(date)\n return mismatch(:year) unless year_matches?(date) if @unit == :years\n return mismatch(:month) unless month_matches?(date) if [:months, :years].include?(@unit)\n return mismatch(:week) unless week_matches?(date) if [:years, :months, :weeks].include?(@unit)\n if [:years, :months, :weeks, :days].include?(@unit)\n return mismatch(:day) unless day_matches?(date)\n\t return mismatch(:time) unless time_matches?(date)\n end\n if @unit == :hours\n\t return mismatch(:hour) unless hour_matches?(date)\n\t return mismatch(:sub_hour) unless sub_hour_matches?(date)\n end\n if @unit == :minutes\n\t return mismatch(:minute) unless minute_matches?(date)\n\t return mismatch(:second) unless second_matches?(date)\n end\n @resolution = nil\t\n true\n end", "def dates_equal?(date1, date2)\n return true if date1.blank? || date2.blank?\n return true unless date_parsable?(date1) && date_parsable?(date2)\n\n Date.parse(date1) == Date.parse(date2)\n end", "def is_valid(year, month, date)\n @yearnew = year.to_i\n @month = month.to_i\n @date = date.to_i\n if @month > 0 && @month < 13 && @date <= 31\n if @month == 2\n if @yearnew % 400 == 0 && @date <= 29\n return true\n elsif @yearnew % 4 == 0 && @yearnew % 100 != 0 && @date <= 29\n return true\n elsif @date <= 28\n return true\n else\n err_code\n end\n elsif @month == 4 || @month == 6 ||\t@month == 9 || @month == 11 && @date > 30\n err_code\n end\n else\n err_code\n end\n end", "def check_new_date(date, field_name)\n dt = parse_datetime_string(date)\n if dt == nil\n return false\n end\n check_now_date(dt, field_name)\n end", "def test_non_leap_year_1_march_falls_on_18_phagun\n assert Nanakshahi.from_gregorian(2001, 3, 1) == Nanakshahi.new(532, 12, 18)\n end", "def test_day_of_scheduled_reminders\n @reminder.scheduled_reminders.each{|x| assert_equal x.run_at.mday, @reminder.fq_day }\n end", "def check_valid_date(date)\n status = false\n if date.count('/') == 2\n removed_slash_day = date.tr('/', '')\n unless removed_slash_day =~ /\\D/\n if (8..10).include? date.length\n month_31days = [1, 3, 5, 7, 8, 10, 12]\n month_30days = [4, 6, 9, 11]\n first_slash_index = date.index('/')\n second_slash_index = date.rindex('/')\n\n dd_length = first_slash_index\n mm_length = second_slash_index - first_slash_index - 1\n yyyy_length = date.length - second_slash_index - 1\n\n dd = date.slice(0, dd_length).to_i\n mm = date.slice(first_slash_index + 1, mm_length).to_i\n yyyy = date.slice(second_slash_index + 1, yyyy_length).to_i\n\n if yyyy.to_s.length == 4\n if month_31days.include? mm\n status = true if dd >= 1 && dd <= 31\n elsif month_30days.include? mm\n status = true if dd >= 1 && dd <= 30\n elsif mm == 2\n if yyyy % 4 == 0\n status = true if dd >= 1 && dd <= 29\n else\n status = true if dd >= 1 && dd <= 28\n end\n end\n end\n end\n end\n end\n status\n end", "def check_date(dt)\n\t# Delimit the string using the slash character: \"/\"\n\tdelimited_date = dt.split('/')\n=begin\n\tPrecondition\n\tIf the delimited date does not have three arguments for month, day,\n\tand year, indicate that the date is invalid\n=end\n\tif 3 > delimited_date.length\n\t\traise \"Invalid date has less than 3 fields.\"\n\tend\n\t\n\t# Check if month is less than 1, or greater than 12\n\tif (1 > delimited_date[0].to_i) or ($num_mths < delimited_date[0].to_i)\n\t\traise \"Values for month in the date must lie between 1 and 12, inclusive.\"\n\tend\n\t\n\t# Check if day is less than 1, or greater than 31\n\tif (1 > delimited_date[1].to_i) or ($num_days_31mth < delimited_date[1].to_i)\n\t\traise \"Values for day in the date must lie between 1 and 31, inclusive.\"\n\tend\n\t\n\t# If the month is Feb, check if day > 29\n\tif ($index_of_feb == delimited_date[0].to_i) and ($num_mths < delimited_date[1].to_i)\n\t\traise \"Day in the date must be < 30 for February.\"\n\tend\n\t\n\t# If the month is Feb and it is not a leap year, check if day > 29\n\tif ($index_of_feb == delimited_date[0].to_i) and (0 != (delimited_date[2].to_i).modulo($leap_num_yr)) and ($num_days_28feb < delimited_date[1].to_i)\n\t\tputs \"delimited_date[0].to_i).modulo(4)::\"+delimited_date[0].to_i.modulo($leap_num_yr).to_s\n\t\traise \"Day in the date must be < 29 for February when it is not a leap year.\"\n\tend\n\t\n\t# Check if a 30-day month has been indicated with >30 days\n\tif ($mth30.include?(delimited_date[0].to_i)) and ($num_days_30mth < delimited_date[1].to_i)\n\t\traise \"Selected month \"+delimited_date[0]+\" should not have >30 days.\"\n\tend\n\t\n\t# Check if year < 2009\n\tif 2009 > delimited_date[2].to_i\n\t\traise \"Values for year must be after 2008.\"\n\tend\n\t\n\t# Extract the current day, month, and year\n\textract_day_mth_yr(dt)\nend", "def test_presence_of_estimated_time\n tat2 = Tat.new(:id => 6, :expected_time => '12/12/06')\n assert_equal(false, tat2.save)\n end", "def expect_all_be_false_expect_these natural_date, exception_dates_string\n exception_dates = exception_dates_string.map { |s| Date.parse(s) }\n\n (Date.new(2016, 1, 1)..Date.new(2016, 12, 31)).to_a.each do |date|\n expect(natural_date =~ date).to eq(exception_dates.include?(date))\n end\n end", "def check_dates\n date_now = DateTime.now.in_time_zone\n start_date = nil\n end_date = nil\n if !@contestproblem.nil? && @contestproblem.at_least(:in_progress)\n start_date = @contestproblem.start_time\n elsif !params[:contestproblem][:start_time].nil?\n start_date = Time.zone.parse(params[:contestproblem][:start_time])\n end\n if !@contestproblem.nil? && @contestproblem.at_least(:in_correction)\n end_date = @contestproblem.end_time\n elsif !params[:contestproblem][:end_time].nil?\n end_date = Time.zone.parse(params[:contestproblem][:end_time])\n end\n @date_problem = false\n \n if (@contestproblem.nil? || @contestproblem.at_most(:in_progress)) && !end_date.nil? && date_now >= end_date\n flash.now[:danger] = \"La deuxième date ne peut pas être dans le passé.\"\n @date_problem = true\n elsif (@contestproblem.nil? || @contestproblem.at_most(:not_started_yet)) && !start_date.nil? && date_now >= start_date\n flash.now[:danger] = \"La première date ne peut pas être dans le passé.\"\n @date_problem = true\n elsif !start_date.nil? && !end_date.nil? && start_date >= end_date\n flash.now[:danger] = \"La deuxième date doit être strictement après la première date.\"\n @date_problem = true\n elsif start_date.min != 0\n flash.now[:danger] = \"La première date doit être à une heure pile#{ '(en production)' if Rails.env.development?}.\"\n @date_problem = true if !Rails.env.development?\n end\n end", "def dates_valid?\n date_check(params[:start_date]) && date_check(params[:end_date]) && dates_sequential?\n end", "def date_match?(date, h)\n h[:months].include?(date.month) and h[:days].include?(date.day) and h[:wdays].include?(date.wday)\n end", "def contains?(date)\n year == date.year && month == date.month\n end", "def test_find_sorted_dates\n assert_nil(MyRegex.find_sorted_dates(RAND_STR),\n \"Test failure for #{RAND_STR}\")\n assert_nil(MyRegex.find_sorted_dates(\"Jnue 25, 1999\"),\n \"Test failure for invalid month\")\n TEST_MONTHS.each do |m|\n [1-50].each do |d|\n test = \"#{m}, #{d}, 1999\"\n begin\n date = Date.strptime(test)\n assert_equal(MyRegex.find_sorted_dates(test), date,\n \"Test failure for #{test}\")\n rescue\n assert_nil(MyRegex.find_sorted_dates(test), \"Test failue for #{test}\")\n end\n end\n end\n end", "def test_should_retun_every_set_of_days_of_month_as_array\n assertion = Month.august(2006).every(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Array)\n # check for data integrity\n assert_equal assertion.size, 9\n assert_equal assertion, [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30),Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n end", "def test_non_member_registering_early_bird\n\t\tnon_member = Enrollments.new(:participantID => participants(:non_member_one).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_nil participants(:non_member_one).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-11-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def exact_date?(options = {})\n from_date(options) == to_date(options)\n end", "def valid_dates\n device_request = DeviceRequest.find(device_request_id)\n current_date = Date.today\n if self.on_date.present?\n self.errors.add :on_date, \"Quotation date can't be future\" if self.on_date > current_date\n self.errors.add :on_date, \"Quotation date should be onwards #{device_request.on_date}\" if self.on_date < device_request.on_date\n end\n end", "def test_response_latest\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n #All resubmission times are before the response time\n #also the response is in current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def check_dates\n dates_already_booked = [date_in, date_out]\n body.bookings.each do |b|\n dates_already_booked << b.date_in\n dates_already_booked << b.date_out\n end\n dates_already_booked.sort!\n idx_in = dates_already_booked.index(date_in)\n idx_out = dates_already_booked.index(date_out)\n if idx_in + 1 == idx_out && idx_in % 2 == 0\n true\n else\n throw(:abort)\n end\n end", "def vulnerable?(dates=@@OPEN_DATES)\n cves(dates).any?\n end", "def is_valid?\n is_valid_datetime?\n end", "def test_member_registering_early_bird\n\t\tmember = Enrollments.new(:participantID => participants(:six).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_operator Date.today, :<=, participants(:six).expirydate, \"Member is not a member\"\n\t\tassert_not_nil participants(:six).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-11-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def test_invalid_when_updating_wanted_on_in_past_with_past_wanted_on\n @item = items(:overdue_unfinished_item)\n @item.wanted_on = 3.days.ago.to_date\n assert !@item.valid?\n assert @item.errors.on(:wanted_on)\n end", "def is_target_date?(date) \n d = date.to_date\n check = false\n if d >= @dStart && d <= @dEnd\n check = true\n end\n return check\n end", "def valid_iyr?(data)\n return false unless data\n\n 2010 <= data.to_i && data.to_i <= 2020\nend", "def validate_published_on\n date_parts = [year, month, day].reject(&:blank?)\n published_on = Date.new(*date_parts)\n if published_on > Time.zone.now.to_date\n errors.add :published_on, \"is a date in the future\"\n elsif published_on < Date.new(1650)\n errors.add :published_on, \"is before 1650\"\n else\n write_attribute(:published_on, published_on)\n end\n rescue ArgumentError\n errors.add :published_on, \"is not a valid date\"\n end", "def test_date date\n res = true\n res = res && @min_date_filter <= date if @min_date_filter\n res = res && @max_date_filter >= date if @max_date_filter\n res\n end", "def test_ID_25840_edit_profile_resident_since_02\n login_as_user1\n go_to_edit_profile_page\n verify_month_can_only_be_selected_from_Jan_to_Dec \"test_ID_25835_edit_profile_desc\", 1, 12\n end", "def test_initialize_date()\n date = @ad_manager.date(2017, 11, 7)\n assert_equal(2017, date.year)\n assert_equal(11, date.month)\n assert_equal(7, date.day)\n end", "def test_send_date()\n # Parameters for the API call\n date = Date.parse('1994-02-13')\n\n # Perform the API call through the SDK function\n result = @controller.send_date(date)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def test_send_date()\n # Parameters for the API call\n date = Date.parse('1994-02-13')\n\n # Perform the API call through the SDK function\n result = @controller.send_date(date)\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n\n # Test whether the captured response is as we expected\n refute_nil(result)\n expected_body = JSON.parse(\n '{\"passed\":true}'\n )\n received_body = JSON.parse(@response_catcher.response.raw_body)\n assert(TestHelper.match_body(expected_body, received_body, check_values: true))\n end", "def test_month_before_is_28_days_direct\n assert_equal(\"Changes between 2015-03-17 and 2015-04-15:\" ,\n header(\"2015-03-17\", \"2015-04-15\"))\n end", "def warn_invalid_date; end" ]
[ "0.80194193", "0.7471824", "0.743819", "0.7415723", "0.7403816", "0.73284316", "0.73203146", "0.7101655", "0.6920093", "0.67597854", "0.67322046", "0.6729371", "0.66519946", "0.6644999", "0.6637887", "0.6637822", "0.6621194", "0.6607913", "0.65953946", "0.65491605", "0.65354353", "0.65337104", "0.64929223", "0.64929223", "0.6474006", "0.64670604", "0.6446344", "0.64284915", "0.64175665", "0.6416054", "0.641563", "0.6410056", "0.6405876", "0.63888234", "0.63538015", "0.6350116", "0.6331312", "0.6325777", "0.6316003", "0.63053036", "0.62910664", "0.6274069", "0.6263415", "0.6252404", "0.6244144", "0.6238927", "0.62353504", "0.6234023", "0.621512", "0.6211192", "0.6209501", "0.6207913", "0.619934", "0.61878645", "0.6185586", "0.6184379", "0.6175073", "0.6166245", "0.614047", "0.6132475", "0.6124572", "0.61184067", "0.61159927", "0.611239", "0.6107037", "0.60985106", "0.6082599", "0.60825557", "0.6074897", "0.6068599", "0.6065623", "0.6053928", "0.60469925", "0.6044208", "0.6036425", "0.6034318", "0.60222346", "0.60218394", "0.6018776", "0.59830785", "0.59817153", "0.5972158", "0.5970705", "0.59692127", "0.59667844", "0.59665245", "0.59508663", "0.59472245", "0.59427655", "0.5932272", "0.5923287", "0.59118277", "0.5902456", "0.58994716", "0.5898011", "0.5897867", "0.5897114", "0.5897114", "0.5892864", "0.5892691" ]
0.8073814
0
DATE COMPLETED Enters date completed per a given set of test data
def enter_date_completed(test_data) hide_notifications_bar logger.info "Entering date completed '#{test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name]}'" wait_for_element_and_type(date_completed_input, test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name]) hit_enter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_date_completed(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def enter_date_completed(test_data)\n hide_notifications_bar\n wait_for_element_and_type(date_completed_input, test_data[UseOfCollections::DATE_COMPLETED.name])\n hit_enter\n end", "def screener_complete_date_for_unended_project\n\t\toe = self.operational_events.screener_complete.unended_project.limit(1).first\n\t\t#\tseparated to try to make 100% coverage (20120411)\n\t\toe.try(:occurred_on)\n\tend", "def assign_date_coverage\n cov_interval = Dataset::DateCoverageService.params_to_interval params\n params[PARAMS_KEY]['date_coverage'] = cov_interval ? cov_interval.edtf : \"\"\n end", "def test_run_completed(test_run)\n report_results test_run\n end", "def report_date\n order.completed_at.to_date\n end", "def completed_date\n nil\n end", "def update_end_date(ds)\n actual_duration = (self.end_date - self.start_date).to_i\n days_worked = self.advance_percentage / 100.0 * (actual_duration) \n if delay_end(end_date + ds.days)\n self.update(advance_percentage: (days_worked / (actual_duration + ds) * 100).to_i)\n dependent_tasks_id = Precedent.where(predecessor_id: id).pluck(:dependent_id)\n dependent_tasks_id.each do |t_id|\n Task.find(t_id).update_start_date(end_date)\n end\n # else \n # if advance(end_date + ds.days)\n # dependent_tasks_id = Precedent.select(:dependent_id).where(predecessor_id: id)\n # dependent_tasks_id.each do |t_id|\n # t = Task.find(t_id)\n # end\n # end\n end\n end", "def done_for(date:) # TODO: Test needed\n latest_progress.split('')[date.day - 1]\n end", "def test_date\n if test_execution_date and test_delivery_date\n if test_execution_date > test_delivery_date\n errors.add(:test_delivery_date, \"should be greater then test date.\")\n end\n end\n end", "def setup_transaction_dates_step\n @lbtt_return.effective_date = @lbtt_return.effective_date&.to_date\n @lbtt_return.relevant_date = @lbtt_return.relevant_date&.to_date\n @lbtt_return.contract_date = @lbtt_return.contract_date&.to_date\n convert_lease_transaction_date\n end", "def enter_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n logger.info \"Entering use date data set at index #{index}: #{date}\"\n wait_for_element_and_type(use_date_input(index), date[CoreUseOfCollectionsData::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def test_is_due\n u = TestHelper.owner_user\n job_hashes = TestHelper.load_fixture(\"is_due\")\n job_hashes.each do |jh|\n job_path = \"#{u.runner.path}/#{jh['name']}\"\n j = Mobilize::Job.find_or_create_by_path(job_path)\n #update job params\n j.update_from_hash(jh)\n #apply the completed_at, failed at, and parent attributes where appropriate\n if jh['completed_at']\n j.stages.last.update_attributes(:completed_at=>eval(jh['completed_at']))\n end\n if jh['failed_at']\n j.stages.last.update_attributes(:failed_at=>eval(jh['failed_at']))\n end\n if jh['parent']\n j.parent.stages.last.update_attributes(:completed_at=>eval(jh['parent']['completed_at'])) if jh['parent']['completed_at']\n j.parent.stages.last.update_attributes(:failed_at=>eval(jh['parent']['failed_at'])) if jh['parent']['failed_at']\n end\n expected = jh['expected']\n #check if is_due\n puts \"checking #{j.name}\"\n assert expected == j.is_due?\n end\n end", "def get_completion(date)\n y = self.completed ? \"Yes\" : \"No\"\n (date && self.completed) ? \"#{y} (#{date})\" : \"#{y}\"\n end", "def assign_parent_completion_date\n if todo_complete.task_completes.map(&:result).exclude?(\"pending\")\n todo_complete.update_column(:completion_date, Time.now)\n UserOccurrence.create(user_id: submitter_id, todo_id: todo_complete.todo_id) if todo_complete.todo.recurring?\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def enter_date_requested(test_data)\n hide_notifications_bar\n logger.info \"Entering date requested '#{test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name]}'\"\n wait_for_element_and_type(date_requested_input, test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name])\n hit_enter\n end", "def enter_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n wait_for_element_and_type(use_date_input(index), date[UseOfCollections::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[UseOfCollections::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[UseOfCollections::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[UseOfCollections::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[UseOfCollections::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def convert_to_est\n self.start_date += 18000\n self.end_date += 18000\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def enter_end_date(test_data)\n hide_notifications_bar\n logger.info \"Entering end date '#{test_data[CoreUseOfCollectionsData::END_DATE.name]}'\"\n wait_for_element_and_type(end_date_input, test_data[CoreUseOfCollectionsData::END_DATE.name])\n hit_enter\n end", "def testSwitchTaskBetweenStartAndEndDates\n executeSimpleTest(\n [ [ 'T1', 'R1', 200, 3, ['T4'], '==='],\n [ 'T2', 'R2', 300, 1, ['T3'], '='],\n [ 'T3', 'R1', 500, 2, [], ' =='],\n [ 'T4', 'R3', 1000, 2, [], ' =='],\n [ 'T5', 'R4', 100, 4, ['T4'], '===='] ] )\n end", "def correct_completion_status_date\n if self.is_complete? && self.completed_at.blank?\n # if task is marked complete without a completion time, update completion time to now & allow confirmation\n self.completed_at = DateTime.now\n return true\n elsif !self.is_complete? && !self.completed_at.blank?\n # if task is marked incomplete, but there is a completion time entered, update completion time to blank & allow confirmation\n self.completed_at = nil\n return true\n else\n return false\n end\n end", "def set_dates(spreadsheet, cal_date_row, cal_date_col, exp_date_row, exp_date_col)\r\n\r\n k = 0\r\n (cal_date_col+1...exp_date_col).each do |j|\r\n if spreadsheet.celltype(cal_date_row, j) == :date\r\n @calibration.caldate = spreadsheet.cell(cal_date_row, j)\r\n k = j + 1\r\n break\r\n end\r\n end\r\n\r\n #look for expiration date\r\n if (k != 0)\r\n\r\n (k..spreadsheet.last_column).each do |j|\r\n if spreadsheet.celltype(cal_date_row, j) == :date\r\n @calibration.expdate = spreadsheet.cell(cal_date_row, j)\r\n break\r\n end\r\n end\r\n end\r\n\r\n end", "def setup_earning_tests\n start_date = Date.today\n i = 0\n Order.find(:all).each do |o|\n o.update_attributes({\n :created_on => start_date - i.months,\n :order_status_code_id => 7,\n :affiliate => @jm\n })\n i += 1\n end\n end", "def record_status_change(status, modified_date, estimated_days)\n if status.is_tested?\n add_estimated_days_on_date @tested, modified_date, estimated_days\n elsif status.is_signed_off?\n add_estimated_days_on_date @signed, modified_date, estimated_days\n elsif status.is_relevant?\n add_estimated_days_on_date @planned, modified_date, estimated_days\n end\n end", "def send_email_after_change_start_date\n\n #Do nothing if start_date not change\n return if(!self.start_date_changed?)\n\n contestants = self.users\n\n #Send email to creator\n UserMailer.start_date_change_creator(self.creator, self).deliver\n\n #Send email to contestants\n contestants.each do |c|\n UserMailer.start_date_change_contestant(c, self).deliver\n end\n\n end", "def on_sale\n all.select {|event| (event.starts..event.ends) === (@date_for_test || Date.today)}\n end", "def change_dates start_date, finish_date\n set_dates start_date, finish_date\n\n set_calendar\n end", "def actual_finish_date_boxes\n @finished = false\n if params[:id] == \"2\"\n @finished = true\n @actual_finish_time = Time.now.strftime(\"%H:%M\")\n @actual_finish_date = Time.now.strftime(\"%d %b %Y\")\n end\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def enter_date_requested(test_data)\n hide_notifications_bar\n wait_for_element_and_type(date_requested_input, test_data[UseOfCollections::DATE_REQUESTED.name])\n hit_enter\n end", "def date\n @completed_date = created_at.strftime(\"%m/%d/%Y\")\n return @completed_date\n end", "def record_estimate_change(status, modified_date, estimate_diff)\n if status.is_relevant?\n add_estimated_days_on_date(@planned, modified_date, estimate_diff)\n if status.is_signed_off?\n add_estimated_days_on_date(@signed, modified_date, estimate_diff)\n if status.is_tested?\n add_estimated_days_on_date(@tested, modified_date, estimate_diff)\n end\n end\n end\n end", "def ordered_executions\n return self.test_executions.sort! {|e1, e2| e2.execution_date <=> e1.execution_date}\n end", "def enter_end_date(test_data)\n hide_notifications_bar\n wait_for_element_and_type(end_date_input, test_data[UseOfCollections::END_DATE.name])\n hit_enter\n end", "def check_and_complete_if_done(date, notify = false)\n @user_actions = self.user_actions || []\n \n # For whole budge\n @num_actions = self.number_actions_possible\n @num_actions_victorious = self.number_actions_victorious\n\n # They're done with this budge\n if @num_actions == @num_actions_victorious or self.time_up? or self.completed?\n\n # Update last completed date\n self.update_attributes(:last_completed_date => date)\n \n self.end_player_budge(date, notify)\n self.start_recommended_budge(date, notify) \n \n # Update the number of invitations they have. Notify them if they got any new ones.\n self.program_player.calculate_num_invites\n \n # If they aren't yet finished with their actions for this budge\n else\n \n # For this day\n @num_actions_on_day = self.number_actions_possible_on_day\n @num_actions_victorious_on_day = self.number_actions_victorious_on_day\n\n if @num_actions_on_day == @num_actions_victorious_on_day\n\n # Update last completed date\n self.update_attributes(:last_completed_date => date)\n \n # Move them to the next day\n if self.day_of_budge < self.program_budge.duration_in_days\n self.move_to_day(self.day_of_budge+1, date+1)\n \n # Move them to the next budge\n elsif self.day_of_budge >= self.program_budge.duration_in_days\n self.end_player_budge(date, notify)\n self.start_recommended_budge(date, notify) \n end\n\n # They still have some actions to complete\n else\n self.program_player.update_needs_to_play_at(self)\n end\n end \n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def completed_date_time=(value)\n @completed_date_time = value\n end", "def completed_date_time=(value)\n @completed_date_time = value\n end", "def completed_date_time=(value)\n @completed_date_time = value\n end", "def completed_date_time=(value)\n @completed_date_time = value\n end", "def completed_date_time=(value)\n @completed_date_time = value\n end", "def completed_date_time=(value)\n @completed_date_time = value\n end", "def committee_date\n @problem.make(Timetable::CommitteeDate.asp(:weekday_id => \"WD\", :timeframe_id => \"TF\")) {\n conjunct{[\n Timeframe.asp(:global_id => \"TF\"),\n Weekday.asp(:global_id => \"WD\"),\n no {Timetable::Entry.asp( :timeframe_id => \"TF\", :weekday_id => \"WD\")},\n no {Teacher::Unavailability.asp(:timeframe_id => \"TF\", :weekday_id => \"WD\")}\n ]}\n }\n @problem.never { no { Timetable::CommitteeDate.asp() }}\n end", "def dates_requiring_data\n collected = Dir.glob(File.join(@config[:data_dir], \"*-*-*.{csv,espi}\")).map { |f| File.basename(f).split(\".\")[0] }\n all_days = []\n\n count_of_days = (Date.today - @config[:start_date]).to_i\n\n count_of_days.times do |i|\n all_days << (@config[:start_date] + i).strftime(\"%Y-%m-%d\")\n end\n\n (all_days - collected).map { |d| Date.parse(d) }\n end", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def invoice_date\n completed_at\n end", "def set_project_end_date\n if state_was == STATE['Completed']\n end_date = nil\n active = true\n else\n active = false\n end_date = Date.current\n end\n end", "def estimated_days_progress_today\n\t\tdays_progresses.at(Date.today).first.try(:expected) || dp_days_progress_today[1]\n\tend", "def calculate_dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n end", "def finish_date_values\n # if a marketing campaign doesn't have a finish date\n # finish date text boxes contain 'now' by default\n @marketing_campaign.finished_at = date_time_to_db_format(params[:mark_campaign_finish_date][:finish_date],\n params[:mark_campaign_finish_time][:finish_time]\n ) unless params[:mark_campaign_finish_date].blank?\n if @marketing_campaign.finished_at == nil\n datetime = separate_date_time(Time.now)\n else\n datetime = separate_date_time(@marketing_campaign.finished_at)\n end\n @finish_time = datetime[\"time\"]\n @finish_date = datetime[\"date\"]\n end", "def done_at\n date_at :done\n end", "def enrollment_dates\n if start_date\n \"#{start_date_formatted} - #{end_date_formatted}\"\n end\n end", "def finish_date\n if self.program_budge.nil?\n return nil\n elsif self.start_date.nil?\n return nil\n end\n duration=self.program_budge.duration_in_days\n default=self.start_date+duration.day\n \n if self.completed?\n #if already finished with level - return date they finished\n return self.last_completed_date.nil? ? default : self.last_completed_date\n else\n return default\n end\n end", "def set_uc_and_kids_date_completed(action_params, new_date_completed = Time.zone.now)\n\n raise MissingUserChecklistParameterError, t('.missing-checklist-param-error') if action_params[:id].blank?\n\n user_checklist_id = action_params[:id]\n user_checklist = UserChecklist.find(user_checklist_id)\n\n if user_checklist\n if new_date_completed\n user_checklist.set_complete_including_children(new_date_completed)\n else\n user_checklist.set_uncomplete_including_children\n end\n new_percent_complete = user_checklist.root.percent_complete\n check_membership_status_if_complete(user_checklist.root, new_percent_complete)\n\n date_str = user_checklist.date_completed.blank? ? '' : user_checklist.date_completed.to_time.to_date\n\n { user_checklist_id: user_checklist_id,\n date_completed: date_str,\n overall_percent_complete: new_percent_complete }\n\n else\n raise UserChecklistNotFoundError, t('.not_found', id: user_checklist_id)\n end\n\n end", "def test_day_of_scheduled_reminders\n @reminder.scheduled_reminders.each{|x| assert_equal x.run_at.mday, @reminder.fq_day }\n end", "def completed_date_cannot_be_less_than_start\n self.errors.add(:completed_at,\"can\\'t be lesser than start date\") if self.start_date && self.completed_at && self.completed && self.completed_at.to_date < self.start_date.to_date\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def task_set_issue_date\n errata.issue_date = Time.now\n errata.save!\n info \"Updated Issue date\"\n end", "def initial_exam_end_date(contact)\n initial_campaign_exam = CampaignExam.where(\"campaign_id = ? AND stage = ?\", self.id, EXAM_STAGE_INITIAL).first\n \n initial_exam_present = false\n initial_exam_ended_date = false\n \n if initial_campaign_exam.present? \n initial_exam_present = true\n \n initial_user_exam = UserExam.where(\"user_id = ? AND exam_id = ?\",contact.id, initial_campaign_exam.exam_id).first\n initial_exam_ended_date = (initial_exam_present) ? initial_user_exam.date_end : false\n end\n \n return initial_exam_present, initial_exam_ended_date \n end", "def set_workflow_completion_datetime(l1_object, l2s_objects, l3s_objects)\n\n\t \t# workflow complete block\n\t \tis_l1_completed = true\n\t \tis_l2_completed = true\n\n\t \tif l2s_objects.present?\n\t \t\tl2s_objects.each do |l2_object|\n\t \t\t\tif l2_object.status.downcase! != 'cancel'\n\t\t \t\t\tmax_l2_eta = WorkflowLiveStep.where(object_id: l2_object.id, object_type: 'L2').maximum(:eta)\t \n\t\t \t\t\tl2_object.completed_estimate = max_l2_eta\n\n\t\t \t\t\tis_l3_completed = true\n\t\t \t\t\tif l3s_objects[l2_object.id].present?\n\t\t \t\t\t\tl3s_objects[l2_object.id].each do |l3_object|\n\t\t \t\t\t\t\tif !l3_object.is_closed and l3_object.status.downcase! != 'cancel'\n\t\t\t\t\t \t\t\tmax_l3_eta = WorkflowLiveStep.where(object_id: l3_object.id, object_type: 'L3').maximum(:eta)\n\t\t\t\t\t \t\t\tl3_object.completed_estimate = max_l3_eta\n\n\t\t\t\t\t\t\t\t\tis_any_step_without_actual = WorkflowLiveStep.joins(:station_step).where(\"workflow_live_steps.is_active= #{true} and workflow_live_steps.object_id= #{l3_object.id} and workflow_live_steps.object_type = 'L3' and workflow_live_steps.actual_confirmation IS NULL and station_steps.is_visible = #{true}\")\n\t\t\t\t\t\t\t\t\tif is_any_step_without_actual.present?\n\t\t\t\t\t\t\t \t\tis_l3_completed = false\n\t\t\t\t\t\t\t\t \tl3_object.completed_actual = nil\n\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t \t\tl3_max_actual_date = WorkflowLiveStep.where(object_id: l3_object.id, object_type: 'L3').maximum(:actual_confirmation)\n\t\t\t\t\t\t\t\t \tl3_object.completed_actual = l3_max_actual_date\n\t\t\t\t\t\t\t \tend\n\t\t\t\t\t\t\t \tl3_object.save!\n\t\t\t\t\t\t \tend\n\t\t \t\t\t\tend\n\t\t \t\t\tend\n\n\t\t \t\t\t# set actual complete date of L2 and update estimate complete if needed\n\t\t \t\t\tif is_l3_completed\n\t\t \t\t\t\tis_any_step_without_actual = WorkflowLiveStep.joins(:station_step).where(\"workflow_live_steps.is_active= #{true} and workflow_live_steps.object_id= #{l2_object.id} and workflow_live_steps.object_type = 'L2' and workflow_live_steps.actual_confirmation IS NULL and station_steps.is_visible = #{true}\")\n\t\t\t\t\t\t if is_any_step_without_actual.present?\n\t\t\t\t\t\t \tis_l2_completed = false\n\t\t\t\t\t\t \tl2_object.completed_actual = nil\n\t\t\t\t\t\t else\n\t\t\t\t\t \t\tl2_max_actual_date = WorkflowLiveStep.where(object_id: l2_object.id, object_type: 'L2').maximum(:actual_confirmation)\n\t\t\t\t\t\t \tl2_object.completed_actual = l2_max_actual_date\n\t \t\t\t\t \tmaximum_l3s_completed_actual_date = L3.where(l2_id: l2_object.id).maximum(:completed_actual)\n\t \t\t\t\t \tif maximum_l3s_completed_actual_date.presence and l2_max_actual_date.presence\n\t\t\t\t\t\t \t\tif DateTime.parse(maximum_l3s_completed_actual_date.to_s) > DateTime.parse(l2_max_actual_date.to_s)\n\t\t\t\t\t\t \t\t\tl2_object.completed_actual = maximum_l3s_completed_actual_date\n\t\t\t\t\t\t \t\tend\t\n\t\t\t\t\t \t\tend\n\t\t\t\t\t \tend\n\t\t \t\t\telse\n\t\t\t\t\t \tis_l2_completed = false\n\t\t\t\t\t \tmaximum_l3s_completed_estimate_date = L3.where(l2_id: l2_object.id).maximum(:completed_estimate)\n\t\t\t\t\t \tif maximum_l3s_completed_estimate_date.presence and max_l2_eta.presence\n\t\t\t\t\t \t\tif DateTime.parse(maximum_l3s_completed_estimate_date.to_s) > DateTime.parse(max_l2_eta.to_s)\n\t\t\t\t\t \t\t\tl2_object.completed_estimate = maximum_l3s_completed_estimate_date\n\t\t\t\t\t \t\tend\n\t\t\t\t \t\tend\n\t\t\t \t\t\tl2_object.completed_actual = nil\n\t\t \t\t\tend\n\t\t\t\t \tl2_object.save!\n\t\t\t\t end \t\n\t \t\tend\n\t \tend\n\n\t \tif l1_object.present?\n\t \t\tmax_l1_eta = WorkflowLiveStep.where(object_id: l1_object.id, object_type: 'L1').maximum(:eta)\n \t\t\tl1_object.completed_estimate = max_l1_eta\n\n \t\t\tmaximum_l2_completed_estimate_date = L2.where(l1_id: l1_object.id).maximum(:completed_estimate)\n\t\t\t\tif maximum_l2_completed_estimate_date.presence and max_l1_eta.presence\n\t\t\t \tif DateTime.parse(maximum_l2_completed_estimate_date.to_s) > DateTime.parse(l1_eta_date.to_s)\n\t\t\t \t\tl1_object.completed_estimate = maximum_l2_completed_estimate_date\n\t\t\t \tend\t\n\t\t \telse\n\t\t\t\t l1_object.completed_estimate = maximum_l2_completed_estimate_date\t\n\t\t\t\tend\n\n\t\t \tif is_l2_completed\n\t\t\t\t\tis_any_step_without_actual = WorkflowLiveStep.joins(:station_step).where(\"workflow_live_steps.is_active= #{true} and workflow_live_steps.object_id= #{l1_object.id} and workflow_live_steps.object_type = 'L1' and workflow_live_steps.actual_confirmation IS NULL and station_steps.is_visible = #{true}\")\n\t\t\t\t if is_any_step_without_actual.present?\n\t\t\t\t \tl1_object.completed_actual = nil\n\t\t\t\t else\n\t\t\t\t \tl1_max_actual_date = WorkflowLiveStep.where(object_id: l1_object.id, object_type: 'L1').maximum(:actual_confirmation)\n\t\t\t\t \tl1_object.completed_actual = l1_max_actual_date\n \t\t\t\t\t\n \t\t\t\t\tmaximum_l2_completed_actual_date = L2.where(l1_id: l1_object.id).maximum(:completed_actual)\n\t\t\t\t \tif maximum_l2_completed_actual_date.presence and l1_max_actual_date.presence\n\t \t\t\t \tif DateTime.parse(maximum_l2_completed_actual_date.to_s) > DateTime.parse(l1_max_actual_date.to_s)\n\t\t\t\t\t \t\tl1_object.completed_actual = maximum_l2_completed_actual_date\n\t\t\t\t\t \tend\n\t\t\t\t\t else\n\t\t\t\t\t l1_object.completed_actual = maximum_l2_completed_actual_date\t\n\t\t\t\t \tend\n\t\t\t \tend\n\t\t \telse\n\t\t \t\tl1_object.completed_actual = nil\n\t\t \tend\n\t\t \tl1_object.save! \t\n\t \tend\n\t end", "def contest_complete\n contest = pet_contests.where(workflow_state: 'in_arena').last\n apply_experience!(contest)\n end", "def estimated_end_date\n start_date + 12.days\n end", "def f_start_date\n\t\tself.expected_start_date.strftime(\"%d / %m / %Y\")\n\tend", "def set_formatted_dates\n @vendortransaction.update_attribute(:duedate, formatted_date(vendortransaction_params[:duedate])) if vendortransaction_params[:duedate].present?\n @vendortransaction.update_attribute(:transaction_date, formatted_date(vendortransaction_params[:transaction_date])) if vendortransaction_params[:transaction_date].present?\n end", "def verification_exam_end_date(contact)\n verification_campaign_exam = CampaignExam.where(\"campaign_id = ? AND stage = ?\", self.id, EXAM_STAGE_VERIFICATION).first\n \n verification_exam_present = false\n verification_exam_ended_date = false\n \n if verification_campaign_exam.present? \n verification_exam_present = true\n \n verification_user_exam = UserExam.where(\"user_id = ? AND exam_id = ?\",contact.id, verification_campaign_exam.exam_id).first\n \n verification_exam_ended_date = (verification_exam_present) ? verificationuser_exam.date_end : false if verification_user_exam.present?\n end\n \n return verification_exam_present, verification_exam_ended_date\n end", "def event_start_end_dates\n esdate and eedate\n end", "def daily_commits_finished\n respond_with Commit.daily_commits_finished\n end", "def update_start_date(expected_start_day)\n\t\t\tself.start_date = expected_start_day\n\tend", "def completed_date\n dropped? ? updated_date : ( @completed_date || parent.completed_date )\n end", "def completed_date_time\n return @completed_date_time\n end", "def completed_date_time\n return @completed_date_time\n end", "def completed_date_time\n return @completed_date_time\n end", "def completed_date_time\n return @completed_date_time\n end", "def completed_date_time\n return @completed_date_time\n end", "def completed_date_time\n return @completed_date_time\n end", "def set_formatted_dates\n @clienttransaction.update_attribute(:duedate, formatted_date(clienttransaction_params[:duedate])) if clienttransaction_params[:duedate].present?\n @clienttransaction.update_attribute(:transaction_date, formatted_date(clienttransaction_params[:transaction_date])) if clienttransaction_params[:transaction_date].present?\n end", "def show_not_completed_by_date_first\n @not_done_date = not_complete_by_date\n @not_done = show_not_completed_items\n return @not_done_date + @not_done\n end", "def ical_export(tasks, datefield)\n return unless datefield.in?(['due'])\n cal = Icalendar::Calendar.new\n tasks.each do |t|\n timestamp = t.due if datefield == 'due'\n e = Icalendar::Event.new\n e.summary = t.description\n e.dtstart = timestamp\n cal.add_event(e)\n end\n cal.to_ical\n end", "def upcomming_courses(date)\n raise \"Esta es una excepción\" if date >= Date.parse('2019-01-01')\n @start_date > date ? \"El curso #{@name} empieza próximamente.\" : \"El curso #{@name} ya empezó.\"\n end", "def dates\n end", "def mark_complete\n self.recorded_on ||= Date.today\n self.update_column(:cleared_on, Date.today)\n if self.lender\n self.lender.calculate_days_to_complete!\n end\n\t\tunless self.job.open_products.where.not(id: self.id).count > 0\n\t\t\tself.job.mark_complete! if self.job.can_mark_complete?\n\t\tend\n\tend", "def finished_date_boxes\n @finished = false\n if params[:id] == \"f\"\n @finished = true\n @finish_time = Time.now.strftime(\"%H:%M\")\n @finish_date = Time.now.strftime(\"%d %b %Y\")\n end\n end", "def calculated_dates\n [period1_from_date,period1_end_date,\n period2_from_date, period2_end_date] \n end", "def loadDcTest\n $dc = dcs(:two)\n $shirt_deadline = ($dc.start_time - 17.days).end_of_day\n $registration_deadline = ($dc.start_time - 4.days).end_of_day\n $registration_starts = true\n $report_deadline = ($dc.start_time + 1.month).end_of_day\n end", "def complete\n @task = Task.find_by(id: params[:id].to_i)\n @task.completion_date = @task.updated_at.to_date.to_s\n @task.save\n redirect_to root_path\n # @task.mark_complete\n # If completion date is nil, apply not_completed class\n # else if completion date is entered, apply completed class\n # Maybe have a render?\n # If user selects complete, update task with today's date as a string /cross out date via class\n # Maybe t his applies a class to that text for the cross out?\n # if task.mark_complete\n # task.completion_date =\n # task.completion_date.update(completion_date: params[:task][:completion_date])\n # task.save\n # else\n #\n end", "def calc_finished_date\n\t\t\t\tspeed = @static_building.speed\n\t\t\t\tlevel = current_user.user_info.level\n\t\t\t\tTime.now + speed.days - level.hours\n\t\t\tend", "def additional_exam_end_date(contact)\n additional_campaign_exam = CampaignExam.where(\"campaign_id = ? AND stage = ?\", self.id, EXAM_STAGE_ADDITIONAL).first\n \n additional_exam_present = false\n additional_exam_ended_date = false\n \n if additional_campaign_exam.present?\n additional_exam_present = true\n \n additional_user_exam = UserExam.where(\"user_id = ? AND exam_id = ?\",contact.id, additional_campaign_exam.exam_id).first\n \n additional_exam_ended_date = (additional_exam_present) ? additional_user_exam.date_end : false if additional_user_exam\n end \n \n return additional_exam_present, additional_exam_ended_date\n end", "def enter_acquisition_dates(data_set)\n acquis_dates = data_set[CoreAcquisitionData::ACQUIS_DATE_GRP.name]\n acquis_dates && acquis_dates.each do |date|\n index = acquis_dates.index date\n logger.debug \"Entering acquisition date '#{date}' at index #{index}\"\n add_button_locator = add_button_locator([fieldset(CoreAcquisitionData::ACQUIS_DATE_GRP.name)])\n hit_escape\n wait_for_element_and_click add_button_locator unless index.zero?\n wait_for_element_and_type(acquis_date_input_locator(index), date[CoreAcquisitionData::ACQUIS_DATE.name])\n hit_enter\n end\n end", "def add_due_date_task(duedatetask)\n @due_date_task_list << duedatetask\n @combined_list = @due_date_task_list + @task_list\n end", "def not_complete_by_date\n @not_done = show_not_completed_date_items\n return @not_done.sort_by {|x| x.due_date }\n end", "def list_not_completed_this_month_date_only\n @due_this_month = not_complete_by_date.select {|x| x.due_date.month == Date.today.month}\n @anniversary_this_month = @anniversary_list.select {|x| x.month == Date.today.month}\n @anniversary_this_month = @anniversary_this_month.sort_by {|x| x.day}\n return @due_this_month + @anniversary_this_month\n end", "def completed_events\n candidate.completed\n end", "def updateDates(iDate, iResourcesInfo)\n if (@StartDate == nil)\n # First time there is an affectation\n @StartDate = iDate\n @EndDate = iDate\n @EndDateHours = 0\n iResourcesInfo.each do |iResource, iHours|\n @EndDateHours += iHours\n end\n elsif (@StartDate > iDate)\n # Different start date\n @StartDate = iDate\n elsif (@EndDate < iDate)\n # Different end date\n @EndDate = iDate\n @EndDateHours = 0\n iResourcesInfo.each do |iResource, iHours|\n @EndDateHours += iHours\n end\n end\n end", "def completed_at\n @completed_at ||= connection.get_experiment_completed_at(@id)\n end" ]
[ "0.6891963", "0.6883246", "0.6543294", "0.57092565", "0.56728524", "0.5656371", "0.5603191", "0.5586998", "0.55691063", "0.55672586", "0.55639", "0.55581975", "0.5546032", "0.5484491", "0.5466815", "0.54416984", "0.54120487", "0.540198", "0.5401393", "0.5377785", "0.5373921", "0.5365197", "0.53613526", "0.5322359", "0.53035206", "0.52907044", "0.52756107", "0.5237164", "0.52344155", "0.52325416", "0.5229139", "0.52230906", "0.5222895", "0.52223235", "0.52193063", "0.52159685", "0.52074885", "0.5202816", "0.51854026", "0.5158529", "0.51465195", "0.5141589", "0.5141589", "0.5141589", "0.5141589", "0.5141589", "0.5141589", "0.51333886", "0.51279294", "0.5121349", "0.5121253", "0.5121161", "0.51195323", "0.51085114", "0.5104406", "0.5091314", "0.5081259", "0.507478", "0.50725776", "0.5065525", "0.50649786", "0.5053467", "0.50502086", "0.5021315", "0.5016403", "0.5014128", "0.50103575", "0.5004644", "0.49995834", "0.49989504", "0.49966586", "0.49949384", "0.49918085", "0.49904263", "0.49878842", "0.4987459", "0.4987459", "0.4987459", "0.4987459", "0.4987459", "0.4987459", "0.49818325", "0.49810237", "0.49577335", "0.49505424", "0.4943071", "0.49353564", "0.49279928", "0.49247724", "0.49171567", "0.49160716", "0.49148837", "0.49133316", "0.491064", "0.4899434", "0.4883011", "0.48814297", "0.4879023", "0.4876227", "0.48673034" ]
0.6637029
2
Verifies date completed matches test data
def verify_date_completed(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def test_date\n if test_execution_date and test_delivery_date\n if test_execution_date > test_delivery_date\n errors.add(:test_delivery_date, \"should be greater then test date.\")\n end\n end\n end", "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[Org::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "def test_is_due\n u = TestHelper.owner_user\n job_hashes = TestHelper.load_fixture(\"is_due\")\n job_hashes.each do |jh|\n job_path = \"#{u.runner.path}/#{jh['name']}\"\n j = Mobilize::Job.find_or_create_by_path(job_path)\n #update job params\n j.update_from_hash(jh)\n #apply the completed_at, failed at, and parent attributes where appropriate\n if jh['completed_at']\n j.stages.last.update_attributes(:completed_at=>eval(jh['completed_at']))\n end\n if jh['failed_at']\n j.stages.last.update_attributes(:failed_at=>eval(jh['failed_at']))\n end\n if jh['parent']\n j.parent.stages.last.update_attributes(:completed_at=>eval(jh['parent']['completed_at'])) if jh['parent']['completed_at']\n j.parent.stages.last.update_attributes(:failed_at=>eval(jh['parent']['failed_at'])) if jh['parent']['failed_at']\n end\n expected = jh['expected']\n #check if is_due\n puts \"checking #{j.name}\"\n assert expected == j.is_due?\n end\n end", "def test_if_correct_date\n skip\n potluck = Potluck.new(\"7-13-18\")\n expected =\n actual = potluck\n\n assert_equal expected, actual\n end", "def team_registration_passed?\n d = @data_object\n today = Date.today\n d.aff_team_reg_end.to_date < today\n end", "def enter_date_completed(test_data)\n hide_notifications_bar\n wait_for_element_and_type(date_completed_input, test_data[UseOfCollections::DATE_COMPLETED.name])\n hit_enter\n end", "def enter_date_completed(test_data)\n hide_notifications_bar\n logger.info \"Entering date completed '#{test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name]}'\"\n wait_for_element_and_type(date_completed_input, test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name])\n hit_enter\n end", "def attested_for?(date)\n last_attested_on && last_attested_on > date.to_time\n end", "def dates_are_correct\n errors.add(:begins, _(\"%{fn} can't be blank\")) if begins.nil?\n errors.add(:finishes, _(\"%{fn} can't be blank\")) if finishes.nil?\n\n dates_in_order?(begins, finishes) or\n errors.add(:begins, _('Conference must end after its start date'))\n\n dates_in_order?(cfp_open_date, cfp_close_date) or\n errors.add(:cfp_open_date, _('Call for papers must end after its ' +\n 'start date'))\n dates_in_order?(cfp_close_date, begins) or\n errors.add(:cfp_close_date, _('Call for papers must finish before ' +\n 'the conference begins'))\n\n dates_in_order?(reg_open_date, reg_close_date) or\n errors.add(:reg_open_date, _('Registration must end after its ' +\n 'start date'))\n dates_in_order?(reg_close_date, finishes) or\n errors.add(:reg_close_date, _('Registration must finish before the ' +\n 'conference ends'))\n end", "def registration_passed?\n d = @data_object\n today = Date.today\n d.aff_reg_end.to_date < today\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def check_completed_at\n self.errors.add('Completion Date', 'can\\'t be blank') if (self.completed && self.completed_at.blank?)\n end", "def correct_completion_status_date\n if self.is_complete? && self.completed_at.blank?\n # if task is marked complete without a completion time, update completion time to now & allow confirmation\n self.completed_at = DateTime.now\n return true\n elsif !self.is_complete? && !self.completed_at.blank?\n # if task is marked incomplete, but there is a completion time entered, update completion time to blank & allow confirmation\n self.completed_at = nil\n return true\n else\n return false\n end\n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def previous_pregnancy_test_done?(today = Date.today)\n lab_encounter = EncounterType.find_by_name(\"LAB RESULTS\")\n pregnancy_test = ConceptName.find_by_name(\"Pregnancy test\")\n yes_concept = ConceptName.find_by_name(\"Yes\")\n\n lmp = self.lmp(today)\n\n checked_date = lmp.present?? lmp : (today.to_date - 9.months)\n\n last_test_visit = self.encounters.joins([:observations])\n .where([\"encounter.encounter_type = ? AND (obs.concept_id = ?) \n AND encounter.encounter_datetime > ?\", lab_encounter.id,\n pregnancy_test.concept_id,checked_date.to_date])\n .order([:encounter_datetime])\n .select(\"value_coded\")\n .last.value_coded rescue nil\n \n if last_test_visit == yes_concept.concept_id\n return true\n end\n\n return false\n\n end", "def test_presence_of_estimated_time\n tat2 = Tat.new(:id => 6, :expected_time => '12/12/06')\n assert_equal(false, tat2.save)\n end", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def completed?\n (@start + 10 * DAY) < Time.now\n # p (@start + 10 * DAY)\n end", "def failed? participate\n return participate.continuous_check_in == 0 || participate.updated_at.to_date != Time.now.utc.to_date\nend", "def correct?\n starts_at < ends_at && starts_at.to_date == ends_at.to_date\n end", "def check_dates\n # TODO the init_time must be less then the end_time\n true\n end", "def has_valid_date?\n self.time_event < Time.now.advance(days: 1)\n end", "def completed?\n \t!completed_at.blank?\n end", "def test_response_valid_in_this_phase\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n #resubmission_time3 after the response time\n #but it is after the current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def date_combination_valid\n\n # just make sure we work on something valid and existing\n\n return false unless date_from?\n\n set_nil_default( :date_until, date_from )\n\n if date_until < date_from\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_period' ))\n return false\n end\n\n if date_from.year != date_until.year\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_years' ))\n return false\n end\n\n # all tests passed\n\n write_attribute( :year_period, date_from.year )\n return true\n end", "def test_valid_with_attributes\r\n fee_schedule = FeeSchedule.new\r\n fee_schedule.start_date = fee_schedules(:fee_schedule_00001).start_date\r\n fee_schedule.end_date = fee_schedules(:fee_schedule_00001).end_date\r\n assert fee_schedule.valid?, fee_schedule.errors.full_messages \r\n end", "def exam_in_the_future\n if self.date < Date.today\n errors.add(:date, 'is in the past')\n end\n end", "def completed?\n !completed_at.blank?\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def completed?\n !completed_at.blank?\n end", "def check_result_has_date(li_arr)\n puts \"#{@@info_indicate} start checking post date\"\n li_arr.each do |li|\n assert_not_nil(get_post_time(li),\"#{@@warning_indicate}Could not found time tag//n\")\n end\n end", "def test_valid_when_updating_dropdead_on_in_future_with_past_dropdead_on\n @item = items(:overdue_unfinished_item)\n @item.dropdead_on = 1.day.from_now.to_date\n assert @item.valid?\n end", "def check_date()\n event = Event.find_by(id: self.event_id) \n if Time.now > event.start_date then\n halt msg: 'check_date() fail' \n false\n else\n true\n end\n end", "def test_valid_when_updating_wanted_on_in_future_with_past_wanted_on\n @item = items(:overdue_unfinished_item)\n @item.wanted_on = 1.day.from_now.to_date\n # Have to also update dropdead_on, to avoid having wanted_on > dropdead_on\n @item.dropdead_on = 1.day.from_now.to_date\n assert @item.valid?\n end", "def test_validate_date_in_the_past\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: 1.day.ago,\n is_hidden: false)\n assert g.valid?\n end", "def completed_date_cannot_be_less_than_start\n self.errors.add(:completed_at,\"can\\'t be lesser than start date\") if self.start_date && self.completed_at && self.completed && self.completed_at.to_date < self.start_date.to_date\n end", "def test_check_good_time\n assert_output '' do\n time = '1553188611.560418000'\n prev_time = '1553188612.100418000'\n line_num = 0\n @verify.check_time(time, prev_time, line_num)\n end\n end", "def check_date(source_file)\n avhrr_file = Dir.glob('*.avhrr').first\n fail 'No avhrr file found, the processing must have failed' unless avhrr_file\n\n # Catch exception in case of wierd dates, like for example \"n19.17366.2352.avhrr\"\n begin\n # time of processed data\n time_of_data = get_time(avhrr_file)\n # time of recieved pass\n time_of_source = get_time(source_file)\n rescue ArgumentError => e\n puts('ERROR: An error occured parsing the source or processed filenames.')\n puts(\"ERROR: \\t#{e.to_s}\")\n raise 'Processed data has a strange time'\n end\n\n # if the time of the processed data and the source data is different by more than 10 minutes, report as bad\n if ((time_of_data - time_of_source) > 600)\n puts('ERROR: Processed data seems to have a strange time')\n puts(\"ERROR: Source: #{source_file}, time => #{time_of_source.to_s}\")\n puts(\"ERROR: Data: #{avhrr_file}, time => #{time_of_data.to_s}\")\n fail 'Processed data has a strange time'\n end\n\n # If the date of the data is more than 4 days in the future, report as bad.\n if ((time_of_data - DateTime.now).to_f > 2.0 )\n puts('ERROR: Processed data is in the future')\n puts(\"ERROR: Source: #{source_file}, time => #{time_of_source.to_s}\")\n puts(\"ERROR: Data: #{avhrr_file}, time => #{time_of_data.to_s}\")\n fail 'Processed data has a date in the future'\n end\n end", "def finished?(date = Date.today)\n !finished_on.nil? && finished_on < date\n end", "def date_valid?(date)\n valid_dates = Date.parse(DATA_START_DATE)..Date.today\n if valid_dates.cover?(date)\n return true\n else\n puts \"\\nDate must be after #{DATA_START_DATE} and before today.\"\n return false\n end\nend", "def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend", "def finished\n if self.end_date < Date.today\n return true\n else\n return false\n end\nend", "def test_assignments_due_at_field_is_not_before_active_at_field\n battleship = Assignment.create(name: \"Battleship\", percent_of_grade: 10, course_id: 2)\n currency = Assignment.create(name: \"Currency Converter\", percent_of_grade: 10, course_id: 2)\n\n battleship.due_at = \"2016-02-10\"\n battleship.active_at = \"2016-2-08\"\n\n currency.due_at = \"2016-02-14\"\n currency.active_at = \"2016-02-16\"\n\n assert battleship.save\n refute currency.save\n end", "def test_invalid_when_updating_wanted_on_in_past_with_past_wanted_on\n @item = items(:overdue_unfinished_item)\n @item.wanted_on = 3.days.ago.to_date\n assert !@item.valid?\n assert @item.errors.on(:wanted_on)\n end", "def complete?\n !instrument_end_date.blank? && !instrument_end_time.blank? && instrument_status.to_s == \"Complete\"\n end", "def completed?\n !!completed_at\n end", "def test_member_register_after_early_bird\n\t\tmember = Enrollments.new(:participantID => participants(:six).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_operator Date.today, :<=, participants(:six).expirydate, \"Member is not a member\"\n\t\tassert_not_nil participants(:six).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-09-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def test_death_after_life\n @person.date_of_birth = Time.now\n @person.date_of_death = Time.now-1000000\n assert !@person.save\n end", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def completed?\n \tcompleted_at?\n end", "def test_validate_valid_date\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: 1.day.from_now,\n is_hidden: false)\n assert g.valid?\n end", "def check_date\n\t\tif self.hasError\n\t\t\terrors.add(\"\", \"You entered Invalid date: \\n - \"+self.interviewer.name)\n\t\t\t# puts \"===================CHECKDATE===================\"\n\t\telsif Time.at(self.sched_end.to_i) <= Time.at(self.sched_start.to_i)\n\t\t\terrors.add(\"\", \"Start time cannot be greater than end time \\n - \"+self.interviewer.name)\n\t\tend\n\tend", "def complete?\n !! completed_at\n end", "def completed?\n self.completed_at.present?\n end", "def test_response_latest\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n #All resubmission times are before the response time\n #also the response is in current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def check_fixed_date_requirements(date)\n return true unless release_fixed_date? && release_date.present?\n date == release_date\n end", "def check_future\n current_start = DateTime.strptime(self.start_time,\"%m/%d/%y %H:%M\").to_time\n current_end = DateTime.strptime(self.end_time,\"%m/%d/%y %H:%M\").to_time \n\n # checks start time of appt is before end time #\n if current_start < current_end\n if current_start > Time.now && current_end > Time.now\n @valid = true\n else\n @valid = false\n end\n end\n @valid\n p @valid\n end", "def test_non_member_registering_early_bird\n\t\tnon_member = Enrollments.new(:participantID => participants(:non_member_one).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_nil participants(:non_member_one).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-11-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def verify_patchset_9141024_created_date\n patchset = PatchSet.where(code_review_id: 9141024, patchset: 3004).first\n #convert dates to strings for comparison\n if patchset.created.to_s.eql?(\"2012-01-20 23:53:25 UTC\") then \n pass()\n else\n fail(\"Wrong created date on patchset 9141024.\")\n end\n end", "def test_member_registering_early_bird\n\t\tmember = Enrollments.new(:participantID => participants(:six).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_operator Date.today, :<=, participants(:six).expirydate, \"Member is not a member\"\n\t\tassert_not_nil participants(:six).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-11-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def finished\n self.date.present? && (self.date < Date.today)\n end", "def check_dates\n date_now = DateTime.now.in_time_zone\n start_date = nil\n end_date = nil\n if !@contestproblem.nil? && @contestproblem.at_least(:in_progress)\n start_date = @contestproblem.start_time\n elsif !params[:contestproblem][:start_time].nil?\n start_date = Time.zone.parse(params[:contestproblem][:start_time])\n end\n if !@contestproblem.nil? && @contestproblem.at_least(:in_correction)\n end_date = @contestproblem.end_time\n elsif !params[:contestproblem][:end_time].nil?\n end_date = Time.zone.parse(params[:contestproblem][:end_time])\n end\n @date_problem = false\n \n if (@contestproblem.nil? || @contestproblem.at_most(:in_progress)) && !end_date.nil? && date_now >= end_date\n flash.now[:danger] = \"La deuxième date ne peut pas être dans le passé.\"\n @date_problem = true\n elsif (@contestproblem.nil? || @contestproblem.at_most(:not_started_yet)) && !start_date.nil? && date_now >= start_date\n flash.now[:danger] = \"La première date ne peut pas être dans le passé.\"\n @date_problem = true\n elsif !start_date.nil? && !end_date.nil? && start_date >= end_date\n flash.now[:danger] = \"La deuxième date doit être strictement après la première date.\"\n @date_problem = true\n elsif start_date.min != 0\n flash.now[:danger] = \"La première date doit être à une heure pile#{ '(en production)' if Rails.env.development?}.\"\n @date_problem = true if !Rails.env.development?\n end\n end", "def waits_for_actual_attestation?\n !index.final_exam_passed? &&\n !attested_for?(Attestation.actual_for_faculty(index.student.faculty))\n end", "def test_day_of_scheduled_reminders\n @reminder.scheduled_reminders.each{|x| assert_equal x.run_at.mday, @reminder.fq_day }\n end", "def test_dates_with_exact_attributes_are_equal\n assert_equal CarbonDate::Date.new(1988, 7, 11, 6, 43, 3, precision: :second), CarbonDate::Date.new(1988, 7, 11, 6, 43, 3, precision: :second)\n end", "def test_MonthlyAppointment\n \n appt = MonthlyAppointment.new(\"Room 216\", \"IT211 Class\", 11, 50, 21)\n \n assert_equal \"Room 216\", appt.location()\n assert_equal 11,appt.hour\n assert_equal \"IT211 Class\", appt.purpose()\n assert_equal 50,appt.min\n assert_equal 21,appt.day\n assert_equal \"Room 216 IT211 Class 11 50 21\", appt.to_s\n assert_equal true, appt.occurs_on?(2018, 2, 21)\n assert_equal false, appt.occurs_on?(2016, 4, 9)\n \n \n end", "def date_verify\n if end_date && start_date.nil?\n errors.add(:end_date, \"cannot only specify end date\")\n elsif all_day && start_date.nil?\n errors.add(:all_day, \"cannot specify without date\")\n elsif (start_date && end_date) && (start_date > end_date)\n errors.add(:start_date, \"cannot larger than end date\")\n end\n end", "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "def completed?\n completed_at ? true : false\n end", "def completed?\n completed_at ? true : false\n end", "def test_set_status\n # in the future\n @absence = Absence.create(:start_time => '1-10-3000 00:00',\n :end_time => '1-10-3000 00:00',\n :reason => 'reason',\n :user_id => User.find_by_admin(true).id,\n :variety => 'Holiday',\n :start_half_day => 'Lunch Time',\n :end_half_day => 'Lunch Time')\n assert_valid @absence\n assert_equal 'Pending', @absence.status\n # in the past\n @absence = Absence.create(:start_time => '1-10-1000 00:00',\n :end_time => '1-10-1000 00:00',\n :reason => 'reason',\n :user_id => User.find_by_admin(true).id,\n :variety => 'Holiday',\n :start_half_day => 'Lunch Time',\n :end_half_day => 'Lunch Time' )\n assert_valid @absence\n assert_equal 'Approved', @absence.status\n end", "def is_experiment_completed?(experiment) # rubocop:todo Naming/PredicateName\n !!VanityExperiment.retrieve(experiment).completed_at\n end", "def test_validation_expiration_dates\n an_account = OrderAccount.new\n #an_account.cc_number = '1234567890'\n \n # An order account must have valid expiration month and year.\n assert !an_account.valid?\n assert an_account.errors.invalid?(:expiration_month), \"Should have an error in expiration_month\"\n assert an_account.errors.invalid?(:expiration_year), \"Should have an error in expiration_year\"\n \n assert_same_elements [\"is not a number\", \"Please enter a valid expiration date.\"], an_account.errors.on(:expiration_month)\n assert_equal \"is not a number\", an_account.errors.on(:expiration_year)\n\n an_account.expiration_month = 1.month.ago.month\n an_account.expiration_year = 1.year.ago.year\n \n an_account.errors.clear\n assert !an_account.valid?\n \n assert an_account.errors.invalid?(:expiration_month), \"Should have an error in expiration_month\"\n assert_equal \"Please enter a valid expiration date.\", an_account.errors.on(:expiration_month)\n end", "def valid_dates\n device_request = DeviceRequest.find(device_request_id)\n current_date = Date.today\n if self.on_date.present?\n self.errors.add :on_date, \"Quotation date can't be future\" if self.on_date > current_date\n self.errors.add :on_date, \"Quotation date should be onwards #{device_request.on_date}\" if self.on_date < device_request.on_date\n end\n end", "def check_contract_period_completed\n if contract_period_status == :completed\n errors.add(:base, :initial_call_off_period_in_past) if contract_period_in_past?\n errors.add(:base, :mobilisation_period_in_past) if mobilisation_period_in_past?\n errors.add(:base, :mobilisation_period_required) unless mobilisation_period_valid_when_tupe_required?\n else\n errors.add(:base, :contract_period_incomplete)\n end\n end", "def valid_release_date?(date)\n # Validate date against all release date requirements\n check_no_delay_requirements(date) && check_before_date_requirements(date) && check_fixed_date_requirements(date)\n end", "def future?\n Date.today <= finish\n end", "def date_consistency\n\t\treturn if [start_date.blank?, end_date.blank?].any?\n\t\terrors.add(:end_date, 'must be after start_date') if start_date > end_date\n\tend", "def booking_deadline_has_passed?\n Date.current > deadline\n end", "def test_should_find_upcoming_meetings\n meetings = Meeting.upcoming_meetings\n assert meetings.size > 0\n for meeting in meetings\n assert meeting.meets_on > Time.now.to_date\n end\n end", "def is_target_date? ( date ) \n d = date.to_date\n check = false\n if d >= @dStart.to_date && d <= @dEnd.to_date\n check = true\n end\n return check\n end", "def inconsistent?(x)\n if @date_added > @date_modified or\n x.date_added > x.date_modified\n# @date_added != x.date_added or\n# @date_modified > x.date_modified\n\n return true\n end\n false\n end", "def test_schedule_time_cannot_be_before_current_time\n \t@schedule.start_time = \"2004-05-06 04:36:00\"\n \tassert !@schedule.save, \"Worked? Saved a schedule to position itself in the past.\"\n end", "def test_valid_member_registered_class\n\t\tregistered_member = enrollments(:one)\n\t\tassert Participant.find_by(participantID: registered_member.participantID), \"Member was not found in Participant database\"\n\t\tassert Course.find_by(courseID: registered_member.courseID), \"Course is not in Courses database\"\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tmember = Participant.find_by(participantID: registered_member.participantID)\n\t\tassert_operator Date.today, :<=, member.expirydate, \"Member is not a member\"\n\t\tassert_not_nil member.expirydate, \"Member is not a member\"\n\n\t\t\n\t\t# Checking the existence of the pair (courseID,startDate) \n\t\texpected = registered_member.startDate\n\t\tactual = Course.find_by(courseID: registered_member.courseID)\n\t\tassert_equal expected, actual.startDate, \"Registering Course does not have valid startDate\"\n\n\t\t# TODO: check doctors note, parq, not yet implemented\n\n\t\tassert registered_member.save, \"valid registered member was not saved\"\n\tend", "def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end", "def test_onetimeappointment\n \n appt = OneTimeAppointment.new(\"Room 202\", \"ISM210\", 1, 30, 26, 2, 2018)\n \n assert_equal \"Room 202\", appt.location()\n assert_equal 1,appt.hour\n assert_equal \"ISM210\", appt.purpose()\n assert_equal 30,appt.min\n assert_equal 26,appt.day\n assert_equal 2018,appt.year\n assert_equal \"Room 202 ISM210 1 30 26 2 2018\", appt.to_s\n assert_equal true, appt.occurs_on?(2018, 2, 26)\n assert_equal false, appt.occurs_on?(2015, 6, 17)\n \n end", "def check_dates\n dates_already_booked = [date_in, date_out]\n body.bookings.each do |b|\n dates_already_booked << b.date_in\n dates_already_booked << b.date_out\n end\n dates_already_booked.sort!\n idx_in = dates_already_booked.index(date_in)\n idx_out = dates_already_booked.index(date_out)\n if idx_in + 1 == idx_out && idx_in % 2 == 0\n true\n else\n throw(:abort)\n end\n end", "def is_target_date?(date) \n d = date.to_date\n check = false\n if d >= @dStart && d <= @dEnd\n check = true\n end\n return check\n end", "def test_date_a_variable_matches_index\n skip\n engine = Engine.new\n assert_equal [6, 2, 2, 5], engine.date_assignment\n end" ]
[ "0.8341166", "0.7105125", "0.70442903", "0.666714", "0.6660662", "0.66597664", "0.6641813", "0.66349506", "0.658938", "0.65710187", "0.64267975", "0.6424494", "0.6405465", "0.6322645", "0.62721294", "0.6220005", "0.6211923", "0.6203252", "0.6202072", "0.6157452", "0.6153661", "0.61487526", "0.6134098", "0.6063614", "0.60626304", "0.6050539", "0.6035213", "0.60205376", "0.6003406", "0.599853", "0.59899336", "0.5987928", "0.5980418", "0.5978676", "0.59709084", "0.59373164", "0.5936939", "0.5936939", "0.59339935", "0.59283924", "0.5908001", "0.5906586", "0.5890629", "0.5890014", "0.5880569", "0.58707905", "0.5807936", "0.58055705", "0.579656", "0.5780887", "0.57791847", "0.5777093", "0.5775532", "0.57745147", "0.57730806", "0.57693434", "0.5765826", "0.5757143", "0.5757143", "0.57543695", "0.5752793", "0.5751015", "0.5747596", "0.5739325", "0.57354337", "0.57276213", "0.57185787", "0.5717573", "0.5710295", "0.5707691", "0.57056576", "0.56977195", "0.5688005", "0.56799203", "0.5665146", "0.566413", "0.56454194", "0.5642076", "0.5641019", "0.5631642", "0.5631642", "0.56293267", "0.56275785", "0.56256473", "0.5624966", "0.56143767", "0.56115156", "0.5610721", "0.5604334", "0.56024903", "0.5594809", "0.5589387", "0.5579444", "0.5576521", "0.5575179", "0.5574718", "0.55738735", "0.5572764", "0.5557367", "0.55561477" ]
0.8371164
0
OCCASIONS Enters occasions per a given set of test data
def enter_occasions(test_data) occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::OCCASION_LIST.name)], occasions) occasions.each_with_index do |occasion, index| logger.info "Entering occasion data set at index #{index}: #{occasion}" enter_auto_complete(occasion_input(index), occasion_options(index), occasion[CoreUseOfCollectionsData::OCCASION.name], 'Occasion Concepts') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_occasions(test_data)\n occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)) }\n end", "def verify_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[UseOfCollections::OCCASION.name], element_value(occasion_input index)) }\n end", "def enter_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::OCCASION_LIST.name)], occasions)\n occasions.each_with_index do |occasion, index|\n enter_auto_complete(occasion_input(index), occasion_options(index), occasion[UseOfCollections::OCCASION.name], 'Occasion Concepts')\n end\n end", "def enter_pahma_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::OCCASION_LIST.name)], occasions)\n occasions.each_with_index do |occasion, index|\n enter_auto_complete(occasion_input(index), occasion_options(index), occasion[UseOfCollections::OCCASION.name], 'Occasion Concepts')\n end\n end", "def operating_expenses_ccs\n fetch(:operating_expenses_ccs) do\n variable_operation_and_maintenance_costs_for_ccs + co2_emissions_costs\n end\n end", "def exec_iter_fixed_alpha aggrStats\n iterStats = RunInfo.new\n iterConsensus = Hash.new {|hash, key| hash[key] = 0 }\n \n # NUMBER_OF_ITER times do\n $NUM_AVG_ITER.times do |i| \n # randomly withhold 20% of data\n pick_patients\n \n # find G'\n cover = exec_search \"nCOP_heruistic\"\n \n # store the stats\n iterStats.fillIn cover\n\n # add the cover to the consensus list\n add_to_consensus(iterConsensus, cover)\n end\n \n # compute the average and std for this set of iterations\n aggrStats.fillAggregateStats iterStats\n aggrStats.alpha << $ALPHA\n aggrStats.beta << $BETA\n\n # remember the frequency genes occured\n $selected_genes = iterConsensus\nend", "def count_electoral_college\n @swing_states.each do |row|\n @swing_votes += @polls[row[0]][0]\n end\n @clinton_states.each do |row|\n @clinton_votes += @polls[row[0]][0]\n end\n @trump_states.each do |row|\n @trump_votes += @polls[row[0]][0]\n end\n end", "def test_annuity_credit_results\n @annuity_credit_Value.each { |key, value| assert_in_delta @calc_annuity[@row_number][key], value, 0.03 }\n check_count @calc_annuity\n end", "def test_doe_latin_hypercube_method_should_return_evenly_distributed_points_across_parameter_space_2_param_case\n @experiment_with_multiple_params.doe_info = [[\"latinHypercube\", [\"param-0\", \"param-1\"]]]\n\n\n doe_method_result = @experiment_with_multiple_params.apply_doe_methods.first\n\n\n assert_equal \"latinHypercube\", doe_method_result[0]\n assert_equal [\"param-0\", \"param-1\"], doe_method_result[1]\n assert_equal 6, doe_method_result[2].size\n\n level_counters = [ [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0] ]\n\n doe_method_result[2].each do |input_parameter_space_point|\n input_parameter_space_point.each_with_index do |value, index|\n level_counters[index][value / 20] += 1\n end\n end\n\n level_counters.each{|counter| assert_equal [1, 1, 1, 1, 1, 1], counter}\n end", "def decisions_by_cd\n cds=@sr.cd_id_by_stage(@stage)\n\n decisions=Decision.where(:systematic_review_id=>@sr.id, :canonical_document_id=>cds, :user_id=>@sr.group_users.map {|u| u[:id]}, :stage=>@stage.to_s).group_and_count(:canonical_document_id, :decision).all\n n_jueces_por_cd=AllocationCd.where(:systematic_review_id=>@sr.id, :canonical_document_id=>cds, :stage=>@stage.to_s).group_and_count(:canonical_document_id).as_hash(:canonical_document_id)\n\n\n# n_jueces=@sr.group_users.count\n cds.inject({}) {|ac,v|\n ac[v]=empty_decisions_hash\n ac[v]=ac[v].merge decisions.find_all {|dec| dec[:canonical_document_id]==v }\n .inject({}) {|ac1,v1| ac1[v1[:decision]]=v1[:count]; ac1 }\n suma=ac[v].inject(0) {|ac1,v1| ac1+v1[1]}\n n_jueces=n_jueces_por_cd[v].nil? ? 0 : n_jueces_por_cd[v][:count]\n ac[v][Decision::NO_DECISION]=n_jueces-suma\n ac\n }\n end", "def cuantas_especies_e_inferiores(opc = {})\n scope = descendants.especies_e_inferiores\n scope = scope.where(estatus: 2) if opc[:validas]\n scope.count\n end", "def set_occasion\n @occasion = Occasion.find(params[:id])\n end", "def set_occasion\n @occasion = Occasion.find(params[:id])\n end", "def set_occasion\n @occasion = Occasion.find(params[:id])\n end", "def generateNumCases \n time1 = Time.now # used for test\n time11 = Time.new # used for test\n puts time1# used for test\n\n\t while !isEmptyOfUC do\n tmprecords=Records.new #new a Record used for store the results\n getMostOccur #get the most occur store in @maxparam and @maxelement\n for i in 0...@maxloopnum do #generate @maxloopnum records and later will random select one\n\n \n\n recorde = generateCase\n if(recorde !=-1)\n tmprecords.recordsArr << recorde\n end\n end\n flag = getMostCover tmprecords\n @records.recordsArr << tmprecords.recordsArr[flag]\n updateUC tmprecords.recordsArr[flag]\n tmprecords.recordsArr.clear\n end\n \n #puts 'list:'\n outputcase \n #print'total number:'\n #puts @records.recordsArr.length\n\n #puts \"start time\" #design for test start\n #puts time11\n time22 = Time.new\n #puts \"end time\"\n \n #puts time22\n time2 = Time.now\n puts time2-time1 #design for test end\n @usetime = time2-time1\n end", "def add_to_consensus iterConsensus, cover\n cover.each { |e| iterConsensus[e] += 1 }\nend", "def test_change_criteria\n # attribute change\n @test.checked_criteria[0].replacement_attribute = 'relevantPeriod'\n @test.checked_criteria[0].change_criteria\n has_relevant_period = @test.checked_criteria.any? do |cc|\n cc.source_data_criteria['dataElementAttributes'][cc.attribute_index]['attribute_name'] == 'relevantPeriod'\n end\n assert has_relevant_period\n\n # attribute change with valueset\n @test.checked_criteria[0].replacement_attribute = 'dischargeDisposition:1.5.6.7'\n @test.checked_criteria[0].change_criteria\n has_discharge_disposition = @test.checked_criteria.any? do |cc|\n cc.source_data_criteria['dataElementAttributes'][cc.attribute_index]['attribute_name'] == 'dischargeDisposition'\n end\n assert has_discharge_disposition\n\n # data_criteria change\n index = Measure.first.source_data_criteria.index { |a| a['description'] == 'Patient Characteristic Ethnicity: Ethnicity' }\n @test.checked_criteria[0].replacement_data_criteria = Measure.first.source_data_criteria[index]._id.to_s\n @test.checked_criteria[0].change_criteria\n has_ethnicity = @test.checked_criteria.any? { |cc| cc.source_data_criteria['description'] == 'Patient Characteristic Ethnicity: Ethnicity' }\n assert has_ethnicity\n\n # both change\n index = Measure.first.source_data_criteria.index { |a| a['description'] == 'Encounter, Performed: EncounterInpatient' }\n @test.checked_criteria[0].replacement_data_criteria = Measure.first.source_data_criteria[index]._id.to_s\n @test.checked_criteria[0].replacement_attribute = 'relevantPeriod'\n @test.checked_criteria[0].change_criteria\n has_ethnicity = @test.checked_criteria.any? { |cc| cc.source_data_criteria['description'] == 'Patient Characteristic Ethnicity: Ethnicity' }\n assert has_ethnicity\n end", "def test_doe_latin_hypercube_method_should_return_evenly_distributed_points_across_parameter_space_5_param_case\n @experiment_with_multiple_params.doe_info = [[\"latinHypercube\", [\"param-0\", \"param-1\", \"param-2\", \"param-3\", \"param-4\"]]]\n\n\n doe_method_result = @experiment_with_multiple_params.apply_doe_methods.first\n\n\n\n assert_equal \"latinHypercube\", doe_method_result[0]\n assert_equal [\"param-0\", \"param-1\", \"param-2\", \"param-3\", \"param-4\"], doe_method_result[1]\n assert_equal 6, doe_method_result[2].size\n\n level_counters = [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]\n\n doe_method_result[2].each do |input_parameter_space_point|\n input_parameter_space_point.each_with_index do |value, index|\n level_counters[index][value / 20] += 1\n end\n end\n\n level_counters.each { |counter| assert_equal [1, 1, 1, 1, 1, 1], counter }\n end", "def cuantas_especies(opc = {})\n scope = descendants.solo_especies\n scope = scope.where(estatus: 2) if opc[:validas]\n scope.count\n end", "def hypothesis1(countsXmajor) \n\tcriteria = 0\n\teuks = 0\n\teuks += 1 if countsXmajor['Sr'] >= 0.25\n\teuks += 1 if countsXmajor['Pl'] >= 0.25\n\teuks += 1 if countsXmajor['Op'] >= 0.25\n\teuks += 1 if countsXmajor['EE'] >= 0.25\n\teuks += 1 if countsXmajor['Am'] >= 0.25\n\teuks += 1 if countsXmajor['Ex'] >= 0.25\t\t\n\tcriteria += 1 if countsXmajor['Ba'] >= 0.25 \n\tcriteria += 1 if countsXmajor['Za'] >= 0.25 \n\tcriteria += 1 if euks >= 5\n\tif criteria == 3\n\t\treturn 1\n\telse\n\t\treturn 0 \n\tend\nend", "def test_standard_credit_results\n @standard_credit_Value.each { |key, value| assert_in_delta @calc_standard[@row_number][key], value, 0.03 }\n check_count @calc_standard\n end", "def test\n\t\t##\n\t\t# Possible outcomes for each test. Do all tests and count the outcome\n\t\t##\n\t\twinLoss = {win: 0, loss: 0, sorted: 0, unsorted: 0}\n\t\t@xData[:test].each{|test|\n\t\t\t#Get the truth\n\t\t\tsorted \t\t= test.sort{|a,b| a <=> b}\n\t\t\t#Take an educated guess\n\t\t\tprediction\t= @machine.run(test).first.round\n\t\t\t##\n\t\t\t# Record outcomes\n\t\t\t##\n\t\t\t#If it is classed as sorted and is sorted\n\t\t\tif prediction == 1 && test == sorted \n\t\t\t\twinLoss[:win] \t\t+= 1\n\t\t\t\twinLoss[:sorted]\t+= 1\n\t\t\t#If it's classed as unsorted and is unsorted\n\t\t\telsif prediction == 0 && test != sorted\n\t\t\t\twinLoss[:win] \t\t+= 1\n\t\t\t\twinLoss[:unsorted]\t+= 1\n\t\t\t#A loos. You've broke something somewhere (probably)\n\t\t\telse\n\t\t\t\twinLoss[:loss] \t\t+= 1\n\t\t\tend\n\t\t}\n\t\t#Print the results\n\t\tputs \"Iterations: #{@iterations}\\nMAX_MSE: #{@maxError}\\n\\t#{winLoss}\" # proof\n\tend", "def data_in_seances x = 50\n if @data_in_seances == nil || @data_in_seances[:x_last] != x\n @data_in_seances = Seance.exercice( self, x )\n end\n @data_in_seances\n end", "def BuildCoauthors(investigator)\n coauthor_ids = investigator.abstracts.collect{|x| x.investigator_abstracts.collect(&:investigator_id)}.flatten.uniq\n coauthor_ids.delete(investigator.id)\n coauthor_ids.each do |coauthor_id|\n colleague=Investigator.find(coauthor_id)\n citation_overlap = investigator.abstracts.collect{|x| x.id}.flatten & colleague.abstracts.collect{|x| x.id}.flatten\n citation_overlap = citation_overlap.uniq.compact\n InsertUpdateInvestigatorColleague(investigator.id,coauthor_id,citation_overlap)\n InsertUpdateInvestigatorColleague(coauthor_id,investigator.id,citation_overlap)\n end\nend", "def index\n @gifts = Gift.order(:id)\n \n @giftEval1 = Hash.new()\n @giftEval2 = Hash.new()\n \n @gifts.each do |gift|\n eval1=Evaluation.where(:gift_id => gift.id).find_by_evalid(1) || Evaluation.create(gift_id: gift.id , evalid: 1 ,count: 0)\n eval2=Evaluation.where(:gift_id => gift.id).find_by_evalid(2) || Evaluation.create(gift_id: gift.id , evalid: 2 ,count: 0)\n @giftEval1[gift]=eval1.count\n @giftEval2[gift]=eval2.count\n end\n \n end", "def validate_contests(contests)\n uniq_contests = []\n contests.each do |contest|\n if (uid_exists?(\"contest\", conid = contest[\"ident\"].to_s))\n if (uniq_contests.include?(contest))\n val_warn(\"Duplicate Contest Declaration\", conid, \"in Election Definition\")\n else\n val_err(\"Non-Unique Contest UID\", conid, \"in Election Definition\")\n end\n else\n uniq_contests.push(contest)\n uid_add(\"contest\", conid)\n end\n end\n contests.each do |contest|\n conid = contest[\"ident\"].to_s\n did = contest[\"district_ident\"].to_s\n val_err(\"Non-Existent District UID\", did, \"in Contest UID\", conid, \"in Election Definition\") unless\n uid_exists?(\"district\", did)\n self.counts_contests[conid] = {\"contest_ident\"=>conid,\n \"overvote_count\"=>0,\n \"undervote_count\"=>0,\n \"writein_count\"=>0,\n \"candidate_count_list\"=>[]}\n end\n end", "def electoral_college\n ec_seats = @seats.dup\n unless ec_seats.has_key?(\"District of Columbia\")\n\tec_seats[\"District of Columbia\"] = 1\n end\n ec_seats.each {|k,v| ec_seats[k] = v + 2}\n ec_seats\n end", "def hypothesis2(countsXmajor) \n\tcriteria = 0\n\teuks = 0\n\teuks += 1 if countsXmajor['Sr'] >= 0.25\n\teuks += 1 if countsXmajor['Pl'] >= 0.25\n\teuks += 1 if countsXmajor['Op'] >= 0.25\n\teuks += 1 if countsXmajor['EE'] >= 0.25\n\teuks += 1 if countsXmajor['Am'] >= 0.25\n\teuks += 1 if countsXmajor['Ex'] >= 0.25\t\t\n\tcriteria += 1 if countsXmajor['Ba'] < 0.25 \n\tcriteria += 1 if countsXmajor['Za'] >= 0.25 \n\tcriteria += 1 if euks >= 5\n\tif criteria == 3\n\t\treturn 1\n\telse\n\t\treturn 0 \n\tend\nend", "def test_die_roll\n test_company = AssociatesCooperation.new\n test_company.hire(6) # six open positions at start\n employees_before = test_company.roll_call.size\n number_of_employees_to_fire = test_company.die_roll\n test_company.fire(number_of_employees_to_fire)\n employees_after = test_company.roll_call.size\n if employees_after == (employees_before - number_of_employees_to_fire)\n puts \"Test successful: The company fired the number of people that the die roll determined.\"\n return true\n else\n puts \"Test failed: The company did not fire the employees as planned.\"\n return false\n end\n end", "def build_cases\n @campaigns = {}\n\n x_g_10\n x_g_5_le_10\n x_g_0_le_5\n x_e_0\n end", "def update_occurrences\n occurrences.destroy_all\n if recurrence_rules.any?\n recurrence_horizon = Time.now + (Radiant::Config['event_calendar.recurrence_horizon'] || 10).to_i.years\n to_ri_cal.occurrences(:before => recurrence_horizon).each do |occ|\n occurrences.create!(self.attributes.merge(:start_date => occ.dtstart, :end_date => occ.dtend, :uuid => nil)) unless occ.dtstart == self.start_date\n end\n end\n end", "def test_case_count\n scenario_count + outlines.reduce(0) { |outline_sum, outline|\n outline_sum += outline.examples.reduce(0) { |example_sum, example|\n example_sum += example.rows.count\n }\n }\n end", "def hypothesis6(countsXmajor) \n\tcriteria = 0\n\teuks = 0\n\teuks += 1 if countsXmajor['Sr'] >= 0.25\n\teuks += 1 if countsXmajor['Pl'] >= 0.25\n\teuks += 1 if countsXmajor['Op'] >= 0.25\n\teuks += 1 if countsXmajor['EE'] >= 0.25\n\teuks += 1 if countsXmajor['Am'] >= 0.25\n\teuks += 1 if countsXmajor['Ex'] >= 0.25\t\n\tcriteria += 1 if countsXmajor['Ba'] < 0.25\n\tcriteria += 1 if countsXmajor['Za'] < 0.25\n\tcriteria += 1 if euks >= 5\n\tif criteria == 3\n\t\treturn 1\n\telse\n\t\treturn 0 \n\tend\nend", "def handle_observation_criteria\n exp = @entry.at_xpath('./cda:measureObservationDefinition/cda:value/cda:expression/@value',\n HQMF2::Document::NAMESPACES)\n # Measure Observations criteria rely on computed expressions. If it doesn't have one,\n # then it is likely formatted improperly.\n fail 'Measure Observations criteria is missing computed expression(s) ' if exp.nil?\n parts = exp.to_s.split('-')\n dc = parse_parts_to_dc(parts)\n @doc.add_data_criteria(dc) unless dc.nil?\n # Update reference_ids with any newly referenced data criteria\n dc.children_criteria.each { |cc| @doc.add_reference_id(cc) } unless dc&.children_criteria.nil?\n dc\n end", "def evaluate_all\n EXAMPLES.each_with_object({}) do |example, hsh|\n puts \"Example: #{example}\"\n\n dog_annotations = annotate(example, 'dog')\n food_annotations = annotate(example, 'food')\n dogs_with_dog_labels = count_occurrences(dog_annotations, DOG_LABELS)\n dogs_with_food_labels = count_occurrences(dog_annotations, FOOD_LABELS)\n food_with_dog_labels = count_occurrences(food_annotations, DOG_LABELS)\n food_with_food_labels = count_occurrences(food_annotations, FOOD_LABELS)\n\n puts \"\\tDogs: #{dogs_with_dog_labels} with dog labels\"\n puts \"\\tDogs: #{dogs_with_food_labels} with food labels\"\n puts \"\\tFood: #{food_with_dog_labels} with dog labels\"\n puts \"\\tFood: #{food_with_food_labels} with food labels\"\n end\n end", "def test_competition_place_results_by_points\n race = standings(:jack_frost).races.create(:category_name => \"Masters Men 50+\")\n\n 20.times do\n race.results.create\n end\n \n ironman = Ironman.create(:date => Date.today)\n ironman_race = ironman.standings.create(:name => '2006').races.create(:category => Category.new(:name => 'Ironman'))\n \n first_competition_result = ironman_race.results.create\n first_competition_result.scores.create(:source_result => race.results[0], :competition_result => first_competition_result, :points => 45)\n \n second_competition_result = ironman_race.results.create\n second_competition_result.scores.create(:source_result => race.results[2], :competition_result => second_competition_result, :points => 45)\n \n third_competition_result = ironman_race.results.create\n race.results[3].place = 2\n race.results[3].save!\n third_competition_result.scores.create(:source_result => race.results[3], :competition_result => third_competition_result, :points => 15)\n third_competition_result.scores.create(:source_result => race.results[4], :competition_result => third_competition_result, :points => 15)\n race.results[4].place = 3\n race.results[4].save!\n \n fourth_competition_result = ironman_race.results.create\n fourth_competition_result.scores.create(:source_result => race.results[1], :competition_result => fourth_competition_result, :points => 30)\n race.results[1].place = 1\n race.results[1].save!\n \n fifth_competition_result = ironman_race.results.create\n fifth_competition_result.scores.create(:source_result => race.results[5], :competition_result => fifth_competition_result, :points => 4)\n race.results[5].place = 15\n race.results[5].save!\n fifth_competition_result.scores.create(:source_result => race.results[7], :competition_result => fifth_competition_result, :points => 2)\n race.results[7].place = 17\n race.results[7].save!\n \n sixth_competition_result = ironman_race.results.create\n sixth_competition_result.scores.create(:source_result => race.results[6], :competition_result => sixth_competition_result, :points => 5)\n race.results[6].place = 15\n race.results[6].save!\n sixth_competition_result.scores.create(:source_result => race.results[8], :competition_result => sixth_competition_result, :points => 1)\n race.results[8].place = 18\n race.results[8].save!\n \n seventh_competition_result = ironman_race.results.create\n seventh_competition_result.scores.create(:source_result => race.results[11], :competition_result => seventh_competition_result, :points => 2)\n race.results[11].place = 20\n race.results[11].save!\n \n eighth_competition_result = ironman_race.results.create\n eighth_competition_result.scores.create(:source_result => race.results[10], :competition_result => eighth_competition_result, :points => 1)\n race.results[10].place = 20\n race.results[10].save!\n eighth_competition_result.scores.create(:source_result => race.results[9], :competition_result => eighth_competition_result, :points => 1)\n race.results[9].place = 25\n race.results[9].save!\n \n ironman_race.results(true)\n for result in ironman_race.results\n result.calculate_points\n result.save!\n end\n ironman_race.place_results_by_points\n ironman_race.results(true).sort!\n assert_equal(first_competition_result, ironman_race.results.first, 'First result')\n assert_equal('1', ironman_race.results.first.place, 'First result place')\n assert_equal(second_competition_result, ironman_race.results[1], 'Second result')\n assert_equal('1', ironman_race.results[1].place, 'Second result place')\n assert_equal(fourth_competition_result, ironman_race.results[2], 'Third result')\n assert_equal('3', ironman_race.results[2].place, 'Third result place')\n assert_equal(third_competition_result, ironman_race.results[3], 'Fourth result')\n assert_equal('4', ironman_race.results[3].place, 'Fourth result place')\n assert_equal(fifth_competition_result, ironman_race.results[4], 'Fifth result')\n assert_equal('5', ironman_race.results[4].place, 'Fifth result place')\n assert_equal(sixth_competition_result, ironman_race.results[5], 'Sixth result')\n assert_equal('6', ironman_race.results[5].place, 'Sixth result place')\n assert_equal(eighth_competition_result, ironman_race.results[6], '7th result')\n assert_equal('7', ironman_race.results[6].place, '7th result place')\n assert_equal(seventh_competition_result, ironman_race.results[7], '8th result')\n assert_equal('8', ironman_race.results[7].place, '8th result place')\n end", "def set_census_tract_variables\n return unless land_use == 'residential' || land_use == 'office'\n\n tract_data = []\n tract_geoids = transportation_analysis.selected_census_tract_geoids\n\n if land_use == \"residential\" \n tract_data = CeqrData::NycAcs.version(\n data_package.table_for('nyc_acs')\n ).query.where(geoid: tract_geoids).all\n elsif land_use == \"office\"\n tract_data = CeqrData::CtppCensustractVariables.version(\n data_package.table_for('ctpp_censustract_variables')\n ).query.where(geoid: tract_geoids).all\n end\n\n self.census_tract_variables = tract_geoids.map do |geoid|\n tract = {}\n\n variables = tract_data.filter {|t| t[:geoid] == geoid}\n variables.each do |v|\n tract[v[:variable]] = v\n end\n\n tract\n end\n end", "def num_of_correct(crct)\n if self.total.nil?\n self.total = 1\n else\n self.total += 1\n end\n \n if crct == 1\n if self.correct.nil?\n self.correct = 1\n else\n self.correct += 1\n end \n else\n self.correct = 0\n end\n end", "def cupcake_solver(cupcake_counts, number_of_students_in_class)\n # number of cupcakes for each flavor\n cake_set = cupcake_counts\n n = number_of_students_in_class\n cakes_per_student = 0\n\n cake_set.each do |count|\n # cakes per student for this flavor\n c = count / n\n # running total\n cakes_per_student += c\n end\n cakes_per_student\nend", "def reset_occurrences\n logger.debug \"resetting occurrences on event_detail \" + self.id.to_s\n \n EventDetailOccurrence.where(:event_detail_id => self.id).delete_all\n \n self.occurrences.each do |oc|\n logger.debug(oc)\n edo = EventDetailOccurrence.new\n edo.event_id = self.event.id\n edo.event_detail_id = self.id\n logger.debug\n edo.time = \n # get date from occurrence\n # get time from event_detail\n Time.new(oc.year, oc.month, oc.day, self.time.hour, self.time.min, self.time.sec, 0)\n edo.save\n end\n end", "def adjust_occurrences(data)\n if Gem.win_platform?\n data = data.dup\n data[:occurrences].map! { |occ| adjust_occurrence occ }\n end\n data\n end", "def hypothesis3(countsXmajor) \n\tcriteria = 0\n\teuks = 0\n\teuks += 1 if countsXmajor['Sr'] >= 0.25\n\teuks += 1 if countsXmajor['Pl'] >= 0.25\n\teuks += 1 if countsXmajor['Op'] >= 0.25\n\teuks += 1 if countsXmajor['EE'] >= 0.25\n\teuks += 1 if countsXmajor['Am'] >= 0.25\n\teuks += 1 if countsXmajor['Ex'] >= 0.25\t\t\n\tcriteria += 1 if countsXmajor['Ba'] >= 0.25 \n\tcriteria += 1 if countsXmajor['Za'] < 0.25 \n\tcriteria += 1 if euks >= 5\n\tif criteria == 3\n\t\treturn 1\n\telse\n\t\treturn 0 \n\tend\nend", "def successful_continous_tests(achievement, user)\n number = achievement.settings['quantity']\n user.continuous_successful_tests(number)\n end", "def capital_expenditures_ccs\n fetch(:capital_expenditures_ccs) do\n (cost_of_capital_ccs || 0.0) +\n (depreciation_costs_ccs || 0.0)\n end\n end", "def refresh_census_tracts!\n set_census_tract_variables\n save!\n end", "def generate_coverages\r\n [].tap do |results|\r\n count = 0\r\n coverages.each do |obj|\r\n cov = {\r\n 'name' => obj['name'],\r\n 'code' => \"COV%03d\" % count,\r\n 'main_coverage' => !obj['rider'],\r\n 'risk_category' => \"AUTO\",\r\n 'insured_object' => \"VEHICLE\",\r\n 'coverage_group' => obj['name'].gsub(/^.*\\((.+)\\).*$/, \"\\\\1\"),\r\n 'limits' => [],\r\n 'deductible' => [],\r\n 'premium' => {\r\n 'type' => 'FixedValue',\r\n 'value' => 0.0\r\n }\r\n }\r\n cov['description'] = obj['damages'].split(';').join(',') +\r\n \" caused by \" + obj['perils'].split(';').join(',') + '.'\r\n \r\n if obj['name'] =~ /^([A-Z]+) \\(([A-Z]+)\\).*$/\r\n pg, dg = $1, $2\r\n cov['peril_groups'] = [\r\n {\r\n 'code' => pg,\r\n 'perils' => obj['perils'].split(';').map(&:strip),\r\n 'damage_groups' => [\r\n {\r\n 'code' => dg,\r\n 'damages' => obj['damages'].split(';').map(&:strip)\r\n }\r\n ]\r\n }\r\n ]\r\n end\r\n\r\n results << cov\r\n count += 1\r\n end\r\n end\r\nend", "def contest_complete\n contest = pet_contests.where(workflow_state: 'in_arena').last\n apply_experience!(contest)\n end", "def enroll_in_experiment\n enrollment_number = @experiment_setting.value[:enrolled_courses_count] + 1\n\n if (enrollment_number % CONTROL_FACTOR).zero?\n update_status 'control'\n else\n update_status 'ready_for_email'\n end\n\n @experiment_setting.value[:enrolled_courses_count] = enrollment_number\n @experiment_setting.save!\n end", "def generate_alltestc\n\n end", "def contests()\n\t\tself.as_contestants.collect{|c| c.contest }\n\tend", "def consolidate_day\n t = Time.zone.local(2012,12,10);\n\n two_days_ago = t - 2.days\n one_days_ago = t - 1.day\n\n last_couple_days = self.energy_data.where(:year => t.year, :month => t.month, :day => one_days_ago.day) #we're 1-indexed\n dayofInterest = self.energy_data.where(:year => t.year, :month => t.month, :day => t.day, :hour => (1..(t.hour+1))) #we're 1-indexed\n @dayTotals = Array.new\n count = 0\n\n hour_sim = 0\n\n #previous couple days\n last_couple_days.each do |day|\n @dayTotals[count] = [Time.utc(day.year,day.month,day.day,day.hour).to_i*1000, day.power]\n count = count + 1\n end\n\n # create array with [hour, power]\n dayofInterest.each do |day|\n last_hour = day.hour\n @dayTotals[count] = [Time.utc(day.year,day.month,day.day,day.hour).to_i*1000, day.power]\n count = count + 1\n end\n\n @dayTotals\n end", "def test_unusual_call_setup\n cdr = Cdr.new('test')\n cse = make_cse(:event_time => 100, :from_tag => 't1', :event_type => 'R')\n assert_nil cdr.accept(cse) \n cse = make_cse(:event_time => 200, :from_tag => 't1', :event_type => 'F')\n assert_not_nil cdr.accept(cse)\n cse = make_cse(:event_time => 300, :from_tag => 't1', :event_type => 'R')\n assert_nil cdr.accept(cse)\n cse = make_cse(:event_time => 400, :from_tag => 't1', :to_tag => 't8', :event_type => 'F')\n assert_not_nil cdr.accept(cse)\n cse = make_cse(:event_time => 500, :from_tag => 't1', :to_tag => 't2', :event_type => 'S')\n assert_nil cdr.accept(cse)\n cse = make_cse(:event_time => 1500, :from_tag => 't2', :to_tag => 't1', :event_type => 'S')\n assert_nil cdr.accept(cse)\n cse = make_cse(:event_time => 1600, :from_tag => 't1', :to_tag => 't2', :event_type => 'E')\n assert_not_nil cdr.accept(cse)\n cse = make_cse(:event_time => 1700, :from_tag => 't1', :to_tag => 't2', :event_type => 'E')\n assert_not_nil cdr.accept(cse)\n\n\n assert_equal( 100, cdr.start_time )\n assert_equal( 500, cdr.connect_time )\n assert_equal( 1700, cdr.end_time )\n \n end", "def generate_eobs\n Output835.log.info \"\\n\\nPatient account number : #{@eob.patient_account_number}\"\n Output835.log.info \"This EOB has #{@services.length} service lines\"\n Output835.log.info \"This is a CLAIM LEVEL EOB\" if @is_claim_eob\n claim_segments = [claim_payment_loop, include_claim_dates]\n claim_segments << claim_supplemental_info unless @facility.details[:interest_in_service_line]\n claim_segments << claim_level_allowed_amount\n claim_segments << standard_industry_code_segments(@eob, @is_claim_eob) if @is_claim_eob\n claim_segments << service_payment_info_loop unless @is_claim_eob\n update_clp! claim_segments\n claim_segments.flatten.compact\n end", "def setup_earning_tests\n start_date = Date.today\n i = 0\n Order.find(:all).each do |o|\n o.update_attributes({\n :created_on => start_date - i.months,\n :order_status_code_id => 7,\n :affiliate => @jm\n })\n i += 1\n end\n end", "def other_events\n result = []\n final_result = []\n # we go through each entry in the file_set resource\n object.resource.each_entry do |e|\n entry_id = e.as_json[\"subject\"][\"@id\"]\n # we are only interested in entries that are nested and are missing in preservation_event md field\n if entry_id.include?(\"#nested\") && object.preservation_event.none? { |pe| pe.as_json[\"id\"] == entry_id }\n # append it to a result array\n result << [id: entry_id, predicate: e.as_json[\"predicate\"][\"@id\"], value: e.as_json[\"object\"][\"@value\"]]\n end\n end\n # once we have all required entries in the result array, we need to group them by their respective IDs\n grouping_by_id = result.group_by { |r| r.first[:id] }\n # once grouped, go through each value from the groupings of IDs\n grouping_by_id.each_value do |grouping|\n event_details = []\n event_type = event_end = event_start = initiating_user = outcome = software_version = ''\n # each grouping/value has a predicate and a value;\n # we go through each grouping and assign values to its respective variable\n # by matching the predicate\n grouping.each do |preservation_event|\n case preservation_event.first[:predicate]\n when \"http://metadata.emory.edu/vocab/cor-terms#eventDetails\" then event_details << preservation_event_value(preservation_event)\n when \"http://metadata.emory.edu/vocab/cor-terms#eventType\" then event_type = preservation_event_value(preservation_event)\n when \"http://metadata.emory.edu/vocab/cor-terms#eventEnd\" then event_end = preservation_event_value(preservation_event)\n when \"http://metadata.emory.edu/vocab/cor-terms#eventStart\" then event_start = preservation_event_value(preservation_event)\n when \"http://metadata.emory.edu/vocab/cor-terms#eventUser\" then initiating_user = preservation_event_value(preservation_event)\n when \"http://metadata.emory.edu/vocab/cor-terms#eventOutcome\" then outcome = preservation_event_value(preservation_event)\n when \"http://metadata.emory.edu/vocab/cor-terms#softwareVersion\" then software_version = preservation_event_value(preservation_event)\n end\n end\n # once we have all the matching values in their respective variables,\n # we create a hash and append it to an array\n final_result << [\n {\n 'event_details' => event_details,\n 'event_type' => event_type,\n 'event_end' => event_end,\n 'event_start' => event_start,\n 'initiating_user' => initiating_user,\n 'outcome' => outcome,\n 'software_version' => software_version\n }.to_json\n ].first\n end\n # we finally return the array with hashes for the missing preservation_events\n final_result\n end", "def set_potential\n # first part calculates %-chance of events occurring\n a_string = @a_text_odds.split(\"/\")\n b_string = @b_text_odds.split(\"/\")\n c_string = @c_text_odds.split(\"/\")\n \n # dealing with single digit odds.\n if a_string[1] == nil\n a_string[1]=\"1\"\n end\n if b_string[1] == nil\n b_string[1]=\"1\"\n end\n if c_string[1] == nil\n c_string[1] = \"1\"\n end\n \n\n a_event_chance = a_string[1].to_f/(a_string[0].to_f + a_string[1].to_f)\n b_event_chance = b_string[1].to_f/(b_string[0].to_f + b_string[1].to_f)\n c_event_chance = c_string[1].to_f/(c_string[0].to_f + c_string[1].to_f)\n \n # calculate expectancy\n \n @potential = (@a_bet*@a_odds-(@b_bet+@c_bet))*a_event_chance + (@b_bet*@b_odds - (@a_bet+@c_bet))*b_event_chance + (@c_bet*@c_odds-(@a_bet + @b_bet))*c_event_chance\n end", "def count_contestants_by_hometown(data, hometown)\n answer_counter = 0\n data.each do |season_key, season_data|\n season_data.each_with_index do |contestant|\n contestant.each do |key, value|\n if value == hometown\n answer_counter += 1\n end\n end\n end\n end\n answer_counter\nend", "def claim_loop\n segments = []\n @eobs.each_with_index do |eob, index|\n @check_grouper.last_eob = eob\n @check = eob.check_information\n @job = @check.job\n if @check.micr_line_information && @check.micr_line_information.payer && @facility.details[:micr_line_info]\n @payer = @check.micr_line_information.payer\n else\n @payer = @check.payer\n end\n @facility_output_config = @facility.output_config(@payer.payer_type)\n @reason_codes = nil #this variable is used in child class for configurable section\n @eob = eob\n @claim = eob.claim_information\n @eob_index = index\n @services = eob.service_payment_eobs\n @is_claim_eob = (eob.category.upcase == \"CLAIM\")\n @count = count\n segments << transaction_set_line_number(index + 1)\n segments << transaction_statistics([eob])\n segments += generate_eobs\n end\n segments.flatten.compact\n end", "def run_nCOP_given_alpha selected_alpha = $alpha\n # use the given alpha\n $alpha_range = ([] << selected_alpha.to_f.round(2))\n \n # set the rest of the params\n $NUM_AVG_ITER = 1000\n $run_alpha_range = false\n \n $all_avail_genes = deep_copy_hash $all_genes\n $all_avail_pat = deep_copy_hash $all_pat\n \n # randomly withhold 15% of the patients\n $HIDE_PERCENT = 0.15\n \n exec_range_alpha\n \n # write the genes sorted by their frequency\n puts \"Writing output to: #{$OUT_DIR}#{$cancer}_results.txt\"\n genes = sort_hash($selected_genes)\n fo = File.open(\"#{$OUT_DIR}#{$cancer}_results.txt\", 'w')\n genes.each { |e| fo.puts \"#{e.ljust(10)} #{($selected_genes[e].to_f*100/$NUM_AVG_ITER).round(1)}%\" }\n puts \"Done.\"\nend", "def daily_consequences\r\n\t\t@sellers.times do |person|\r\n\t\t\trandom = rand(50)\r\n\t\t\tif random == 0\r\n\t\t\t\t@sellers -= 1\r\n\t\t\t\tputs \"*\"*50\r\n\t\t\t\tputs \"one of your sellers got arrested! You now have #{@sellers} left!\"\r\n\t\t\t\tputs \"*\"*50\r\n\t\t\tend\r\n\t\tend\r\n\t\t@thieves.times do |person|\r\n\t\t\trandom = rand(50)\r\n\t\t\tif random == 0\r\n\t\t\t\t@thieves -= 1\r\n\t\t\t\tputs \"*\"*50\r\n\t\t\t\tputs \"one of your thieves got arrested! You now have #{@thieves} left!\"\r\n\t\t\t\tputs \"*\"*50\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def operating_expenses_excluding_ccs\n fetch(:operating_expenses_excluding_ccs) do\n variable_operation_and_maintenance_costs -\n variable_operation_and_maintenance_costs_for_ccs +\n fixed_operation_and_maintenance_costs_per_year\n end\n end", "def test_cayman_islands\n end", "def count_occurrences(predicted, actual)\n correct = predicted.select do |p|\n !(p & actual).empty?\n end\n correct.count\n end", "def grouped_happening_cases(this)\n\t\t\tsession_id_list = []\n\t\t\tthis.offering_sessions.each do |os|\n\t\t\t\tsession_id_list << os.id\n\t\t\tend\n\n\t\t\tsorted_happening_cases = HappeningCase.where(happening_type: \"OfferingSession\", happening_id: session_id_list).group_by(&:date_and_time)\n\t\tend", "def average_investment_ccs\n fetch(:average_investment_ccs) { (ccs_investment || 0.0) / 2 }\n end", "def offense_counts; end", "def offense_counts; end", "def essentials(on,dc)\n # Create the essential list.\n es = []\n\n # For each cube of on, check if it is essential.\n on.each_cube do |cube|\n # Step 1: build the +cover+ (on-cube)+dc.\n # NOTE: could be done without allocating multiple covers,\n # but this is much readable this way, so kept as is as long\n # as there do not seem to be any much performance penalty.\n cover = (on-cube)+dc\n # Step 2: Gather the concensus beteen each cube of +cover+\n # and their sharp with +cube+.\n cons = Cover.new(*on.each_variable)\n cover.each_cube do |ccube|\n # Depending on the distance.\n dist = cube.distance(ccube)\n # If the distance is >1 there is no consensus.\n # Otherwise:\n if (dist == 1) then\n # The distance is 1, the consensus is computed directly.\n cons << ccube.consensus(cube)\n elsif (dist == 0)\n # The distance is 0, sharp ccube from cube and\n # compute the concensus from each resulting prime cube.\n ccube.sharp(cube).each do |scube|\n scube = scube.consensus(cube)\n cons << scube if scube\n end\n end\n end\n # Step 3: check if +cube+ is covered by cover+cons.\n # This is done by checking is the cofactor with cube\n # is not a tautology.\n unless (cons+dc).cofactor_cube(cube).is_tautology?\n # +cube+ is not covered by cover+cons, it is an essential.\n es << cube\n end\n end\n \n # Create the resulting cover.\n result = Cover.new(*on.each_variable)\n es.each { |es| result << es }\n return result\n end", "def number_of_event_commissions(login=nil)\n count_by_frbr(login, :is_commissioned_for, :how_many_events?) \n end", "def do_checks agent_page, values\n @agent_audit[\"#{agent_page}\".to_sym] = values[:expected]\n\n values[:checks].each do |sub_ques, check_value|\n if !@agent_audit[sub_ques.to_sym].nil? && !@agent_audit[sub_ques.to_sym].in?(check_value)\n increment_occurance sub_ques\n # increment_occurance agent_page # To add on to Agent Page errors\n @agent_audit[\"#{agent_page}_count\".to_sym] = @agent_audit[\"#{agent_page}_count\".to_sym] + 1\n @agent_audit[\"#{agent_page}\".to_sym] = values[:unexpected]\n @hud_count = true if values[:hud]\n end\n end\n end", "def update_annual_happiness_distributions! \n HappinessEntry.beginning_of_year_days.each do |beginning_of_year_day|\n uid = uid_for_year(beginning_of_year_day)\n end_of_year_day = beginning_of_year_day.end_of_year\n entries_for_year = HappinessEntry.in_year(beginning_of_year_day, end_of_year_day)\n update_happiness_distribution! uid, :year, entries_for_year \n end\n end", "def calculate_intra_consensus_value\n count=0\n if IntraResidueContact.all(:seq_id => self.seq_id, :first_residue=>self.original_position) || IntraResidueContact.all(:seq_id => self.seq_id, :second_residue=>self.original_position)\n count +=1\n end\n #if !Conseq.first(:aasequence_id => self.AAsequence_id).nil? && Conseq.first(:aasequence_id => self.AAsequence_id).color > 4\n if !Conseq.first(:aasequence_id => self.AAsequence_id).nil? && Conseq.first(:aasequence_id => self.AAsequence_id).score < 0\n count +=1\n end\n if !Xdet.first(:aasequence_id => self.AAsequence_id).nil? && (Xdet.first(:aasequence_id => self.AAsequence_id).correlation > 0.0 || Xdet.first(:aasequence_id => self.AAsequence_id).correlation == -2)\n count +=1\n end\n if !NewCap.first(:seq_id=> self.seq_id, :position_one => self.original_position).nil? || !NewCap.first(:seq_id=> self.seq_id, :position_two => self.original_position).nil?\n count +=1\n end\n self.contact_consensus = count /4\n puts self.contact_consensus\n self.save\n end\n \n def calculate_intra_consensus_value_special\n count=0\n #if !Conseq.first(:aasequence_id => self.AAsequence_id).nil? && Conseq.first(:aasequence_id => self.AAsequence_id).color > 4\n if !Conseq.first(:aasequence_id => self.AAsequence_id).nil? && Conseq.first(:aasequence_id => self.AAsequence_id).score < 0\n count +=1\n end\n if !Xdet.first(:aasequence_id => self.AAsequence_id).nil? && (Xdet.first(:aasequence_id => self.AAsequence_id).correlation > 0.0 || Xdet.first(:aasequence_id => self.AAsequence_id).correlation == -2)\n count +=1\n end\n if !NewCap.first(:seq_id=> self.seq_id, :position_one => self.original_position).nil? || !NewCap.first(:seq_id=> self.seq_id, :position_two => self.original_position).nil?\n count +=1\n end\n self.contact_consensus = count/3\n self.save\n puts self.contact_consensus\n end", "def enrolled_hash\n result = []\n @insurance_coverage_hash[:enrolledCoverages].each do |enrolled_coverage|\n next if ['NONE', 'EMPLOYER_SPONSORED'].include?(enrolled_coverage[:insuranceMarketType])\n if enrolled_coverage[:insuranceMarketType] == \"INDIVIDUAL_INSURANCE\" && @medicaid_hash && @medicaid_hash[:insuranceCoverage]\n # TODO: what need to be done for EMPLOYER_SPONSORED for medicaid when \"INDIVIDUAL_INSURANCE\"\n @medicaid_hash[:insuranceCoverage].each do |medicaid_coverage|\n next unless medicaid_coverage[:insuranceMarketType]\n next if ['NONE', 'EMPLOYER_SPONSORED'].include?(medicaid_coverage[:insuranceMarketType])\n next unless @medicaid_hash[:enrolledInHealthCoverageIndicator]\n result << {\n kind: Ffe::Types::BenefitsKindMapping[medicaid_coverage[:insuranceMarketType].to_sym],\n status: 'is_enrolled',\n start_on: Date.parse('2021-01-01'), # default value\n end_on: medicaid_coverage[:medicaidEndIndicator] ? medicaid_coverage[:medicaidEndDate] : nil\n }\n end\n else\n next unless enrolled_coverage[:insuranceMarketType]\n next unless Ffe::Types::BenefitsKindMapping[enrolled_coverage[:insuranceMarketType].to_sym]\n result << {\n kind: Ffe::Types::BenefitsKindMapping[enrolled_coverage[:insuranceMarketType].to_sym],\n status: 'is_enrolled',\n start_on: Date.parse('2021-01-01'), # default value\n end_on: nil\n }\n end\n end\n result\n end", "def test_acts_of_homonymy\n create_some_test_data\n assert_equal 0, @s1.acts_of_homonymy_for_ref.size \n assert_equal 1, @s5.acts_of_homonymy_for_ref.size\n assert_equal [[@ontology_classes[3], @ontology_classes[4]]], @s5.acts_of_homonymy_for_ref\n end", "def make_complaints\n puts \"Making Complaints\"\n days = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]\n 40.times do\n studnets = Student.all(limit: 40 , order: \"RANDOM()\" )\n description = Faker::Lorem.paragraphs(rand(2..8)).join('')\n reason_of_delay = Faker::Lorem.paragraphs(rand(2..8)).join('')\n expectations = Faker::Lorem.paragraphs(rand(2..8)).join('')\n date_of_alleged_event = Time.now - 10.days\n category = [1,2,3,4]\n studnets.each do |student|\n subjects = student.subjects.all(limit: 4) if student.subjects\n subjects.each do |subject|\n priority = [1,2,3]\n time = (Time.now - 4.days) + days.sample.days\n Ticket.create!(created_at: time, description: description, student_id: student.id, subject_id: subject.id, priority_id: priority.sample, date_of_alleged_event: date_of_alleged_event,\n expectations: expectations, reason_of_delay: reason_of_delay, category_id: category.sample)\n ticket = Ticket.last\n if ticket.priority.priority_name == 'high'\n due = ticket.created_at.to_date + 2.days\n ticket.update_attributes(due: due)\n elsif ticket.priority.priority_name == 'normal'\n due = ticket.created_at.to_date + 7.days\n ticket.update_attributes(due: due)\n elsif ticket.priority.priority_name == 'low'\n due = ticket.created_at.to_date + 10.days\n ticket.update_attributes(due: due)\n end\n subject_id = ticket.subject_id\n subject_staff = SubjectStaff.where(subject_id: subject_id)\n advisor_id = subject_staff.first.advisor_id\n ticket_id = ticket.id\n status = [1,2,3,4,5]\n TicketStatus.create!(status_id: status.sample,ticket_id: ticket_id, advisor_id: advisor_id )\n end\n end\n end\nend", "def contest_info\n @contest_registered_contracts = BookContestParticipant.where(:book_contest_id => @book_contest.id).select(:contract_id)\n @tkm_contest_registered_contracts = @contest_registered_contracts.where(:book_language_id => BookLanguage.find_by_bookLanguageShortName(\"TKM\").id)\n @rus_contest_registered_contracts = @contest_registered_contracts.where(:book_language_id => BookLanguage.find_by_bookLanguageShortName(\"RUS\").id)\n @eng_contest_registered_contracts = @contest_registered_contracts.where(:book_language_id => BookLanguage.find_by_bookLanguageShortName(\"ENG\").id)\n end", "def excise connected_components, gses, gsms\n excisions = 0\n connected_components.each { |c|\n print \"Connected component with #{c.length} GSEs:\\n\"\n c.each { |gse1|\n c.each { |gse2|\n next if (gse1 == gse2) or\n (gsms[gse1].length < gsms[gse2].length) or\n ! gsms[gse1].intersect?( gsms[gse2] )\n\n diff = gsms[gse1] - gsms[gse2]\n if diff.length >= @options.minimum # default: there must be at least 3 samples left\n inter = (gsms[gse1] & gsms[gse2])\n if @excisions\n if @excised[gse1] \n @excised[gse1] = (@excised[gse1] + inter)\n else\n @excised[gse1] = inter\n end\n end\n print \"gsms[#{gse1}]: #{gsms[gse1].length} -> #{diff.length}\\n\"\n if @options.verbose and @options.dictionary\n printf \"removing these GSMs from #{gse1}:\\n\"\n stringify_gsms inter\n end\n gsms[gse1] = diff\n excisions += 1\n end\n }\n }\n }\n\n print \"Number of excisions: #{excisions}\\n\"\n \n print \"\\nPairwise overlaps after excision:\\n\"\n overlapping = overlaps(gses.to_a, gsms, true)\n print \" total overlaps: #{overlapping[0]}\\n\"\n print \" nontrivial overlaps: #{overlapping[1]}\\n\"\n overlapping[1]\nend", "def classificateResult(label, sampleMap, foundAllArr)\n puts \"[classificateResult] started label #{label}\"\n foundArr = foundAllArr.select{|found| matchLabels?(found.label, label)}\n expRecognitionResult = Spnt::Exp::Data::ExpRecognitionResult.new()\n expRecognitionResult.falseNegative = []\n expRecognitionResult.falsePostive = []\n #missed = sampleArr - foundArr\n #1 step. filter that was found and transform to array\n substituted = sampleMap.select{|ekey, sample|\n if(matchLabels?( label, sample.label))\n nil == foundArr.detect{|found| sample.ekey == found.ekey && found.shouldStart != @@UNDEFINED_CELL} \n end\n }.collect { |k, v| v }\n deleted =foundArr.select{|found|\n found.foundStart == nil || found.foundStart == @@UNDEFINED_CELL \n }\n inserted =foundArr.select{|found|\n found.shouldStart == nil || found.shouldStart == @@UNDEFINED_CELL \n }\n \n puts \"[classificateResult] %s substituted: %i\" % [label, substituted.length]\n puts \"[classificateResult] %s deleted: %i\" % [label, deleted.length]\n puts \"[classificateResult] %s inserted: %i\" % [label, inserted.length]\n\n expRecognitionResult.falseNegative = (expRecognitionResult.falseNegative << substituted).flatten\n expRecognitionResult.falseNegative = (expRecognitionResult.falseNegative << deleted).flatten\n expRecognitionResult.falsePostive = (expRecognitionResult.falsePostive << inserted).flatten\n \n puts \"[classificateResult] %s falseNegative: %i\" % [label, expRecognitionResult.falseNegative.length]\n puts \"[classificateResult] %s falsePostive: %i\" % [label, expRecognitionResult.falsePostive.length]\n\n\n puts \"[classificateResult]substituted: \" + substituted.collect{|v| \" %i => %s[%s]\" % [v.id, v.ekey, v.foundStart]}.join(\"; \")\n\n# foundDuplicates = {}\n# expRecognitionResult.correct = foundArr.select{|found|\n# sample = sampleMap[found.ekey]\n# if(sample != nil && matchLabels?( label, found.label))\n# if(found.foundStart == nil)\n# #puts \"[classificateResult]falseNegative [#{found.ekey}] no start: #{sample.shouldStart} #{found.foundStart}\"\n# expRecognitionResult.falseNegative << sample\n# false\n# else\n# absStartDelta = (sample.shouldStart - found.foundStart).abs\n# absEndDelta = (sample.shouldEnd - found.foundEnd).abs\n# matched = sample.ekey == found.ekey && absStartDelta <= @@thresholdStart && absEndDelta <= @@thresholdEnd\n# if matched == true\n# foundDuplicateElement = foundDuplicates[found.ekey]\n# if foundDuplicateElement == nil\n# foundDuplicateElement = []\n# foundDuplicates[found.ekey] = foundDuplicateElement\n# end\n# foundDuplicateElement << found\n# #puts \"foundDuplicates[#{sample.ekey}] #{foundDuplicates[sample.ekey].length} #{matched && foundDuplicates[sample.ekey].length == 1}\"\n# end\n# matched && foundDuplicates[sample.ekey].length == 1\n# end\n# else\n# false\n# end\n# }\n #expRecognitionResult.falsePostive = foundArr.select{|found| !expRecognitionResult.correct.include?(found) && !expRecognitionResult.falseNegative.include?(found)}\n# expRecognitionResult.correct = foundArr.select{|found|\n# expRecognitionResult.falsePostive.include?(found) && expRecognitionResult.falseNegative.include?(found)\n# }\n expRecognitionResult.correct = foundArr.to_set - expRecognitionResult.falsePostive.to_set - expRecognitionResult.falseNegative.to_set;\n puts \"falsePostive[#{expRecognitionResult.falsePostive.length}] + falseNegative[#{expRecognitionResult.falseNegative.length}]+correct[#{expRecognitionResult.correct.length}] = foundArr[#{foundArr.length}]\"\n expRecognitionResult\n end", "def refactoring_reduction_profile events\n events.group_by(&:method_name)\n .map {|_,e| percent_reduction(e) }\n .freq_by {|e| (e * 100 / 10).to_i }\nend", "def eob_count\r\n count = count_of_insurance_eobs\r\n if count == 0\r\n count = count_of_patpay_eobs\r\n end\r\n count\r\n end", "def apply_exam\n @companies = Company.all\n @placement_news = PlacementNews.all\n end", "def claim_loop\n segments = []\n eobs.each_with_index do |eob, index|\n Output835.log.info \"\\n\\n Check number #{eob.check_information.check_number} undergoing processing\"\n Output835.log.info \"\\n\\n Check has #{eob.check_information.insurance_payment_eobs.length} eobs\"\n segments << transaction_set_line_number(index + 1)\n segments << transaction_statistics([eob])\n eob_klass = Output835.class_for(\"SingleStEob\", facility)\n eob_obj = eob_klass.new(eob, facility, payer, index, @element_seperator, @check_num,count(eob)) if eob\n Output835.log.info \"Applying class #{eob_klass}\" if index == 0\n segments += eob_obj.generate\n end\n segments = segments.flatten.compact\n segments unless segments.blank?\n end", "def test_08c\n Rate.find_all_by_price_id(1).each {|r| r.update_attribute :monthly_rate, 0.0}\n Charges.new(Date.new(2011,05,10),\n Date.new(2011,06,10),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 3, charges.size\n\n assert_equal 2, charges[0].season_id\n assert_in_delta 3.143, charges[0].period.to_f, 0.005\n assert_equal 90.0, charges[0].rate.to_f\n assert_in_delta 282.86, charges[0].amount.to_f, 0.005\n assert_equal Charge::WEEK, charges[0].charge_units\n\n assert_equal 3, charges[1].season_id\n assert_in_delta 0.857, charges[1].period.to_f, 0.005\n assert_equal 189.0, charges[1].rate.to_f\n assert_in_delta 162.00, charges[1].amount.to_f, 0.005\n assert_equal Charge::WEEK, charges[1].charge_units\n\n assert_equal 3, charges[2].season_id\n assert_in_delta 3.0, charges[2].period.to_f, 0.005\n assert_equal 31.5, charges[2].rate.to_f\n assert_in_delta 94.5, charges[2].amount.to_f, 0.005\n assert_equal Charge::DAY, charges[2].charge_units\n end", "def open_occurrences(days_out = 90, date_start = Time.zone.now)\n schedule = IceCube::Schedule.new(date_start)\n date_end = date_start + days_out.days\n\n # add a recurrence for each business day\n business_days.each do |bd|\n day = bd.name.downcase.to_sym\n schedule.add_recurrence_rule IceCube::Rule.weekly.day(day)\n end\n\n return schedule.occurrences(date_end)\n end", "def attendance_statistics\n # retrieves courses which are supervised by the course coordinator\n @courses = current_staff.courses\n # used to display how many student attended out of enrolled students\n @num_of_students_enrolled = {}\n # initiliasing hashes to gather neccessary information\n @practicals_on_specific_weeks = {}\n @attendance_statistics = {}\n \n # groupping the past practicals for each course by weeks\n @courses.each do |course|\n # retrieves the number of students enrolled to the course\n @num_of_students_enrolled[course.course_title] = course.enrolments.count\n # retrives the week number from the start_time of the first practical\n week_number = course.practicals.first.start_time.strftime(\"%U\").to_i\n @practicals_on_specific_weeks[course.course_title] = [[]]\n index = 0\n course.practicals.where(\"end_time < ?\", DateTime.now).each do |practical|\n # moving to the next array element when the week number of the current practical\n # is not equal to the week number of the previous one\n if practical.start_time.strftime(\"%U\").to_i != week_number\n week_number = practical.start_time.strftime(\"%U\").to_i\n index += 1\n @practicals_on_specific_weeks[course.course_title][index] = []\n end\n @practicals_on_specific_weeks[course.course_title][index] << practical\n end\n end\n \n # calculates how many student attended the practicals during the week\n @courses.each do |course|\n @attendance_statistics[course.course_title] = Array.new(@practicals_on_specific_weeks[course.course_title].count, 0)\n @practicals_on_specific_weeks[course.course_title].each_with_index do |practicals_on_same_week, index|\n practicals_on_same_week.each do |practical|\n @attendance_statistics[course.course_title][index] += practical.attendances.count\n end\n end\n end\n end", "def add_samples( no_samples, from_qc_inspection_test )\n max_old_sample = from_qc_inspection_test.qc_results.find(:first, :select => 'sample_no', :order => 'sample_no DESC').sample_no\n\n self.qc_inspection_tests.each do |qc_inspection_test|\n inspection_type_test = qc_inspection_test.qc_inspection_type_test\n next if inspection_type_test.cull_test # Doesn't apply to cull tests.\n\n no_samples.times do |cnt|\n qc_result = QcResult.new( :qc_test_id => inspection_type_test.qc_test_id, :sample_no => max_old_sample + cnt + 1)\n if qc_inspection_test.qc_results << qc_result\n inspection_type_test.qc_test.qc_measurement_types.each do |qc_measurement_type|\n qc_result_measurement = QcResultMeasurement.new( :qc_measurement_type_id => qc_measurement_type.id, :sample_no => max_old_sample + cnt + 1)\n ['qc_measurement_code', 'qc_measurement_description', 'test_uom', 'test_criteria',\n #'test_method', 'measurement', 'annotation_1', 'annotation_2', 'annotation_3'\n 'test_method'\n ].each {|a| qc_result_measurement.send(a+'=', qc_measurement_type.attributes[a]) }\n\n unless qc_result.qc_result_measurements << qc_result_measurement\n qc_result_measurement.errors.each_full do |msg|\n errors.add_to_base \"QC Result Measurement: #{msg}\"\n end\n raise \"Unable to add measurement for extra sample: #{self.errors.full_messages.to_s}\"\n end\n end\n else\n qc_result.errors.each_full do |msg|\n errors.add_to_base \"QC Result: #{msg}\"\n end\n raise \"Unable to add result for extra sample: #{self.errors.full_messages.to_s}\"\n end\n end\n end\n from_qc_inspection_test.qc_results.find(:all, :conditions => \"sample_no > #{max_old_sample}\", :order => 'sample_no')\n end", "def init_baseline\n @predicted = {}\n Oracle.mcrae_raw.each_pair do |category,exemplars|\n @predicted[category] = []\n exemplars.each_pair do |word,freq|\n @predicted[category].push [word,freq]\n end\n @predicted[category] = @predicted[category].sort { |a,b| b[1] <=> a[1] }[0..9].map { |x| x[0] }\n end\n @debug = false\n @cosines = Cosine.new(File.join(@datapath,\"cosine_wordmap.yaml\"),File.join(@datapath,\"cosine_matrix.yaml\"))\n end", "def create_staff_association_work_orders\n ['seas', 'leas', 'elementary', 'middle', 'high'].each{|type|\n create_staff_at_ed_org_work_orders(type)\n }\n create_staff_cohort_associations\n end", "def publish_test_results(test_category, test_phase, test_suite_result_list)\n ReportLog.entering(@@class_name, __method__.to_s)\n\n test_suite_result_list.each do |test_suite_result|\n test_suite_name = test_suite_result['TestSuiteName']\n test_count = test_suite_result['TestCount'].to_i\n error_count = test_suite_result['ErrorCount'].to_i\n failure_count = test_suite_result['FailureCount'].to_i\n\n pass_rate = 1 - (error_count.to_f + failure_count.to_f)/test_count.to_f\n\n input = Hash.new\n input[:RTCConfig] = data_for(:RTC_config)\n\n if pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:minor_threshold])\n # pass rate standard not met, create or update existing defect\n if pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:blocker_threshold])\n defect_severity = Constants::RTC_SEVERITY_BLOCKER\n elsif pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:major_threshold])\n defect_severity = Constants::RTC_SEVERITY_MAJOR\n elsif pass_rate < get_threshold_value(data_for(:RTC_defect_threshold)[:normal_threshold])\n defect_severity = Constants::RTC_SEVERITY_NORMAL\n else\n defect_severity = Constants::RTC_SEVERITY_MINOR\n end\n\n # Check from the TEST DB whether there is already an open defect for this test suite\n # if yes, update it\n # if no, create a new one\n\n # set up RTC client and run /getOpenTestAutoDefect API\n ReportLog.info('Pass rate beneath standard. Update existing open defect or create a new one.')\n ReportLog.info(\"Looking for open defect for test suite #{test_suite_name} ...\")\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getOpenTestAutoDefect])\n @payload = JSON.generate(input)\n @params = Hash.new\n @params[Constants::PARAM_TEST_SUITE_NAME] = test_suite_name\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n @params = Hash.new\n @params[Constants::PARAM_TEST_CATEGORY] = test_category\n @params[Constants::PARAM_TEST_PHASE] = test_phase\n @params[Constants::PARAM_DEFECT_SEVERITY] = defect_severity\n input['TestSuiteResult'] = test_suite_result\n @payload = JSON.generate(input)\n if rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).nil?\n # no existing open defect, create a new one\n ReportLog.info('Open defect not found. Creating a new one...')\n # set up RTC client and run /createTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_createTestAutoDefect])\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_POST, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Created a new defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n else\n # existing open defect found, update it\n ReportLog.info('Open defect found. Updating its content...')\n # set up RTC client and run /updateTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_updateTestAutoDefect])\n @params[Constants::PARAM_DEFECT_NUM] = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Defect Number').to_s\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_POST, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Updated the open defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n else\n raise construct_api_failure_msg(rtc_client)\n end\n else\n # pass rate reached standard, close open defect automatically\n # Check from the TEST DB whether there is already an open defect for this test suite\n # if yes, close it\n # if no, do nothing, you are good\n\n # set up RTC client for /getOpenTestAutoDefect API\n ReportLog.info('Pass rate reached standard. Close open defect if there is any.')\n ReportLog.info(\"Looking for open defect for test suite #{test_suite_name} ...\")\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_getOpenTestAutoDefect])\n @payload = JSON.generate(input)\n @params = Hash.new\n @params[Constants::PARAM_TEST_SUITE_NAME] = test_suite_name\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n @params = Hash.new\n if rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).nil?\n # do nothing\n else\n # existing open defect found, close it\n ReportLog.info('Open defect found. Closing it...')\n # set up RTC client and run /closeTestAutoDefect API\n @api = RTCClientRestAPI.new(data_for(:RTC_client_api_url)[:RTC_REST_URL_closeTestAutoDefect])\n @params[Constants::PARAM_DEFECT_NUM] = rtc_client.response_body.fetch(Constants::JSON_KEY_RESULT).fetch('Defect Number').to_s\n @params[Constants::PARAM_COMMENT] = \"Closed defect upon test execution at #{test_suite_result['ExecutionTimestamp']} \"\n + \"from build #{test_suite_result['Build']['BuildName']} \"\n + \"with an acceptable pass rate of #{pass_rate}.\"\n @params[Constants::PARAM_BUILD_NAME] = test_suite_result['Build']['BuildName']\n rtc_client = RTCRestClient.new(Constants::REST_TYPE_PUT, @api, @params, @payload)\n rtc_client.run_api\n if rtc_client.run_successfully\n ReportLog.info('Closed the open defect.')\n ReportLog.info(\"RTC client response: #{rtc_client.response_body.to_s}\")\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n else\n raise construct_api_failure_msg(rtc_client)\n end\n end\n end\n ReportLog.exiting(@@class_name, __method__.to_s)\n end", "def testCoverage4\n\t text1 = [\"He played the guitar.\"] \n text2 = [\"He played the flute.\"] \n text3 = [\"This is funny.\"]\n\t subm_text = Array.new\n subm_text << text1\n subm_text << text2\n subm_text << text3\n \n #setting up sentences and similarities before generation of clusters\n subm_sents = Array.new #Sentence[] s = new Sentence[2]; \n g = GraphGenerator.new\n g.generate_graph(subm_text[0], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(0, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[1], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(1, g.vertices, g.edges, g.num_vertices, g.num_edges)\n g.generate_graph(subm_text[2], pos_tagger, core_NLP_tagger, false, false)\n subm_sents << Sentence.new(2, g.vertices, g.edges, g.num_vertices, g.num_edges)\n \n\t #calculating sentence similarity\n ssim = SentenceSimilarity.new\n #sentence similarity\n sent_sim = ssim.get_sentence_similarity(pos_tagger, subm_sents, speller)\n sent_list = ssim.sim_list\n sim_threshold = ssim.sim_threshold\n \n topic = Array.new\n topic << subm_sents[0]\n sentsToCover = Array.new\n sentsToCover << subm_sents[0]\n sentsToCover << subm_sents[1]\n sentsToCover << subm_sents[2]\n\t \n #identifying topic sentences\n tsent = TopicSentenceIdentification.new\n result = tsent.coverage(topic, 1, sentsToCover, sent_sim, 3)\n assert_equal(true, result)\n \n #change in sentence covered state\n assert_equal(true, subm_sents[0].flag_covered)\n assert_equal(true, subm_sents[1].flag_covered)\n assert_equal(false, subm_sents[2].flag_covered)\n end", "def ab_counts(_experiment, _alternative)\n raise \"Not implemented\"\n end", "def gcThree #average gc 3 values for seqs\n freqs = Array.new\n self.codons.each{ | eachRow |\n gcCount = 0\n codonCount = 0\n eachRow.each{ |eachCodon |\n if ! (eachCodon.include?(\"N\") or eachCodon.include?(\"-\"))\n codonCount += 1\n if eachCodon[2,1] =~ /[GC]/\n gcCount += 1\n end\n end\n }\n\n if codonCount != 0\n freqs << gcCount.to_f / codonCount\n end\n }\n\n\n return freqs.sampleMean\n end", "def construct_initial_clusters\n timer = Array.new(4, 0)\n startg = Time.now\n\n @documents.each do |document|\n start = Time.now\n # get the appeared items in the document\n present_freq_items = document.doc_vector.get_present_items(true)\n timer[0] += (Time.now - start)\n\n start = Time.now\n covered_clusters = Clusters.new\n # get all clusters that can cover this doc\n @cluster_warehouse.find_covered_clusters(present_freq_items, covered_clusters)\n timer[1] += (Time.now - start)\n\n start = Time.now\n # assign doc to all the covered clusters\n assign_doc_to_clusters(document, covered_clusters)\n timer[2] += (Time.now - start)\n end\n\n timer[3] = (Time.now - startg)\n puts \"duration: #{timer}\" if Configuration.debug\n end", "def consolidate_count_positions\n\t\tconsolidate = {}\n\t\tMeasureChangeDenomination.all.each do |measure_change_denomination|\n\t\t\tconsolidate[measure_change_denomination.measure_change_type_id] = {:name => measure_change_denomination.measure_change_type.name,:denominations => {}} if !consolidate.has_key?(measure_change_denomination.measure_change_type_id)\n\t\t\tconsolidate[measure_change_denomination.measure_change_type_id][:denominations][measure_change_denomination.id] = {:total_amount => 0,:quantity => 0,:name => measure_change_denomination.name}\n\t\tend\n\t\tcash_bank_cash_count_positions.each do |cash_bank_cash_count_position|\n\t\t\tmeasure_change_type_id = cash_bank_cash_count_position.measure_change_denomination.measure_change_type_id\n\t\t\tmeasure_change_denomination_id = cash_bank_cash_count_position.measure_change_denomination_id\n\t\t\tif consolidate[measure_change_type_id][:denominations].has_key?(measure_change_denomination_id)\n\t\t\t\tconsolidate[measure_change_type_id][:denominations][measure_change_denomination_id][:total_amount] += cash_bank_cash_count_position.total_amount\n\t\t\t\tconsolidate[measure_change_type_id][:denominations][measure_change_denomination_id][:quantity] += cash_bank_cash_count_position.quantity\n#\t\t\telse\n#\t\t\t\tconsolidate[measure_change_type_id][:denominations][measure_change_denomination_id] = {}\n#\t\t\t\tconsolidate[measure_change_type_id][:denominations][measure_change_denomination_id][:total_amount] = cash_bank_cash_count_position.total_amount\n#\t\t\t\tconsolidate[measure_change_type_id][:denominations][measure_change_denomination_id][:quantity] = cash_bank_cash_count_position.quantity\n#\t\t\t\tconsolidate[measure_change_type_id][:denominations][measure_change_denomination_id][:name] = cash_bank_cash_count_position.measure_change_denomination.name\n\t\t\tend\n\t\tend\n\t\tconsolidate\n\tend", "def count_contestants_by_hometown(data, hometown)\n count_of_contestants_from_hometown = 0\n data.each do |season_in_hash, contestant_array|\n contestant_array.each do |contestant|\n if contestant[\"hometown\"] == hometown\n count_of_contestants_from_hometown += 1\n end\n end\n end\n count_of_contestants_from_hometown\nend", "def run_average_case\n user = User.find(1)\n timetable = user.timetables[1]\n timetable.subjects = user.subjects.ids.sample(10)\n\n p \">>>>>>> Running Average Case for Population Size\"\n run_for_population_size(timetable)\n # p \">>>>>>> Running Average Case for Generations\"\n # run_for_generations(timetable)\n\n # tp all_runs.map { |x| x[:chromosomes] }\n #p all_runs.map(&:fitness).inject(0, :+) / all_runs.size\n #tp all_runs[0].data.collect {|x| x.subject }\n end", "def ecdfs_per_spending_bucket_for_aggregate_card_preses quantile_count, aggregate_card_preses\n card_present_ratios_for_each_spending_bucket(aggregate_card_preses).map do |spending_bucket|\n ecdf(quantile_count, spending_bucket.sort!)\n end\nend", "def decisions\n\t\t@empresa = getMyEnterpriseAPP\n\n\t\tif !@empresa.nil?\n\t\t\t@dims = [DIM_DEC_1, DIM_DEC_2, DIM_DEC_3, DIM_DEC_4, DIM_DEC_5, DIM_DEC_6]\n\t\t\t# ES: Envia las genericas ordenadas por dimension, para realizar el agrupamiento:\n\t\t\t# EN: # Send the generic decisions, sorted by dimension, to perform a grouping:\n\t\t\t@genericas = GovernanceDecision.where(\"decision_type = ? AND enterprise_id = ?\", GENERIC_TYPE, @empresa.id).order(dimension: :asc)\n\t\t\t# ES: Envia las especificas ordenadas por su padre, para realizar el agrupamiento:\n\t\t\t# EN: # Send the generic decisions, sorted by its father, to perform a grouping\n\t\t @genericas.size == 0 ? @tieneDecisiones = false : @tieneDecisiones = true\n\t\t @especificas = GovernanceDecision.where(\"decision_type = ? AND enterprise_id = ?\", SPECIFIC_TYPE, @empresa.id).order(parent_id: :asc)\n\t\telse\n\t\t\tredirect_to main_app.root_url, :alert => 'ERROR: Enterprise not found. Select one from the initial menu'\n\t\tend\n\tend", "def hypothesis5(countsXmajor) \n\tcriteria = 0\n\tphotoeuks = 0\n\tnonPhotoeuks = 0\n\tphotoeuks += 1 if countsXmajor['Sr'] >= 0.25\n\tphotoeuks += 1 if countsXmajor['Pl'] >= 0.25\n\tphotoeuks += 1 if countsXmajor['EE'] >= 0.25\n\tnonPhotoeuks += 1 if countsXmajor['Op'] >= 0.25\n\tnonPhotoeuks += 1 if countsXmajor['Am'] >= 0.25\n\tnonPhotoeuks += 1 if countsXmajor['Ex'] >= 0.25\t\t\n\tcriteria += 1 if countsXmajor['Ba'] >= 0\n\tcriteria += 1 if countsXmajor['Za'] < 0.25\n\tcriteria += 1 if photoeuks == 3\n\tcriteria += 1 if nonPhotoeuks == 0\n\tif criteria == 4\n\t\treturn 1\n\telse\n\t\treturn 0 \n\tend\nend", "def score(options = {})\n count = 0;\n \n assignations = options[:assignations]\n \n if assignations.blank?\n assignations = self.assignation_array()\n end\n\n assignations.each do |a|\n #ATTENTION: we skip learnphase assignations!\n if a.test.test_learnphase? \n next\n end\n \n count+=1 if a.passed?\n end\n count\n end" ]
[ "0.6667795", "0.6657743", "0.64520264", "0.6071771", "0.5657711", "0.5128094", "0.5081924", "0.50161386", "0.5003963", "0.49939463", "0.49630982", "0.4942076", "0.4942076", "0.4942076", "0.49415475", "0.49330622", "0.4888488", "0.48785657", "0.48690873", "0.4866526", "0.48584947", "0.48545527", "0.48389256", "0.48154286", "0.48071516", "0.4783785", "0.4777084", "0.4773944", "0.4772485", "0.47679394", "0.47561666", "0.475351", "0.47482347", "0.47408223", "0.47402504", "0.47301075", "0.47284076", "0.47269014", "0.47196257", "0.47019598", "0.47006616", "0.46999553", "0.4695416", "0.46946868", "0.4692404", "0.46878925", "0.46857375", "0.4676578", "0.46747807", "0.4673737", "0.46722788", "0.4671237", "0.46631247", "0.46595752", "0.46507612", "0.46487176", "0.4643773", "0.46408623", "0.46392635", "0.46363845", "0.46281102", "0.46239957", "0.4617248", "0.45987207", "0.45986837", "0.45816985", "0.45816985", "0.45736828", "0.4570424", "0.4564298", "0.45594943", "0.45510334", "0.45504403", "0.45489836", "0.45474005", "0.45439982", "0.4538522", "0.4537841", "0.45182836", "0.45163268", "0.45137176", "0.4513149", "0.45120648", "0.4508026", "0.45080027", "0.45009276", "0.44995904", "0.44991192", "0.44983274", "0.4497509", "0.44933835", "0.44904393", "0.44895622", "0.4487316", "0.44853377", "0.44811946", "0.44805485", "0.44773775", "0.447619", "0.44748405" ]
0.66651464
1
Verifies occasions match test data
def verify_occasions(test_data) occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}] occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def verify_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[UseOfCollections::OCCASION.name], element_value(occasion_input index)) }\n end", "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def test_csv_table_match(subject)\n # Compare the fields\n if !subject.empty?\n subject_fields = subject[0].keys\n master_fields = @golden_master.headers\n\n if subject_fields.count != master_fields.count\n throw_no_match \"Expected #{master_fields.count} field(s), got #{subject_fields.count}\"\n end\n\n master_fields.each_with_index do |column, index|\n if column != subject_fields[index]\n throw_no_match \"Expected field \\\"#{column}\\\", got field \\\"#{subject_fields[index]}\\\"\"\n end\n end\n end\n\n # Compare the number of records\n subject_record_count = subject.count\n master_record_count = @golden_master.inject(0){|count| count += 1}\n if subject_record_count != master_record_count\n throw_no_match \"Expected #{master_record_count} record(s), got #{subject_record_count}\"\n end\n\n # Compare the values of the golden master with the subject\n current_row = 0\n @golden_master.each do |row|\n row.each do |field, master_string|\n subject_value = subject[current_row][field]\n if !match_values?(master_string, subject_value)\n throw_no_match \"Field \\\"#{field}\\\", Record #{current_row + 1}: Expected value #{master_string.nil? ? '<NULL>' : \"\\\"#{master_string}\\\"\"}, got #{subject_value.nil? ? '<NULL>' : \"\\\"#{subject_value}\\\"\"}\"\n end\n end\n current_row += 1\n end\n end", "def verify_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def test_idempotency_validation\n FootballData::Scrape.get_team_year(1, '1999-2000')\n assert_equal FootballData::RawGame.count, @count\n end", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def assert_valid\n @validator = validator\n assert @validator.validate(data_sample, fail_fast: true)\n assert @validator.validate(data_sample, fail_fast: false)\n end", "def assert_equal_station station, sample_station\n if station.instance_of?(Station) && sample_station.instance_of?(Station)\n return assert(station.abbreviation == sample_station.abbreviation && station.est.include_all?(sample_station.est), \"Estimates should be equal\")\n end\n false\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def test_standard_credit_results\n @standard_credit_Value.each { |key, value| assert_in_delta @calc_standard[@row_number][key], value, 0.03 }\n check_count @calc_standard\n end", "def test_annuity_credit_results\n @annuity_credit_Value.each { |key, value| assert_in_delta @calc_annuity[@row_number][key], value, 0.03 }\n check_count @calc_annuity\n end", "def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data record! -- sample #{id}\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[0]} --\", \"#{dose_unit_text(values[values.keys[0]])}/day,\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[1]} --\", \"#{dose_unit_text(values[values.keys[1]])}/day.\", \"|\"]\n puts \"%s%7s\" % [\"| Sample #{id} will not include in the analysis!\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n data.delete(id)\n end\n end\n data\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def check_solution(test_number, array, expected)\n actual = find_peaks(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def test_contains_13_eachsuit\n assert true == false\n end", "def test_check_good_time\n assert_output '' do\n time = '1553188611.560418000'\n prev_time = '1553188612.100418000'\n line_num = 0\n @verify.check_time(time, prev_time, line_num)\n end\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def pass?\n expected_array.size == actual_array.size &&\n [expected_array, actual_array].transpose.all? do |expected_element, actual_value|\n expected_element.match_against_actual_value(actual_value)\n end\n end", "def validate_same_number_of_sts_in_p_and_f(asp_w_f_sts)\n p_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[0].count('@') }\n f_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[1].count('@') }\n if p_st_count != f_st_count\n if debug\n puts asp_w_f_sts.ai(indent: -2)\n puts \"\\n\\n\\n\\n\"\n puts \"mismatches:\".color(:red)\n asp_w_f_sts.each { |(primary,foreign,conf)|\n pr_st_count = primary.count('@')\n fo_st_count = foreign.count('@')\n if pr_st_count != fo_st_count\n puts '-' * 10\n p primary\n puts \"pr_st_count: #{ pr_st_count }\"\n p foreign\n puts \"fo_st_count: #{ fo_st_count }\"\n puts \"conf: #{ conf.inspect }\"\n end\n }\n end\n raise \"Mismatch in subtitle counts: primary has #{ p_st_count } and foreign has #{ f_st_count }\"\n end\n true\n end", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def test_cards_are_unique\n #build a fresh deck to test\n\t @testDeck = Card.find(:all)\n\t \n\t $i=0\n\t while $i < @testDeck.count do\n\t\t$k=0\n\t \twhile $k < @testDeck.count do\n\t\t\tif @testDeck[$i].value == @testDeck[$k].value && @testDeck[$i].suit == @testDeck[$k].suit && $i!=$k\n\t\t\t\tassert false, \"A double card has been found\"\n\t\t\telse\n\t\t\t\tassert true\n\t\t\tend #end if\n\t\t\t$k+=1\n\t\tend #end inner loop\n\t\t$i+=1\n\t end #end outer loop\n end", "def compare_tests(test_a, test_b); end", "def compare_tests(test_a, test_b); end", "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def verify(event_data)\n true\n end", "def verify_staff(test_data)\n staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def test\n\t\t##\n\t\t# Possible outcomes for each test. Do all tests and count the outcome\n\t\t##\n\t\twinLoss = {win: 0, loss: 0, sorted: 0, unsorted: 0}\n\t\t@xData[:test].each{|test|\n\t\t\t#Get the truth\n\t\t\tsorted \t\t= test.sort{|a,b| a <=> b}\n\t\t\t#Take an educated guess\n\t\t\tprediction\t= @machine.run(test).first.round\n\t\t\t##\n\t\t\t# Record outcomes\n\t\t\t##\n\t\t\t#If it is classed as sorted and is sorted\n\t\t\tif prediction == 1 && test == sorted \n\t\t\t\twinLoss[:win] \t\t+= 1\n\t\t\t\twinLoss[:sorted]\t+= 1\n\t\t\t#If it's classed as unsorted and is unsorted\n\t\t\telsif prediction == 0 && test != sorted\n\t\t\t\twinLoss[:win] \t\t+= 1\n\t\t\t\twinLoss[:unsorted]\t+= 1\n\t\t\t#A loos. You've broke something somewhere (probably)\n\t\t\telse\n\t\t\t\twinLoss[:loss] \t\t+= 1\n\t\t\tend\n\t\t}\n\t\t#Print the results\n\t\tputs \"Iterations: #{@iterations}\\nMAX_MSE: #{@maxError}\\n\\t#{winLoss}\" # proof\n\tend", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def test_any_chance_of_working \n assert_equal(true, credit_cards(:cc_no_statuses_live).any_chance_of_working?)\n assert_equal(true, credit_cards(:cc_no_statuses_live).any_chance_of_working?(true))\n\n assert_equal(false, credit_cards(:cc_no_statuses_expired).any_chance_of_working?)\n assert_equal(true, credit_cards(:cc_no_statuses_expired).any_chance_of_working?(true))\n\n assert_equal(false, credit_cards(:cc_one_status_expired).any_chance_of_working?)\n assert_equal(true, credit_cards(:cc_one_status_expired).any_chance_of_working?(true))\n\n assert_equal(false, credit_cards(:cc_one_status_expired).any_chance_of_working?)\n assert_equal(true, credit_cards(:cc_one_status_expired).any_chance_of_working?(true))\n\n assert_equal(true, credit_cards(:cc_one_status_gateway).any_chance_of_working?)\n assert_equal(true, credit_cards(:cc_one_status_gateway).any_chance_of_working?(true))\n\n assert_equal(false, credit_cards(:cc_one_status_addrnomatch).any_chance_of_working?)\n assert_equal(false, credit_cards(:cc_one_status_addrnomatch).any_chance_of_working?(true))\n \n end", "def check_matchness(aa_sequence_hash,nt_sequence_hash)\n missing_nt_sequence = Array.new\n aa_sequence_hash.each do |defi, seq|\n if nt_sequence_hash[defi].nil? \n # miss that stuff\n missing_nt_sequence << defi\n end\n end\n\n missing_aa_sequence = Array.new\n nt_sequence_hash.each do |defi, seq|\n if aa_sequence_hash[defi].nil?\n missing_aa_sequence << defi\n end\n end\n\n\n return missing_aa_sequence, missing_nt_sequence\n end", "def test_prev_hash_correct_true\n assert @bv.prev_hash_correct?(0, \"abcd\", \"abcd\")\n end", "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def disjoint_test\n\t\treturnValue = true\n\t\t@production_rules.each_key do |non_term|\n\t\t\tpredict_sets = predict_sets(non_term)\n\t\t\tpredict_sets.each_index do |index|\n\t\t\t\tfor sercond_index in (index+1)..(predict_sets.length-1)\n\t\t\t\t\tif(predict_sets[index] & predict_sets[sercond_index] != [])\n\t\t\t\t\t\t#predict sets overlap, return false\n\t\t\t\t\t\tprint \"Predict sets of #{non_term} overlap. Rule #{index} and #{sercond_index}\\n\"\n\t\t\t\t\t\treturnValue = false\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn returnValue\n\tend", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def test_response_valid_in_this_phase\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n #resubmission_time3 after the response time\n #but it is after the current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def test_truth\n end", "def test_a_longer_matching_ticket_returns_false_if_matches_less_than_three\n\t\t\tmy_ticket = \"4577\"\n\t\t\twinning_tickets = [\"4577\",\"1234\"]\n\t\t\tassert_equal(winning_tickets, find_winners(my_ticket, winning_tickets))\n\tend", "def validate(parsed_data)\n graph_name = load_data parsed_data\n \n begin \n results = @tests.map do |test|\n run_test(test, graph_name)\n end\n ensure\n clear_graph graph_name\n end\n\n # Remove empty results\n results.flatten.reject(&:empty?)\n end", "def test_recognize_successfully_cracked\n\t\tguess = 'axel'\n\t\ttarget = Digest::MD5.hexdigest(guess)\n\n\t\tassert @pass_cracker.successfully_cracked?(guess, target)\n\tend", "def test_contains_four_eachface\n assert true == false\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_compare_many\n result = @comparer.compare @first_doc, @second_doc\n\n #assert_equal result >= 0, true\n #assert_equal result <= 1, true\n\n results = Array.new(@documents.length) { Array.new(@documents.length, 0) }\n\n @dest = SheetDestination.new $test_results_dir + \"/loaded(#{@doc_count})_compare-documents(#{@compare_count}).ods\"\n\n @documents.length.times { |i|\n @documents.length.times { |j|\n puts \"comapre #{i} with #{j}\" if j % 10 == 0\n\n results[i][j] = @comparer.compare @documents[i], @documents[j]\n\n @dest.write results[i][j], i, j\n\n break if j + 1 >= @compare_count\n }\n\n break if i + 1 >= @compare_count\n }\n\n @dest.save\n dest = SheetDestination.new $test_results_dir + '/tdm.ods'\n dest.write_tdm @documents\n\n end", "def refute_valid\n @validator = validator\n refute @validator.validate(data_sample, fail_fast: true)\n refute @validator.validate(data_sample, fail_fast: false)\n end", "def verify_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def is_correct_data?(data, *expected_keys)\n return false until contains_expected_keys?(data, *expected_keys)\n filter_keys(data, *expected_keys)\n data.each do |key, value|\n return false until correct_type?(key, value)\n end\n data.each do |key, value|\n return false until corresponds_to_constraint?(key, value)\n end\n return true\nend", "def point_match(point, nominal)\n point[0].should be_within(0.01).of(nominal[0])\n point[1].should eq nominal[1]\nend", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend", "def test_e121_point_distance\n (1..30).each {#Idempotence verification\n verify_method :e121_point_distance,\n :with => [{\n param: 2,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(2, points_pairs, shortest)\n }},\n {\n param: 3,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(3, points_pairs, shortest) }\n },\n {\n param: 5,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(5, points_pairs, shortest) }\n },\n {\n param: 9,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(9, points_pairs, shortest) }\n },\n {\n param: 30,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(30, points_pairs, shortest) }\n }]\n }\n end", "def test_states_on_examples\n assert_equal(4,@small_dfa.states.size)\n assert_equal(4,@small_nfa.states.size)\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def invisible_testSuccess(c, ci, cv, state)\n @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == c and terms[1] == ci}\nend", "def consistency_checks\n unless certificate_serial_number == voucher_serial_number\n error_report << \"serial number mismatch certificate '#{certificate_serial_number}' vs '#{voucher_serial_number}'\"\n return false\n end\n # other tests here.\n return true\n end", "def valid?\n tally = Hash.new(0)\n tally[:xxx] = 1\n \n 5.times do |u|\n 5.times do |h|\n if !@solution[h][u].nil?\n tally[@solution[h][u]] += 1\n end\n end\n return true if tally.values.max < 2\n end\n puts \"invalid: #{tally.inspect}\"\n puts self.to_s\n return false\n end", "def passed_test?(event)\n event['event'] == 'test' && event['status'] == 'pass'\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def compare_result(test, result)\n if @per_test_insert\n expected = translate_column_names(test['expected'])\n else\n expected = test['expected']\n end\n expected.each do |key, value|\n if value == 'ignore'\n next\n end\n\n if !compare_values(value, result[key])\n @num_fails += 1\n @failed_tests.push(test['name'])\n\n puts \" Expected: \\\"#{key}\\\": #{value}\"\n puts \" Result: \\\"#{key}\\\": #{result[key]}\"\n puts \" Status: Failed\"\n return\n end\n end\n\n @num_successes += 1\n puts \" Status: Passed\"\n end", "def compare_product_tests(test1, test2)\n # compare relevant details\n test1.save\n test2.save\n assert_performed_jobs 2\n\n test1.reload\n test2.reload\n compare_results(test1, test2)\n\n # compare records\n test1.patients.each_index do |x|\n patient1 = test1.patients.fetch(x)\n patient2 = test2.patients.fetch(x)\n compare_records(patient1, patient2)\n end\n end", "def testa_comparacao_entre_dinheiro\n COMPARACAO.each { |comparacao| assert comparacao }\n end", "def exact_matches\n matches = 0\n 4.times{ |x| matches += 1 if @num_guess[x] == @code[x] }\n matches\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def verify_owamp(data, extended=false)\n\n errors = []\n failed = false\n if data.has_key? :local\n directions = [:local, :remote]\n else\n directions = [\"local\", \"remote\"]\n end\n directions.each do |direction|\n if data.has_key? direction\n begin\n if data[direction][:max].to_f > 15 \n errors << \"#{direction}: Max RTT over 15ms\"\n failed = true\n end\n if data[direction][:jitter].to_f > 10\n errors << \"#{direction}: Jitter over 10 ms\"\n failed = true\n end\n if data[direction][:loss].to_f > 0.5\n errors << \"#{direction}: Packet loss over 0.5%\"\n failed = true\n end\n rescue\n errors << \"An unhanded exception occured\"\n failed = true\n end\n else\n errors << \"No data found for test direction #{direction}.\"\n failed = true\n end\n end\n\n if extended\n if failed\n [false, errors]\n else\n [true, nil]\n end\n else\n if failed\n return false\n else\n return true\n end\n end\n end", "def test_both_players_exceed_defcon\n scenario us: 4, ussr: 5, defcon: 3\n assert_no_award\n end", "def verify_table_length(records)\n records.size == TestRecord.count\n end", "def test_should_not_validate_double_claiming\n claiming = create_claiming\n assert claiming.valid?\n claiming = create_claiming\n assert !claiming.valid?\n end", "def test_num_transactions_correct_0_true\n assert_equal(false, @bv.num_transactions_correct?(0, [0,1]))\n end", "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "def dataVerification(accounts)\r\n @insuredName = (account[\"accountName\"] + \"_\" + $accountID)\r\n \r\n accounts.each do |account| \r\n if account[\"accountName\"] != \"\" \r\n \r\n #run tests for individual tables, in this case, just the AccountInfo table\r\n accountInfo(account)\r\n\r\n puts \"\"\r\n puts \"Data Compare tests complete for account: \" + @insuredName + \".\"\r\n puts \"\"\r\n end\r\n end\r\nend", "def check_correctness(question, auto_grading)\n check_test_types = ['public_test', 'private_test'].freeze\n test_count = question.test_cases.reject(&:evaluation_test?).size\n passed_test_count = count_passed_test_cases(auto_grading, check_test_types)\n passed_test_count == test_count\n end", "def check_correctness(question, auto_grading)\n check_test_types = ['public_test', 'private_test'].freeze\n test_count = question.test_cases.reject(&:evaluation_test?).size\n passed_test_count = count_passed_test_cases(auto_grading, check_test_types)\n passed_test_count == test_count\n end", "def verify(test_secret = false, time_tolerance_seconds = 60)\n return false if @timestamp.to_i+time_tolerance_seconds.to_i < Time.now.utc.to_i\n return !!(@payload == test_secret) if test_secret \n return true\n end", "def testNominal\n executeProcess(\n [\n '--masterticket', '123',\n '--slaveticket', '456'\n ]\n ) do |iError, iSlaveActions|\n assert_equal(\n {\n Tools::TicketTracker => {\n Actions::Ticket_RejectDuplicate => [\n [ '123', '456' ]\n ]\n }\n },\n iSlaveActions\n )\n end\n end", "def test_should_retun_every_set_of_days_of_month\n assertion = Month.august(2006).every!(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Hash)\n # monday assertions\n assert_equal assertion[:monday].size, 4\n assert_equal assertion[:monday], [Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n # wednesday assertions\n assert_equal assertion[:wednesday].size, 5\n assert_equal assertion[:wednesday],\n [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30)]\n end", "def test_get_etc_function_by_qa\n\t\tbatch = Batch.create!( :batchid => 291206,\n :facility => facilities(:facility1),\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :arrival_time => \"#{Time.now}\",\n :target_time\t=> \"#{Time.now.tomorrow - 64.minutes}\",\n :status => \"New\",\n :manual_override => false)\n\n\t\tjob_new = Job.create!(:batch=>batch,\n :tiff_number=>1234,:check_number=>12131,\n :count=>12,:estimated_eob => 50,\n :qa_id => 1)\n\t\tbatch.reload\n\t\tbatch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_with_qa = batch.expected_completion_time\n\n job_one_more = Job.create(:batch=>batch,:tiff_number=>1231,\n :check_number=>12135,:count=>12,\n :estimated_eob => 50,\n :qa_id => 2)\n\t\tbatch.reload\n\t\tbatch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_with_two_jobs = batch.expected_completion_time\n \tassert_in_delta etc_with_qa.to_i, etc_with_two_jobs.to_i,1\n\n\t\tjob_one_more.qa_id = 1\n\t\tjob_one_more.update\n\t\tbatch.reload\n\t\tbatch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_after_change_qa = batch.expected_completion_time\n\n\t\tassert_not_equal(etc_with_qa, etc_after_change_qa)\n\n\t\tjob_new.qa_id = nil\n\t\tjob_new.update\n\t\tbatch.reload\n batch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_after_deallocate = batch.expected_completion_time\n\t\tassert_not_equal(etc_after_deallocate, etc_after_change_qa)\n\t\tassert_in_delta etc_after_deallocate.to_i, etc_with_two_jobs.to_i, 1\n end", "def test_response_latest\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n #All resubmission times are before the response time\n #also the response is in current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def test_is_applicable_to_test_models\n\t[\"LargeHotel-90.1-2010-ASHRAE 169-2006-3B.osm\", \"LargeOffice-90.1-2010-ASHRAE 169-2006-5A.osm\", \"MediumOffice-90.1-2010-ASHRAE 169-2006-5A.osm\", \"PrimarySchool-90.1-2007-ASHRAE 169-2006-2A.osm\", \"SecondarySchool-90.1-2010-ASHRAE 169-2006-4A.osm\", \"SmallHotel-90.1-2010-ASHRAE 169-2006-3B.osm\", \"SmallOffice-90.1-2010-ASHRAE 169-2006-2A.osm\"].each do |m|\n\t\tresult,_ = applytotestmodel(m)\n\t\tassert_equal(\"Success\", result.value.valueName)\n end\n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def verify_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n errors = []\n test_terms.each_with_index do |test_term, index|\n text_values_match?(test_term[Org::TERM_DISPLAY_NAME.name], element_value(org_display_name_input index), errors)\n text_values_match?(test_term[Org::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[Org::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[Org::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[Org::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[Org::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[Org::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[Org::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[Org::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "def test_state_count_on_examples\n assert_equal(4, @small_dfa.state_count)\n assert_equal(4, @small_nfa.state_count)\n end", "def test_response_stale\n response = Response.new\n\n response.updated_at = Time.parse(\"2012-12-02 06:00:00 UTC\")\n\n #resubmission_time3 after the response time\n #also the response before in current review phase\n latest_review_phase_start_time = Time.parse(\"2012-12-02 08:00:00 UTC\")\n\n resubmission_time1 = ResubmissionTime.new\n resubmission_time1.resubmitted_at = Time.parse(\"2012-12-02 04:00:00 UTC\")\n resubmission_time2 = ResubmissionTime.new\n resubmission_time2.resubmitted_at = Time.parse(\"2012-12-02 05:00:00 UTC\")\n resubmission_time3 = ResubmissionTime.new\n resubmission_time3.resubmitted_at = Time.parse(\"2012-12-02 07:00:00 UTC\")\n\n resubmission_times = [resubmission_time3, resubmission_time2, resubmission_time1]\n\n assert !response.is_valid_for_score_calculation?(resubmission_times, latest_review_phase_start_time)\n end", "def check_against(unit_test)\n grade_sheet = unit_test.execute(src_code) \n Feedback.on(grade_sheet)\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def verify_appointments_count(start_dates)\n if start_dates.count == 5\n true\n elsif start_dates.count == 8\n false\n else\n false\n end\n end", "def check_indices(data, num)\n data.length.should == num\n end", "def test_prev_hash_correct_false\n assert_equal(false, @bv.prev_hash_correct?(0, \"abcd\", \"efgh\"))\n end", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def waits_for_actual_attestation?\n !index.final_exam_passed? &&\n !attested_for?(Attestation.actual_for_faculty(index.student.faculty))\n end", "def test_equiprobability\n winners_1, winners_2 = nil, nil\n\n @unique_advertises_count.times do\n winners_1 = Auctioneer.auction(\n creatives: @creatives,\n number_of_winners: @unique_advertises_count\n )\n winners_2 = Auctioneer.auction(\n creatives: @creatives,\n number_of_winners: @unique_advertises_count\n )\n\n break if winners_1 != winners_2\n end\n\n assert { winners_1 != winners_2 }\n end" ]
[ "0.6480882", "0.6372067", "0.63353753", "0.6115042", "0.61078775", "0.60995275", "0.60554236", "0.6024318", "0.5981473", "0.5944085", "0.59133285", "0.5910317", "0.5901079", "0.58943504", "0.5869047", "0.5851933", "0.58485425", "0.58390445", "0.58315474", "0.5829393", "0.5824787", "0.5815939", "0.58109975", "0.5779312", "0.57604504", "0.5751784", "0.5741633", "0.5726237", "0.569891", "0.5696516", "0.5696516", "0.5659263", "0.5645131", "0.5641751", "0.5631861", "0.56184554", "0.5611981", "0.56026495", "0.55975497", "0.5589365", "0.55805296", "0.5576017", "0.5560774", "0.554839", "0.554615", "0.55317205", "0.5523182", "0.55182993", "0.55168056", "0.551646", "0.5513807", "0.5510119", "0.5505725", "0.5501889", "0.5500921", "0.54892457", "0.5486811", "0.5469415", "0.54638296", "0.54606044", "0.54599786", "0.545714", "0.5450932", "0.5445684", "0.5442357", "0.54406", "0.5439302", "0.54344535", "0.5430542", "0.54280853", "0.5427549", "0.5427485", "0.5423367", "0.5419616", "0.54107195", "0.5410266", "0.5408468", "0.5407135", "0.5406673", "0.53923845", "0.53923666", "0.53923666", "0.5389866", "0.5388335", "0.5383809", "0.5380645", "0.5378393", "0.5373457", "0.537099", "0.53651273", "0.53648555", "0.53632164", "0.53632027", "0.53627586", "0.53616995", "0.5360334", "0.53586763", "0.5356363", "0.5353596", "0.53453267" ]
0.6060249
6
PROJECT DESCRIPTION Enters project description per a given set of test data
def enter_project_desc(test_data) hide_notifications_bar logger.info "Entering project description '#{test_data[CoreUseOfCollectionsData::PROJECT_DESC.name]}'" wait_for_element_and_type(project_desc_text_area, test_data[CoreUseOfCollectionsData::PROJECT_DESC.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_project_desc(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def enter_project_desc(test_data)\n hide_notifications_bar\n wait_for_element_and_type(project_desc_text_area, test_data[UseOfCollections::PROJECT_DESC.name])\n end", "def set_ProjectDescription(value)\n set_input(\"ProjectDescription\", value)\n end", "def description\n project.description\n end", "def description\n project.description\n end", "def description\n conf['description'] || proj.description\n end", "def set_project\n @project = Project.friendly.find(params[:id])\n @title = @project.title\n @content = @project.title + ' started at ' + @project.start_date.to_s + ' for ' + @project.client_name.to_s +\n ' with ' + @project.contract_type + ' contract type ' + 'and lasted '+ @project.duration.to_s + ' month, located at ' + @project.location + ', ' + @project.design_capacity + ' design capacity and ' + @project.construction_man_hour.to_s + ' construction man hour.'\n end", "def test_overriding_description\r\n\t\t# first, a feature with no description assigned\r\n\t\tfeatures = Feature.for_static_page(static_pages(:aboutus).id)\r\n\r\n\t\tassert_equal(\"Short description\", features.first[:short_description])\r\n\r\n\t\t# now, a feature with a description to override\r\n\t\tfeatures = Feature.for_category(categories(:livestock).id)\r\n\r\n\t\tassert_equal(\"Different description\", features.first[:short_description])\r\n\tend", "def description=(description)\n @description = description\n @config_doc.elements[\"/project/description\"].text = description\n @config = @config_doc.to_s\n update\n end", "def description=(description)\n @description = description\n @config_doc.elements[\"/project/description\"].text = description\n @config = @config_doc.to_s\n update\n end", "def set_description(page)\n if !page.data['description']\n page.data['description'] = \"Check end-of-life, release policy and support schedule for #{page.data['title']}.\"\n end\n end", "def setDescription(description)\n\t\tRestClient.put(\"https://#{Cbthelper.username}:#{Cbthelper.authkey}@crossbrowsertesting.com/api/v3/selenium/#{@testId}\",\n \"action=set_description&description=#{description}\")\n\tend", "def add_description!(options)\n # Can be useful if an app generates additional tests on the fly for a single test in the flow,\n # e.g. a POR, in that case they will not want the description to be attached to the POR, but to\n # the test that follows it\n unless options[:inhibit_description_consumption]\n ht_coms = OrigenTesters::Flow.ht_comments\n cc_coms = OrigenTesters::Flow.cc_comments\n line_no = options[:source_line_number]\n # options[:then] only present on the second iteration of the same test same loop (not sure what this is really)\n # This method is called twice per test method in a loop but the second call should not consume a comment\n if line_no && !options[:then]\n if ht_coms[line_no]\n options[:description] ||= ht_coms[line_no]\n end\n if cc_coms[line_no] && cc_coms[line_no].first\n options[:description] ||= [cc_coms[line_no].shift]\n end\n end\n end\n end", "def edit_project(description, status)\n update!(description: description, status: status)\n end", "def description\n \"This task hits the corpwatch API and adds detail for the organization.\"\nend", "def anonymize_projects(all_projects)\n all_projects.each do |project|\n # anonymize the project\n project[:name] = 'The ' + random_name(4).capitalize + ' Project'\n project[:description] = 'A description of the project'\n end\n end", "def show_alt_descriptions(obj, projects = nil)\n type = obj.type_tag\n\n # Show existing drafts, with link to create new one.\n head = content_tag(:b, :show_name_descriptions.t) + \": \"\n head += link_with_query(:show_name_create_description.t,\n controller: obj.show_controller,\n action: \"create_#{type}_description\", id: obj.id)\n\n # Add title and maybe \"no descriptions\", wrapping it all up in paragraph.\n list = list_descriptions(obj).map { |link| indent + link }\n any = list.any?\n list.unshift(head)\n list << indent + \"show_#{type}_no_descriptions\".to_sym.t unless any\n html = list.safe_join(safe_br)\n html = content_tag(:p, html)\n\n # Show list of projects user is a member of.\n if projects.present?\n head2 = :show_name_create_draft.t + \": \"\n list = [head2] + projects.map do |project|\n item = link_with_query(project.title,\n action: \"create_#{type}_description\",\n id: obj.id, project: project.id,\n source: \"project\")\n indent + item\n end\n html2 = list.safe_join(safe_br)\n html += content_tag(:p, html2)\n end\n html\n end", "def test_format_reason_code_description\n valid_rc_desc = \"The impact of prior payer(s) adjudication including payments and/or adjustments\"\n assert_equal(valid_rc_desc, @output_xml_obj.format_reason_code_description(@reason_code1))\n assert_equal(valid_rc_desc, @output_xml_obj.format_reason_code_description(@reason_code2))\n assert_equal(valid_rc_desc, @output_xml_obj.format_reason_code_description(@reason_code3))\n end", "def default_value_for_description\n warn(\"Using README as description\")\n # RubyGems refuses to build a gem if the description contains `FIXME` or `TODO`,\n # which are perfectly valid words to use in a description, but alas.\n @chunked_source.readme.gsub(/FIXME/i, \"FIZZIX-ME\").gsub(/TODO/i, \"TOODLES\")\n end", "def projects=(projs)\n return false unless projs.is_a? Array\n removed = @projects - projs\n added = projs - @projects\n @text << \" \" << added.map{|t| \"+#{t}\"}.join(\" \")\n removed.each {|r| @text.gsub!(\" +#{r}\",\"\")}\n @projects=projs\n end", "def update_project(project, ptProject)\n project.title = ptProject.name\n project.current_iteration_id = ptProject.current_iteration_number\n project.save\n end", "def desc(description)\n ConfigureTask.add_description(description)\n end", "def show_alt_descriptions(object:, projects: nil)\n type = object.type_tag\n\n # Show existing drafts, with link to create new one.\n head = tag.b(:show_name_descriptions.t) + \": \"\n head += link_to(*create_description_tab(object))\n\n # Add title and maybe \"no descriptions\", wrapping it all up in paragraph.\n list = list_descriptions(object: object).map { |link| indent + link }\n any = list.any?\n list.unshift(head)\n list << indent + \"show_#{type}_no_descriptions\".to_sym.t unless any\n html = list.safe_join(safe_br)\n html = tag.div(html)\n\n add_list_of_projects(object, html, projects) if projects.present?\n html\n end", "def description\n \"testing\"\n end", "def description\n \"testing\"\n end", "def description\n @description = \"Espresso\"\n end", "def project_summary\n move_down 50\n summary = [[\"Project Summary\",\"\",\"\",\"\"],\n [\"Project Name\",\"Sales Person\",\"Project Status\",\"No. of Sites\"],\n [@project.project_name, \"#{@project.sales_person.sales_person_first_name} #{@project.sales_person.sales_person_last_name}\", @project.project_status.project_status_name ,@project.project_sites.count],\n [\"Project Setting\",\"Procurement Tool\",\"Deal Type\",\"Irrigation Responsibility\"],\n [@project.project_setting.project_setting_name,@project.procurement_tool.procurement_tool_name,@project.deal_type.deal_type_name,@project.irrigation_responsibility.irrigation_responsibility_name]\n ]\n table summary do\n rows(0..1).font_style = :bold\n row(3).font_style = :bold\n rows(0).background_color = \"a414e2\"\n rows(0).text_color = \"FFFFFF\"\n self.row_colors = [\"addbed\",\"25b2ea\"]\n column(0).width = 160\n column(1).width = 125\n column(2).width = 126\n column(3).width = 126\n columns(0..3).size = 10\n column(0).row(0).borders = :top, :left\n columns(1..2).row(0).borders = :top, :bottom\n column(3).row(0).borders = :top, :bottom, :right\n end\n end", "def update_project\n project.update_title\n end", "def description\n return @description if @description\n \n parts = []\n \n tp = trial_period(false)\n parts << \"#{tp}-day trial\" if tp && tp > 0\n \n sa = setup_amount(false)\n parts << \"#{number_to_currency(sa)} setup fee\" if sa && sa > 0\n \n am = amount(false)\n parts << \"#{number_to_currency(am)}/mo\"\n \n if prepaid_message_count >= UNLIMITED\n texts = \"unlimited\"\n else\n texts = \"#{prepaid_message_count}/mo prepaid\"\n end\n \n @description = parts.join(', ') + \" and #{texts} texts after that.\"\n\n return @description\n end", "def caption\n self.project.title\n end", "def description\n [@group.description,@description].join(' ')\n end", "def testTitle\n puts @originalTestCaseTitle # fw2_properties.rb\nend", "def set_description\n\t\t@description = \"Sales by Rails\"\n\tend", "def projects ; end", "def exp_task\n\t\texperiments.each do |e|\n\t\t\tif !e.task_desc.nil?\n\t\t\t\te.task_desc + ' '\n\t\t\tend\n\t\tend\n\tend", "def setup(description=\"TBD\")\n TestReport.instance.setDescription(description)\n\n @tStart=Time.now()\n @completed=false\n end", "def main_description; end", "def get_project_info()\n print \"\\n--------------------------------------------------------\\n\"\n print \"04) Searching for project: '#{$my_testrail_project}'...\\n\"\n my_proj_info = nil\n\n # First, get all projects...\n uri = 'get_projects'\n begin\n all_PROJECTs = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"\\tEXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to get information about all TestRail projects'\\n\"\n exit ERR_EXIT_GETPROJS\n end\n\n # Try to find our desired project from the list of projects...\n if all_PROJECTs.length > 0\n all_PROJECTs.each do |item|\n if item['name'] == $my_testrail_project\n @tr_proj_info = item\n break\n end\n end\n else\n print \"ERROR: No projects found in TestRail.'\\n\"\n exit ERR_EXIT_NOPROJS\n end\n if @tr_proj_info == nil\n print \"ERROR: Could not find project named: '#{$my_testrail_project}'\\n\"\n exit ERR_EXIT_PROJNF\n end\n p = @tr_proj_info\n print \"\\tfound project:\\n\"\n print \"\\t id = #{p['id']}\\n\"\n print \"\\t name = #{p['name']}\\n\"\n print \"\\t suite_mode = #{p['suite_mode']}\\n\"\n print \"\\t is_completed = #{p['is_completed']}\\n\"\n print \"\\t url = #{p['url']}\\n\"\n if p['announcement'].nil?\n str = 'nil'\n else\n str = p['announcement'].gsub(/\\n/,\"\\n\\t\\t\\t\")\n end\n print \"\\t announcement = #{str}\\n\"\n\n # Get all suites in our project...\n @tr_proj_id = @tr_proj_info['id']\n uri = \"get_suites/#{@tr_proj_id}\"\n begin\n @tr_suites = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"\\tEXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to get information about all TestRail suites in project.\\n\"\n exit ERR_EXIT_SUITES\n end\n suiteids = Array.new # Build an array of suite ID's for display...\n @tr_suites.each_with_index do |this_suite, index_suite|\n suiteids.push(this_suite['id'])\n end\n print \"\\n\\tFound '#{@tr_suites.length}' suites in the project: '#{suiteids}'\\n\"\n\n return @tr_proj_info, @tr_suites\nend", "def replace_keyword_in_requirement\n reqs = Requirement.where(project: project)\n reqs.each do |req|\n next unless req.description.include?(key)\n abbr = \"<abbr title='#{definition}'>#{key}</abbr>\"\n newdesc = if req.description[%r{<abbr title='[A-Za-z0-9 ,.\\-]*'>#{key}</abbr>}]\n req.description.gsub(%r{<abbr title='[A-Za-z0-9 ,.\\-]*'>#{key}</abbr>}, abbr)\n else\n req.description.gsub(key, abbr)\n end\n req.update(description: newdesc)\n req.save\n end\n end", "def process_descriptions(n)\n descriptions = self.feature.descriptions\n delete_descriptions = self.fields.delete('descriptions.delete')\n descriptions.clear if !delete_descriptions.blank? && delete_descriptions.downcase == 'yes'\n 0.upto(n) do |i|\n prefix = i>0 ? \"#{i}.descriptions\" : 'descriptions'\n description_content = self.fields.delete(\"#{prefix}.content\")\n if !description_content.blank?\n description_content = \"<p>#{description_content}</p>\"\n author_name = self.fields.delete(\"#{prefix}.author.fullname\")\n description_title = self.fields.delete(\"#{prefix}.title\")\n author = author_name.blank? ? nil : AuthenticatedSystem::Person.find_by(fullname: author_name)\n description = description_title.blank? ? descriptions.find_by(content: description_content) : descriptions.find_by(title: description_title) # : descriptions.find_by(['LEFT(content, 200) = ?', description_content[0...200]])\n language = Language.get_by_code_or_name(self.fields.delete(\"#{prefix}.languages.code\"), self.fields.delete(\"#{prefix}.languages.name\"))\n attributes = {:content => description_content, :title => description_title}\n attributes[:language_id] = language.id if !language.nil?\n if description.nil?\n if language.nil?\n self.say \"Language needed to create description for feature #{self.feature.pid}.\"\n description = nil\n else\n description = descriptions.create(attributes)\n end\n else\n description.update_attributes(attributes)\n end\n if !description.nil?\n self.spreadsheet.imports.create(:item => description) if description.imports.find_by(spreadsheet_id: self.spreadsheet.id).nil?\n description.authors << author if !author.nil? && !description.author_ids.include?(author.id)\n end\n end\n end \n end", "def change_description_of_issue(issue_name, description_text)\n\tissue = @client.Issue.find(issue_name)\n\tissue.save({\"fields\"=>{\"description\"=>description_text}})\nend", "def add_list_of_projects(object, html, projects)\n return if projects.blank?\n\n head2 = :show_name_create_draft.t + \": \"\n list = [head2] + projects.map do |project|\n item = link_to(*new_description_for_project_tab(object, project))\n indent + item\n end\n html2 = list.safe_join(safe_br)\n html += tag.p(html2)\n html\n end", "def populate_remark(result)\n result.remark = \"Results created using Inspec version #{@data['inspec_version']}.\\n#{@data['profiles'].map { |p| \"Profile: #{p['name']} Version: #{p['version']}\" }.join(\"\\n\")}\"\n end", "def title_for(product, test_type, is_qrda_1_measure_test: true)\n case test_type\n when 'ChecklistTest'\n product.c3_test && product.eh_tests? ? 'C1 + C3 Sample' : 'C1 Sample'\n when 'MeasureTest'\n measure_test_title(product, is_qrda_1_measure_test:)\n when 'FilteringTest'\n 'C4 (QRDA-I and QRDA-III)'\n when 'MultiMeasureTest'\n 'MultiMeasureTest'\n when 'CMSProgramTest'\n 'CMSProgramTest'\n end\n end", "def configure_tests_build_configuration_settings(project, name, platforms)\n\n platforms.each do |platform|\n\n target = project.targets.find { |y| y.name == \"#{name} #{platform} Tests\" }\n\n settings = { \n 'INFOPLIST_FILE' => \"#{name}Tests/Info.plist\",\n 'COMBINE_HIDPI_IMAGES' => 'YES'\n }\n\n settings.each do |key, val|\n target.build_configuration_list.set_setting(key, val)\n end\n end\nend", "def description_task(dir_path, id, target, display_name)\n description_file = \"#{dir_path}/description.xml\"\n data = String.new TEMPLATE_DESCRIPTION\n data.gsub!(/\\$\\{ID\\}/, id)\n data.gsub!(/\\$\\{VERSION\\}/, VERSION)\n data.gsub!(/\\$\\{TARGET\\}/, target)\n data.gsub!(/\\$\\{DISPLAY_NAME\\}/, display_name)\n open(description_file, \"w\") do |f|\n f.write(data)\n f.flush\n end\nend", "def set_description(desc)\n @result.description = desc\n end", "def change_name!\n @project[:name] = \"#{@project[:name]}-PR#{@number}\" if @project[:name]\n @project[:value][:name] = \"#{@project[:value][:name]}-PR#{@number}\" if @project[:value][:name]\n end", "def test_scenario1\n puts \"\\nTesting projects REST api calls\\n\" \n name = \"my project\"\n new_name = \"my new project\"\n\n puts \"Given I create a project with name \"+ name\n project = @api.create_project({'name' => name})\n\n puts \"And I wait until project is ready\"\n assert_equal(@api.ok(project), true)\n\n puts \"Then I check project name is \" + project[\"object\"][\"name\"]\n assert_equal(name, project[\"object\"][\"name\"])\n\n puts \"And I update the project with new name \"+new_name\n project = @api.update_project(project[\"resource\"], {\"name\" => new_name})\n assert_equal(BigML::HTTP_ACCEPTED, project[\"code\"])\n\n puts \"Then I check the project name is a new name \"+new_name\n assert_equal(new_name, project[\"object\"][\"name\"]) \n\n puts \"And i delete the project\"\n project = @api.delete_project(project[\"resource\"])\n assert_equal(BigML::HTTP_NO_CONTENT, project[\"code\"])\n\n end", "def displayDescription(step)\n description = step['Description'].strip\n description = description.gsub('Parameter1', step['Parameter1'].to_s)\n description = description.gsub('Parameter2', step['Parameter2'].to_s)\n puts description.colorize(:color => :white, :background => :blue)\n end", "def set_project_brief\n @project_brief = ProjectBrief.find(params[:id])\n end", "def setup\n @suite.p \"\\n:: [SETUP]\\n\"\n # -- let's print the description of each test first:\n Dir.glob(\"#{@suite.suite_root}/tests/**/*_test.rb\") {|f|\n file_contents = File.read(f)\n @suite.p \"\\n [description] : \" + /^#.*@description(.*$)/.match(file_contents)[0].gsub(/^#.*@description/, '') + \"\\n\\n\" if /#{self.class.name}/.match(file_contents)\n }\n end", "def update_all\n client.user_projects('emanuelemacri').each do |t|\n @work.title = t.post.title\n @work.save!\n end\n end", "def description\n\t\"This task scrapes Hoovers for company info.\"\nend", "def update_pr_description\n client.update_pull_request(repository, pr_id, body: report_urls.updated_pr_description(pr_description))\n end", "def description\n @description = \"House Blend Coffee\"\n end", "def description\n \"This is an example Tapir task. It associates a random host with the calling entity.\"\nend", "def test_info(project_name, plan_name, test_case_name)\n test_plan_id = test_plan_id(project_name, plan_name)\n test_cases = test_cases_for_test_plan(test_plan_id)\n\n test_cases.values.find do |test_case|\n test_case[:name] == test_case_name\n end\n end", "def validate_project\n\n # project name should be 10 to 30 length, and 5 words or fewer\n validate_length_words 'Project Name', self.project_name, 10, 30, 0, 5\n\n # vision should be 1 sentence\n validate_sentences_length 'Vision', self.vision, 30, 100, 1\n\n # goal should be 1 sentence\n validate_sentences_length 'Goal', self.goal, 30, 100, 1\n\n # description, and scope should be 5 sentences!\n validate_sentences_length 'Description', self.description, 100, 500, 5\n validate_sentences_length 'Scope', self.scope, 100, 500, 5\n\n # advice needed\n validate_sentences_length 'Advice Required', self.advice_required, 50, 200, 3\n\n # randomize program and train complaints!\n validate_random_day 'Program', self.program.name\n validate_random_day 'Train', self.train.name\n end", "def project_params\n params.require(:project).permit(:title, :short_description, :institution_country, :description, :country, :picture, :user_id, :institution_location, :state, :expires_at, :request_description, :institution_name, :institution_logo, :institution_description,\n project_edits_attributes: [:id, :_destroy, :description])\n end", "def setDescription(description)\n @description = description.to_s\n end", "def desc( description )\n @description = description\n end", "def styled_projects_with_each projects\n\tuppercase_projects = []\n\tprojects.each do |project|\n\t\tproject.upcase\n\tend\nend", "def project_params\n params.require(:project).permit(:description)\n end", "def _test_details(test)\n suite_name = test.category\n test_name = test.name\n test_description = test.description\n test_name_key = \"[#{test_name}] #{test_description}\"\n\n [suite_name, test_name_key]\n end", "def describe(description)\n @description = description\n end", "def description\n super + \", Mocha\"\n end", "def alter_description(description, additions, subtractions)\n new_description = description\n additions.each do |addition|\n stylized_weights = addition.weights&.join('->')\n if stylized_weights == '' || stylized_weights.nil?\n stylized_weights = 'body weight'\n end\n\n # This will look off for things I do 1 set or rep of,\n # but I'm ok with that - it makes eventually parsing\n # a dump of my data from Strava in the future easier.\n new_description << <<~EOF\n #{addition.exercise}: #{addition.num_sets} sets of #{addition.num_reps} reps at #{stylized_weights} lbs\n EOF\n end\n subtractions.each do |subtraction|\n new_description_array = new_description.split(\"\\n\").reject do |line|\n line.index(subtraction) == 0\n end\n new_description = new_description_array.join(\"\\n\")\n end\n\n new_description\nend", "def for_project(projname)\n # Read the stopwords list\n stopwords = Set.new()\n File.read(\"stopwords\").each_line do |line|\n line = line.strip\n stopwords.add(line)\n end\n\n pdata = ProjData.new(projname, stopwords)\n @dbconn.execute(\"SELECT ws.id, ws.type, ws.seq FROM word_seqs ws, proj_ids pids WHERE pids.id = ws.id AND pids.project = \\\"#{projname}\\\"\") do |row|\n pdata.add(row[0], row[1], row[2])\n end\n\n yield pdata\n end", "def desc(text)\n @storage[:description] = text\n end", "def description\n description = \"\"\n end", "def extract_title(test_case)\n requirements_tags = all_tags(test_case).select{|tag| tag.name =~ /req_\\w+/}.map{|tag| /req_(\\w+)/.match(tag.name)[1]}.join(', ')\n if test_case.source.last.is_a?(Cucumber::Core::Ast::ExamplesTable::Row)\n title = test_case.source.select{|s| s.is_a?(Cucumber::Core::Ast::ScenarioOutline)}.first.name\n if ENV['OLD_STYLE_OUTLINE_NAMES'] \n title += ' :: ' + test_case.source.last.send(:data).map{|key,value| \"#{key}='#{value}'\"}.join(', ')\n else\n title += \" \" + test_case.source.last.send(:data).map{|key,value| \"#{key}=#{value}\"}.join(', ')\n end\n else\n title = test_case.source.last.name\n end\n [requirements_tags,title].compact.join(' ').strip\n end", "def description\n description_section.join(\" \").tr(\"\\n\", ' ').gsub(/[{}]/,'').gsub(/\\[[^\\]]+\\]/,'') # strip rdoc\n end", "def setDescription(description)\r\n\t\t\t\t\t@description = description\r\n\t\t\t\tend", "def setDescription(description)\r\n\t\t\t\t\t@description = description\r\n\t\t\t\tend", "def description\n \"This is an example Tapir task. It associates a random host with the calling entity.\"\n end", "def set_project\n\n end", "def set_project\n\n end", "def data\n projects.map do |project|\n [].tap do |column|\n column << project.reference\n column << project.object_project\n column << project.projectName\n column << project.projectDescription\n column << project.focal_point\n column << project.project_situation\n column << project.public_partenership\n column << project.private_partenership\n column << project.amount\n column << project.contratDuration\n end\n end\n end", "def to_s\n # First check that we have all necessary fields\n raise 'Missing project name' if(name.nil? || name.empty?)\n raise 'Missing project type' if(type.nil? || type.empty?)\n\n # Now we can build the string and return it\n str = ''\n\n str << 'project ' + name + \" {\\n\"\n str << \" # The project type determines what kind of file will be created, as well as\\n\"\n str << \" # its name. Given a project named 'foo', we can build one of three file types:\\n\"\n str << \" # 1) An application named foo\\n\"\n str << \" # 2) A static library named libfoo.a\\n\"\n str << \" # 3) A shared library named libfoo.so\\n\"\n str << \" type = #{type}\\n\"\n str << \"\\n\"\n str << \" # All files in this project that should be compiled\\n\"\n str << \" files {\\n\"\n files.each { |x| str << \" #{x}\\n\" } if !files.nil?\n str << \" }\\n\"\n str << \"\\n\"\n str << \" # All the other projects that this project depends on\\n\"\n str << \" deps {\\n\"\n deps.each { |x| str << \" #{x}\\n\" } if !deps.nil?\n str << \" }\\n\"\n str << \"\\n\"\n str << \" # A list of third-party libraries used by this project.\\n\"\n str << \" # For a library file named 'libfoo.a' or 'libfoo.so', just write 'foo'.\\n\"\n str << \" libs {\\n\"\n libs.each { |x| str << \" #{x}\\n\" } if !libs.nil?\n str << \" }\\n\"\n str << \"\\n\"\n str << \" # Paths to search for included files\\n\"\n str << \" inc-paths {\\n\"\n inc_paths.each { |x| str << \" #{x}\\n\" } if !inc_paths.nil?\n str << \" }\\n\"\n str << \"\\n\"\n str << \" # Paths to search for third-party library files\\n\"\n str << \" lib-paths {\\n\"\n lib_paths.each { |x| str << \" #{x}\\n\" } if !lib_paths.nil?\n str << \" }\\n\"\n str << \"}\\n\"\n \n return str;\n end", "def test_checklist_for_project\n login\n project = projects(:one_genus_two_species_project)\n expect = Name.joins(observations: :project_observations).\n where({ observations: { project_observations:\n { project_id: project.id } } }).\n with_rank(\"Species\").distinct\n\n get(:show, params: { project_id: project.id })\n assert_match(/Checklist for #{project.title}/, css_select(\"title\").text,\n \"Wrong page\")\n\n prove_checklist_content(expect)\n end", "def format_title_description\n if description.present? && title.present?\n self.description = description.strip.capitalize\n self.title = title.strip.capitalize\n end\n end", "def format_title_description\n if description.present? && title.present?\n self.description = description.strip.capitalize\n self.title = title.strip.capitalize\n end\n end", "def format_title_description\n if description.present? && title.present?\n self.description = description.strip.capitalize\n self.title = title.strip.capitalize\n end\n end", "def update_project(username, projectname)\n\n #handle commits\n list_commits username, projectname, Encounter.last, Campaign.last\n #handle issues\n list_issues username, projectname, Encounter.last, Campaign.last\n end", "def update_readme(data_hash)\n \n puts \"Updating README measure order...\"\n \n table_flag_start = \"MEASURE_WORKFLOW_START\"\n table_flag_end = \"MEASURE_WORKFLOW_END\"\n \n readme_path = \"README.md\"\n \n # Create table\n table_lines = []\n table_lines << \"|Group|Measure|Dependencies*|\\n\"\n table_lines << \"|:---|:---|:---|\\n\"\n data_hash.each do |group|\n new_group = true\n group[\"group_steps\"].each do |group_step|\n grp = \"\"\n if new_group\n grp = group[\"group_name\"]\n end\n name = group_step['name']\n deps = group_step['dependencies']\n table_lines << \"|#{grp}|#{name}|#{deps}|\\n\"\n new_group = false\n end\n end\n \n # Embed table in README text\n in_lines = IO.readlines(readme_path)\n out_lines = []\n inside_table = false\n in_lines.each do |in_line|\n if in_line.include? table_flag_start\n inside_table = true\n out_lines << in_line\n out_lines << table_lines\n elsif in_line.include? table_flag_end\n inside_table = false\n out_lines << in_line\n elsif not inside_table\n out_lines << in_line\n end\n end\n \n File.write(readme_path, out_lines.join(\"\"))\n \nend", "def description\n @description = \"Dark Roast Coffee\"\n end", "def createProject(description) \n project = Project.new \n project.Description = description \n @Projects.push(project) \n end", "def apply_changes(project, changes)\n changes.each do |key, data|\n next unless ALLOWED_FIELDS.include?(key)\n next unless update_value?(project, key, data)\n\n # Store change:\n project[key] = data[:value]\n # Now add the explanation, if we can.\n next unless key.to_s.end_with?('_status') && data.key?(:explanation)\n\n justification_key = (key.to_s.chomp('_status') + '_justification').to_sym\n if project.attribute_present?(justification_key)\n unless project[justification_key].end_with?(data[:explanation])\n project[justification_key] =\n project[justification_key] + ' ' + data[:explanation]\n end\n else\n project[justification_key] = data[:explanation]\n end\n end\n end", "def desc(task, description)\n Task.new(task).description = description\n end", "def concat_description\n id = Readline.readline(\"ID of task to concatenate to: \").to_i\n str = Readline.readline(\"Information to concatenate: \").chomp\n ok = ConcatDescription.new(id, str).execute\n puts \"No such issue\" if !ok\n end", "def listprojects()\n #loading array of all projects\n projects = Array.new(GoodData::Project.all)\n\n puts \"\"\n puts \"\"\n puts \"Listing GoodData projects available under provided credentials\"\n puts \"\"\n\n counter = 0\n #loop through projects and print their title and PID\n projects.each do |pr|\n counter += 1\n puts \"#{counter}. \"+pr.title+\" - \"+pr.pid\n end\n puts \"\"\n puts \"\"\n\n #get the number of the project from the user\n print \"Choose project:\"\n\n pnum = gets.chomp.to_i - 1\n\n wrkproj = projects[pnum]\n project_detail(wrkproj)\nend", "def description\n \"This task hits the Google API and finds related content. Discovered domains are created.\"\nend", "def description\n \"This task hits the Google API and finds related content. Discovered domains are created.\"\nend", "def xml_change_description( xml )\r\n unit = xml.parent.xpath('ancestor::unit')[0]\r\n Nokogiri::XML::Builder.with( unit ){ |x| \r\n xml_set_or_delete( x, 'description', @should[:description] )\r\n }\r\n end", "def pr_description\n danger_file.warn('Please provide a summary in the Pull Request description') if danger_file.github.pr_body.length < 3 && danger_file.git.lines_of_code > 10\n end", "def description(text='')\n return @description if text.blank?\n @description = text\n end", "def notify\n desc = MU.structToHash(cloud_desc)\n desc[\"project_id\"] = @project_id\n desc\n end", "def initialize_description_source(desc)\n desc.license = @user.license\n\n # Creating a draft.\n if !params[:project].blank?\n project = Project.find(params[:project])\n if @user.in_group?(project.user_group)\n desc.source_type = :project\n desc.source_name = project.title\n desc.project = project\n desc.public = false\n desc.public_write = false\n else\n flash_error(:runtime_create_draft_create_denied.\n t(:title => project.title))\n redirect_to(:controller => 'project', :action => 'show_project',\n :id => project.id)\n end\n\n # Cloning an existing description.\n elsif !params[:clone].blank?\n clone = find_description(params[:clone])\n if clone.is_reader?(@user)\n desc.all_notes = clone.all_notes\n desc.source_type = :user\n desc.source_name = ''\n desc.project_id = nil\n desc.public = false\n desc.public_write = false\n else\n flash_error(:runtime_description_private.t)\n redirect_to(:action => 'show_name', :id => desc.parent_id)\n end\n\n # Otherwise default to :public description.\n else\n desc.source_type = :public\n desc.source_name = ''\n desc.project_id = nil\n desc.public = true\n desc.public_write = true\n end\n end" ]
[ "0.7484834", "0.7426628", "0.7066008", "0.6692473", "0.6624863", "0.6624863", "0.6368204", "0.63073653", "0.6232441", "0.6153696", "0.60862726", "0.59314036", "0.59187055", "0.5891368", "0.5818819", "0.5814073", "0.57859427", "0.5782038", "0.5772886", "0.57672167", "0.5733661", "0.5730881", "0.57262343", "0.5700486", "0.5690862", "0.5690862", "0.56839186", "0.56271875", "0.56100744", "0.55607396", "0.555796", "0.5557294", "0.5530053", "0.5509493", "0.54733884", "0.54728854", "0.54659647", "0.5455704", "0.54315597", "0.5428392", "0.54246044", "0.5412553", "0.54022425", "0.53968114", "0.5362774", "0.53611004", "0.5358376", "0.5351723", "0.5344905", "0.5341303", "0.5334834", "0.5331184", "0.5324539", "0.53216064", "0.53209794", "0.5316925", "0.5315643", "0.5314369", "0.5308374", "0.53044856", "0.5303651", "0.5301683", "0.52791744", "0.52750355", "0.5269453", "0.52649105", "0.5260282", "0.5248319", "0.52448666", "0.52392256", "0.5233393", "0.5233066", "0.52271116", "0.5218489", "0.5212403", "0.5212403", "0.5204464", "0.5202661", "0.5202661", "0.52005124", "0.5193108", "0.5190065", "0.5185946", "0.5185946", "0.51857203", "0.51781684", "0.5177235", "0.5172963", "0.5171466", "0.51713574", "0.5168313", "0.5167123", "0.5163186", "0.5159261", "0.5159261", "0.51585996", "0.51574147", "0.51519483", "0.5151756", "0.5150269" ]
0.7310079
2
Verifies project description matches test data
def verify_project_desc(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_DESC.name], element_value(project_desc_text_area)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_project_desc(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_DESC.name], element_value(project_desc_text_area))\n end", "def verify_project_id(test_data)\n verify_values_match(test_data[UseOfCollections::PROJECT_ID.name], element_value(project_id_input))\n end", "def verify_project_id(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROJECT_ID.name], element_value(project_id_input))\n end", "def test_old\n assert_equal({\n \"shiva\"=>\"Shiva\",\n \"ganesha\"=>\"Ganesha\",\n \"surya\"=>\"Surya\",\n \"ganga\"=>\"Ganga\",\n \"shakti\"=>\"Shakti\",\n \"vishnu\"=>\"Vishnu\",\n \"shiva_desc\"=>\"Shiva is the god of transformation through destruction and the Lord of Dance.\",\n \"ganesha_desc\"=>\"Ganesha is the god of knowledge and beginnings, the Lord of Obstacles.\",\n \"surya_desc\"=>\"Surya is the god of the sun, courage and will.\",\n \"ganga_desc\"=>\"Ganga is the goddess of the sacred river, Ganges, who purifies and redeems.\",\n \"shakti_desc\"=>\"Shakti is the goddess of power and dynamic energy.\",\n \"vishnu_desc\"=>\"Vishnu is the all-pervading god who sustains the world.\",\n \"RV_NO_DEITY_TITLE\"=>\"No Current Deity.\",\n \"RV_NO_DEITY_DESC\"=>\"Hinduism allows you to select which god to follow as your main deity. Each deity will come with its own effects and last until your monarch changes.\",\n \"RV_PICK_DEITY_THIS\"=>\"Follow $NAME|Y$\",\n \"RV_PICK_DEITY\"=>\"Select Deity\",\n }, FakeYaml.load(sample(\"religion_l_english\")))\n end", "def validate_project\n\n # project name should be 10 to 30 length, and 5 words or fewer\n validate_length_words 'Project Name', self.project_name, 10, 30, 0, 5\n\n # vision should be 1 sentence\n validate_sentences_length 'Vision', self.vision, 30, 100, 1\n\n # goal should be 1 sentence\n validate_sentences_length 'Goal', self.goal, 30, 100, 1\n\n # description, and scope should be 5 sentences!\n validate_sentences_length 'Description', self.description, 100, 500, 5\n validate_sentences_length 'Scope', self.scope, 100, 500, 5\n\n # advice needed\n validate_sentences_length 'Advice Required', self.advice_required, 50, 200, 3\n\n # randomize program and train complaints!\n validate_random_day 'Program', self.program.name\n validate_random_day 'Train', self.train.name\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def assert_code_and_desc_ok(object)\n cloned = object.clone\n assert_presence_required(object,:code)\n assert_presence_required(object,:description)\n assert object.save,\"Failed to save object first time in uniqueness test; pass unique record first\"\n assert !cloned.save,\"Saved object twice while testing for uniqueness of :code and :description\"\n assert(cloned.errors[:code].to_s =~ /taken/, \"Missing or wrong error message for duplicate code\" )\n assert(cloned.errors[:description].to_s =~ /taken/, \"Missing or wrong error message for duplicate description\") \n end", "def test_creating_a_valid_project\n project = Project.new(:name => \"My Project\",\n :start_date => \"12/01/2007\",\n :end_date => \"12/01/2008\",\n :total_budget => 100000 )\n \n assert project.valid?\n end", "def compare_to(project_name)\n compare_contents @project_path, project_fixture(project_name)\n end", "def verify_provisos(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROVISOS.name], element_value(provisos_text_area))\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def verify_provisos(test_data)\n verify_values_match(test_data[UseOfCollections::PROVISOS.name], element_value(provisos_text_area))\n end", "def verify_title(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::TITLE.name], element_value(title_input))\n end", "def test_checklist_for_project\n login\n project = projects(:one_genus_two_species_project)\n expect = Name.joins(observations: :project_observations).\n where({ observations: { project_observations:\n { project_id: project.id } } }).\n with_rank(\"Species\").distinct\n\n get(:show, params: { project_id: project.id })\n assert_match(/Checklist for #{project.title}/, css_select(\"title\").text,\n \"Wrong page\")\n\n prove_checklist_content(expect)\n end", "def validateProject(data, isSocialGood = false)\n fails = []\n # Check if project is private\n if data.private\n fails.push(\"Project is either private or doesn't exist!\")\n end \n # Check if project has license\n if data.license == nil\n fails.push(\"Project doesn't have a license\")\n end\n # Check if project has atleast 100 stars\n if data.stargazers_count < 100 && !isSocialGood\n fails.push(\"Project has less than 100 stars\")\n end\n return fails\nend", "def test_should_require_description\n archive = create(:description => nil)\n assert archive.errors.invalid?(:description), \":description should be required\"\n assert_invalid archive, \"archive shouldn't be created\"\n end", "def verify_title(test_data)\n verify_values_match(test_data[UseOfCollections::TITLE.name], element_value(title_input))\n end", "def test_necessary_existence_of_description\n @composer.role_type_desc = nil\n assert !@composer.save\n check_for_error_messages([\"can't be blank\", \"is too short (minimum is 2 characters)\"], @composer, :role_type_desc)\n end", "def test_basedata\n assert_not_nil(Cardiotype.find(:first, :conditions => [\"description = ?\", \"Run\"]))\n assert_not_nil(Cardiotype.find(:first, :conditions => [\"description = ?\", \"Swim\"]))\n assert_not_nil(Cardiotype.find(:first, :conditions => [\"description = ?\", \"Cycle\"]))\n end", "def validate_release\n if !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end", "def test_format_reason_code_description\n valid_rc_desc = \"The impact of prior payer(s) adjudication including payments and/or adjustments\"\n assert_equal(valid_rc_desc, @output_xml_obj.format_reason_code_description(@reason_code1))\n assert_equal(valid_rc_desc, @output_xml_obj.format_reason_code_description(@reason_code2))\n assert_equal(valid_rc_desc, @output_xml_obj.format_reason_code_description(@reason_code3))\n end", "def test_validate_reason_code_with_valid_data\n reason_code1 = ReasonCode.new\n reason_code1.reason_code = \"RC.S-A_\"\n reason_code1.save\n assert reason_code1.valid?, reason_code1.errors.full_messages.to_s\n end", "def _validate_description(d)\n if d == spec.summary\n results.add_warning('description', 'The description is equal to' \\\n ' the summary.')\n end\n\n if d.strip.empty?\n results.add_error('description', 'The description is empty.')\n elsif spec.summary && d.length < spec.summary.length\n results.add_warning('description', 'The description is shorter ' \\\n 'than the summary.')\n end\n end", "def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end", "def validate_release\n if !system(\"origen specs\") || !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def test_compare_strings_are_same\n assert_same @c.string1, @c.string2\n end", "def test_creating_public_description\n # We want to create an empty, default public description for a name that\n # doesn't have any descriptions yet -- simplest possible case.\n @name = Name.find_by(text_name: \"Strobilurus diminutivus\")\n assert_equal([], @name.descriptions)\n @description_data = {\n source_type: \"public\",\n source_name: nil,\n readable: true,\n writable: true,\n notes: \"I like this mushroom.\"\n }\n @group_expectations = {\n admins: [UserGroup.reviewers],\n writers: [UserGroup.all_users],\n readers: [UserGroup.all_users],\n authors: [],\n editors: [mary]\n }\n\n admin = open_admin_session(dick)\n reviewer = open_normal_session(rolf)\n owner = open_normal_session(mary)\n random_user = open_normal_session(katrina)\n lurker = open_lurker_session\n\n reviewer.should_be_reviewer\n owner.should_not_be_reviewer\n random_user.should_not_be_reviewer\n\n # sets (not checks) the abilities\n admin.should_be_able_to_do_anything\n reviewer.should_be_able_to_do_anything_but_change_permissions\n owner.should_be_able_to_edit_and_change_name\n random_user.should_be_able_to_edit_text_only\n lurker.should_be_able_to_see_but_needs_to_login\n\n owner.create_name_description\n owner.check_name_description\n\n admin.check_abilities\n reviewer.check_abilities\n owner.check_abilities\n random_user.check_abilities\n lurker.shouldnt_be_able_to_do_anything\n end", "def enter_project_desc(test_data)\n hide_notifications_bar\n logger.info \"Entering project description '#{test_data[CoreUseOfCollectionsData::PROJECT_DESC.name]}'\"\n wait_for_element_and_type(project_desc_text_area, test_data[CoreUseOfCollectionsData::PROJECT_DESC.name])\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def assert_equal(type,expected, actual)\n text1=get_text(type,expected)\n text2=$array1[\"#{actual}\"] \n puts text1\n puts text2\n if text1 == text2\n puts \"given text is available\"\n elsif \n $log.error \"given #{expected} text is not displayed\"\n raise(\"given #{expected} text is not displayed\")\n end\nend", "def validate_release \n if !system(\"origen examples\") #|| !system(\"origen specs\") \n puts \"Sorry but you can't release with failing tests, please fix them and try again.\" \n exit 1 \n else \n puts \"All tests passing, proceeding with release process!\" \n end \n end", "def test_crud_project\n #create\n @project= create_project\n assert_equal @project.name, R3c.project.find(@project.id).name \n size= R3c.project.all.size\n #update\n @project.name=\"replaced\"\n @project.save!\n assert_equal \"replaced\", R3c.project.find(@project.id).name \n #delete\n delete_project(@project.id)\n assert_equal (size-1), R3c.project.all.size\n end", "def enter_project_desc(test_data)\n hide_notifications_bar\n wait_for_element_and_type(project_desc_text_area, test_data[UseOfCollections::PROJECT_DESC.name])\n end", "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def test_ut_diff_result_02\n original_source_code = OriginalSourceCode.new(\n :original_file_id => 10,\n :line_number => 349898,\n :error_line => 4564,\n :line_content => \"123456\"\n )\n assert_equal(10,original_source_code.original_file_id)\n assert_equal(349898,original_source_code.line_number)\n assert_equal(4564,original_source_code.error_line)\n assert_equal(\"123456\",original_source_code.line_content)\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def test_project\n project\n @browser.find_element(:id, 'tab-versions').click\n sleep (2)\n @browser.find_element(:xpath, \"//*[@id='tab-content-versions']/p[2]/a\").click\n version = rand(999).to_s + 'version'\n @browser.find_element(:id, 'version_name').send_keys version\n @browser.find_element(:name, 'commit').click\n #expected = 'Successful creation.'\n expected = 'Создание успешно.'\n assert_equal(expected, @browser.find_element(:id, 'flash_notice').text)\n end", "def test_when_time_entries_have_no_issue_associated\n assert_equal false , @project.has_time_entries_with_no_issue\n end", "def test_valid_doi\n File.foreach File.dirname(__FILE__) + '/fixtures/good-doi.txt' do |doi|\n assert SimpleDOI.valid?(doi), \"#{doi} should be considered a valid DOI\"\n end\n end", "def check_description(description)\r\n # Return error message if description is blank.\r\n return \"Description cannot be blank.\" if description == \"\"\r\n # Return error message if description is too long.\r\n if description.length > 140\r\n return \"Description was #{description.length} characters long; cannot exceed 140.\"\r\n end\r\n # Otherwise \"ok\"\r\n return \"ok\"\r\n end", "def failure_message\n actual = prettify_args(@actual)\n\n if @description\n \"'#{actual}' should #{@description}\"\n else\n \"'#{actual}' should satisfy the requirements\"\n end\n end", "def test_compare_strings_are_equal\n assert_equal @c.string1, @c.string2\n end", "def create_draft_tester(project, name, user = nil, success: true)\n count = NameDescription.count\n params = {\n id: name.id,\n source: \"project\",\n project: project.id\n }\n requires_login(:new, params, user.login)\n if success\n assert_template(\"names/descriptions/new\")\n assert_template(\"names/descriptions/_form\")\n else\n assert_redirected_to(project_path(project.id))\n end\n assert_equal(count, NameDescription.count)\n end", "def test_valid\n assert_equal(correct_results,\n ConfigParser.parse(\"data/valid.config\"))\n end", "def infoTest data\n failure = RubyUnit::AssertionFailure.new(data)\n data.each do |index, value|\n assertMatch /#{index}/, failure.info, \"Missing index for #{index}\"\n assertMatch /#{value}/, failure.info, \"Missing value for #{index}\"\n end\n end", "def test_ut_diff_source_code_o1\n assert @diff_source_code_1.save\n diff_source_code_copy = DiffSourceCode.find(@diff_source_code_1.id)\n assert_equal @diff_source_code_1.diff_file_id, diff_source_code_copy.diff_file_id \n assert @diff_source_code_1.valid?\n assert @diff_source_code_1.destroy\n end", "def test_correct_file_found\n @setup_issue_show.current_version = '2.3.1'\n assert_equal '2.3.1', @setup_issue_show.show_file.redmine_version, 'Did not find the exact match.'\n\n @setup_issue_show.current_version = '2.3.2'\n assert_equal '2.3.1', @setup_issue_show.show_file.redmine_version, 'Did not find the most recent match.'\n\n @setup_issue_show.current_version = '0.0.0'\n assert_nil @setup_issue_show.show_file\n end", "def test_validation\n \n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-')\n pcba_pn = '500-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No - PCB, PCBA part numbers are not unique.\n pcba_pn = '600-123-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert( pn.error_message)\n assert_equal('The PCB part number (600-123-a0 a) and the PCBA part number ' +\n \"(600-123-00 b) must be unique - YOUR PART NUMBER WAS NOT CREATED\",\n pn.error_message)\n \n\n # Valid? - No - Format bad, short prefix\n pcb_pn = '12-123-a0'.split('-')\n pcba_pn = '34-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No - Format bad, illegal characters in the prefix\n pcb_pn = '12e-123-a0'.split('-')\n pcba_pn = 'pcb-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, wrong number of characters in the number\n pcb_pn = '127-3-a0'.split('-')\n pcba_pn = '128-21-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the number\n pcb_pn = '127-###-a0'.split('-')\n pcba_pn = '128-JPA-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the dash number\n pcb_pn = '127-714-*'.split('-')\n pcba_pn = '128-755-!&'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert(!pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes\n pcb_pn = '127-714-01'.split('-')\n pcba_pn = '128-755-a0'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n\n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No, pcb pn exists.\n pcb_pn = '252-700-b0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n \n # Valid? - No, pcb pn duplicates pcba pn \n pcb_pn = '259-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'b'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n # Valid? - No, pcb pn prefix contains the wrong number of characters \n pcb_pn = '12-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No, pcb pn prefix contains illegal characters \n pcb_pn = '12e-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains wrong number of characters \n pcb_pn = '127-3-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n #assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains illegal characters \n pcb_pn = '127-#*@-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn dash number contains wrong number of, and illegal, characters \n pcb_pn = '127-714-@'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes \n pcb_pn = '127-714-01'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n \n assert(!pn.exists?)\n assert_nil(pn.error_message)\n pn.save\n assert(pn.exists?)\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n\n assert(PartNumber.valid_prefix?('100'))\n assert(!PartNumber.valid_prefix?('1'))\n assert(!PartNumber.valid_prefix?('a'))\n assert(!PartNumber.valid_prefix?('10'))\n assert(!PartNumber.valid_prefix?('a7'))\n assert(!PartNumber.valid_prefix?('1aa'))\n assert(!PartNumber.valid_prefix?('a00'))\n assert(!PartNumber.valid_prefix?('1776'))\n assert(!PartNumber.valid_prefix?('a345'))\n \n assert(PartNumber.valid_number?('100'))\n assert(!PartNumber.valid_number?('1'))\n assert(!PartNumber.valid_number?('a'))\n assert(!PartNumber.valid_number?('10'))\n assert(!PartNumber.valid_number?('a7'))\n assert(!PartNumber.valid_number?('1aa'))\n assert(!PartNumber.valid_number?('a00'))\n assert(!PartNumber.valid_number?('1776'))\n assert(!PartNumber.valid_number?('a345'))\n \n assert(PartNumber.valid_dash_number?('a0'))\n assert(PartNumber.valid_dash_number?('0a'))\n assert(!PartNumber.valid_dash_number?('a'))\n assert(!PartNumber.valid_dash_number?('4'))\n assert(!PartNumber.valid_dash_number?('aa33'))\n assert(!PartNumber.valid_dash_number?('333'))\n \n # Create known part numbers for testing.\n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-802-00'.split('-')\n pcba_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-01'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n\n pn = PartNumber.initial_part_number\n pcb_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert(!pn.valid_components?('not'=='new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n pcba_pn = '700-900-90'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n \n pcba_pn = '000-000-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n end", "def test_ut_diff_warning_02\n assert_equal 2,@diff_warning.diff_status_id\n assert_equal 1,@diff_warning.diff_file_id\n assert_equal 1,@diff_warning.rule_set\n assert_equal 1,@diff_warning.warning_id\n assert_equal 1,@diff_warning.original_file_id\n end", "def check_solution(test_number, argument, expected)\n actual = fields(argument)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def descrips_match(expected, descrips)\n begin\n expected.zip(descrips).collect {\n |x, y| (x == :anything || x == y) }.inject(true) {\n |x, y| x && y }\n rescue TypeError => te\n puts \"TypeError: #{te}\"\n end\n end", "def test_should_require_description\n link = create(:description => nil)\n assert link.errors.invalid?(:description), \":description should be required\"\n assert_invalid link, \"link shouldn't be created\"\n end", "def failure_message_for_should\n message = \"expected #{@collection_key} to match the user's mental model, but:\\n\"\n unless expected_items_found?\n message += \"expected to be present: #{pp_array(expected_items)}\\n\"\n message += \"the missing elements were: #{pp_array(expected_items_that_were_not_found)}\\n\"\n end\n if unexpected_items_found?\n message += \"expected to not be present: #{pp_array(unexpected_items)}\\n\"\n message += \"the unexpected extra elements: #{pp_array(unexpected_items_that_were_found)}\\n\"\n end\n message\n end", "def test_result_content_should_match_provided_array_content\n @scenarios.each do |scenario|\n expectation = scenario[:expectation].with_indifferent_access[:artworks]\n result = GoogleImageSearch.search(q: scenario[:search_keyword]).with_indifferent_access[:artworks]\n\n 0.upto(expectation.length - 1) do |index|\n assert_equal expectation[index], result[index], \"unexpected result at #{(index+1).ordinalize} thumbnail\"\n end\n end\n end", "def verify_existing_release_metadata\n return false if existing_files.empty?\n msg \"Verifying cached release metadata\"\n @invalid_metadata_files = existing_files.select {|f| !f.quick_verify}\n msg \"invalid_metadata_files: #{@invalid_metadata_files.size}\"\n end", "def ensure_metadata_as_expected!\n expected_metadata_rb = <<~E\n name 'foo'\n maintainer ''\n maintainer_email ''\n license ''\n description 'Installs/Configures foo'\n long_description 'Installs/Configures foo'\n version '1.0.0'\n\n E\n expect(IO.read(metadata_path)).to eq(expected_metadata_rb)\n end", "def correct!\n if @failures.any?\n unless @failures.all? {|matcher| @scenarios[:failed].any? {|s| matcher.match? s}}\n missing_failures = @failures.reject {|matcher| @scenarios[:failed].any? {|s| matcher.match? s}}\n missing_failures = missing_failures.collect{|f| \" - #{f.to_s}\"}.join(\"\\n\")\n mods = self.desc || \"(None)\"\n mods = \" - #{mods}\"\n raise IncorrectAnswer, \"The following scenarios passed incorrectly (should have failed):\\n#{missing_failures}\\nwith the following modifications:\\n#{mods}\"\n end\n else\n unless @scenarios[:failed].empty? or @scenarios[:steps][:total] != @scenarios[:steps][:passed]\n raise IncorrectAnswer, \"Feature should have passed, but had the following failures:\\n#{@scenarios[:failed].collect {|f| \" #{f}\"}}\"\n end\n end\n true\n end", "def test_course_code_format\n course = Course.new(name: \"Ruby on Rails\", course_code: \"ABC123\", color: \"Violet\")\n course_one = Course.new(name: \"Front End\", course_code: \"DE456\", color: \"Mustard\")\n course_two = Course.new(name: \"Javascript\", course_code: \"DEF6\", color: \"Mustard\")\n\n assert course.save\n refute course_one.save\n refute course_two.save\n end", "def test_can_it_read_text\n assert_equal @fr_read, \"Here is some sample text\"\n end", "def test_validity\r\n assert @valid_skill.valid?\r\n end", "def verify_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n errors = []\n test_terms.each_with_index do |test_term, index|\n text_values_match?(test_term[Org::TERM_DISPLAY_NAME.name], element_value(org_display_name_input index), errors)\n text_values_match?(test_term[Org::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[Org::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[Org::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[Org::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[Org::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[Org::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[Org::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[Org::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "def test_edit_course_with_duplicate_title\r\n number_of_course = Course.count\r\n post :update_course,:id => 2, :course => { :title => 'Object-Oriented Programming'}\r\n assert_equal Course.count, number_of_course\r\n assert_equal 1, Course.count(:all, :conditions => \"title = 'Object-Oriented Programming'\"),\r\n \"The duplicate title course save into database\" \r\n #assert !Course.find(:all, :conditions => \"title = 'E-Commerce'\");\r\n end", "def test_task_should_not_be_valid_without_title\n @task.title = \"\"\n assert @task.invalid?\n end", "def test_existing_file\n assert verify_parameters(['verifier_tests.rb'])\n end", "def ensure_metadata_as_expected!\n expected_metadata_rb = <<~E\n name 'local-cookbook'\n maintainer ''\n maintainer_email ''\n license ''\n description 'Installs/Configures local-cookbook'\n long_description 'Installs/Configures local-cookbook'\n version '2.3.4'\n\n E\n expect(IO.read(metadata_path)).to eq(expected_metadata_rb)\n end", "def test_ut_diff_result_02\n original_file = OriginalFile.new(\n :source_name => \"simple 1\",\n :path => \"http\",\n :normal_result_id => 349898,\n :hirisk_result_id => 4564,\n :critical_result_id => 45 )\n assert_equal(\"simple 1\",original_file.source_name)\n assert_equal(349898,original_file.normal_result_id)\n assert_equal(4564,original_file.hirisk_result_id)\n assert_equal(45,original_file.critical_result_id)\n assert_equal(\"http\",original_file.path)\n end", "def test_edit_course_with_invalid_title\r\n number_of_course = Course.count\r\n post :update_course,:id => 1, :course => { :title => ''}\r\n assert_equal Course.count, number_of_course\r\n assert Course.find(:all, :conditions => \"title = 'E-Commerce'\")\r\n assert !Course.find(:all, :conditions => \"title = ''\"),\r\n \"The blank title course save into database\" \r\n end", "def check_description\n @repo_data ? @repo_data['description'] : nil\n end", "def verify_foundation_place(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_PLACE.name], element_value(foundation_place_input), errors)\n errors\n end", "def test_courses_must_have_course_code_and_name\n course = Course.new(name: \"Ruby on Rails\", course_code: \"ROR600\", color: \"Violet\")\n course_one = Course.new(course_code: \"JST600\", color: \"Mustard\")\n course_two = Course.new(name: \"Front End\", color: \"Mustard\")\n\n assert course.save\n refute course_one.save\n refute course_two.save\n end", "def test_edit_course_with_valid_title\r\n number_of_course = Course.count\r\n title = Course.find(1).title\r\n post :update_course,:id => 1, :course => { :title => 'Database'}\r\n assert_equal flash[:notice], 'Course was successfully updated.'\r\n assert_redirected_to :action => 'list_folders', :id =>1\r\n assert_equal Course.count, number_of_course\r\n assert Course.find(:all, :conditions => \"title = 'Database'\");\r\n assert_nil Course.find(:first, :conditions => \"title = '#{title}'\");\r\n end", "def should_see_project_named(name)\n expect(page).to have_content name\n expect(page).to have_content \"STATUS UNDERWAY\"\n end", "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[Org::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "def test_ut_t2_ats_acd_001\n assert_equal ['make_options',\n 'environment_variables',\n 'header_file_at_analyze',\n 'analyze_tool_config',\n 'others'],AnalyzeConfigDetail.column_names\n end", "def assert_file_content_equal(refFile,resContent, explanationstring=\"\")\n if explanationstring.empty?\n explanationstring=explanationstring + \": \"\n end\n\n refContArr = File.open(refFile,\"r\").read.split(/\\n/)\n resContArr = resContent.split(/\\n/)\n assert_equal(refContArr.size,resContArr.size,explanationstring + \"Line count assertions : answer file: #{refFile}: \")\n for count in 0...refContArr.size\n assert_equal(refContArr[count],resContArr[count],explanationstring + \"At line :\" + count.to_s + \": answer file: #{refFile}: \")\n end\n end", "def failure_message\n matching_files = @fixture.files & @local.files\n fixture_only_files = @fixture.files - @local.files\n local_only_files = @local.files - @fixture.files\n buf = \"expected fixture #{@fixture.path} to match files:\\n\"\n (@fixture.files | @local.files).sort.each do |file|\n if matching_files.include?(file)\n local_file = @local.absolute(file)\n fixture_file = @fixture.absolute(file)\n if File.directory?(local_file) && File.directory?(fixture_file)\n # Do nothing\n elsif File.directory?(fixture_file)\n buf << \" #{file} should be a directory\\n\"\n elsif File.directory?(local_file)\n buf << \" #{file} should not be a directory\"\n else\n actual = IO.read(local_file)\n expected = IO.read(fixture_file)\n if actual != expected\n # Show a diff\n buf << \" #{file} does not match fixture:\"\n buf << differ.diff(actual, expected).split(/\\n/).map {|line| ' '+line }.join(\"\\n\")\n end\n end\n elsif fixture_only_files.include?(file)\n buf << \" #{file} is not found\\n\"\n elsif local_only_files.include?(file)\n buf << \" #{file} should not exist\\n\"\n end\n end\n buf\n end", "def check_solution(test_number, string, expected)\n actual = compress_string(string)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def check_solution(test_number, string, expected)\n actual = compress_string(string)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def verify_groups(test_data)\n test_groups = test_data[Org::GROUPS.name]\n errors = []\n test_groups = [{ Org::GROUP.name => ''}] unless test_groups\n test_groups.each_with_index do |test_grp, index|\n text_values_match?(test_grp[Org::GROUP.name], element_value(group_input(index)), errors)\n end\n errors\n end", "def test_overriding_description\r\n\t\t# first, a feature with no description assigned\r\n\t\tfeatures = Feature.for_static_page(static_pages(:aboutus).id)\r\n\r\n\t\tassert_equal(\"Short description\", features.first[:short_description])\r\n\r\n\t\t# now, a feature with a description to override\r\n\t\tfeatures = Feature.for_category(categories(:livestock).id)\r\n\r\n\t\tassert_equal(\"Different description\", features.first[:short_description])\r\n\tend", "def test_person_validity\n assert people(:valid_person).valid?\n end", "def test_relevant\n add_test_judgement\n assert(@gold_standard.relevant? :document => \"doc1\", :query => \"query1\")\n end", "def test_scenario1\n puts \"\\nTesting projects REST api calls\\n\" \n name = \"my project\"\n new_name = \"my new project\"\n\n puts \"Given I create a project with name \"+ name\n project = @api.create_project({'name' => name})\n\n puts \"And I wait until project is ready\"\n assert_equal(@api.ok(project), true)\n\n puts \"Then I check project name is \" + project[\"object\"][\"name\"]\n assert_equal(name, project[\"object\"][\"name\"])\n\n puts \"And I update the project with new name \"+new_name\n project = @api.update_project(project[\"resource\"], {\"name\" => new_name})\n assert_equal(BigML::HTTP_ACCEPTED, project[\"code\"])\n\n puts \"Then I check the project name is a new name \"+new_name\n assert_equal(new_name, project[\"object\"][\"name\"]) \n\n puts \"And i delete the project\"\n project = @api.delete_project(project[\"resource\"])\n assert_equal(BigML::HTTP_NO_CONTENT, project[\"code\"])\n\n end", "def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end", "def test_contains_four_eachface\n assert true == false\n end", "def test_valid_record\n process :good_company\n assert_response :success\n\n assert_deprecated_assertion { assert_valid_record 'company' }\n end", "def invisible_testSuccess(c, ci, cv, state)\n @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == c and terms[1] == ci}\nend", "def test_total_codings\n assert_equal 25, @mk.codings.size\n # assert_equal 25, @mk.codings_old.size\n # assert_equal @mk.codings.size, @mk.codings_old.size\n end", "def test_validate_name_and_account_number_by_giving_valid_data\n balance_record_config = BalanceRecordConfig.new\n balance_record_config.first_name = \"RAJ.jk-9\"\n balance_record_config.last_name = \"CC.9-\"\n balance_record_config.account_number = \"gh.gh-89\"\n balance_record_config.save\n assert balance_record_config.valid?, balance_record_config.errors.full_messages.to_s\n end", "def assert_changes_saved\n assert_text \"All changes saved.\"\n end", "def test_add_course_with_invalid_title\r\n number_of_course = Course.count\r\n post :create_course, :course => { :title => ''}\r\n # assert_template 'course/new'\r\n assert_equal number_of_course, Course.count\r\n assert !Course.find(:all, :conditions => \"title = ''\"), \r\n \"The blank title course save into database\"\r\n end", "def test_new\n assert_equal({\n \"drylands\"=>\"Drylands\",\n \"savannah\"=>\"Savanna\",\n }, FakeYaml.load(sample(\"terrain_stuff_l_english\")))\n end", "def solution_correct?\n current = params[:solution].strip\n current.gsub!(/\\/\\*[\\w\\s]*\\*\\//,\"\") \n current.gsub!(/--.*\\n/,\"\")\n existing = format_str(@lesson.solution.strip)\n current = format_str(current.strip)\n if existing == current\n return true\n else\n existing_arr = existing.split\n current_arr = current.split\n len= existing_arr.length\n err =[]\n j=0 \n for i in 0..len\n if existing_arr[i]!=current_arr[i]\n err[j]= existing_arr[i]\n j=j+1 \n end\n end\n return err\n end \n end", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def content_file_checksums_match?\n checksum_failures = \"\"\n described_datafiles.each do |datafile|\n info = datafile.checksum_info\n\n if File.exists?(datafile.datapath) == false\n checksum_failures << \"#{datafile['sip-path']} - missing; \"\n elsif info[0] != info[1]\n checksum_failures << \"#{datafile['sip-path']} - expected: #{info[0]} computed: #{info[1]}; \"\n else\n next\n end\n end\n\n if checksum_failures.length > 0\n metadata[\"checksum_failures\"] = checksum_failures\n return false\n else\n return true\n end\n end", "def test_courses_haz_course_code_and_name_10\n b = Course.new()\n a = Course.create(course_code: \"ABC 123\", name: \"Michael Jackson\")\n assert a.name && a.course_code\n refute b.save\n end", "def test_ut_t4_mtv_pu_002\n pj = Pj.find(3)\n assert_equal FALSE, pj.has_analyzed_task?\n end", "def test_truth\n end" ]
[ "0.825243", "0.6627522", "0.65851676", "0.63383394", "0.6198498", "0.61342806", "0.6125127", "0.61203575", "0.6052599", "0.6051125", "0.6023687", "0.59743345", "0.5962489", "0.58685297", "0.5855546", "0.58372307", "0.5831967", "0.58305585", "0.58274776", "0.58077896", "0.58074874", "0.58025897", "0.5801602", "0.57896537", "0.5789448", "0.57877225", "0.5739693", "0.5739144", "0.5719373", "0.57121557", "0.5688763", "0.5681623", "0.56680834", "0.5653539", "0.5653096", "0.56376696", "0.5632136", "0.56287616", "0.5623654", "0.5620829", "0.5617022", "0.5607957", "0.5607732", "0.5579638", "0.556091", "0.5555346", "0.554093", "0.5536131", "0.55216014", "0.55070597", "0.5500088", "0.5498528", "0.54936147", "0.5488624", "0.5476539", "0.5469186", "0.5454979", "0.54527897", "0.54422307", "0.54382426", "0.54376554", "0.54284835", "0.542492", "0.5424256", "0.5422316", "0.54085445", "0.5399541", "0.5378784", "0.5378081", "0.53750765", "0.53716063", "0.53706986", "0.536973", "0.53639185", "0.53627765", "0.53590196", "0.53584754", "0.5354301", "0.53434813", "0.53434813", "0.532515", "0.53136677", "0.5307368", "0.5295001", "0.52890223", "0.52851", "0.52790195", "0.5276785", "0.5272701", "0.52721006", "0.52652156", "0.5263026", "0.52620244", "0.5261086", "0.5260779", "0.5260663", "0.52583593", "0.5250184", "0.52480084", "0.5246239" ]
0.827891
0
AUTHORIZATIONS Enters authorizations per a given set of test data
def enter_authorizations(test_data) authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::AUTHORIZATION_GRP.name)], authorizations) authorizations.each_with_index do |auth, index| logger.info "Entering authorization data set at index #{index}: #{auth}" enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], 'Local Persons') wait_for_element_and_type(authorization_date_input(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name]) hit_enter wait_for_element_and_type(authorization_note_input(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name]) wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def verify_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def enter_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::AUTHORIZATION_GRP.name)], authorizations)\n authorizations.each_with_index do |auth, index|\n enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[UseOfCollections::AUTHORIZED_BY.name], 'Local Persons')\n wait_for_element_and_type(authorization_date_input(index), auth[UseOfCollections::AUTHORIZATION_DATE.name])\n hit_enter\n wait_for_element_and_type(authorization_note_input(index), auth[UseOfCollections::AUTHORIZATION_NOTE.name])\n wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[UseOfCollections::AUTHORIZATION_STATUS.name])\n end\n end", "def enter_pahma_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::AUTHORIZATION_GRP.name)], authorizations)\n authorizations.each_with_index do |auth, index|\n enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[UseOfCollections::AUTHORIZED_BY.name], 'PAHMA Persons')\n wait_for_element_and_type(authorization_date_input(index), auth[UseOfCollections::AUTHORIZATION_DATE.name])\n hit_enter\n wait_for_element_and_type(authorization_note_input(index), auth[UseOfCollections::AUTHORIZATION_NOTE.name])\n wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[UseOfCollections::AUTHORIZATION_STATUS.name])\n end\n end", "def apply_authorities(env)\n DogBiscuits.config.authorities_add_new.each do |authority_name|\n term = authority_name.to_s.singularize.to_sym\n next unless env.attributes.key? term\n env.attributes[term].each do |attr|\n add_new(authority_name.to_s, attr)\n end\n end\n end", "def authorizations\n @@authorized_actions ||= {}\n @@authorized_actions\n end", "def authorizations(params = {})\n scope 'default'\n post('authorizations/', params)\n end", "def authorize_for_all\n # Clear all authorizations and create an allow-all entry\n ContentAuthorization.transaction do\n update_privacy_level(ContentAuthorization::AuthPublic)\n clear_accessors\n end\n end", "def authorizes(*authorizees)\n TransitiveAuthorization::AuthorizedUser.transitive_authorized_user.class_eval do\n alias_method :old_authorizables_for, :authorizables_for\n alias_method :old_has_role?, :has_role?\n alias_method :old_roles_for, :roles_for\n alias_method :old_method_missing, :method_missing\n include TransitiveAuthorization::Authorizer::InstanceMethods\n self.cattr_accessor :transitive_authorizees\n self.transitive_authorizees ||= Array.new\n self.transitive_authorizees << authorizees\n end\n end", "def ach_authorizations(entity_id)\n API::request(:get, \"entities/#{entity_id}/ach_authorizations\")\n end", "def run_filters\n set_user\n authorize\n end", "def update(*args)\n require_authentication\n arguments(args, required: [:authorization_id]) do\n sift(VALID_AUTH_PARAM_NAMES)\n end\n\n patch_request(\"/authorizations/#{authorization_id}\", arguments.params)\n end", "def authorized_by(authorizer)\n authorizer.to_s.camelize.constantize # get authorizer loaded\n alias_method :old_users, :users\n alias_method :old_method_missing, :method_missing\n include TransitiveAuthorization::Authorizee::InstanceMethods\n self.cattr_accessor :transitive_authorizer\n self.transitive_authorizer = authorizer\n end", "def index\n @authorizations = Authorization.all\n end", "def index\n @authorizations = Authorization.all\n end", "def authorize_for_all_guests\n # Clear all authorizations and create an allow-all entry\n #ContentAuthorization.transaction do\n update_privacy_level(ContentAuthorization::AuthPrivate)\n clear_accessors\n #end\n end", "def reset\n @authorizations = []\n @filters = []\n end", "def test_object_acl_set\r\n\t\tVCR.use_cassette('object_acl_set') do\r\n\t\t\tcred=JSON.parse(YAML::load_file('test/fixtures/credential.yml').to_json)\r\n\t\t\tjson = JSON.parse(File.read(\"test/fixtures/acl_list.json\"))\r\n\t\t\tid = \"#{CORDRA_PREFIX}/RMNH.RENA.44084\"\r\n\t\t\tresult=CordraRestClient::DigitalObject.set_premissions(API_URL, id, json, cred[\"uc_1\"])\r\n\t\t\t#check that the result is saved\r\n\t\t\tassert_equal 200, result[:code]\r\n\t\t\tassert_equal \"OK\", result[\"message\"]\r\n\t\t\tassert_equal 4, result.length\r\n\t\t\tassert_equal 1, result[\"readers\"].length\r\n\t\t\tassert_equal '#{CORDRA_PREFIX}/1517d545cc11283e2360', result[\"readers\"][0]\r\n\t\tend\r\n\tend", "def authorization(*args, &block); end", "def test_review_type_role_assignment\n\n # Verify response when not logged in.\n get :review_type_role_assignment, {},{}\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n\n # Verify response when logged in as a non-admin\n get :review_type_role_assignment, {}, rich_designer_session\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Verify response when logged in as an admin\n get :review_type_role_assignment, {}, cathy_admin_session\n assert_response :success\n\n roles = assigns(roles)['roles']\n review_types = assigns(review_types)['review_types']\n\n assert_equal(@expected_values.size, roles.size)\n assert_equal(5, review_types.size)\n\n roles.each_with_index { |role, i|\n expected_role = @expected_values[i]\n assert_equal(expected_role[:name], role.name)\n\n review_types = role.review_types.sort_by { |rt| rt.name }\n review_types.each_with_index { |rt, j|\n expected_name = expected_role[:review_types][j]\n assert_equal(expected_role[:name]+'::'+expected_name.to_s,\n role.name+'::'+rt.name)\n }\n\n }\n\n expected_values = [\n {:name => 'Final',\n :role_names => ['CE-DFT', 'DFM', 'HWENG',\n 'Mechanical', 'Mechanical-MFG', 'PCB Design',\n 'Planning', 'TDE', 'Valor'] },\n {:name => 'Pre-Artwork',\n :role_names => ['CE-DFT', 'DFM', 'HWENG', \n 'Library', 'Mechanical', 'Mechanical-MFG',\n 'PCB Input Gate', 'PCB Mechanical', 'Planning',\n 'SLM BOM', 'SLM-Vendor', 'TDE',\n 'Valor' ]},\n {:name => 'Placement',\n :role_names => ['CE-DFT', 'DFM', 'HWENG',\n 'Mechanical', 'Mechanical-MFG', 'TDE' ]},\n {:name => 'Routing',\n :role_names => ['CE-DFT', 'DFM', 'HWENG',\n 'Library', 'Mechanical-MFG' ]},\n {:name => 'Release',\n :role_names => ['HWENG', 'Operations Manager',\n 'PCB Design' ]},\n ]\n\n review_types.each_with_index do |review_type, i|\n expected_rt = expected_values[i]\n assert_equal(expected_rt[:name], review_type.name)\n\n review_type.roles.sort_by { |role| role.name }.each_with_index do |role, j|\n expected_role = expected_rt[:role_names]\n expected_name = expected_role[j]\n assert_equal(expected_name, role.name)\n end\n end\n\n end", "def create_authorizations_api\n InfluxDB2::API::AuthorizationsApi.new(@api_client)\n end", "def authorize(num_elems, data, names)\n @ole.Authorize(num_elems, data, names)\n end", "def update_authorizations(role_ids)\n role_ids = role_ids.map {|i| i.to_i }\n roles = self.roles.collect(&:id) # get current role ids\n roles_to_remove = roles - role_ids\n roles_to_add = role_ids - roles\n\n unless roles_to_remove.blank?\n self.authorizations.where(role_id: roles_to_remove).destroy_all\n end\n\n unless roles_to_add.blank?\n roles_to_add.each do |r|\n self.authorizations.create({:role_id => r})\n end\n email_roles_granted(roles_to_add)\n end\n return {:roles_added => roles_to_add, :roles_removed => roles_to_remove}\n end", "def test_method_combinations_with_default_true\n old_permission = nil\n ActiveScaffold.defaults do |config|\n old_permission = config.security.default_permission\n config.security.default_permission = true\n end\n\n pass(@model.authorized_for?(:column => :a3), '_a_')\n miss(@model.authorized_for?(:column => :a2), '_f_')\n pass(@model.authorized_for?(:column => :a1), '_t_')\n\n pass(@model.authorized_for?(:crud_type => :create), 'a__')\n miss(@model.authorized_for?(:crud_type => :update), 'f__')\n pass(@model.authorized_for?(:crud_type => :read), 't__')\n\n pass(@model.authorized_for?(:crud_type => :create, :column => :c3), 'aaa')\n miss(@model.authorized_for?(:crud_type => :create, :column => :b3), 'aaf')\n pass(@model.authorized_for?(:crud_type => :create, :column => :a3), 'aat')\n miss(@model.authorized_for?(:crud_type => :create, :column => :c2), 'afa')\n miss(@model.authorized_for?(:crud_type => :create, :column => :b2), 'aff')\n pass(@model.authorized_for?(:crud_type => :create, :column => :a2), 'aft')\n pass(@model.authorized_for?(:crud_type => :create, :column => :c1), 'ata')\n miss(@model.authorized_for?(:crud_type => :create, :column => :b1), 'atf')\n pass(@model.authorized_for?(:crud_type => :create, :column => :a1), 'att')\n\n miss(@model.authorized_for?(:crud_type => :update, :column => :c3), 'faa')\n miss(@model.authorized_for?(:crud_type => :update, :column => :b3), 'faf')\n pass(@model.authorized_for?(:crud_type => :update, :column => :a3), 'fat')\n miss(@model.authorized_for?(:crud_type => :update, :column => :c2), 'ffa')\n miss(@model.authorized_for?(:crud_type => :update, :column => :b2), 'fff')\n pass(@model.authorized_for?(:crud_type => :update, :column => :a2), 'fft')\n miss(@model.authorized_for?(:crud_type => :update, :column => :c1), 'fta')\n miss(@model.authorized_for?(:crud_type => :update, :column => :b1), 'ftf')\n pass(@model.authorized_for?(:crud_type => :update, :column => :a1), 'ftt')\n\n pass(@model.authorized_for?(:crud_type => :read, :column => :c3), 'taa')\n miss(@model.authorized_for?(:crud_type => :read, :column => :b3), 'taf')\n pass(@model.authorized_for?(:crud_type => :read, :column => :a3), 'tat')\n miss(@model.authorized_for?(:crud_type => :read, :column => :c2), 'tfa')\n miss(@model.authorized_for?(:crud_type => :read, :column => :b2), 'tff')\n pass(@model.authorized_for?(:crud_type => :read, :column => :a2), 'tft')\n pass(@model.authorized_for?(:crud_type => :read, :column => :c1), 'tta')\n miss(@model.authorized_for?(:crud_type => :read, :column => :b1), 'ttf')\n pass(@model.authorized_for?(:crud_type => :read, :column => :a1), 'ttt')\n\n ActiveScaffold.defaults do |config|\n config.security.default_permission = old_permission\n end\n end", "def update(*args)\n raise_authentication_error unless authenticated?\n arguments(args, required: [:id])\n\n patch_request(\"/authorizations/#{arguments.id}\", arguments.params)\n end", "def index\n @claimppriorauthorizations = Claimppriorauthorization.all\n end", "def enter_person_auth_data(test_data)\n enter_terms(test_data)\n enter_nationality(test_data)\n end", "def void_pending_authorizations\n self.transactions.authorized.pending.each do |t|\n t.account.void(t.authorization)\n end\n end", "def set_test\n @test = authorize Test.find(params[:id])\n end", "def do_acl_changes\n if access_controls.requires_changes?\n converge_by(access_controls.describe_changes) do\n access_controls.set_all\n end\n end\n end", "def do_acl_changes\n if access_controls.requires_changes?\n converge_by(access_controls.describe_changes) do\n access_controls.set_all\n end\n end\n end", "def all_authorisor\n -> enforcer, policies, ctx {\n Fn.compose.( finally_fn.(enforcer),\n Fn.fmap_compose.(policies)\n ).(Success(ctx))\n }.curry\n end", "def index\n authorize @publisher\n @publishers_tests = @publisher.tests\n\n end", "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'deny'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def test_index_authorized\n authorize @valid_user\n get :index\n assert_response :success\n assert_template \"index\"\n end", "def test_authorize\n object_person = people(:valid_person) # person_id 1\n subject_person_1aa = people(:person1) # person_id 1aa\n subject_person_2aa = people(:person3) # person_id 2aa\n \n assert Rule.authorize?(subject_person_1aa, object_person.id, \"view\", \"email\")\n assert !Rule.authorize?(subject_person_2aa, object_person.id, \"view\",\"email\")\n\n end", "def test_authors\n auths = [\n \"Jepson, J.E.,Makarkin, V.N., & Jarzembowski, E.A.\", # 0\n \"Ren, D & Meng, X-m.\", # 1\n \"Ren, D and Meng, X-m.\", # 2\n \"Smith, J.H. and Jones, Y.K.\", # 3 \n \"Thomas jr. D.B.\", # 4\n \"Wighton, D.C., & Wilson, M.V.H.\", # 5\n \"Heyden, C.H.G. von & Heyden, L.F.J.D. von\", # 6 \n \"Zhang, B., et al.\", # 7\n \" Zhang, J.F. \", # 8\n \"Hong, Y-C.\", # 9 \n \"Yan, E.V.\", # 10\n \"Foo A, Bar ZA, Smith-Blorf A\", # 11\n \"Smith and Barnes\", # 12\n \"Smith & Barnes\", # 13 \n \"Smith\", # 14 \n \"Smith, Jones and Simon\", # 15\n \"Van Duzee\", # 16\n \"Walker, F.\", # 17\n \"Watson, T. F., D. Langston, D. Fullerton, R. Rakickas, B. Engroff, R. Rokey, and L. Bricker\", # 18\n \"Wheeler, A. G., Jr. and T. J. Henry.\", # 19\n \"Wheeler, A. G., Jr., B. R. Stinner, and T. J. Henry\", # 20\n \"Wilson, L. T. and A. P. Gutierrez\", # 21\n \"Torre-Bueno, J. R. de la\", # 22\n \"Vollenhoven, S. C. S.\", # 23\n \"Usinger, R. L. and P. D. Ashlock\", # 24\n \"van den Bosch, R. and K. Hagen\", # 25\n \"Slater, J. A. and J. E. O'Donnell\", # 26\n \"O'Donnell, J.E. and Slater, J. A.\", # 27\n \"Van Steenwyk, R. A., N. C. Toscano, G. R. Ballmer, K. Kido, and H. T. Reynolds\", # 28\n \"Ward, C. R., C. W. O'Brien, L. B. O'Brien, D. E. Foster, and E. W. Huddleston\", # 29\n \"McPherson, R. M., J. C. Smith, and W. A. Allen\", # 30\n \"Oatman, E. R., J. A. McMurty, H. H. Shorey, and V. Voth\", # 31\n \"Ferrari, E. von \", # 32\n \"Whitaker J. O., Jr., D. Rubin and J. R. Munsee\", # 33\n \"Palisot de Beauvois, A. M. F. J.\", # 34\n \"Maa, T.-C. and K.-S. Lin\", # 35\n \"Costa Lima, A. M. da, C. A. Campos Seabra, and C. R. Hathaway\", # 36\n \"Falcon, L. A., R. van den Bosch, C. A. Ferris, L. K. Stromberg, L. K. Etzel, R. E. Stinner, and T. F. Leigh\", # 37\n \"Kinzer, R. E., J. W. Davis, Jr., J. R. Coppedge, and S. L. Jones\", # 38\n \"Doesburg, P. H. van, Jr. \", # 39\n \"Arias J. R., Young D. G.\" # 40 \n ]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[40])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Arias', 'Young'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{J R}, %w{D G}] , t.names[0..1].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[39])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Doesburg'], t.names.collect{|n| n[:last_name] }\n assert_equal \"van Jr.\", t.names[0][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[38])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Kinzer', 'Davis', 'Coppedge', 'Jones'], t.names.collect{|n| n[:last_name] }\n assert_equal \"Jr.\", t.names[1][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[37])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Falcon', 'van den Bosch', 'Ferris', 'Stromberg', 'Etzel', 'Stinner', 'Leigh'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{L A}, %w{R}, %w{C A}] , t.names[0..2].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[36])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Costa Lima', 'Campos Seabra', 'Hathaway'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{A M}, %w{C A}, %w{C R}] , t.names.collect{|n| n[:initials] }\n assert_equal \"da\" , t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[35])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Maa', 'Lin'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{T -C}, %w{K -S}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[32])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Ferrari'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E}] , t.names.collect{|n| n[:initials] }\n assert_equal ['von'] , t.names.collect{|n| n[:suffix] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[31])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Oatman', 'McMurty', 'Shorey', 'Voth'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E R}, %w{J A}, %w{H H}, %w{V}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[30])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"McPherson\", \"Smith\", \"Allen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R M}, %w{J C}, %w{W A}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[29])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Ward\", \"O'Brien\", \"O'Brien\", \"Foster\", \"Huddleston\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{C R}, %w{C W}, %w{L B}, %w{D E}, %w{E W}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[28])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Van Steenwyk\", \"Toscano\", \"Ballmer\", \"Kido\", \"Reynolds\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R A}, %w{N C}, %w{G R}, %w{K}, %w{H T}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[27])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"O'Donnell\", \"Slater\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"E\"],[\"J\", \"A\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[26])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Slater\", \"O'Donnell\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"A\"],[\"J\", \"E\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[25])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"van den Bosch\", \"Hagen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\"],[\"K\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[24])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Usinger\", \"Ashlock\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\", \"L\"],[\"P\", \"D\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[23])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Vollenhoven\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"S\", \"C\", \"S\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[22])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Torre-Bueno\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"R\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"de la\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[21])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wilson\", \"Gutierrez\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"L\", \"T\"], [\"A\", \"P\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[20])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Stinner\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"B\", \"R\"], [\"T\", \"J\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[19])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"T\", \"J\"]] , [t.names.first[:initials], t.names.last[:initials]]\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[18])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Watson\", \"Langston\", \"Fullerton\", \"Rakickas\", \"Engroff\", \"Rokey\", \"Bricker\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"T\", \"F\"], [\"L\"]] , [t.names.first[:initials], t.names.last[:initials]]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[17])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Walker\", t.names[0][:last_name]\n assert_equal [\"F\"], t.names[0][:initials]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[16])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Van Duzee\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[15])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Jones\", t.names[1][:last_name]\n assert_equal \"Simon\", t.names[2][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[14])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[13])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[12])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[0])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Jepson\", t.names[0][:last_name]\n assert_equal \"JE\", t.names[0][:initials].join\n assert_equal \"Jarzembowski\", t.names[2][:last_name]\n assert_equal \"EA\", t.names[2][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[1])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Ren\", t.names[0][:last_name]\n assert_equal \"D\", t.names[0][:initials].join\n assert_equal \"Meng\", t.names[1][:last_name]\n assert_equal \"X-m\", t.names[1][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[9])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Hong\", t.names[0][:last_name]\n assert_equal \"Y-C\", t.names[0][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[11])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Foo\", t.names[0][:last_name]\n assert_equal \"A\", t.names[0][:initials].join\n assert_equal \"Bar\", t.names[1][:last_name]\n assert_equal \"ZA\", t.names[1][:initials].join\n assert_equal \"Smith-Blorf\", t.names[2][:last_name]\n assert_equal \"A\", t.names[2][:initials].join\n end", "def authorization; end", "def test_update\n ## First test with no user credentials\n # try and update a node without authorisation\n # first try to delete node without auth\n private_user = create(:user, :data_public => false)\n private_node = create(:node, :changeset => create(:changeset, :user => private_user))\n user = create(:user)\n node = create(:node, :changeset => create(:changeset, :user => user))\n\n content node.to_xml\n put :update, :params => { :id => node.id }\n assert_response :unauthorized\n\n ## Second test with the private user\n\n # setup auth\n basic_authorization private_user.email, \"test\"\n\n ## trying to break changesets\n\n # try and update in someone else's changeset\n content update_changeset(private_node.to_xml,\n create(:changeset).id)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"update with other user's changeset should be forbidden when data isn't public\"\n\n # try and update in a closed changeset\n content update_changeset(private_node.to_xml,\n create(:changeset, :closed, :user => private_user).id)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"update with closed changeset should be forbidden, when data isn't public\"\n\n # try and update in a non-existant changeset\n content update_changeset(private_node.to_xml, 0)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"update with changeset=0 should be forbidden, when data isn't public\"\n\n ## try and submit invalid updates\n content xml_attr_rewrite(private_node.to_xml, \"lat\", 91.0)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"node at lat=91 should be forbidden, when data isn't public\"\n\n content xml_attr_rewrite(private_node.to_xml, \"lat\", -91.0)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"node at lat=-91 should be forbidden, when data isn't public\"\n\n content xml_attr_rewrite(private_node.to_xml, \"lon\", 181.0)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"node at lon=181 should be forbidden, when data isn't public\"\n\n content xml_attr_rewrite(private_node.to_xml, \"lon\", -181.0)\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"node at lon=-181 should be forbidden, when data isn't public\"\n\n ## finally, produce a good request which still won't work\n content private_node.to_xml\n put :update, :params => { :id => private_node.id }\n assert_require_public_data \"should have failed with a forbidden when data isn't public\"\n\n ## Finally test with the public user\n\n # try and update a node without authorisation\n # first try to update node without auth\n content node.to_xml\n put :update, :params => { :id => node.id }\n assert_response :forbidden\n\n # setup auth\n basic_authorization user.email, \"test\"\n\n ## trying to break changesets\n\n # try and update in someone else's changeset\n content update_changeset(node.to_xml,\n create(:changeset).id)\n put :update, :params => { :id => node.id }\n assert_response :conflict, \"update with other user's changeset should be rejected\"\n\n # try and update in a closed changeset\n content update_changeset(node.to_xml,\n create(:changeset, :closed, :user => user).id)\n put :update, :params => { :id => node.id }\n assert_response :conflict, \"update with closed changeset should be rejected\"\n\n # try and update in a non-existant changeset\n content update_changeset(node.to_xml, 0)\n put :update, :params => { :id => node.id }\n assert_response :conflict, \"update with changeset=0 should be rejected\"\n\n ## try and submit invalid updates\n content xml_attr_rewrite(node.to_xml, \"lat\", 91.0)\n put :update, :params => { :id => node.id }\n assert_response :bad_request, \"node at lat=91 should be rejected\"\n\n content xml_attr_rewrite(node.to_xml, \"lat\", -91.0)\n put :update, :params => { :id => node.id }\n assert_response :bad_request, \"node at lat=-91 should be rejected\"\n\n content xml_attr_rewrite(node.to_xml, \"lon\", 181.0)\n put :update, :params => { :id => node.id }\n assert_response :bad_request, \"node at lon=181 should be rejected\"\n\n content xml_attr_rewrite(node.to_xml, \"lon\", -181.0)\n put :update, :params => { :id => node.id }\n assert_response :bad_request, \"node at lon=-181 should be rejected\"\n\n ## next, attack the versioning\n current_node_version = node.version\n\n # try and submit a version behind\n content xml_attr_rewrite(node.to_xml,\n \"version\", current_node_version - 1)\n put :update, :params => { :id => node.id }\n assert_response :conflict, \"should have failed on old version number\"\n\n # try and submit a version ahead\n content xml_attr_rewrite(node.to_xml,\n \"version\", current_node_version + 1)\n put :update, :params => { :id => node.id }\n assert_response :conflict, \"should have failed on skipped version number\"\n\n # try and submit total crap in the version field\n content xml_attr_rewrite(node.to_xml,\n \"version\", \"p1r4t3s!\")\n put :update, :params => { :id => node.id }\n assert_response :conflict,\n \"should not be able to put 'p1r4at3s!' in the version field\"\n\n ## try an update with the wrong ID\n content create(:node).to_xml\n put :update, :params => { :id => node.id }\n assert_response :bad_request,\n \"should not be able to update a node with a different ID from the XML\"\n\n ## try an update with a minimal valid XML doc which isn't a well-formed OSM doc.\n content \"<update/>\"\n put :update, :params => { :id => node.id }\n assert_response :bad_request,\n \"should not be able to update a node with non-OSM XML doc.\"\n\n ## finally, produce a good request which should work\n content node.to_xml\n put :update, :params => { :id => node.id }\n assert_response :success, \"a valid update request failed\"\n end", "def authenticate\n unless params[:just_retrieving_resources_to_prove_they_exist_in_client_test]\n render json: { errors: ['You are not authorized'] }, status: :unauthorized\n end\n end", "def void_pending_expired_authorizations\n self.transactions.authorized.pending.expired.each do |t|\n t.account.void(t.authorization)\n end\n end", "def update\n\n # Only allow update by SEA or LEA admin.\n unless is_app_authorizer?\n logger.warn 'User is not SEA or LEA admin and cannot update application authorizations'\n raise ActiveResource::ForbiddenAccess, caller\n end\n\n # Top level edOrg to expand\n edorg = session[:edOrgId]\n # EdOrgs selected using Tree Control\n added = params[:application_authorization][:edorgsAdded] || ''\n added.strip!\n addedEdOrgs = added.split(/,/)\n\n removed = params[:application_authorization][:edorgsRemoved] || ''\n removed.strip!\n removedEdOrgs = removed.split(/,/)\n\n # ID of app\n appId = params[:application_authorization][:appId]\n\n updates = {\"appId\" => appId, \"authorized\" => true, :edorgs => addedEdOrgs}\n @application_authorization = ApplicationAuthorization.find(params[:id])\n success = @application_authorization.update_attributes(updates)\n\n updates = {\"appId\" => appId, \"authorized\" => false, :edorgs => removedEdOrgs}\n @application_authorization = ApplicationAuthorization.find(params[:id])\n success = @application_authorization.update_attributes(updates)\n\n # Redirect to response page\n ApplicationAuthorization.cur_edorg = edorg\n respond_to do |format|\n if success\n format.html { redirect_to application_authorizations_path, notice: 'Application was succesfully updated.'}\n #format.html {redirect_to :action => 'index', notice: 'Application authorization was succesfully updated.'}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @application_authorization.errors, status: :unprocessable_entity }\n end\n end\n end", "def admin_for_companies\n get(\"/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&count=100\")\n end", "def index\n authorize Authentication, :index?\n @authentications = policy_scope(Authentication)\n end", "def set_authorisation_header(request)\n request[\"Authorization\"] = \"Bearer #{access_token}\"\n end", "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def authorized_homerooms\n if EnvironmentVariable.is_true('ENABLE_HOMEROOM_AUTHORIZATION_V2')\n authorizer.homerooms\n else\n authorizer.allowed_homerooms_DEPRECATED(acknowledge_deprecation: true)\n end\n end", "def test_book\n source = <<EOF\n[aliases]\nharry=Harry\nhewlett=Hugh\njoe=Joe\npackard=Packard\nsally=Sally\n[groups]\ncalc-developers = &harry, &sally, &joe\ncalc-owners = &hewlett, &packard\ncalc = @calc-developers, @calc-owners\n[calc:/branches/calc/bug-142]\nharry = rw\nsally = r\n# give sally write access only to the 'testing' subdir\n[calc:/branches/calc/bug-142/testing]\nsally = rw\n# deny harry\n[calc:/branches/calc/bug-142/secret]\nharry =\n[calendar:/projects/calendar]\n$anonymous = r\n$authenticated = rw\n# Any calc participant has read-write access...\n[calc:/projects/calc]\n@calc = rw\n# ...but only allow the owners to make and modify release tags.\n[calc:/projects/calc/tags]\n~@calc-owners = r\nEOF\n io = StringIO.new(source)\n @svnauthz.load(io)\n\n assert_equal(\"rw\",@svnauthz.permissions('harry','calc:/branches/calc/bug-142'))\n assert_equal(\"r\",@svnauthz.permissions('sally','calc:/branches/calc/bug-142'))\n assert_equal(\"rw\",@svnauthz.permissions('harry','calc:/branches/calc/bug-142/testing'))\n assert_equal(\"rw\",@svnauthz.permissions('sally','calc:/branches/calc/bug-142/testing'))\n assert_equal(\"\",@svnauthz.permissions('harry','calc:/branches/calc/bug-142/secret'))\n\n assert_equal(\"rw\",@svnauthz.permissions('anybody','calendar:/projects/calendar'))\n assert_equal(\"r\",@svnauthz.permissions(nil,'calendar:/projects/calendar'))\n devels = ['Harry', 'Sally', 'Joe']\n owners = ['Hugh', 'Packard']\n (devels+owners).each {|u| assert_equal(\"rw\",@svnauthz.permissions(u,'calc:/projects/calc'),\"#{u}\")}\n devels.each {|u| assert_equal(\"r\",@svnauthz.permissions(u,'calc:/projects/calc/tags'),\"#{u}\")}\n owners.each {|u| assert_equal(\"rw\",@svnauthz.permissions(u,'calc:/projects/calc/tags'),\"#{u}\")}\n end", "def principals\n modify\n end", "def authorize_collection! action, collection\n collection.map do |model|\n authorize! action, model\n end\n end", "def ingest_rbac\n Rbac::Ingest.new(@options).run\n end", "def index\n @claimauthorizations = Claimauthorization.all\n end", "def index\n authorize controller_class\n render json: policy_class::Scope.new(current_user, controller_class).editable.order(prepared_params[:sort]),\n include: prepared_params[:include], fields: prepared_params[:fields]\n end", "def authorize\n end", "def authorize\n end", "def test_set3_14_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny'\n res_ob_adrs='/db/temp/test'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs) \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def load_authorities(options)\n return unless options[:authorities]\n\n redis = options.fetch(:redis, redis_connect(options))\n Argot::AuthorityEnricher.new(redis: redis).as_block\n end", "def update_authorization(id, options={})\n patch \"/authorizations/#{id}\", :body => options\n end", "def index\n # @users = User.all\n # authorize @users \n @users = policy_scope(User)\n authorize @users\n end", "def authorities=(authorities)\n AuthorityRole.delete_all(:role_name => self.name)\n if authorities\n for authority in authorities\n AuthorityRole.new(:role_name => self.name,\n :authority_name => authority.name).save\n end\n end\n end", "def test_set3_16_check()\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny' \n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def index\n @samples = policy_scope(Sample.all)\n authorize Sample\n end", "def setup_with_audit!\n self.settings = audit_user.settings\n self.treatments = reified_actives_for(\"treatments\").map do |t|\n # uniq_name = \"treatment_#{t[\"name\"]}\"\n # quantity, unit = settings[\"#{uniq_name}_quantity\"], settings[\"#{uniq_name}_unit\"]\n\n {name: t[\"name\"], quantity: nil, unit: nil}\n end\n self.conditions = reified_actives_for(\"conditions\").map(&:name)\n self.catalogs = self.conditions.map { |c| CATALOG_CONDITIONS[c] }.compact\n\n save_without_processing\n self\n end", "def update_access_controls!\n update!(edit_users: permission_template.agent_ids_for(access: 'manage', agent_type: 'user'),\n edit_groups: permission_template.agent_ids_for(access: 'manage', agent_type: 'group'))\n end", "def index\n @admins = Admin.order(:email)\n authorize @admins\n end", "def set_test\n @test = authorize Test.includes(plate: [wells: [sample: [:client]]]).find(params[:id])\n end", "def update!(**args)\n @authorization = args[:authorization] if args.key?(:authorization)\n end", "def update!(**args)\n @authorization = args[:authorization] if args.key?(:authorization)\n end", "def index\n @bookings = policy_scope(current_user.bookings)\n authorize @bookings\n @experiences = policy_scope(current_user.experiences)\n authorize @experiences\n end", "def assert_rbac(klass, ids)\n num_visible = Rbac.filtered(klass.where(:id => ids), :user => current_user).count\n raise _(\"Unauthorized object or action\") unless ids.length == num_visible\n end", "def test_set3_13_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'ALL_PRIVILEGES'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'ALTER'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n priv_name = 'ALTER'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n priv_name = 'DROP'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def test_ut_t2_ars_arc_014\n # pu admin\n current_user = User.find_by_id(PU_ADMIN_ID)\n # ars created by pu\n pu_id = PrivilegesUsers.find_all_by_user_id(current_user.id)[0].pu_id\n ars = Pu.find_by_id(pu_id).analyze_rule_configs[0]\n ars.created_by = current_user.id\n ars.save\n #\n assert ars.editable?(current_user,pu_id,nil)\n end", "def test_authorize_according_to_one_rule\n rule_or = rules(:active_or_rule) # friends or members of group tkk can view name of person 1\n rule_and = rules(:active_and_rule) # friends who are members of group tkk can view email of person 1\n\n action_view_name = actions(:view_name)\n action_view_email = actions(:view_email)\n object_person = people(:valid_person) # person id 1\n subject_person_test = people(:test) # not friend, not member of group tkk\n subject_person_4 = people(:friend) # person 4 is a friend, but not a member of group tkk\n subject_person_1aa = people(:person1) # person 1aa is a friend, and also a member of group tkk\n\n assert subject_person_1aa.contacts.include? object_person\n assert subject_person_1aa.is_member_of? groups(:tkk)\n\n assert !rule_or.authorize_according_to_one_rule(subject_person_test, object_person.id, action_view_name.action_type, action_view_name.action_value)\n assert !rule_and.authorize_according_to_one_rule(subject_person_test, object_person.id, action_view_email.action_type, action_view_email.action_value)\n assert rule_or.authorize_according_to_one_rule(subject_person_4, object_person.id, action_view_name.action_type, action_view_name.action_value)\n assert !rule_and.authorize_according_to_one_rule(subject_person_4, object_person.id, action_view_email.action_type, action_view_email.action_value)\n assert rule_or.authorize_according_to_one_rule(subject_person_1aa, object_person.id, action_view_name.action_type, action_view_name.action_value)\n assert rule_and.authorize_according_to_one_rule(subject_person_1aa, object_person.id, action_view_email.action_type, action_view_email.action_value)\n end", "def list\n response = Tiptaplab.api.make_call(\"users/authorizations\")\n response.keys\n end", "def check_authorizations!\n raise FphsNotAuthorized unless can_create_in_list?\n\n unless list_class.no_master_association || from_master.allows_user_access\n raise FphsNotAuthorized, 'Master does not allow user access'\n end\n\n raise FphsNotAuthorized, \"No access to #{source_type}\" unless can_access_source_type?\n\n raise FphsNotAuthorized, \"No access to #{assoc_name}\" unless can_access_associated_table?\n end", "def authorization_tier_collection\n @authorization_tier_collection = @authorization_tiers.invert\n end", "def set_authorization\n @user ||= current_user\n authorize @user\n end", "def authorized(&block)\n authorizer.authorized(&block)\n end", "def authorized(&block)\n authorizer.authorized(&block)\n end", "def index\n @authorized_clients = AuthorizedClient.all\n end", "def roles=(roles_arr)\n self.authorizations = []\n roles_arr.each do |role|\n find_or_create_authorization(role) unless role.blank?\n end\n end", "def roles=(roles_arr)\n self.authorizations = []\n roles_arr.each do |role|\n find_or_create_authorization(role) unless role.blank?\n end\n end", "def set_test_status\n @test_status = TestStatus.find(params[:id])\n authorize @test_status\n end", "def save\n response = if @id.nil?\n Cloud.instance.post ['cloud-service-auth', 'accounts', @account.id, 'authorities'], self\n else\n raise 'editing authorities not supported'\n # @cloud.put [\"cloud-service-auth\", \"principals\", @id], self\n end\n apply_data(response.body)\n self\n end", "def authorize_resource(*args); end", "def test_process_assignments\n \n board_prep_sections = [oi_category_sections(:board_prep_1),\n oi_category_sections(:board_prep_2),\n oi_category_sections(:board_prep_3)]\n section_ids = board_prep_sections.collect { |s| s.id }\n team_member_list = [@siva_e]\n \n section_selections = {}\n section_ids.each { |id| section_selections[id.to_s] = '0' }\n\n\n # Try accessing from an account that is not a PCB Designer and\n # verify that the user is redirected.\n post(:process_assignments,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :section => section_selections },\n pat_dfm_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(\"You are not authorized to access this page\", flash['notice'])\n \n \n # Verify that a contractor PCB Designer can not access the list.\n post(:process_assignments,\n { :category => { :id => @board_prep.id },\n :design => { :id => @mx234a.id },\n :section => section_selections },\n siva_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(\"You are not authorized to access this page\", flash['notice'])\n\n end", "def test_set3_15_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test' \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def prepare_for_tests( runs, collectors )\n if Maadi::Expert::Expert::is_expert?( @expert ) and Maadi::Organizer::Organizer::is_organizer?( @organizer )\n if @organizer.works_with?( @expert.domain )\n Maadi::post_message(:Info, 'Expert and Organizer are compatible')\n else\n Maadi::post_message(:Warn, \"Expert (#{@expert.domain}) is NOT compatible with Organizer (#{@organizer.supported_domains.join(', ')})\")\n return false\n end\n\n unless @expert.is_ready?\n @expert.prepare\n end\n\n unless @organizer.is_ready?\n @organizer.prepare\n end\n\n if @expert.is_ready? && @organizer.is_ready?\n collectors.each do |collector|\n collector.log_options( @expert )\n collector.log_options( @organizer )\n end\n\n parameters = @expert.parameters( 'all' )\n ready = @organizer.available_parameters( parameters, runs )\n\n if ready\n Maadi::post_message(:More, 'Generator is ready')\n return true\n end\n else\n Maadi::post_message(:Warn, 'Expert or Organizer NOT ready')\n end\n else\n Maadi::post_message(:Warn, 'Expert or Organizer NOT correct type/initialized')\n end\n\n return false\n end", "def index\n @organization_profiles = policy_scope(OrganizationProfile).all\n authorize User\n end", "def update_applicationAuthorization(dbName)\n appAuth2Id = {}\n @conn[dbName][APPAUTH_COLLECTION].find({}).each do |appAuth|\n id = appAuth[\"_id\"]\n appAuth2Id[id] = appAuth[\"body\"]\n end\n appAuth2Id.each do |id, appAuth_body|\n puts id if DEBUG == true\n edorgs = appAuth_body[\"edorgs\"]\n if appAuth_body.has_key?(\"edorgs\") and notMigrated(edorgs)\n edorgs_new = []\n edorgs.each do |edorg|\n edorg_entry = {}\n edorg_entry[\"authorizedEdorg\"] = edorg\n edorgs_new.push(edorg_entry)\n end\n appAuth_body[\"edorgs\"] = edorgs_new\n @conn[dbName][APPAUTH_COLLECTION].update({\"_id\"=>id}, {\"body\"=>appAuth_body})\n end\n end\nend", "def create_authorizer\n auth = {}\n [\n # ACCOUNT\n :can_create_account?,\n :can_view_account?,\n :can_renew_account?,\n :can_close_account?,\n # RESOURCE\n :can_create_resource?,\n :can_view_resource?,\n :can_release_resource?,\n :can_modify_resource?,\n # LEASE\n :can_create_lease?,\n :can_view_lease?,\n :can_modify_lease?,\n :can_release_lease?,\n ].each do |m| auth[m] = true end\n OMF::SFA::AM::DefaultAuthorizer.new(auth)\n end", "def create_authorizer\n auth = {}\n [\n # ACCOUNT\n :can_create_account?,\n :can_view_account?,\n :can_renew_account?,\n :can_close_account?,\n # RESOURCE\n :can_create_resource?,\n :can_view_resource?,\n :can_release_resource?,\n :can_modify_resource?,\n # LEASE\n :can_create_lease?,\n :can_view_lease?,\n :can_modify_lease?,\n :can_release_lease?,\n ].each do |m| auth[m] = true end\n OMF::SFA::AM::DefaultAuthorizer.new(auth)\n end", "def update_resource_from_rspec(resource_el, leases, clean_state, authorizer)\n debug \"central update_resource_from_rspec: resource_el:'#{resource_el}' leases: #{leases} clean_state:'#{clean_state}'\"\n []\n end", "def authorization(id)\n get \"/authorizations/#{id}\"\n end", "def authorizations_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuthorizationsApi.authorizations_list ...'\n end\n # resource path\n local_var_path = '/authorizations'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Authorization>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthorizationsApi#authorizations_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end", "def index\n if admin_signed_in? && current_admin.company? \n @admin = current_admin\n @company = @admin.company\n @timesheets = @company.timesheets.order(updated_at: :desc)\n @orders = @company.orders\n @with_active_jobs = @orders.with_active_jobs\n authorize @orders\n elsif user_signed_in? && current_user.not_an_employee?\n @current_user = current_user if current_user.present?\n @company = @current_user.company\n @orders = @company.orders\n @with_active_jobs = @orders.with_active_jobs\n @timesheets = @company.timesheets.order(updated_at: :desc)\n authorize @orders\n end\n \n \n \n\n \n end", "def test_different_method\n make_controller :different_header\n get :index\n assert_protected\n login :index, 'ferret', 'REVOLUTION', 'MY_OWN_MAGIC1'\n assert_response :success\n login :index, 'ferret', 'REVOLUTION', 'MY_OWN_MAGIC2'\n assert_response :success\n end", "def index\n @authorities = Authority.all\n end", "def index\n @authorities = Authority.all\n end", "def pundit_authorize\n authorize [:admin, @testimonial||:testimonial]\n end" ]
[ "0.73924065", "0.7369466", "0.73413664", "0.69584966", "0.6077782", "0.6047196", "0.60247546", "0.5831679", "0.57561964", "0.567943", "0.5657679", "0.56197613", "0.55741775", "0.55505776", "0.55505776", "0.5503196", "0.54036134", "0.53916806", "0.53885525", "0.53673524", "0.534759", "0.53464633", "0.5303546", "0.52914256", "0.5290658", "0.5272772", "0.52673984", "0.51750064", "0.5148136", "0.5147857", "0.5147857", "0.51409817", "0.5126368", "0.51182455", "0.5105783", "0.5105213", "0.50748146", "0.50705636", "0.50650036", "0.5060029", "0.50590986", "0.50356174", "0.5022836", "0.50179106", "0.50050837", "0.50023097", "0.49885207", "0.49603364", "0.4959308", "0.49545625", "0.49530703", "0.49472487", "0.49314168", "0.49230245", "0.49230245", "0.49206007", "0.4920393", "0.49100626", "0.49092236", "0.49015862", "0.48982906", "0.48949996", "0.4880817", "0.48700103", "0.4867038", "0.4859914", "0.4855836", "0.4855836", "0.48514017", "0.4849235", "0.4848073", "0.48440203", "0.48423406", "0.4836371", "0.48251715", "0.4815309", "0.48146874", "0.4813929", "0.4813929", "0.48122764", "0.4810812", "0.4810812", "0.48057744", "0.4803875", "0.4789234", "0.4786", "0.4784028", "0.47814682", "0.4769465", "0.47661078", "0.47635993", "0.47635993", "0.47602925", "0.47545305", "0.4753643", "0.47535047", "0.47466123", "0.47425613", "0.47425613", "0.4739721" ]
0.73114604
3
Verifies authorizations match test data
def verify_authorizations(test_data) authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization] authorizations.each_with_index do |auth, index| verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index)) verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index)) verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index)) verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def verify()\n # TODO\n end", "def test_authorize\n object_person = people(:valid_person) # person_id 1\n subject_person_1aa = people(:person1) # person_id 1aa\n subject_person_2aa = people(:person3) # person_id 2aa\n \n assert Rule.authorize?(subject_person_1aa, object_person.id, \"view\", \"email\")\n assert !Rule.authorize?(subject_person_2aa, object_person.id, \"view\",\"email\")\n\n end", "def verify\n end", "def enter_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::AUTHORIZATION_GRP.name)], authorizations)\n authorizations.each_with_index do |auth, index|\n enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[UseOfCollections::AUTHORIZED_BY.name], 'Local Persons')\n wait_for_element_and_type(authorization_date_input(index), auth[UseOfCollections::AUTHORIZATION_DATE.name])\n hit_enter\n wait_for_element_and_type(authorization_note_input(index), auth[UseOfCollections::AUTHORIZATION_NOTE.name])\n wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[UseOfCollections::AUTHORIZATION_STATUS.name])\n end\n end", "def verify\n end", "def verify\n\n end", "def enter_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::AUTHORIZATION_GRP.name)], authorizations)\n authorizations.each_with_index do |auth, index|\n logger.info \"Entering authorization data set at index #{index}: #{auth}\"\n enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], 'Local Persons')\n wait_for_element_and_type(authorization_date_input(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name])\n hit_enter\n wait_for_element_and_type(authorization_note_input(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name])\n wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name])\n end\n end", "def test_set3_14_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny'\n res_ob_adrs='/db/temp/test'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs) \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def test_set3_16_check()\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny' \n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def enter_pahma_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::AUTHORIZATION_GRP.name)], authorizations)\n authorizations.each_with_index do |auth, index|\n enter_auto_complete(authorized_by_input(index), authorized_by_options(index), auth[UseOfCollections::AUTHORIZED_BY.name], 'PAHMA Persons')\n wait_for_element_and_type(authorization_date_input(index), auth[UseOfCollections::AUTHORIZATION_DATE.name])\n hit_enter\n wait_for_element_and_type(authorization_note_input(index), auth[UseOfCollections::AUTHORIZATION_NOTE.name])\n wait_for_options_and_select(authorization_status_input(index), authorization_status_options(index), auth[UseOfCollections::AUTHORIZATION_STATUS.name])\n end\n end", "def verify\n head :ok\n end", "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def authenticate\n unless params[:just_retrieving_resources_to_prove_they_exist_in_client_test]\n render json: { errors: ['You are not authorized'] }, status: :unauthorized\n end\n end", "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'deny'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def test_set3_15_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test' \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def verify!\n return true if verified?\n http = Net::HTTP.new('rest.akismet.com', 80)\n resp, data = http.post('/1.1/verify-key', \"key=#{@key}&blog=#{@blog}\", @headers)\n @verified = (data == \"valid\")\n end", "def verify\n # nothing to do here, so just return\n end", "def test_index_authorized\n authorize @valid_user\n get :index\n assert_response :success\n assert_template \"index\"\n end", "def verify_against_enabled_authorization_handlers\n @verified_handler= authorization_handlers.find {|handler| handler.valid? }\n\n errors.add(:authorizations, :invalid) unless @verified_handler\n end", "def verify_access_token\n Rails.logger.debug \"====== request.headers['Authorization'] = #{request.headers['Authorization']} ======\"\n\n server = AuthorizationServer.new(Application.authorization_server,\n Application.resource_server)\n\n result, @authorized_user = server.authorize_request(request)\n Rails.logger.debug \"------ authorized_user = #{@authorized_user.inspect} ------\"\n\n # If the result is OK, proceed with the operation\n head result unless result == :ok\n end", "def verify_iss; end", "def verify_iss; end", "def test_BooksForAnAuthor\n loginRegisterBazzarVoice\n writeReview \n assert true \n end", "def verified?\n true\n end", "def test_valid\n assoc = Association.new('handle', 'secret', Time.now, 10000, 'HMAC-SHA1')\n\n assert_log_matches() {\n assert_equal(call_negotiate([assoc]), assoc)\n }\n end", "def test_successful_authorize_stored_card_metadata\n test_successful_purchase_credit_card_metadata(false, true, true)\n end", "def test_successful_authorize_encryption_credit_card_metadata\n test_successful_purchase_credit_card_metadata(true, true)\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def test_authors\n auths = [\n \"Jepson, J.E.,Makarkin, V.N., & Jarzembowski, E.A.\", # 0\n \"Ren, D & Meng, X-m.\", # 1\n \"Ren, D and Meng, X-m.\", # 2\n \"Smith, J.H. and Jones, Y.K.\", # 3 \n \"Thomas jr. D.B.\", # 4\n \"Wighton, D.C., & Wilson, M.V.H.\", # 5\n \"Heyden, C.H.G. von & Heyden, L.F.J.D. von\", # 6 \n \"Zhang, B., et al.\", # 7\n \" Zhang, J.F. \", # 8\n \"Hong, Y-C.\", # 9 \n \"Yan, E.V.\", # 10\n \"Foo A, Bar ZA, Smith-Blorf A\", # 11\n \"Smith and Barnes\", # 12\n \"Smith & Barnes\", # 13 \n \"Smith\", # 14 \n \"Smith, Jones and Simon\", # 15\n \"Van Duzee\", # 16\n \"Walker, F.\", # 17\n \"Watson, T. F., D. Langston, D. Fullerton, R. Rakickas, B. Engroff, R. Rokey, and L. Bricker\", # 18\n \"Wheeler, A. G., Jr. and T. J. Henry.\", # 19\n \"Wheeler, A. G., Jr., B. R. Stinner, and T. J. Henry\", # 20\n \"Wilson, L. T. and A. P. Gutierrez\", # 21\n \"Torre-Bueno, J. R. de la\", # 22\n \"Vollenhoven, S. C. S.\", # 23\n \"Usinger, R. L. and P. D. Ashlock\", # 24\n \"van den Bosch, R. and K. Hagen\", # 25\n \"Slater, J. A. and J. E. O'Donnell\", # 26\n \"O'Donnell, J.E. and Slater, J. A.\", # 27\n \"Van Steenwyk, R. A., N. C. Toscano, G. R. Ballmer, K. Kido, and H. T. Reynolds\", # 28\n \"Ward, C. R., C. W. O'Brien, L. B. O'Brien, D. E. Foster, and E. W. Huddleston\", # 29\n \"McPherson, R. M., J. C. Smith, and W. A. Allen\", # 30\n \"Oatman, E. R., J. A. McMurty, H. H. Shorey, and V. Voth\", # 31\n \"Ferrari, E. von \", # 32\n \"Whitaker J. O., Jr., D. Rubin and J. R. Munsee\", # 33\n \"Palisot de Beauvois, A. M. F. J.\", # 34\n \"Maa, T.-C. and K.-S. Lin\", # 35\n \"Costa Lima, A. M. da, C. A. Campos Seabra, and C. R. Hathaway\", # 36\n \"Falcon, L. A., R. van den Bosch, C. A. Ferris, L. K. Stromberg, L. K. Etzel, R. E. Stinner, and T. F. Leigh\", # 37\n \"Kinzer, R. E., J. W. Davis, Jr., J. R. Coppedge, and S. L. Jones\", # 38\n \"Doesburg, P. H. van, Jr. \", # 39\n \"Arias J. R., Young D. G.\" # 40 \n ]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[40])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Arias', 'Young'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{J R}, %w{D G}] , t.names[0..1].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[39])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Doesburg'], t.names.collect{|n| n[:last_name] }\n assert_equal \"van Jr.\", t.names[0][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[38])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Kinzer', 'Davis', 'Coppedge', 'Jones'], t.names.collect{|n| n[:last_name] }\n assert_equal \"Jr.\", t.names[1][:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[37])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Falcon', 'van den Bosch', 'Ferris', 'Stromberg', 'Etzel', 'Stinner', 'Leigh'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{L A}, %w{R}, %w{C A}] , t.names[0..2].collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[36])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Costa Lima', 'Campos Seabra', 'Hathaway'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{A M}, %w{C A}, %w{C R}] , t.names.collect{|n| n[:initials] }\n assert_equal \"da\" , t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[35])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Maa', 'Lin'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{T -C}, %w{K -S}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[32])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Ferrari'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E}] , t.names.collect{|n| n[:initials] }\n assert_equal ['von'] , t.names.collect{|n| n[:suffix] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[31])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal ['Oatman', 'McMurty', 'Shorey', 'Voth'], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{E R}, %w{J A}, %w{H H}, %w{V}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[30])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"McPherson\", \"Smith\", \"Allen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R M}, %w{J C}, %w{W A}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[29])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Ward\", \"O'Brien\", \"O'Brien\", \"Foster\", \"Huddleston\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{C R}, %w{C W}, %w{L B}, %w{D E}, %w{E W}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[28])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Van Steenwyk\", \"Toscano\", \"Ballmer\", \"Kido\", \"Reynolds\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [%w{R A}, %w{N C}, %w{G R}, %w{K}, %w{H T}] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[27])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"O'Donnell\", \"Slater\" ], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"E\"],[\"J\", \"A\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[26])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Slater\", \"O'Donnell\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"A\"],[\"J\", \"E\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[25])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"van den Bosch\", \"Hagen\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\"],[\"K\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[24])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Usinger\", \"Ashlock\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"R\", \"L\"],[\"P\", \"D\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[23])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Vollenhoven\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"S\", \"C\", \"S\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[22])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Torre-Bueno\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"J\", \"R\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"de la\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[21])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wilson\", \"Gutierrez\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"L\", \"T\"], [\"A\", \"P\"]] , t.names.collect{|n| n[:initials] }\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[20])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Stinner\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"B\", \"R\"], [\"T\", \"J\"]] , t.names.collect{|n| n[:initials] }\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[19])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Wheeler\", \"Henry\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"A\", \"G\"], [\"T\", \"J\"]] , [t.names.first[:initials], t.names.last[:initials]]\n assert_equal \"Jr.\", t.names.first[:suffix]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[18])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal [\"Watson\", \"Langston\", \"Fullerton\", \"Rakickas\", \"Engroff\", \"Rokey\", \"Bricker\"], t.names.collect{|n| n[:last_name] }\n assert_equal [[\"T\", \"F\"], [\"L\"]] , [t.names.first[:initials], t.names.last[:initials]]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[17])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Walker\", t.names[0][:last_name]\n assert_equal [\"F\"], t.names[0][:initials]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[16])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Van Duzee\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[15])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Jones\", t.names[1][:last_name]\n assert_equal \"Simon\", t.names[2][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[14])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[13])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[12])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Smith\", t.names[0][:last_name]\n assert_equal \"Barnes\", t.names[1][:last_name]\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[0])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Jepson\", t.names[0][:last_name]\n assert_equal \"JE\", t.names[0][:initials].join\n assert_equal \"Jarzembowski\", t.names[2][:last_name]\n assert_equal \"EA\", t.names[2][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[1])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 2, t.names.size\n assert_equal \"Ren\", t.names[0][:last_name]\n assert_equal \"D\", t.names[0][:initials].join\n assert_equal \"Meng\", t.names[1][:last_name]\n assert_equal \"X-m\", t.names[1][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[9])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 1, t.names.size\n assert_equal \"Hong\", t.names[0][:last_name]\n assert_equal \"Y-C\", t.names[0][:initials].join\n\n lexer = Taxonifi::Splitter::Lexer.new(auths[11])\n assert t = lexer.pop(Taxonifi::Splitter::Tokens::Authors)\n assert_equal 3, t.names.size\n assert_equal \"Foo\", t.names[0][:last_name]\n assert_equal \"A\", t.names[0][:initials].join\n assert_equal \"Bar\", t.names[1][:last_name]\n assert_equal \"ZA\", t.names[1][:initials].join\n assert_equal \"Smith-Blorf\", t.names[2][:last_name]\n assert_equal \"A\", t.names[2][:initials].join\n end", "def enter_person_auth_data(test_data)\n enter_terms(test_data)\n enter_nationality(test_data)\n end", "def authorize(_subject, _auth)\n false\n end", "def test_verifier\n @client = SRP::Client.new @login,\n :password => @password,\n :salt => '4c78c3f8'.hex\n v = '474c26aa42d11f20544a00f7bf9711c4b5cf7aab95ed448df82b95521b96668e7480b16efce81c861870302560ddf6604c67df54f1d04b99d5bb9d0f02c6051ada5dc9d594f0d4314e12f876cfca3dcd99fc9c98c2e6a5e04298b11061fb8549a22cde0564e91514080df79bca1c38c682214d65d590f66b3719f954b078b83c'\n assert_equal v, \"%x\" % @client.verifier\n end", "def verify\n\t\t#puts \"INSIDE DEF: vERIFY IN ORDER CONCERN.\"\n\t\tself.reports.each do |report|\n\t\t\treport.a_test_was_verified = false\n\t\t\tif report.consider_for_processing?(self.history_tags)\n\t\t\t#puts \"checking report: #{report.name}\"\n\t\t\t#puts \"report verify all is: #{report.verify_all},,, #{Diagnostics::Report::VERIFY_ALL}\"\n\t\t\t\tif report.verify_all == Diagnostics::Report::VERIFY_ALL\n\t\t\t\t\t#puts \"reprot verify all is true\"\n\t\t\t\t\tif report.impression.blank?\n\t\t\t\t\t\t#puts \"impression is balnk\"\n\t\t\t\t\t\treport.tests.each do |test|\n\t\t\t\t\t\t\t#puts \"Calling verify if normal on test: #{test.name}\"\n\t\t\t\t\t\t\tunless test.verify_if_normal(self.current_user).blank?\n\t\t\t\t\t\t\t\treport.a_test_was_verified = true\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\treport.tests.each do |test|\n\t\t\t\t\t\t\tunless test.verify.blank?\n\t\t\t\t\t\t\t\treport.a_test_was_verified = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def test_successful_authorize_encryption_stored_card_metadata\n test_successful_purchase_stored_card_metadata(true, true)\n end", "def test_successful_authorize_credit_card_metadata\n test_successful_purchase_credit_card_metadata(false, true, false)\n end", "def test_authorize_according_to_one_rule\n rule_or = rules(:active_or_rule) # friends or members of group tkk can view name of person 1\n rule_and = rules(:active_and_rule) # friends who are members of group tkk can view email of person 1\n\n action_view_name = actions(:view_name)\n action_view_email = actions(:view_email)\n object_person = people(:valid_person) # person id 1\n subject_person_test = people(:test) # not friend, not member of group tkk\n subject_person_4 = people(:friend) # person 4 is a friend, but not a member of group tkk\n subject_person_1aa = people(:person1) # person 1aa is a friend, and also a member of group tkk\n\n assert subject_person_1aa.contacts.include? object_person\n assert subject_person_1aa.is_member_of? groups(:tkk)\n\n assert !rule_or.authorize_according_to_one_rule(subject_person_test, object_person.id, action_view_name.action_type, action_view_name.action_value)\n assert !rule_and.authorize_according_to_one_rule(subject_person_test, object_person.id, action_view_email.action_type, action_view_email.action_value)\n assert rule_or.authorize_according_to_one_rule(subject_person_4, object_person.id, action_view_name.action_type, action_view_name.action_value)\n assert !rule_and.authorize_according_to_one_rule(subject_person_4, object_person.id, action_view_email.action_type, action_view_email.action_value)\n assert rule_or.authorize_according_to_one_rule(subject_person_1aa, object_person.id, action_view_name.action_type, action_view_name.action_value)\n assert rule_and.authorize_according_to_one_rule(subject_person_1aa, object_person.id, action_view_email.action_type, action_view_email.action_value)\n end", "def test_26\n customer_hash = {\n 'orderId' => '26',\n 'amount' => '18698',\n 'orderSource'=>'ecommerce',\n 'card'=>{\n 'number' =>'5194560012341234',\n 'expDate' => '1212',\n 'type' => 'MC'},\n 'allowPartialAuth' => 'true',\n 'healthcareIIAS' => {\n 'healthcareAmounts' => {\n 'totalHealthcareAmount' =>'20000'\n },\n 'IIASFlag' => 'Y'\n }\n }\n hash = customer_hash.merge(@@merchant_hash)\n auth_response = CnpOnlineRequest.new.authorization(hash)\n assert_equal('341', auth_response.authorizationResponse.response)\n assert_equal('Invalid healthcare amounts', auth_response.authorizationResponse.message)\n end", "def verify\n #@blog.verified = 1\n if @blog.verify\n succ\n else\n err\n end\n end", "def test_object_acl_set\r\n\t\tVCR.use_cassette('object_acl_set') do\r\n\t\t\tcred=JSON.parse(YAML::load_file('test/fixtures/credential.yml').to_json)\r\n\t\t\tjson = JSON.parse(File.read(\"test/fixtures/acl_list.json\"))\r\n\t\t\tid = \"#{CORDRA_PREFIX}/RMNH.RENA.44084\"\r\n\t\t\tresult=CordraRestClient::DigitalObject.set_premissions(API_URL, id, json, cred[\"uc_1\"])\r\n\t\t\t#check that the result is saved\r\n\t\t\tassert_equal 200, result[:code]\r\n\t\t\tassert_equal \"OK\", result[\"message\"]\r\n\t\t\tassert_equal 4, result.length\r\n\t\t\tassert_equal 1, result[\"readers\"].length\r\n\t\t\tassert_equal '#{CORDRA_PREFIX}/1517d545cc11283e2360', result[\"readers\"][0]\r\n\t\tend\r\n\tend", "def verify\n @educator = Educator.find(params[:id])\n respond_to do |format|\n if @educator.update(verified: true)\n format.html { redirect_to current_admin, notice: 'Educator successfully verified.' }\n format.json { render current_admin, status: :ok, location: @educator }\n else\n format.html { redirect_to current_admin }\n format.json { render json: @educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_set3_13_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'ALL_PRIVILEGES'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'ALTER'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n priv_name = 'ALTER'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n priv_name = 'DROP'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def verify\n recipes.each { |rcp| rcp.verify }\n end", "def verify_authorization_code_hash!\n sha_256 = OpenSSL::Digest::SHA256.new\n digest = sha_256.digest(@authorization_code)\n left_half_digest = digest[0...(digest.size / 2)]\n encoded_digest = Base64.urlsafe_encode64(left_half_digest, padding: false)\n\n code_hash = decode_without_verification(@claimed_id_token)[:c_hash]\n\n unless code_hash == encoded_digest\n raise SignInWithAppleErrors::AuthorizationCodeMismatch, \"Authorization Code is invalid. Authorization_code value: #{@authorization_code}, c_hash value: #{code_hash}\"\n end\n end", "def test_review_type_role_assignment\n\n # Verify response when not logged in.\n get :review_type_role_assignment, {},{}\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n\n # Verify response when logged in as a non-admin\n get :review_type_role_assignment, {}, rich_designer_session\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Verify response when logged in as an admin\n get :review_type_role_assignment, {}, cathy_admin_session\n assert_response :success\n\n roles = assigns(roles)['roles']\n review_types = assigns(review_types)['review_types']\n\n assert_equal(@expected_values.size, roles.size)\n assert_equal(5, review_types.size)\n\n roles.each_with_index { |role, i|\n expected_role = @expected_values[i]\n assert_equal(expected_role[:name], role.name)\n\n review_types = role.review_types.sort_by { |rt| rt.name }\n review_types.each_with_index { |rt, j|\n expected_name = expected_role[:review_types][j]\n assert_equal(expected_role[:name]+'::'+expected_name.to_s,\n role.name+'::'+rt.name)\n }\n\n }\n\n expected_values = [\n {:name => 'Final',\n :role_names => ['CE-DFT', 'DFM', 'HWENG',\n 'Mechanical', 'Mechanical-MFG', 'PCB Design',\n 'Planning', 'TDE', 'Valor'] },\n {:name => 'Pre-Artwork',\n :role_names => ['CE-DFT', 'DFM', 'HWENG', \n 'Library', 'Mechanical', 'Mechanical-MFG',\n 'PCB Input Gate', 'PCB Mechanical', 'Planning',\n 'SLM BOM', 'SLM-Vendor', 'TDE',\n 'Valor' ]},\n {:name => 'Placement',\n :role_names => ['CE-DFT', 'DFM', 'HWENG',\n 'Mechanical', 'Mechanical-MFG', 'TDE' ]},\n {:name => 'Routing',\n :role_names => ['CE-DFT', 'DFM', 'HWENG',\n 'Library', 'Mechanical-MFG' ]},\n {:name => 'Release',\n :role_names => ['HWENG', 'Operations Manager',\n 'PCB Design' ]},\n ]\n\n review_types.each_with_index do |review_type, i|\n expected_rt = expected_values[i]\n assert_equal(expected_rt[:name], review_type.name)\n\n review_type.roles.sort_by { |role| role.name }.each_with_index do |role, j|\n expected_role = expected_rt[:role_names]\n expected_name = expected_role[j]\n assert_equal(expected_name, role.name)\n end\n end\n\n end", "def test_existing_file\n assert verify_parameters(['verifier_tests.rb'])\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def verify_auth_token\n halt 401 unless valid_user?(extracted_token)\n end", "def verify( *suspect_words )\n\t\tsuspect_words.flatten.sort == @banned_words\n\tend", "def assert_valid\n check_api_key\n check_application_id\n check_index_name\n\n Algolia.init(\n application_id: application_id,\n api_key: api_key\n )\n\n nil\n end", "def verify_confidential_application!\n render 'doorkeeper/authorizations/error' if authorizable_confidential?\n end", "def verify_signature(data)\n Signature.valid?(data.merge('api_key' => api_key))\n end", "def verify_users(test_data)\n users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def verify_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n errors = []\n test_terms.each_with_index do |test_term, index|\n text_values_match?(test_term[Org::TERM_DISPLAY_NAME.name], element_value(org_display_name_input index), errors)\n text_values_match?(test_term[Org::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[Org::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[Org::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[Org::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[Org::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[Org::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[Org::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[Org::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "def verify_occasions(test_data)\n occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)) }\n end", "def verify_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[UseOfCollections::USER.name], element_value(user_name_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[UseOfCollections::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def test_is_semantic\n assert_match SEMVER_REGEXP, OmniAuth::BCrypt::VERSION\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def check_authorizations!\n raise FphsNotAuthorized unless can_create_in_list?\n\n unless list_class.no_master_association || from_master.allows_user_access\n raise FphsNotAuthorized, 'Master does not allow user access'\n end\n\n raise FphsNotAuthorized, \"No access to #{source_type}\" unless can_access_source_type?\n\n raise FphsNotAuthorized, \"No access to #{assoc_name}\" unless can_access_associated_table?\n end", "def test_authorization_and_capture\n return if Base.mode == :test # only tests in production mode\n assert_equal Base.mode, :production\n assert authorization = @gateway.authorize(@amount, @credit_card, @options)\n assert_success authorization\n \n assert capture = @gateway.capture(@amount, authorization.authorization)\n assert_success capture\n assert_match(/This transaction has been approved/, capture.message)\n end", "def test_authenticate\n assert_equal users(:jordan), User.authenticate('jordan@test.com', 'test')\n end", "def authorize(oauth_verifier)\n @access_token = request_access_token(oauth_verifier)\n @authorized = true\n return true\n rescue\n puts $! if @@verbose\n return false\n end", "def validator\n test_realms.each do |realm|\n output = kcadm('get', resource[:test_url], realm)\n begin\n data = JSON.parse(output)\n rescue JSON::ParserError\n Puppet.debug('Unable to parse output from kcadm get resource')\n next\n end\n data.each do |d|\n d.each_pair do |k, v|\n next unless k == resource[:test_key].to_s\n return true if v == resource[:test_value].to_s\n end\n end\n end\n false\n end", "def verify_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[UseOfCollections::OCCASION.name], element_value(occasion_input index)) }\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def test_q11_b_ac\n test_agreement = create_test_agreement\n params = HashWithIndifferentAccess.new\n params[:q11] = 'b'\n params[:q11_b_a] = \"true\"\n params[:q11_b_c] = \"true\"\n\n form_processor = Maps.new\n form_processor.process_question(test_agreement.agreementid.to_i, '11', params, 'UNIT_TESTING')\n\n permissions = test_agreement.active_permissions\n\n # Check Permissions created\n assert_equal 3, permissions.length, \"Incorrect number of permissions created\"\n assert_equal 3, form_processor.permission_count, \"Incorrect count of permissions on form processor\"\n\n #Check Permissions match rules\n assert_equal 1, permissions.select{|p| p.rule==\"r31\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r33\"}.length, \"Incorrect rule created\"\n assert_equal 1, permissions.select{|p| p.rule==\"r50\"}.length, \"Incorrect rule created\"\n end", "def test_successful_authorize_encryption_credit_card_recurring_metadata\n test_successful_purchase_credit_card_recurring_metadata(true, true)\n end", "def verifyPostIdeaResponseContract\n return verifyResponseContract(@postIdea_response_structure)\n end", "def verify_access\n authenticate_or_request_with_http_basic(\"Documents Realm\") do |username, password|\n username == 'rdi' && password == 'btc'\n end\n end", "def verify_access\n unless current_user.id == @organization.user_id\n flash[:warning] = \"You do not have authority to access that.\"\n redirect_to user_path(current_user.id)\n end\n end", "def test_realm\n make_controller :realm\n get :index\n assert_protected\n assert_equal 'Basic realm=\"GOURANGA!\"', @response.headers['WWW-Authenticate']\n end", "def author_identity_different?(attribs)\n !(\n # not the identical identity where Author is assumed to be Stanford University\n # checks in order of likelihood of changes\n # note that this code works for nil/empty string comparisons by calling `to_s`\n first_name.to_s.casecmp(attribs[:first_name].to_s) == 0 &&\n middle_name.to_s.casecmp(attribs[:middle_name].to_s) == 0 &&\n last_name.to_s.casecmp(attribs[:last_name].to_s) == 0 &&\n institution.to_s.casecmp(attribs[:institution].to_s) == 0\n )\n end", "def validate_assertion(assertion)\n Nestful.post 'https://verifier.login.persona.org/verify',\n format: :json,\n params: { assertion: assertion, audience: url_for(:root) }\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def verify( *suspect_words )\n suspect_words.flatten.sort == @banned_words\n end", "def authorize\n end", "def authorize\n end", "def test_ut_t2_ars_arc_013\n # pu admin\n current_user = User.find_by_id(PU_ADMIN_ID)\n # pu ars\n pu_id = PrivilegesUsers.find_all_by_user_id(current_user.id)[0].pu_id\n ars = Pu.find_by_id(pu_id).analyze_rule_configs[0]\n #\n assert ars.editable?(current_user,pu_id,nil)\n end", "def verify\n response = script_mode do \n query(\"configshow | grep RBAC\")\n end \n response.data.match(/#{Replies::RBAC_DENIED}/) ? false : true\n end", "def test_verify\n # Start out unavailabl\n assert_raise(Puppet::Network::InvalidClientRequest) do\n @obj.verify(@request)\n end\n class << @obj\n def available?(req)\n true\n end\n end\n assert_raise(Puppet::Network::InvalidClientRequest) do\n @obj.verify(@request)\n end\n class << @obj\n def authorized?(req)\n true\n end\n end\n assert_nothing_raised do\n @obj.verify(@request)\n end\n end", "def consistency_checks\n unless certificate_serial_number == voucher_serial_number\n error_report << \"serial number mismatch certificate '#{certificate_serial_number}' vs '#{voucher_serial_number}'\"\n return false\n end\n # other tests here.\n return true\n end", "def assert_rbac(klass, ids)\n num_visible = Rbac.filtered(klass.where(:id => ids), :user => current_user).count\n raise _(\"Unauthorized object or action\") unless ids.length == num_visible\n end", "def authorize(username, password)\np username\np password\n username == settings.username && password == settings.password\n end", "def authorized(authorization)\n if (ENV['SECRET_NAME'])\n creds = get_secret(ENV['SECRET_NAME'])\n calculated = \"Basic \" + Base64.encode64(\"#{creds['a2user'] || creds['A2USER']}:#{creds['a2pass'] || creds['A2PASS']}\")\n return (authorization || \"\").strip == (calculated || \"\").strip\n end\n if (ENV['A2USER'] && ENV['A2PASS'])\n calculated = \"Basic \" + Base64.encode64(\"#{ENV['A2USER']}:#{ENV['A2PASS']}\")\n return (authorization || \"\").strip == (calculated || \"\").strip\n end\n return false\nend", "def test_should_activate_user\n assert_nil User.authenticate('unactivated@example.com', 'test')\n get :activate, :activation_code => users(:unactivated_user).activation_code\n assert_nil flash[:error]\n assert_not_nil flash[:notice]\n assert_redirected_to person_path(people(:unactivated_person).id)\n assert_equal users(:unactivated_user), User.authenticate('unactivated@example.com', 'test')\n end", "def verify(state) ; end", "def verify( *suspect_words )\n suspect_words.flatten.sort == @banned_words\n end", "def check_auth\n authorize @equipment_listing\n end", "def test_values_unique\n\n #Arrange\n @user3 = User.new\n @user4 = User.new\n\n # Act\n @user3.name = \"fede\"\n @user3.surname = \"guti\"\n @user3.username = \"fede3\"\n @user3.email = \"fede3@gmail.com\"\n @user3.password = \"123456789\"\n\n @user4.name = \"fede\"\n @user4.surname = \"guti\"\n @user4.username = \"luca\"\n @user4.email = \"luca@gmail.com\"\n @user4.password = \"123456789\"\n\n\n # Assert\n @user3.save\n @user4.save\n all_ok = assert_equal @user3.valid? && @user4.valid? , true\n\n # Act\n @user4.email = \"fede3@gmail.com\"\n @user4.save\n\n # Assert\n email_check = assert_equal @user4.valid?, false\n\n # Act\n @user4.email = \"luca@gmail.com\"\n @user4.username = \"fede3\"\n @user4.save\n\n # Assert\n user_check = assert_equal @user4.valid?, false\n\n # Assert\n assert_equal (all_ok || email_check || user_check) , true\n\n end", "def required_authorization?\n unauthorized_commit_authors.any?\n end", "def verify_commits expected_commits\n expected_commits.diff! commits_in_current_repo(expected_commits.headers)\nend", "def test_auth_allow_new_clients\n File.open(File.join(@repodir, 'etchserver.conf'), 'w') do |file|\n file.puts 'auth_enabled=true'\n file.puts 'auth_deny_new_clients=false'\n end\n \n #\n # New client, should work\n #\n testname = 'auth, allow new clients, new client'\n \n FileUtils.mkdir_p(\"#{@repodir}/source/#{@targetfile}\")\n File.open(\"#{@repodir}/source/#{@targetfile}/config.xml\", 'w') do |file|\n file.puts <<-EOF\n <config>\n <file>\n <warning_file/>\n <source>\n <plain>source</plain>\n </source>\n </file>\n </config>\n EOF\n end\n \n sourcecontents = \"Test #{testname}\\n\"\n File.open(\"#{@repodir}/source/#{@targetfile}/source\", 'w') do |file|\n file.write(sourcecontents)\n end\n \n assert_etch(@server, @testroot, :testname => testname)\n \n # Verify that the file was created properly\n assert_equal(sourcecontents, get_file_contents(@targetfile), testname)\n \n #\n # Existing client, should work\n #\n testname = 'auth, allow new clients, existing client'\n \n FileUtils.mkdir_p(\"#{@repodir}/source/#{@targetfile}\")\n File.open(\"#{@repodir}/source/#{@targetfile}/config.xml\", 'w') do |file|\n file.puts <<-EOF\n <config>\n <file>\n <warning_file/>\n <source>\n <plain>source</plain>\n </source>\n </file>\n </config>\n EOF\n end\n \n sourcecontents = \"Test #{testname}\\n\"\n File.open(\"#{@repodir}/source/#{@targetfile}/source\", 'w') do |file|\n file.write(sourcecontents)\n end\n \n assert_etch(@server, @testroot, :testname => testname)\n \n # Verify that the file was created properly\n assert_equal(sourcecontents, get_file_contents(@targetfile), testname)\n \n #\n # Existing client, bad signature, should be denied\n #\n testname = 'auth, allow new clients, existing client, bad signature'\n \n FileUtils.mkdir_p(\"#{@repodir}/source/#{@targetfile}\")\n File.open(\"#{@repodir}/source/#{@targetfile}/config.xml\", 'w') do |file|\n file.puts <<-EOF\n <config>\n <file>\n <warning_file/>\n <source>\n <plain>source</plain>\n </source>\n </file>\n </config>\n EOF\n end\n \n sourcecontents = \"Test #{testname}\\n\"\n File.open(\"#{@repodir}/source/#{@targetfile}/source\", 'w') do |file|\n file.write(sourcecontents)\n end\n \n # Put some text into the original file so that we can make sure it\n # is not touched.\n origcontents = \"This is the original text\\n\"\n File.delete(@targetfile)\n File.open(@targetfile, 'w') do |file|\n file.write(origcontents)\n end\n \n assert_etch(@server, @testroot, :errors_expected => true, :key => \"--key=#{File.join(File.dirname(__FILE__), 'keys', 'testkey2')}\", :testname => testname)\n \n # Verify that the file was not touched\n assert_equal(origcontents, get_file_contents(@targetfile), testname)\n end", "def test_authorization_and_capture\n assert authorization = @gateway.authorize(@amount, @good_card, @options)\n assert_success authorization\n\n assert capture = @gateway.capture(@amount, authorization.authorization)\n assert_success capture\n assert capture.params['aux_msg'].include? 'has been successfully marked for settlement.'\n assert_equal 'Success', capture.message\n end", "def expect_counts(actual, expected_targets, expected_auth_count)\n expect(actual[1]).to eq(expected_auth_count)\n expect(actual[0].to_a).to match_array(expected_targets)\n end", "def verify!(block)\n self.instance_eval(&block)\n expected = Set.new(expected_entries)\n provided = Set.new(provided_entries)\n missing_entries = expected - provided\n extra_entries = provided - expected\n missing_entries_found(missing_entries) if missing_entries.any?\n extra_entries_found(extra_entries) if extra_entries.any?\n end", "def test_should_have_missing_fields\n assert ! roles(:missing_person_id).valid?\n assert ! roles(:missing_client_id).valid?\n assert ! roles(:missing_title).valid?\n end", "def authorize\n \n token = decode_token(@auth_header)\n data = get_canvas_data(@canvas, token.first[\"user_id\"])\n \n data[\"group_id\"] == token.first[\"group_id\"] && data[\"has_access\"] == \"true\"\n \n rescue StandardError => _\n false\n end", "def verify_key; end", "def verify_key; end" ]
[ "0.8358752", "0.6307299", "0.63008535", "0.6188723", "0.61446315", "0.61429673", "0.608929", "0.60514903", "0.60482997", "0.59818226", "0.597407", "0.5931718", "0.59058934", "0.5903351", "0.58933544", "0.5871764", "0.5817203", "0.58089256", "0.58004326", "0.57967824", "0.57792145", "0.57744694", "0.57744694", "0.57562965", "0.57039315", "0.5693337", "0.5662839", "0.56412834", "0.56176084", "0.56128633", "0.5598528", "0.55869913", "0.5585667", "0.5585425", "0.5583773", "0.5582616", "0.55796784", "0.55719405", "0.555944", "0.5558352", "0.55490273", "0.5534295", "0.5516559", "0.5474891", "0.5461491", "0.54434884", "0.5427578", "0.5422817", "0.5413823", "0.5413153", "0.5413028", "0.5407943", "0.5405834", "0.5391938", "0.538403", "0.5378633", "0.53754205", "0.5374883", "0.53725225", "0.5371724", "0.5371483", "0.5370471", "0.5367445", "0.5351664", "0.53402334", "0.53321993", "0.5329822", "0.5322738", "0.53190714", "0.53146845", "0.53143644", "0.53115773", "0.5309992", "0.5309271", "0.5306974", "0.53030854", "0.52964604", "0.52964604", "0.5296116", "0.52955097", "0.5285472", "0.52813995", "0.5280829", "0.5280456", "0.52784365", "0.5267333", "0.52625763", "0.525934", "0.5252436", "0.5246149", "0.52455217", "0.5243846", "0.52438307", "0.5241658", "0.52347845", "0.52322423", "0.52252483", "0.522469", "0.52176976", "0.52176976" ]
0.83103573
1
USE DATES Enters use dates per a given set of test data
def enter_use_dates(test_data) dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USE_DATE_GRP.name)], dates) dates.each_with_index do |date, index| logger.info "Entering use date data set at index #{index}: #{date}" wait_for_element_and_type(use_date_input(index), date[CoreUseOfCollectionsData::USE_DATE.name]) hit_enter wait_for_element_and_type(use_date_time_note(index), date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name]) wait_for_element_and_type(use_num_visitors_input(index), date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name]) wait_for_element_and_type(use_hours_spent_input(index), date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name]) wait_for_element_and_type(use_note_input(index), date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def dates_requiring_data\n collected = Dir.glob(File.join(@config[:data_dir], \"*-*-*.{csv,espi}\")).map { |f| File.basename(f).split(\".\")[0] }\n all_days = []\n\n count_of_days = (Date.today - @config[:start_date]).to_i\n\n count_of_days.times do |i|\n all_days << (@config[:start_date] + i).strftime(\"%Y-%m-%d\")\n end\n\n (all_days - collected).map { |d| Date.parse(d) }\n end", "def enter_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n wait_for_element_and_type(use_date_input(index), date[UseOfCollections::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[UseOfCollections::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[UseOfCollections::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[UseOfCollections::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[UseOfCollections::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def set_dates( start_date, end_date = nil )\n \n # If the end date isn't specified, default to sameday\n end_date ||= start_date\n \n # Break the dates into a hash query format. \n hash = [ [ start_date, { dd: '%d', mon: '%m', yyyy: '%Y' } ] , [ end_date, { todd: '%d', tomon: '%m', toyyyy: '%Y' } ] ].inject({}) do |h, ( date, args )|\n args.each { |k,v| h[k.to_s] = date.strftime(v) } ; h\n end\n\n # Update the query with the new values\n update_query( hash )\n end", "def use_dates\n @use_dates || true\n end", "def set_dates(spreadsheet, cal_date_row, cal_date_col, exp_date_row, exp_date_col)\r\n\r\n k = 0\r\n (cal_date_col+1...exp_date_col).each do |j|\r\n if spreadsheet.celltype(cal_date_row, j) == :date\r\n @calibration.caldate = spreadsheet.cell(cal_date_row, j)\r\n k = j + 1\r\n break\r\n end\r\n end\r\n\r\n #look for expiration date\r\n if (k != 0)\r\n\r\n (k..spreadsheet.last_column).each do |j|\r\n if spreadsheet.celltype(cal_date_row, j) == :date\r\n @calibration.expdate = spreadsheet.cell(cal_date_row, j)\r\n break\r\n end\r\n end\r\n end\r\n\r\n end", "def set_date_options\n @date_start = !@params[:date_start].blank? ? DateTime.parse(@params[:date_start]).to_date : Order.first_datetime.to_date\n @date_end = !@params[:date_end].blank? ? DateTime.parse(@params[:date_end]).to_date : Date.today\n @date_unit = @params[:date_unit] || 'month'\n @date_start_db = @date_start.to_datetime.to_s(:db)\n @date_end_db = @date_end.to_datetime.to_s(:db)\n\n case @date_unit\n when 'day'\n @date_values = date_range_to_single_dates(@date_start, @date_end)\n when 'week'\n @date_values = date_range_to_weeks(@date_start, @date_end).map { |d| d[0] }\n when 'month'\n @date_values = date_range_to_months(@date_start, @date_end)\n end\n end", "def test_date_a_variable_matches_index\n skip\n engine = Engine.new\n assert_equal [6, 2, 2, 5], engine.date_assignment\n end", "def set_api_by_date(startdate, enddate, hostname)\n\n\t\t# setup date range\n\t\tdate_range = @analytics::DateRange.new(start_date: startdate, end_date: enddate)\n\n\t\t# set metircs data. 10 metrices are allowed per one request\n\t\tmetrics = ['ga:pageviews', 'ga:users', 'ga:bounces', 'ga:sessions',\n\t\t\t\t 'ga:avgTimeOnPage', 'ga:newUsers', 'ga:goal1ConversionRate', 'ga:goal1Completions'\n\t\t\t\t ]\n\n\t\t# make new array and put metric type data in the array\n\t\tmetric_type = Array.new\n\t\tmetrics.each do |m|\n\t\t\tmetric = @analytics::Metric.new\n\t\t\tmetric.expression = m\n\t\t\tmetric_type.push(metric)\n\t\tend\n\n\t\t\n\t\t# if startdate == enddate then\n\t\t# \tdimension = @analytics::Dimension.new(name: 'ga:hour')\n\t\t# \torder_by = @analytics::OrderBy.new(field_name: 'ga:hour', sort_order: 'ASCENDING')\n\t\t# else\n\t\t# \tdimension = @analytics::Dimension.new(name: 'ga:date')\n\t\t# \torder_by = @analytics::OrderBy.new(field_name: 'ga:date', sort_order: 'ASCENDING')\n\t\t# end\n\n\n\t \t# set dimensions, dimension_filters by hostname. if hostname is total, then set only hour or date in dimension\n\n\t \tif hostname == 'total'\n\t\t\tif startdate == enddate then\n\t\t\t\tdimensions = ['ga:hour']\n\t\t\telse\n\t\t\t\tdimensions = ['ga:date']\n\t\t\tend\t \t\t\n\t \telse\n\t \t\tif startdate == enddate then\n\t\t\t\tdimensions = ['ga:hour', 'ga:hostname']\n\t\t\telse\n\t\t\t\tdimensions = ['ga:date', 'ga:hostname']\n\t\t\tend\t\n\t \t\tdimension_filters = @analytics::DimensionFilterClause.new(\n\t\t filters: [\n\t\t @analytics::DimensionFilter.new(\n\t\t dimension_name: 'ga:hostname',\n\t\t not: false,\n\t\t operator: \"IN_LIST\",\n\t\t expressions: [hostname]\n\t\t )\n\t\t ]\n\t\t )\n\t \tend\n\n\t \tdimension_type = Array.new\n\t\tdimensions.each do |d|\n\t\t\tdimension = @analytics::Dimension.new\n\t\t\tdimension.name = d\n\t\t\tdimension_type.push(dimension)\n\t\tend\t\t\t\n\n\t\t#set order_bys\n\t\torder_by = @analytics::OrderBy.new(field_name: dimensions[0], sort_order: 'ASCENDING')\n\n\n\t\t# setup request with the data i set up above to google analytics server\n\t\trequest = @analytics::GetReportsRequest.new(\n \t\t\treport_requests: [@analytics::ReportRequest.new(\n \t\t\tview_id: @view_id, \n \t\t\tmetrics: metric_type,\n \t\t\tdimensions: dimension_type,\n \t\t\tdimension_filter_clauses: [dimension_filters],\n \t\t\tdate_ranges: [date_range],\n \t\t\torder_bys: [order_by]\n \t\t\t)]\n\t\t)\n\n\t\t# send request and get the result in the response\n\t\tresponse = @client.batch_get_reports(request)\n\n\t\t# make new array for the total data. it will has datahash and dropdwnhash, datahash is for total data and\n\t\t# the other is for hourly/daily data. key would be time(00,01,02,...) or date(i.e. 5/20.5/21,...). \n\t\tset_total_array = Array.new\n\n\t\t# this data is mcv and it is from database\n\t\ttotal_clicks_count = set_total_article(startdate, enddate)\n\n\n\t\t# getting total data part start\n\n\t\ttotal_data = response.reports.first.data.totals\n\t\tkey_array = metrics\n\t\t# get rid of 'ga:'\n\t\tkey_array.each_with_index do |k, index| \n\t\t\tkey_array[index] = k.gsub(\"ga:\",\"\")\n\t\tend\n\n\t\ttotal_data.each do |t|\n\t\t\tdatahash = {}\n\n\t\t\tt.values.each_with_index do |v, index|\n\t\t\t\tdatahash[key_array[index]] = v\t\n\t\t\tend\n\t\t\tdatahash['mcv'] = total_clicks_count\n\t\t\tset_total_array.push(datahash)\n\t\tend\n\t\t# datahash sample -> { \"pageviews\": \"11\", \"users\": \"22\", \"bounces\": \"33\", ... , \"mcv\": 0 }\n\n\t\t# getting total data part end\n\n\t\t# getting daily or hourly data part start\n\t\tdropdwnhash = {}\n\n\t\tdata_from_google = response.reports.first.data.rows\n\t\t\n\t\tdata_from_google.each do |r|\n\t\t\tvhash = {}\n\t\t\t# key would be hour or date\n\t\t\tkey = r.dimensions.first\n\n\t\t\t# vhash is the data such as pageview, users and so on for specific time or date\n\t\t\tr.metrics.first.values.each_with_index do |v, index|\n\t\t\t\tvhash[key_array[index]] = v\n\t\t\tend\n\n\t\t\tif startdate == enddate\n\t\t\t\tkey = key + \":00\"\n\t\t\tend\n\t\t\t\n\t\t\tdropdwnhash[key.to_sym] = vhash\n\t\tend\n\n\t\t# dropdwnhash sample (hour) -> \"00:00\": { \"pageviews\": \"534\", \"users\": \"478\", \"bounces\": \"432\", ... }, \"01:00\": { ... }\n\t\t# dropdwnhash sample (date) -> \"20200608\": { \"pageviews\": \"534\", \"users\": \"478\", \"bounces\": \"432\", ... }, \"20200609\": { ... }\n\n\t\tset_total_array.push(dropdwnhash)\n\n\t\t# getting daily or hourly data part end\n\n\t\treturn set_total_array\n\tend", "def on_sale\n all.select {|event| (event.starts..event.ends) === (@date_for_test || Date.today)}\n end", "def set_dates(results)\n date_dimension = []\n for result in results\n stored_element = date_dimension.detect { |element| element[:date].to_s == result.send(:date).to_s }\n if stored_element\n stored_element[:value][:pageviews] += result.send(:pageviews).to_i\n stored_element[:value][:unique_pageviews] += result.send(:unique_pageviews).to_i\n else\n date_dimension << {:date => result.send(:date).to_s, :value => {:pageviews => result.send(:pageviews).to_i, :unique_pageviews => result.send(:unique_pageviews).to_i} }\n end\n result.date_dimension = date_dimension\n end\n end", "def set_dates(start_date = nil, end_date = nil)\n\n\t if (start_date.nil? and not end_date.nil?)\n\n\t\t start_date = (@utils.get_date_object(end_date)) - (MAX_HISTORICAL_DAYS * (24 * 60 * 60))\n\n\t\t @start_date = start_date.to_s\n\t\t @end_date = end_date.to_s\n\n\t elsif (not start_date.nil? and end_date.nil?)\n\n\t\t end_date =(@utils.get_date_object(start_date)) + (MAX_HISTORICAL_DAYS * (24 * 60 * 60))\n\n\t\t if end_date > Time.new.utc\n\t\t\tend_date = nil #Let API default to Now.\n\t\t end\n\n\t\t @start_date = start_date.to_s\n\t\t @end_date = end_date.to_s if not end_date.nil?\n\n\t end\n end", "def loadDcTest\n $dc = dcs(:two)\n $shirt_deadline = ($dc.start_time - 17.days).end_of_day\n $registration_deadline = ($dc.start_time - 4.days).end_of_day\n $registration_starts = true\n $report_deadline = ($dc.start_time + 1.month).end_of_day\n end", "def load_data!(date)\n if date.to_date == Date.today\n @euro ||= load_daily\n elsif !defined?(@euro) || @euro.size < 2\n @euro = load_ninty\n end\n end", "def test_should_retun_every_set_of_days_of_month\n assertion = Month.august(2006).every!(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Hash)\n # monday assertions\n assert_equal assertion[:monday].size, 4\n assert_equal assertion[:monday], [Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n # wednesday assertions\n assert_equal assertion[:wednesday].size, 5\n assert_equal assertion[:wednesday],\n [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30)]\n end", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def create_daily_tests()\n\n Rails.logger.info \"Checking for Daily test runs\"\n\n # get instances of a daily test run\n tests_to_add_to_stack = RecurringSchedule.get_daily_tests()\n setup_scheduled_test(tests_to_add_to_stack)\n end", "def test_should_retun_every_set_of_days_of_month_as_array\n assertion = Month.august(2006).every(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Array)\n # check for data integrity\n assert_equal assertion.size, 9\n assert_equal assertion, [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30),Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n end", "def update_daily_happiness_distributions! \n HappinessEntry.dates.each do |date|\n uid = uid_for_day(date)\n entries_for_date = HappinessEntry.on_date(date)\n update_happiness_distribution! uid, :day, entries_for_date \n end\n end", "def create_service_set(seed_date)\n year = seed_date.year\n\n one_day_back = seed_date - 1\n sat_time = DateTime.civil(year, one_day_back.month, one_day_back.day, 18)\n\n sun_9_time = DateTime.civil(year, seed_date.month, seed_date.day, 9)\n\n sun_1115_time = DateTime.civil(year, seed_date.month, seed_date.day, 11, 15)\n\n sun_5_time = DateTime.civil(year, seed_date.month, seed_date.day, 17)\n\n [sat_time, sun_9_time, sun_1115_time, sun_5_time]\nend", "def calculated_dates\n [period1_from_date,period1_end_date,\n period2_from_date, period2_end_date] \n end", "def handle_date\n today = DateTime.now.beginning_of_day.to_date\n @max_end = today + 400.days\n @inv_start = today\n @master_rates_start = today\n @agoda_rates_start = today\n @expedia_rates_start = today\n @bookingcom_rates_start = today\n @gta_travel_rates_start = today\n @orbitz_rates_start = today\n @ctrip_rates_start = today\n\n begin\n # set the date in inventory table\n @inv_start = Date.strptime(params[:inv_start]) unless params[:inv_start].blank?\n @inv_start = today if @inv_start < today\n @inv_start = @max_end if @inv_start > @max_end\n\n # set the date in master rate table\n @master_rates_start = Date.strptime(params[:master_rates_start]) unless params[:master_rates_start].blank?\n @master_rates_start = today if @master_rates_start < today\n @master_rates_start = @max_end if @master_rates_start > @max_end\n\n # set the date in agoda rates table\n @agoda_rates_start = Date.strptime(params[:agoda_rates_start]) unless params[:agoda_rates_start].blank?\n @agoda_rates_start = today if @agoda_rates_start < today\n @agoda_rates_start = @max_end if @agoda_rates_start > @max_end\n\n # set the date in expedia rates table\n @expedia_rates_start = Date.strptime(params[:expedia_rates_start]) unless params[:expedia_rates_start].blank?\n @expedia_rates_start = today if @expedia_rates_start < today\n @expedia_rates_start = @max_end if @expedia_rates_start > @max_end\n\n # set the date in booking.com table\n @bookingcom_rates_start = Date.strptime(params[:bookingcom_rates_start]) unless params[:bookingcom_rates_start].blank?\n @bookingcom_rates_start = today if @bookingcom_rates_start < today\n @bookingcom_rates_start = @max_end if @bookingcom_rates_start > @max_end\n\n # set the date in gta travel\n @gta_travel_rates_start = Date.strptime(params[:gta_travel_rates_start]) unless params[:gta_travel_rates_start].blank?\n @gta_travel_rates_start = today if @gta_travel_rates_start < today\n @gta_travel_rates_start = @max_end if @gta_travel_rates_start > @max_end\n\n # set the date in orbitz\n @orbitz_rates_start = Date.strptime(params[:orbitz_rates_start]) unless params[:orbitz_rates_start].blank?\n @orbitz_rates_start = today if @orbitz_rates_start < today\n @orbitz_rates_start = @max_end if @orbitz_rates_start > @max_end\n\n # set the date in ctrip\n @ctrip_rates_start = Date.strptime(params[:ctrip_rates_start]) unless params[:ctrip_rates_start].blank?\n @ctrip_rates_start = today if @ctrip_rates_start < today\n @ctrip_rates_start = @max_end if @ctrip_rates_start > @max_end\n \n rescue => ex\n flash[:alert] = ex.message\n end\n end", "def index_data(symbol, start_date, end_date)\n @all_dates = dates(start_date, end_date)\n json = quan(symbol,start_date,end_date)\n @dates = date_array(json)\n value = value_array(json)\n @missing_dates = compare_json_dates_range_dates(@dates, @all_dates)\n create_value(@missing_dates, value)\n @final = @all_dates.zip(value)\n return @final\n end", "def prepare_data(id, day_out, day_back, dose_out, dose_back)\r\n total_dose_in_lab = 0\r\n days_in_lab = Date.parse(day_back).mjd - Date.parse(day_out).mjd\r\n (0...days_in_lab).each do |step|\r\n day_dose = dose_out * Math.exp( step.to_f / days_in_lab * Math.log( dose_back / dose_out))\r\n total_dose_in_lab += day_dose\r\n end\r\n return [id, days_in_lab, total_dose_in_lab]\r\nend", "def filling_dates (student_class, class_day)\n prefix = Dayweek.find_by_id(class_day.dayweek_id).dayname\n if prefix == \"Monday\"\n student_class.Mon_fromh = class_day.from_time[0,2]\n student_class.Mon_fromm = class_day.from_time[2,2]\n student_class.Mon_toh = class_day.to_time[0,2]\n student_class.Mon_tom = class_day.to_time[2,2] \n student_class.Mon_check = \"1\"\n end\n if prefix == \"Tuesday\"\n student_class.Tue_fromh = class_day.from_time[0,2]\n student_class.Tue_fromm = class_day.from_time[2,2]\n student_class.Tue_toh = class_day.to_time[0,2]\n student_class.Tue_tom = class_day.to_time[2,2]\n student_class.Tue_check = \"1\"\n end\n \n if prefix == \"Wednesday\"\n student_class.Wed_check = \"1\"\n student_class.Wed_fromh = class_day.from_time[0,2]\n student_class.Wed_fromm = class_day.from_time[2,2]\n student_class.Wed_toh = class_day.to_time[0,2]\n student_class.Wed_tom = class_day.to_time[2,2]\n student_class.Wed_check = \"1\" \n end\n if prefix == \"Thursday\"\n student_class.Thu_fromh = class_day.from_time[0,2]\n student_class.Thu_fromm = class_day.from_time[2,2]\n student_class.Thu_toh = class_day.to_time[0,2]\n student_class.Thu_tom = class_day.to_time[2,2]\n student_class.Thu_check = \"1\"\n end\n if prefix == \"Friday\"\n student_class.Fri_fromh = class_day.from_time[0,2]\n student_class.Fri_fromm = class_day.from_time[2,2]\n student_class.Fri_toh = class_day.to_time[0,2]\n student_class.Fri_tom = class_day.to_time[2,2] \n student_class.Fri_check = \"1\" \n end\n if prefix == \"Saturday\"\n student_class.Sat_fromh = class_day.from_time[0,2]\n student_class.Sat_fromm = class_day.from_time[2,2]\n student_class.Sat_toh = class_day.to_time[0,2]\n student_class.Sat_tom = class_day.to_time[2,2] \n student_class.Sat_check = \"1\" \n end\n if prefix == \"Sunday\" \n student_class.Sun_fromh = class_day.from_time[0,2]\n student_class.Sun_fromm = class_day.from_time[2,2]\n student_class.Sun_toh = class_day.to_time[0,2]\n student_class.Sun_tom = class_day.to_time[2,2]\n student_class.Sun_check = \"1\"\n end\n end", "def setup_earning_tests\n start_date = Date.today\n i = 0\n Order.find(:all).each do |o|\n o.update_attributes({\n :created_on => start_date - i.months,\n :order_status_code_id => 7,\n :affiliate => @jm\n })\n i += 1\n end\n end", "def dates\n end", "def convert_to_est\n self.start_date += 18000\n self.end_date += 18000\n end", "def default_data collection, factor\n your_data, comparison_data, l1_data, l2_data, l3_data = [], [], [], [], []\n average_l1_comp_data, average_l2_comp_data, average_l3_comp_data = [],[],[]\n duration = params[\"duration\"]\n uniq_exam_dates = collection.map(&:exam_date).uniq\n if duration == \"12\"\n Date.today.month.times do |count|\n l1_temp_data, l2_temp_data, l3_temp_data = [], [], []\n collection.where(exam_date:(Time.now-count.month).all_month()).each do |r|\n l1_temp_data << r.send(:\"l1_#{factor}\")\n l2_temp_data << r.send(:\"l2_#{factor}\")\n l3_temp_data << r.send(:\"l3_#{factor}\")\n end\n l1_comp_data, l2_comp_data, l3_comp_data = [], [], [] \n Report.where(exam_date: (Time.now-count.month).all_month(), school_id:current_user.school.id).each do |m|\n l1_comp_data << m.send(:\"l1_#{factor}\")\n l2_comp_data << m.send(:\"l2_#{factor}\")\n l3_comp_data << m.send(:\"l3_#{factor}\")\n end\n l1_data << average(l1_temp_data)\n l1_data.reverse!\n l2_data << average(l2_temp_data)\n l2_data.reverse!\n l3_data << average(l3_temp_data)\n l3_data.reverse!\n average_l1_comp_data << average(l1_comp_data)\n average_l1_comp_data.reverse!\n average_l2_comp_data << average(l2_comp_data)\n average_l2_comp_data.reverse!\n average_l3_comp_data << average(l3_comp_data)\n average_l3_comp_data.reverse!\n end\n else\n uniq_exam_dates.each do |date|\n l1_temp_data, l2_temp_data, l3_temp_data = [], [], []\n collection.where(exam_date:date).each do |r|\n l1_temp_data << r.send(:\"l1_#{factor}\")\n l2_temp_data << r.send(:\"l2_#{factor}\")\n l3_temp_data << r.send(:\"l3_#{factor}\")\n end\n l1_comp_data, l2_comp_data, l3_comp_data = [], [], [] \n Report.where(exam_date: date, school_id:current_user.school.id).each do |m|\n l1_comp_data << m.send(:\"l1_#{factor}\")\n l2_comp_data << m.send(:\"l2_#{factor}\")\n l3_comp_data << m.send(:\"l3_#{factor}\")\n end\n l1_data << average(l1_temp_data)\n l2_data << average(l2_temp_data)\n l3_data << average(l3_temp_data)\n average_l1_comp_data << average(l1_comp_data)\n average_l2_comp_data << average(l2_comp_data)\n average_l3_comp_data << average(l3_comp_data)\n end\n end\n your_data = [l1_data, l2_data, l3_data]\n comparison_data = [average_l1_comp_data, average_l2_comp_data, average_l3_comp_data]\n factor == \"time\" ? plot_timedistribution(your_data, comparison_data) : plot_strategy(your_data, comparison_data)\n end", "def testSplitInterchangeableDay\n # TODO: Code the interchangeable days feature, and uncomment after\n# executeSimpleTest(\n# [ [ 'T1', 'R1', 300, 2, [], '= ='],\n# [ 'T2', 'R1', 200, 2, ['T3'], ' =='],\n# [ 'T3', 'R2', 400, 2, [], ' =='],\n# [ 'T4', 'R3', 100, 3, ['T3'], '==='] ] )\n executeSimpleTest(\n [ [ 'T1', 'R1', 300, 2, [], ' =='],\n [ 'T2', 'R1', 200, 2, ['T3'], '=='],\n [ 'T3', 'R2', 400, 2, [], ' =='],\n [ 'T4', 'R3', 100, 3, ['T3'], '==='] ] )\n end", "def simulate_test_running_on_different_days\n travel_to Time.parse(ENV['SPEC_DATE'] || \"26-#{rand(9..12)}-2019 14:33:20'\")\n end", "def set_doe_util_changes\n\n # there is no bldg_id column for sca projects\n buildings = self.school_buildings\n\n buildings_ids_array = buildings.map {|b| b['bldg_id']}.uniq\n\n doe_significant_utilization_changes = CeqrData::DoeSignificantUtilizationChanges.version(\n data_package.table_for(\"doe_significant_utilization_changes\")\n ).doe_util_changes_matching_with_building_ids(buildings_ids_array)\n\n self.doe_util_changes = doe_significant_utilization_changes.map do |d|\n {\n url: d[:url],\n title: d[:title],\n org_id: d[:org_id],\n bldg_id: d[:bldg_id],\n vote_date: d[:vote_date],\n at_scale_year: d[:at_scale_year],\n at_scale_enroll: d[:at_scale_enroll],\n bldg_id_additional: d[:bldg_id_additional]\n }\n end\nend", "def make_data\r\n @holidays = ['2014/09/02','2015/01/01']\r\n @wday_name = l(:ts_week_day_names).split(',')\r\n @month_names = l(:ts_month_names).split(',')\r\n @break_time_names = l(:ts_break_time_names).split(',')\r\n @break_time_values = l(:ts_break_time_values).split(',')\r\n #month data\r\n @month_sheet = []\r\n @total_hours = 0;\r\n @total_result = 0;\r\n (@first_date..@last_date).each do |date|\r\n date_str = date.strftime(\"%Y/%m/%d\")\r\n date_id = date.strftime(\"%Y%m%d\")\r\n date_sheet = Timecards.where([\"work_date = ? AND users_id = ?\", date_str, @this_uid]).first\r\n if (date_sheet == nil) \r\n date_sheet = Timecards.new\r\n date_sheet.work_date = date\r\n end\r\n date_sheet.is_holiday = false\r\n if @holidays.include?(date_str)\r\n date_sheet.is_holiday = true\r\n end\r\n format_time_card(date_sheet)\r\n @month_sheet << date_sheet\r\n if (date_sheet.work_hours != nil)\r\n @total_hours = @total_hours + date_sheet.work_hours\r\n end\r\n if (date_sheet.work_result != nil)\r\n @total_result = @total_result + date_sheet.work_result\r\n end\r\n end\r\n end", "def build_dates\n from = @start_date || @settlement\n temp = from\n\n @accrual_dates = []\n @payment_dates = []\n @periods = []\n\n unless @first_coupon_date.nil?\n from = @first_coupon_date\n @accrual_dates << from\n end\n\n @accrual_dates = @frequency.build(from, @maturity)\n\n @accrual_dates.each do |date|\n @periods << @day_count.period(temp, date)\n @payment_dates << @business_day.next_day(date, @calendar)\n temp = date\n end\n end", "def generate_daytime_distribution \n \n end", "def daily_usage(supply: nil, dates: nil, date_format: nil, meter: nil)\n return nil unless dates\n datetime_range = (dates.first.beginning_of_day..dates.last.end_of_day)\n\n # TODO this is a bit messy\n result_array = readings_with_selected_meters(supply, meter)\n .where(reading_date: datetime_range)\n .order(:reading_date)\n .group_by(&:reading_date)\n .map { |reading_date, amr_readings| [reading_date, amr_readings.sum(&:one_day_kwh).to_f] }\n\n fill_in_blank_dates(dates, result_array, date_format)\n end", "def load_all_local_sensors_by_date(start_date, end_date)\n s_date = start_date.to_time.utc\n e_date = end_date.to_time.utc \n names = Sensor.find(:all, \n :conditions=>[\"created_at between ? and ?\", s_date, e_date], \n :group=>\"name\");\n @resultset = {}\n names.each do |s|\n @resultset[s.name] = Sensor.find(:all, \n :conditions=>[\"created_at between ? and ? AND name=?\", s_date, e_date, s.name], \n :order=>\"created_at\");\n end\n end", "def generate_ymd_indices\n years = {}\n months = {}\n days = {}\n\n sorted_articles.each do |item|\n time = attribute_to_time(item[:created_at])\n\n years[time.year] ||= []\n years[time.year] << item\n\n months[time.year] ||= {}\n months[time.year][time.month] ||= []\n months[time.year][time.month] << item\n\n days[time.year] ||= {}\n days[time.year][time.month] ||= {}\n days[time.year][time.month][time.day] ||= []\n days[time.year][time.month][time.day] << item\n end\n\n ret = []\n years.each do |year, a_year|\n ret << Nanoc::Item.new(\n '<%= render \\'partials/article_list\\', :articles => @item[:list] %>',\n {\n :title => Date.new(year).strftime(@config[:year]),\n :kind => 'fixed', :extension => 'html', :list => a_year\n },\n Date.new(year).strftime('/%Y/')\n )\n\n months[year].each do |month, a_month|\n ret << Nanoc::Item.new(\n '<%= render \\'partials/article_list\\', :articles => @item[:list] %>',\n {\n :title => Date.new(year, month).strftime(@config[:monthyear]),\n :kind => 'fixed', :extension => 'html', :list => a_month\n },\n Date.new(year, month).strftime('/%Y/%m/')\n )\n\n days[year][month].each do |day, a_day|\n ret << Nanoc::Item.new(\n '<%= render \\'partials/article_list\\', :articles => @item[:list] %>',\n {\n :title => Date.new(year, month, day).strftime(@config[:date]),\n :kind => 'fixed', :extension => 'html', :list => a_day\n },\n Date.new(year, month, day).strftime('/%Y/%m/%d/')\n )\n end\n end\n end\n\n ret\nend", "def each_row(_batch = ETL::Batch.new)\n fiscal_map = FiscalQuarter.new(@fiscal_start_month)\n log.debug(\"Building date table starting from date #{start_date} to #{end_date}\\n\")\n for d in start_date..end_date\n day = Day.new(d, fiscal_map)\n yield day.values\n end\n end", "def setup_transaction_dates_step\n @lbtt_return.effective_date = @lbtt_return.effective_date&.to_date\n @lbtt_return.relevant_date = @lbtt_return.relevant_date&.to_date\n @lbtt_return.contract_date = @lbtt_return.contract_date&.to_date\n convert_lease_transaction_date\n end", "def create_stat_for(start_at, end_at)\n info \"#{start_at}..#{end_at}\"\n se =StatExtractor.new\n (Date.parse(start_at)..Date.parse(end_at)).each do |basedate|\n #puts \"\\n== [create_stat_for] #{basedate.to_s} ==\"\n Rule.stat_rules('day').each{|r|se.extract_stat(basedate.to_s, \"day\", r.rtype , r )}\n Rule.stat_rules('week').each{|r|se.extract_stat(basedate.to_s, \"week\", r.rtype , r )} if basedate.wday == 1\n Rule.stat_rules('month').each{|r|se.extract_stat(basedate.to_s, \"month\", r.rtype , r )} if basedate.day == 1\n end \nend", "def set_formatted_dates\n @clienttransaction.update_attribute(:duedate, formatted_date(clienttransaction_params[:duedate])) if clienttransaction_params[:duedate].present?\n @clienttransaction.update_attribute(:transaction_date, formatted_date(clienttransaction_params[:transaction_date])) if clienttransaction_params[:transaction_date].present?\n end", "def set_defaults_for(project)\n if self.can_generate_from_scheulde_for(project)\n project_entries = project.entries.start_date_ordered\n \n @start_date = project_entries.first.start_date\n @end_date = project_entries.last.end_date\n @end_date = @start_date + 1.month if (@start_date + 1.month) > @end_date # Always make sure there is at least a full month apart\n \n @frequency = '0'\n end\n end", "def set_default_values\n\t\tself.month = init_date.split(\"/\")[1]\n\t\tself.year = init_date.split(\"/\")[2]\n\t\tif !self.test\n\t\t\tself.paid = true\n\t\tend\n\tend", "def set_dates \n if self.date_entered.nil?\n self.date_entered = Date.current\n end \n if self.shopping_date.nil?\n self.shopping_date = self.date_entered\n end\n return true\n end", "def date_set(date_from, date_to)\n # if the first parameter is empty, default to using second date instead\n date_from = date_overwrite(date_from, date_to)\n date_to = date_overwrite(date_to, date_from)\n\n # after date potentially duplicated above, use first/last entry years\n # and first/last day of year to cover missing year, month, and day\n date_from = date_default(date_from, [DATE_FIRST[0], \"01\", \"01\"])\n date_to = date_default(date_to, [DATE_LAST[0], \"12\", \"31\"])\n\n date_from = date_format(date_from, default_year: DATE_FIRST[0].to_i)\n date_to = date_format(date_to, default_year: DATE_LAST[0].to_i)\n\n # Set parameters so form populated with calculated dates\n params[:date_from] = date_from.split(\"-\")\n params[:date_to] = date_to.split(\"-\")\n\n [date_from, date_to]\n end", "def set_formatted_dates\n @vendortransaction.update_attribute(:duedate, formatted_date(vendortransaction_params[:duedate])) if vendortransaction_params[:duedate].present?\n @vendortransaction.update_attribute(:transaction_date, formatted_date(vendortransaction_params[:transaction_date])) if vendortransaction_params[:transaction_date].present?\n end", "def apply_dates(attributes)\n attributes[:date] ||= []\n attributes[:date] << attributes[:date_published]\n attributes[:date] << attributes[:date_available]\n attributes[:date] << attributes[:date_accepted]\n attributes[:date] << attributes[:date_submitted]\n attributes[:date].uniq!\n end", "def test_18\n start_date = Date.new(2011,05,31)\n end_date = Date.new(2011,06,02)\n ActiveRecord::Base.logger.debug \"start season test_18 #{ Season.find_by_date(start_date).id}\"\n ActiveRecord::Base.logger.debug \"end season test_18 #{ Season.find_by_date(end_date).id}\"\n Charges.new(start_date, end_date, 1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 2, charges.count\n charges.each do |c|\n ActiveRecord::Base.logger.debug \"res_id #{c.reservation_id}, start #{c.start_date}, end #{c.end_date}\"\n end\n assert_equal 2, charges[0].season_id\n assert_equal 1.0, charges[0].period.to_f\n assert_equal 15.0, charges[0].rate.to_f\n assert_equal 15.0, charges[0].amount.to_f\n assert_equal Charge::DAY, charges[0].charge_units\n assert_equal 3, charges[1].season_id\n assert_equal 1.0, charges[1].period.to_f\n assert_equal 31.5, charges[1].rate.to_f\n assert_equal 31.5, charges[1].amount.to_f\n assert_equal Charge::DAY, charges[1].charge_units\n end", "def test_should_return_every_day_of_month_as_array\n assertion = Month.april(2003).every(:tuesday)\n assert_equal assertion.size, 5\n assert_equal assertion, [Date.new(2003,4,1),Date.new(2003,4,8),Date.new(2003,4,15),Date.new(2003,4,22),Date.new(2003,4,29)]\n end", "def day_calculations\n\t\t@prev_beg_range = @beg_range.to_date-1.day\n\t\t@prev_end_range = @beg_range.to_date-1.day\n\t\t@next_beg_range = @beg_range.to_date+1.day\n\t\t@next_end_range = @beg_range.to_date+1.day\n\tend", "def specific_days_in_semester\n date_start = USDateParse(self.start_date)#USDateParse(self.start_date)\n date_end = USDateParse(self.end_date)#USDateParse(self.end_date)\n curr_date = date_start\n date_hash = Hash.new(0)\n while curr_date <= date_end do\n if (! self.individual_dates_with_no_classes.include?(curr_date))\n date_hash[curr_date.cwday] += 1\n end\n curr_date += 1\n end\n return date_hash\n end", "def enter_acquisition_dates(data_set)\n acquis_dates = data_set[Acquisition::ACQUIS_DATE_GRP.name]\n acquis_dates && acquis_dates[0..1].each do |date|\n inputs = elements acquis_date_input_locator\n input = acquis_dates[0..1].index(date).zero? ? inputs[0] : inputs[1]\n input.clear\n sleep Config.click_wait\n input.send_keys date[Acquisition::ACQUIS_DATE.name]\n hit_enter\n hit_tab\n end\n end", "def set_days_of_week\n @days_of_week = Date::DAYNAMES.each_with_index\n end", "def test_should_return_every_day_of_month\n assertion = Month.april(2003).every(:tuesday)\n assert_equal assertion.size, 5\n assert_equal assertion, [Date.new(2003,4,1),Date.new(2003,4,8),Date.new(2003,4,15),Date.new(2003,4,22),Date.new(2003,4,29)]\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def getDates\n date_string = @xml.xpath('./dc:date/text()').first.to_s\n \n # Store the year as a string, along with the Ca., if it exists, so we can display it \n @doc[:date_display] = date_string[/^[Cc]a\\.+ *\\d+|^\\d+ |^\\w+ \\d+, \\d+ |^\\w+, \\d+/]\n \n if @doc[:date_display]\n \n stripped_year = @doc[:date_display][/\\d{4}/]\n # Store the year as an actual date, so we can do math on it \n @doc[:creation_date] = stripped_year.concat(\"-01-01T23:59:59Z\")\n # Store a range value\n creation_era = []\n if 100.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 100 years old\"\n end\n if 50.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 50 years old\"\n end\n if 20.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 20 years old\"\n end\n if 10.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 10 years old\"\n end\n if 10.years.ago <= DateTime.parse(stripped_year)\n creation_era << \"Less than 10 years old\"\n end\n if 5.years.ago <= DateTime.parse(stripped_year)\n creation_era << \"Less than 5 years old\"\n end\n if 1.year.ago <= DateTime.parse(stripped_year)\n creation_era << \"Less than 1 year old\"\n end\n @doc[:subject_era_facet] = creation_era\n end\n \n \n \n end", "def testSplitInterchangeableDayWithPriority\n # TODO: Code the interchangeable days feature, and uncomment after\n# executeSimpleTest(\n# [ [ 'T1', 'R1', 300, 2, [], ' =='],\n# [ 'T2', 'R1', 200, 2, ['T3'], '= ='],\n# [ 'T3', 'R2', 400, 2, [], ' =='],\n# [ 'T4', 'R3', 100, 3, ['T3'], '==='],\n# [ 'T5', 'R1', 50, 2, ['T6'], ' =='],\n# [ 'T6', 'R4', 500, 2, [], ' =='],\n# [ 'T7', 'R5', 30, 3, ['T6'], '==='] ] )\n executeSimpleTest(\n [ [ 'T1', 'R1', 300, 2, [], ' =='],\n [ 'T2', 'R1', 200, 2, ['T3'], ' =='],\n [ 'T3', 'R2', 400, 2, [], ' =='],\n [ 'T4', 'R3', 100, 3, ['T3'], '==='],\n [ 'T5', 'R1', 50, 2, ['T6'], '=='],\n [ 'T6', 'R4', 500, 2, [], ' =='],\n [ 'T7', 'R5', 30, 3, ['T6'], '==='] ] )\n end", "def test_08d\n Rate.find_all_by_price_id(1).each {|r| r.update_attribute :monthly_rate, 0.0}\n Rate.find_all_by_price_id(1).each {|r| r.update_attribute :weekly_rate, 0.0}\n Charges.new(Date.new(2011,05,10),\n Date.new(2011,06,10),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n # charges.each {|c| p c.inspect}\n assert_equal 2, charges.size\n\n assert_equal 2, charges[0].season_id\n assert_in_delta 22.0, charges[0].period.to_f, 0.005\n assert_equal 15.0, charges[0].rate.to_f\n assert_in_delta 330.00, charges[0].amount.to_f, 0.005\n assert_equal Charge::DAY, charges[0].charge_units\n\n assert_equal 3, charges[1].season_id\n assert_in_delta 9.0, charges[1].period.to_f, 0.005\n assert_equal 31.5, charges[1].rate.to_f\n assert_in_delta 283.5, charges[1].amount.to_f, 0.005\n assert_equal Charge::DAY, charges[1].charge_units\n end", "def index\n @test_dates = TestDate.all\n end", "def fill_missing_dates(report_result)\n start_date = Date.parse(report_result.data.startDate)\n end_date = Date.parse(report_result.data.endDate)\n headers = report_result.data.headers\n rows = report_result.data.rows\n current_pos = 0\n\n # Check if the results fit the requirements for this method.\n if !headers\n raise ArgumentError, 'No headers defined in report results.'\n end\n\n if headers.length < 2 || headers.first.type != 'DIMENSION'\n raise ArgumentError, 'Insufficient dimensions and metrics defined.'\n end\n\n if headers[1].type == 'DIMENSION'\n raise ArgumentError, 'Only one dimension allowed.'\n end\n\n date_format, date = nil\n\n # Adjust output format and start date according to time period.\n if headers.first.name == 'DATE'\n date_format = '%F'\n date = start_date\n elsif headers.first.name == 'MONTH'\n date_format = '%Y-%m'\n # Normalize date to 1st of the month.\n date = Date.parse(start_date.strftime(date_format) + '-01')\n else\n raise ArgumentError, 'Results require a DATE or MONTH dimension.'\n end\n\n # Process data.\n processed_data = []\n\n while date < end_date do\n row_date = nil\n if rows && rows[current_pos]\n # Parse date on current row.\n if headers.first.name == 'DATE'\n row_date = Date.parse(rows[current_pos][0])\n elsif headers.first.name == 'MONTH'\n row_date = Date.parse(rows[current_pos][0] + '-01')\n end\n end\n\n # Is there an entry for this date?\n if row_date && date == row_date\n processed_data << rows[current_pos]\n current_pos += 1\n else\n new_row = []\n new_row << date.strftime(date_format)\n new_row += headers[1..-1].map { |header| 'no data' }\n processed_data << new_row\n end\n\n # Increment date accordingly.\n if headers.first.name == 'DATE'\n date += 1\n elsif headers.first.name == 'MONTH'\n date >>= 1\n end\n end\n\n return processed_data\nend", "def dates\n\t\t@times = { \n\t\t\t:haiti=>{\n\t\t\t\t:one_week_before=>\tTime.new(2010,01,5),\n\t\t\t\t:event\t\t\t=>\tTime.new(2010,01,12),\n\t\t\t\t:one_week_after\t=>\tTime.new(2010,01,19),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2010,02,12)\n\t\t\t},\n\n\t\t\t:philippines=>{ \n\t\t\t\t:one_week_before=>\tTime.new(2013,11,1),\n\t\t\t\t:event\t\t\t=>\tTime.new(2013,11,8),\n\t\t\t\t:one_week_after\t=>\tTime.new(2013,11,15),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2013,12,8)\n\t\t\t},\n\t\t\t:phil=>{ \n\t\t\t\t:one_week_before=>\tTime.new(2013,11,1),\n\t\t\t\t:event\t\t\t=>\tTime.new(2013,11,8),\n\t\t\t\t:one_week_after\t=>\tTime.new(2013,11,15),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2013,12,8)\n\t\t\t}\n\t\t}\n\tend", "def test_custom_model_calculation_method\n create_user \"2014-05-01\"\n create_user \"2014-05-01\"\n create_user \"2014-05-03\"\n\n expected = {\n Date.parse(\"2014-05-01\") => 2,\n Date.parse(\"2014-05-02\") => 0,\n Date.parse(\"2014-05-03\") => 1\n }\n\n assert_equal expected, User.group_by_day(:created_at).custom_count\n end", "def data_collector collection, factor, duration\n your_data, comparison_data = [], [], []\n uniq_exam_dates = collection.map(&:exam_date).uniq\n if duration == \"12\"\n Date.today.month.times do |count|\n your_temp_data, todays_data = [], []\n collection.where(exam_date:(Time.now-count.month).all_month()).each do |report|\n your_temp_data << report.send(:\"#{factor}\")\n end\n Report.where(exam_date: (Time.now-count.month).all_month(), school_id:current_user.school.id).each do |m|\n todays_data << (m.send(:\"#{factor}\")).round(2) rescue 0\n end\n comparison_data << average(todays_data)\n your_data << average(your_temp_data)\n end\n else\n uniq_exam_dates.each do |date|\n your_temp_data,todays_data = [], []\n collection.where(exam_date:date).each do |report|\n your_temp_data << report.send(:\"#{factor}\")\n end\n Report.where(exam_date:date, school_id:current_user.school.id).each do |m|\n todays_data << (m.send(:\"#{factor}\")).round(2) rescue 0\n end\n comparison_data << average(todays_data)\n your_data << average(your_temp_data)\n end\n end\n your_data.reverse!\n comparison_data.reverse!\n factor == \"accuracy\" ? plot_accuracy(your_data, comparison_data) : plot_time_management(your_data, comparison_data)\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def daily_report( report, ignored = nil )\n @range.each do | day |\n add_column( day..day )\n end\n end", "def fix_dates( data )\n\n ## check for missing / no dates \n ## examples\n ## - rubytogether feed @ https://rubytogether.org/news.xml\n data.items.each do |item|\n if item.updated.nil? &&\n item.published.nil?\n ## try to get date from slug in url\n ## e.g. /news/2019-10-17-growing-ruby-together\n if (m=FIX_DATE_SLUG_RE.match( item.url ))\n ## todo/fix: make sure DateTime gets utc (no timezone/offset +000)\n published = DateTime.new( m[:year].to_i(10),\n m[:month].to_i(10),\n m[:day].to_i(10) )\n item.published_local = published\n item.published = published\n end\n end\n end\n\n \n ## check if all updated dates are the same (uniq count is 1)\n ## AND if all published dates are present\n ## than assume \"fake\" updated dates and nullify updated dates\n ## example real-world \"messed-up\" feeds include:\n ## - https://bundler.io/blog/feed.xml\n ## - https://dry-rb.org/feed.xml\n ##\n ## todo/check - limit to atom feed format only - why? why not?\n\n count = data.items.size\n count_published = data.items.reduce( 0 ) {|count,item| count += 1 if item.published; count }\n\n if count == count_published\n uniq_count_updated = 0\n last_updated = nil\n\n data.items.each do |item|\n uniq_count_updated += 1 if item.updated != last_updated\n last_updated = item.updated\n end\n\n if uniq_count_updated == 1\n puts \"bingo!! nullify all updated dates\"\n ## todo/fix: log report updated date fix!!!!\n data.items.each do |item|\n item.updated = nil\n item.updated_local = nil\n end\n end\n end\n end", "def select_trend_by_day\n self.trend_period = 'day'\n records = []\n records = get_select_trend_by_day( day_from_date, end_date, accounts)\n records = fill_missing_rows(records, day_from_date, end_date) \n records.flatten\n end", "def set_param_date\n # sets datas based on params or last transaction\n # if params include a date from/to converted to beginning and end of month\n # if only front will set from and to (or today of to missing)\n # if parmans not present will get last transaction and set from to beginning of its month\n # if from is in current month, may look back 7 days from from date\n @today = Date.today\n minus7 = @today.day < 8 ? 8 - @today.day : 0 # if in first week of month, look back 7 days\n if params[:date].present? # from month pulldown\n @date = Ledger.set_date(params[:date])\n @from = @date.beginning_of_month\n @to = @date.end_of_month\n elsif params[:from].present? # from date picker(from,to)\n @from = Ledger.set_date(params[:from])\n @to = params[:to].present? ? Ledger.set_date(params[:to]) : @today.end_of_month\n else\n last_tran = @account.last_entry_date ||= @today.beginning_of_year\n @from = last_tran.beginning_of_month\n @from -= minus7 if Ledger.dates_in_same_month(@today,@from)\n @to = @today.end_of_month\n end\n end", "def update_dates ( date )\n date = Date.parse(date)\n if !DATES[date].nil?\n DATES[date] += 1\n end\nend", "def updateDates(iDate, iResourcesInfo)\n if (@StartDate == nil)\n # First time there is an affectation\n @StartDate = iDate\n @EndDate = iDate\n @EndDateHours = 0\n iResourcesInfo.each do |iResource, iHours|\n @EndDateHours += iHours\n end\n elsif (@StartDate > iDate)\n # Different start date\n @StartDate = iDate\n elsif (@EndDate < iDate)\n # Different end date\n @EndDate = iDate\n @EndDateHours = 0\n iResourcesInfo.each do |iResource, iHours|\n @EndDateHours += iHours\n end\n end\n end", "def ead_unitdate_fields(fields = Hash.new)\n start_dates, end_dates = [], []\n unless self.unitdate_normal.nil?\n self.unitdate_normal.each do |unitdate|\n start_dates << unitdate_start(unitdate)\n end_dates << unitdate_end(unitdate)\n end\n Solrizer.set_field(fields, \"unitdate_start\", start_dates.compact, :facetable, :displayable, :sortable)\n Solrizer.set_field(fields, \"unitdate_end\", end_dates.compact, :facetable, :displayable, :sortable)\n Solrizer.insert_field(fields, \"unitdate\", ead_date_display, :displayable)\n end\n return fields\n end", "def process_bc_ad_dates(ng_date_elements)\n ng_date_elements.map do |ng_date_element|\n case\n when date_is_edtf?(ng_date_element) && ng_date_element.text.strip == '0'\n ng_date_element.content = \"1 B.C.\"\n when date_is_bc_edtf?(ng_date_element)\n year = ng_date_element.text.strip.gsub(/^-0*/, '').to_i + 1\n ng_date_element.content = \"#{year} B.C.\"\n when date_is_ad?(ng_date_element)\n ng_date_element.content = \"#{ng_date_element.text.strip.gsub(/^0*/, '')} A.D.\"\n end\n ng_date_element\n end\n end", "def daily\n if dates_ok?\n @entries = Entry.where('user_id = ?\n AND \"time\"(date) BETWEEN ? AND ?\n AND CAST(date AS DATE) >= ? and CAST(date AS DATE) <= ?', current_user.id, params[:timeFrom], params[:timeTo], Date.parse(params[:dateFrom]), Date.parse(params[:dateTo])).\n select('CAST(date AS DATE), sum(calories) as calories').group('CAST(date AS DATE)')\n else\n @entries = Entry.where('user_id = ?', current_user.id).\n select('CAST(date AS DATE), sum(calories) as calories').group('CAST(date AS DATE)')\n end\n end", "def standardize\n @dataset = {}\n return dataset if @resultset.empty?\n # process sensors for each station\n @resultset.keys.each do |station|\n # group into days: assume 4 days for now\n days = descretize_sensor_data_by_day(@resultset[station])\n @dataset[station] = {} \n # process days\n days.keys.each do |date|\n # squash into hours (ordered)\n @dataset[station][date] = descretize_sensor_data_by_half_hour(days[date])\n end\n end\n end", "def makeDays\n\t\thowManyDaysAgo = (rand()*CONFERENCE_START).round(0)+18\n\t\tlengthDays = (rand()*CONFERENCE_DAYS_MAX_DIFF).round() + CONFERENCE_DAYS_BASIC\n\t\t@startDate = (Date.today-howManyDaysAgo)\n\t\t@endDate = (Date.today-howManyDaysAgo+lengthDays)\n\t\t# That's the end of fields you want to print\t\n\t\t@days = Array.new\n\t\t(howManyDaysAgo-lengthDays..howManyDaysAgo).each{|x| @days << (CDay.new((Date.today-x), self))\t}\n\t\t@days.reverse! # If we want them in correct order\n\t\t# Discounts, some weird stuff may happen here, like functional programming\n\t\t@discounts = Array.new\n\t\tdays = DISCOUNT_DAYS.map{|x| x+((rand()-0.5)*DISCOUNT_DAYS_MAX_DIFF).round(0)}\n\t\tammounts = DISCOUNT_AMMOUNTS.map{|x| x+((rand()-0.5)*DISCOUNT_AMMOUNTS_MAX_DIFF).round(2)}\n\t\t(0..2).each{|x| @discounts << Discount.new(((@startDate)-days[x].to_i-1), ((@startDate)-days[x+1].to_i), self, ammounts[x])}\n\tend", "def group_by_day\n\n\tend", "def calculate\n calculate_for_dates(bucket_dates)\n end", "def calculate_dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n end", "def set_variables(month, year)\n @month = month\n @year = year\n\n @start_of_month = Date.parse(\"#{year}-#{month}-1\")\n @days_in_month = Time.days_in_month(@month, @year)\n\n @dates = [[]]\n\n # Add blank dates before 1st of month\n blank_spaces_at_start_of_cal(@start_of_month.wday).times { @dates[0] << nil }\n\n # Loop over days in given month\n @days_in_month.times do |date_in_month|\n date_in_month = date_in_month + 1\n\n row = (date_in_month + day_of_week(@start_of_month.wday) - 1) / 7\n row -= 1 if day_of_week(@start_of_month.wday) == 7 && (date_in_month + 6) % 7 == 0\n\n @dates[row] = [] unless @dates[row]\n @dates[row] << date_in_month\n end\n\n # Fill remaining array with nil values after the last day of the month\n # to keep aesthetic consistency\n if @dates.last.length < 7\n (7 - @dates.last.length).times do |n|\n @dates.last << nil\n end\n end\n\n @active_employees = Employee.all.where(active: true)\n end", "def check_dates\n if(self.d_publish.nil?) && (self.d_remove.nil?)\n self.d_remove = \"2094-03-25\"\n self.d_publish = Time.zone.today\n elsif(self.d_publish?)\n self.d_remove = \"2094-03-25\"\n elsif(self.d_remove?)\n self.d_publish = Time.zone.today\n end\n end", "def change_dates start_date, finish_date\n set_dates start_date, finish_date\n\n set_calendar\n end", "def test\n WorkCalendar.configure do |c|\n c.weekdays = %i(mon tue wed thu fri)\n c.holidays = [Date.new(2015, 1, 1), Date.new(2015, 7, 3), Date.new(2015, 12, 25)]\n end\n end", "def seed_data\n # for my own testing purposes\n puts \"Providing some seed data here\"\n today = Date.today\n range1 = DateRange.new(start_date_obj: today, end_date_obj: today + 3)\n hotel.make_reservation(date_range: range1, customer: \"Butters\", new_nightly_rate: 50)\n hotel.make_reservation(date_range: range1, customer: \"Me\")\n hotel.make_block(date_range: range1, room_ids:[11,12,13,14,15], new_nightly_rate:100)\n hotel.make_reservation_from_block(room_id:11, customer:\"Oski\")\n hotel.make_reservation_from_block(room_id:12, customer: \"Jesse\")\n hotel.make_block(date_range: range1, room_ids:[19,20], new_nightly_rate:125)\nend", "def test_day_of_scheduled_reminders\n @reminder.scheduled_reminders.each{|x| assert_equal x.run_at.mday, @reminder.fq_day }\n end", "def register_dates(*names)\n names.each do |name|\n label = \"#{name.to_s}_after\"\n dates[label] = {}\n dates[label][\"label\"] = label\n dates[label][\"value\"] = DEFAULT_DATE_AFTER\n dates[label][\"field\"] = name.to_s\n dates[label][\"operator\"] = \">=\"\n label = \"#{name}_before\"\n dates[label] = {}\n dates[label][\"label\"] = label\n dates[label][\"value\"] = DEFAULT_DATE_BEFORE\n dates[label][\"field\"] = name.to_s\n dates[label][\"operator\"] = \"<=\"\n end\n end", "def data_for_day(date)\n\t\tbegin\n\t\tfilename = filename_for_day(date)\n\t\tfilestring = File.read(\"#{@directory}/#{filename}\")\n\t\tCSV.parse(filestring, headers: true)\n\trescue Exception => e\n\t\tputs e\n\tend\n\tend", "def assign_date_coverage\n cov_interval = Dataset::DateCoverageService.params_to_interval params\n params[PARAMS_KEY]['date_coverage'] = cov_interval ? cov_interval.edtf : \"\"\n end", "def fetch_dates(dates)\n completed = []\n\n connect do |service|\n dates.each do |date|\n @ui.log.info(\"Fetching #{date}\")\n\n data = service.fetch_espi(date)\n next if data.empty?\n\n @ui.log.info(\"Verifying #{date}\")\n samples = Samples.parse_espi(data)\n\n if samples.any?\n @ui.log.info(\"Saving #{date}\")\n FileUtils.mkdir_p(File.dirname(data_file(date)))\n File.open(data_file(date), \"w\") do |f|\n f.write(data)\n end\n\n upload(date, samples.on(date))\n\n @ui.log.info(\"Completed #{date}\")\n completed << date\n else\n @ui.log.info(\"Incomplete #{date}\")\n end\n end\n end\n\n completed\n end", "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[Org::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "def combine_dates\n tmpdate = date\n tmpdate << date_available\n tmpdate << date_created\n tmpdate << date_updated\n tmpdate << date_copyrighted\n tmpdate << date_collected\n tmpdate << date_valid\n self.date = tmpdate\n end", "def set_test_date\n @test_date = TestDate.find(params[:id])\n end", "def dates_for_axis influences\n\t\tmin = influences[0].date\n\t\tmax = influences[0].date\n\n\t\tinfluences.each do |influence| \n\t\t\tif influence.date < min\n\t\t\t\tmin = influence.date\n\t\t\tend\n\t\t\tif influence.date > max\n\t\t\t\tmax = influence.date\n\t\t\tend\n\t\tend\n\t\thours = ((max - min)/3600)/3\n\n\t\tmedia = min + hours.hour\n\n\t\tdates = []\n\n\t\tdates << min \n\t\tdates << media\n\t\tdates << max\n\n\t\tdates\n\tend", "def test_String_009_format_dateString_mmddyyyy\n \n #require 'date'\n \n puts2(\"\")\n puts2(\"#######################\")\n puts2(\"Testcase: test_String_009_format_dateString_mmddyyyy\")\n puts2(\"#######################\")\n \n puts2(\"\\nTesting slash delimited dates expressed as STRINGS to the 1900's\")\n \n # Array of date strings to test\n aDateStrings = [\n \"1/1/01\",\n \"01/02/01\",\n \"11/1/01\",\n \"1/10/01\",\n \"12/31/2000\",\n ]\n \n # Loop through the list, converting each date string\n aDateStrings.each do | sDateString |\n puts2(\"#{sDateString} formatted as \" + sDateString.format_dateString_mmddyyyy(\"/\" ,\"19\"))\n end\n \n \n puts2(\"\\nTesting period delimited dates expressed as STRINGS to the 2300's\")\n \n # Array of date strings to test\n aDateStrings = [\n \"1.1.01\",\n \"01.02.01\",\n \"11.1.01\",\n \"1.10.01\",\n \"12.31.2000\",\n ]\n \n # Loop through the list, converting each date string\n aDateStrings.each do | sDateString |\n puts2(\"#{sDateString} formatted as \" + sDateString.format_dateString_mmddyyyy(\".\" ,\"23\"))\n end\n \n end", "def test_17\n ActiveRecord::Base.logger.debug \"start season test_17 #{ Season.find_by_date(Date.new(2011,04,14)).name}\"\n ActiveRecord::Base.logger.debug \"end season test_17 #{ Season.find_by_date(Date.new(2011,04,16)).name}\"\n Charges.new(Date.new(2011,04,14),\n Date.new(2011,04,16),\n\t\t1, 1, 20)\n charges = Charge.find_all_by_reservation_id 20\n assert_equal 2, charges.size\n assert_equal 1, charges[0].season_id\n assert_equal 1.0, charges[0].period.to_f\n assert_equal 12.0, charges[0].rate.to_f\n assert_equal 12.0, charges[0].amount.to_f\n assert_equal Charge::DAY, charges[0].charge_units\n assert_equal 2, charges[1].season_id\n assert_equal 1.0, charges[1].period.to_f\n assert_equal 15.0, charges[1].rate.to_f\n assert_equal 15.0, charges[1].amount.to_f\n assert_equal Charge::DAY, charges[1].charge_units\n end", "def dates_with_earnings(driver)\n earns_per_date = {}\n \n driver.each do |rides|\n # Add the date (key) if it does not exist in the hash, and assign a temporary value 0\n if !earns_per_date.has_key? rides[:date]\n earns_per_date[rides[:date]] = 0\n end\n # If there are more than one ride on a day, the eanring (value) will keep adding on\n earns_per_date[rides[:date]] += rides[:cost]\n end\n return earns_per_date\nend", "def load_dates\n begin\n @start_date, @end_date = set_dates(params[:start_date],params[:end_date])\n raise 'Date Invalid' if @start_date.nil? || @end_date.nil?\n rescue\n flash.now[:error] = 'Date invalid'\n render action: :search and return nil\n end\n end", "def test_date_of_today\n skip\n engine = Engine.new\n\n assert engine.date\n end", "def logLoader(startDate, endDate)\r\n\tsDate = DateTime.parse(startDate)\r\n\teDate = DateTime.parse(endDate)\r\n\tlogpareser = Datadb::LogParser.new\r\n\tif (sDate <= eDate)\r\n\t\tlogpareser.uploadDataFromTestRepositoryOnDate(sDate.to_date.to_s)\r\n\t\tsDate += 1\r\n\t\tlogLoader(sDate.to_s, eDate.to_s)\r\n\tend\r\nend" ]
[ "0.6976588", "0.69226384", "0.6822835", "0.67585146", "0.60089093", "0.59574413", "0.59156114", "0.59090245", "0.57875764", "0.57688", "0.5733654", "0.5644477", "0.5638423", "0.5628136", "0.56105125", "0.5583802", "0.5579486", "0.55758893", "0.5575779", "0.5554881", "0.5531897", "0.5518656", "0.5487103", "0.5485192", "0.5471765", "0.54613245", "0.5445809", "0.54457545", "0.5439438", "0.5427984", "0.541568", "0.5405899", "0.53962904", "0.5384811", "0.5382013", "0.53659284", "0.5363988", "0.534323", "0.5330883", "0.5312238", "0.5305002", "0.53032607", "0.5301072", "0.5300892", "0.5297071", "0.5289337", "0.52877134", "0.5285764", "0.5284996", "0.52791935", "0.5276267", "0.5273434", "0.5264665", "0.526107", "0.5251247", "0.5246197", "0.52388835", "0.5234886", "0.5220168", "0.52180964", "0.52113956", "0.52090096", "0.5199081", "0.5193117", "0.5190791", "0.51766557", "0.51760334", "0.51743805", "0.5172051", "0.51667476", "0.51648986", "0.51608956", "0.51594526", "0.5137756", "0.51369274", "0.51340276", "0.51256454", "0.512524", "0.5125073", "0.5122762", "0.5113906", "0.51110595", "0.5108083", "0.5106408", "0.50966126", "0.50907505", "0.5090408", "0.5081065", "0.50759053", "0.5075618", "0.50751084", "0.5067684", "0.5067612", "0.50673795", "0.505869", "0.5057058", "0.50538903", "0.5040832", "0.50386983", "0.5038537" ]
0.67348754
4
Verifies use dates match test data
def verify_use_dates(test_data) dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date] dates.each_with_index do |date, index| verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index)) verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index))) verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index)) verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index)) verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[Org::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def test_if_correct_date\n skip\n potluck = Potluck.new(\"7-13-18\")\n expected =\n actual = potluck\n\n assert_equal expected, actual\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def date_combination_valid\n\n # just make sure we work on something valid and existing\n\n return false unless date_from?\n\n set_nil_default( :date_until, date_from )\n\n if date_until < date_from\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_period' ))\n return false\n end\n\n if date_from.year != date_until.year\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_years' ))\n return false\n end\n\n # all tests passed\n\n write_attribute( :year_period, date_from.year )\n return true\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def date_valid?(date)\n valid_dates = Date.parse(DATA_START_DATE)..Date.today\n if valid_dates.cover?(date)\n return true\n else\n puts \"\\nDate must be after #{DATA_START_DATE} and before today.\"\n return false\n end\nend", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend", "def check_dates\n # TODO the init_time must be less then the end_time\n true\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def test_date\n if test_execution_date and test_delivery_date\n if test_execution_date > test_delivery_date\n errors.add(:test_delivery_date, \"should be greater then test date.\")\n end\n end\n end", "def verify_patchset_9141024_created_date\n patchset = PatchSet.where(code_review_id: 9141024, patchset: 3004).first\n #convert dates to strings for comparison\n if patchset.created.to_s.eql?(\"2012-01-20 23:53:25 UTC\") then \n pass()\n else\n fail(\"Wrong created date on patchset 9141024.\")\n end\n end", "def check_fixed_date_requirements(date)\n return true unless release_fixed_date? && release_date.present?\n date == release_date\n end", "def dates_are_correct\n errors.add(:begins, _(\"%{fn} can't be blank\")) if begins.nil?\n errors.add(:finishes, _(\"%{fn} can't be blank\")) if finishes.nil?\n\n dates_in_order?(begins, finishes) or\n errors.add(:begins, _('Conference must end after its start date'))\n\n dates_in_order?(cfp_open_date, cfp_close_date) or\n errors.add(:cfp_open_date, _('Call for papers must end after its ' +\n 'start date'))\n dates_in_order?(cfp_close_date, begins) or\n errors.add(:cfp_close_date, _('Call for papers must finish before ' +\n 'the conference begins'))\n\n dates_in_order?(reg_open_date, reg_close_date) or\n errors.add(:reg_open_date, _('Registration must end after its ' +\n 'start date'))\n dates_in_order?(reg_close_date, finishes) or\n errors.add(:reg_close_date, _('Registration must finish before the ' +\n 'conference ends'))\n end", "def test_raises_error_with_invalid_dates\n assert_raises DataWrangler::Configuration::Error do\n _new_validator(\n {\n \"from\" => @invalid_date_string,\n \"to\" => Date.today.to_s\n }\n )\n end\n end", "def test_valid_with_attributes\r\n fee_schedule = FeeSchedule.new\r\n fee_schedule.start_date = fee_schedules(:fee_schedule_00001).start_date\r\n fee_schedule.end_date = fee_schedules(:fee_schedule_00001).end_date\r\n assert fee_schedule.valid?, fee_schedule.errors.full_messages \r\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def dates_equal?(date1, date2)\n return true if date1.blank? || date2.blank?\n return true unless date_parsable?(date1) && date_parsable?(date2)\n\n Date.parse(date1) == Date.parse(date2)\n end", "def correct?\n starts_at < ends_at && starts_at.to_date == ends_at.to_date\n end", "def test_date_a_variable_matches_index\n skip\n engine = Engine.new\n assert_equal [6, 2, 2, 5], engine.date_assignment\n end", "def vulnerable?(dates=@@OPEN_DATES)\n cves(dates).any?\n end", "def test_dates_with_exact_attributes_are_equal\n assert_equal CarbonDate::Date.new(1988, 7, 11, 6, 43, 3, precision: :second), CarbonDate::Date.new(1988, 7, 11, 6, 43, 3, precision: :second)\n end", "def validate_date?(start_date,end_date)\n\t\tstart_date <= end_date\n\tend", "def dates_valid?\n date_check(params[:start_date]) && date_check(params[:end_date]) && dates_sequential?\n end", "def correct_dates?(object)\n object.date_from <= object.date_to\n end", "def check_date(source_file)\n avhrr_file = Dir.glob('*.avhrr').first\n fail 'No avhrr file found, the processing must have failed' unless avhrr_file\n\n # Catch exception in case of wierd dates, like for example \"n19.17366.2352.avhrr\"\n begin\n # time of processed data\n time_of_data = get_time(avhrr_file)\n # time of recieved pass\n time_of_source = get_time(source_file)\n rescue ArgumentError => e\n puts('ERROR: An error occured parsing the source or processed filenames.')\n puts(\"ERROR: \\t#{e.to_s}\")\n raise 'Processed data has a strange time'\n end\n\n # if the time of the processed data and the source data is different by more than 10 minutes, report as bad\n if ((time_of_data - time_of_source) > 600)\n puts('ERROR: Processed data seems to have a strange time')\n puts(\"ERROR: Source: #{source_file}, time => #{time_of_source.to_s}\")\n puts(\"ERROR: Data: #{avhrr_file}, time => #{time_of_data.to_s}\")\n fail 'Processed data has a strange time'\n end\n\n # If the date of the data is more than 4 days in the future, report as bad.\n if ((time_of_data - DateTime.now).to_f > 2.0 )\n puts('ERROR: Processed data is in the future')\n puts(\"ERROR: Source: #{source_file}, time => #{time_of_source.to_s}\")\n puts(\"ERROR: Data: #{avhrr_file}, time => #{time_of_data.to_s}\")\n fail 'Processed data has a date in the future'\n end\n end", "def date_verify\n if end_date && start_date.nil?\n errors.add(:end_date, \"cannot only specify end date\")\n elsif all_day && start_date.nil?\n errors.add(:all_day, \"cannot specify without date\")\n elsif (start_date && end_date) && (start_date > end_date)\n errors.add(:start_date, \"cannot larger than end date\")\n end\n end", "def verifyCalendarDate\n # Make sure the given year is not less than 1900.\n if @year < 1900\n @year = 1900\n end\n\n # Make sure the month is within range.\n if @month > 12\n @month = 12\n end\n if @month < 1\n @month = 1\n end\n\n # Make sure the day given is within range of the month.\n month_length = CDK::CALENDAR.getMonthLength(@year, @month)\n if @day < 1\n @day = 1\n end\n if @day > month_length\n @day = month_length\n end\n end", "def test_simple_valid_datetime\n assert_equal [11, 0], verify_and_return_datetime([10, 100], '11.0', 10)\n end", "def check_dates\n dates_already_booked = [date_in, date_out]\n body.bookings.each do |b|\n dates_already_booked << b.date_in\n dates_already_booked << b.date_out\n end\n dates_already_booked.sort!\n idx_in = dates_already_booked.index(date_in)\n idx_out = dates_already_booked.index(date_out)\n if idx_in + 1 == idx_out && idx_in % 2 == 0\n true\n else\n throw(:abort)\n end\n end", "def dates_not_same\n if start_date == end_date\n errors.add(:start_date, 'start date can not equal end date')\n errors.add(:end_date, 'end date can not equal start date')\n end\n end", "def expect_all_be_false_expect_these natural_date, exception_dates_string\n exception_dates = exception_dates_string.map { |s| Date.parse(s) }\n\n (Date.new(2016, 1, 1)..Date.new(2016, 12, 31)).to_a.each do |date|\n expect(natural_date =~ date).to eq(exception_dates.include?(date))\n end\n end", "def same_date\n return unless start_at? && end_at?\n return unless start_at.to_date != end_at.to_date\n\n errors.add(:start_at, :same_date)\n errors.add(:end_at, :same_date)\n end", "def valid_release_date?(date)\n # Validate date against all release date requirements\n check_no_delay_requirements(date) && check_before_date_requirements(date) && check_fixed_date_requirements(date)\n end", "def test_validate_valid_date\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: 1.day.from_now,\n is_hidden: false)\n assert g.valid?\n end", "def test_date_value\n assert_match /\"2012-01-01T00:00:00.*/, value(Date.parse('2012-01-01'))\n end", "def has_valid_date?\n self.time_event < Time.now.advance(days: 1)\n end", "def dates_sequence\n [:fpfv, :lplv, :expected_db_lock].each do |d|\n unless send(d).instance_of?(Date)\n errors.add(d, \"Must be valid Date\")\n return false\n end\n end\n\n unless fpfv < lplv\n errors.add(:fpfv, \"Must be less than lplv\")\n return false\n end\n\n unless expected_db_lock > lplv\n errors.add(:expected_db_lock, \"Must be greater than lplv\")\n return false\n end\n\n return true\n end", "def test_should_retun_every_set_of_days_of_month\n assertion = Month.august(2006).every!(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Hash)\n # monday assertions\n assert_equal assertion[:monday].size, 4\n assert_equal assertion[:monday], [Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n # wednesday assertions\n assert_equal assertion[:wednesday].size, 5\n assert_equal assertion[:wednesday],\n [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30)]\n end", "def test_nanak_550_is_not_leap_year\n assert Nanakshahi.new(550, 10, 12).leap? == false\n end", "def dates_in_span_valid?(date_string)\n dates_array = date_string.split(\"-\")\n start_range = dates_array[0]\n begin\n start_range = USDateParse(start_range)\n self.individual_dates_with_no_classes += [start_range]\n rescue\n errors.add(:dates_with_no_classes_day, 'Could not verify the date range because the date is not parsable.')\n return false\n end\n #also need to check if startdate is before enddate\n if dates_array.length == 2\n end_range = dates_array[1]\n begin\n end_range = USDateParse(end_range)\n if end_range < start_range\n errors.add(:dates_with_no_classes_day, 'Could not add the date range because end date is before start date.')\n return false\n end\n date = start_range\n while date < end_range\n date += 1\n self.individual_dates_with_no_classes += [date]\n end\n rescue\n errors.add(:dates_with_no_classes_day, 'Could not verify the date range because the date is not parsable.')\n return false\n end\n elsif dates_array.length > 2\n errors.add(:dates_with_no_classes_day, 'Could not verify the date range because the range is not parsable.')\n return false\n end\n return true\n end", "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "def assert_equal_dates(expected, actual, message = nil, format = \"%Y-%m-%d\")\n if expected != nil && (expected.is_a?(Date) || expected.is_a?(DateTime) || expected.is_a?(Time))\n expected = expected.strftime(format)\n end\n formatted_actual = actual\n if !actual.nil? and (actual.is_a?(Date) || actual.is_a?(DateTime) || actual.is_a?(Time))\n formatted_actual = actual.strftime(format)\n end\n flunk(\"#{message} \\nExpected #{expected} \\nbut was #{formatted_actual}\") unless expected == formatted_actual\n end", "def test_find_sorted_dates\n assert_nil(MyRegex.find_sorted_dates(RAND_STR),\n \"Test failure for #{RAND_STR}\")\n assert_nil(MyRegex.find_sorted_dates(\"Jnue 25, 1999\"),\n \"Test failure for invalid month\")\n TEST_MONTHS.each do |m|\n [1-50].each do |d|\n test = \"#{m}, #{d}, 1999\"\n begin\n date = Date.strptime(test)\n assert_equal(MyRegex.find_sorted_dates(test), date,\n \"Test failure for #{test}\")\n rescue\n assert_nil(MyRegex.find_sorted_dates(test), \"Test failue for #{test}\")\n end\n end\n end\n end", "def test_date_of_today\n skip\n engine = Engine.new\n\n assert engine.date\n end", "def team_registration_passed?\n d = @data_object\n today = Date.today\n d.aff_team_reg_end.to_date < today\n end", "def check_date()\n event = Event.find_by(id: self.event_id) \n if Time.now > event.start_date then\n halt msg: 'check_date() fail' \n false\n else\n true\n end\n end", "def verify_appointments_count(start_dates)\n if start_dates.count == 5\n true\n elsif start_dates.count == 8\n false\n else\n false\n end\n end", "def date_consistency\n\t\treturn if [start_date.blank?, end_date.blank?].any?\n\t\terrors.add(:end_date, 'must be after start_date') if start_date > end_date\n\tend", "def test_should_retun_every_set_of_days_of_month_as_array\n assertion = Month.august(2006).every(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Array)\n # check for data integrity\n assert_equal assertion.size, 9\n assert_equal assertion, [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30),Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n end", "def enter_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n wait_for_element_and_type(use_date_input(index), date[UseOfCollections::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[UseOfCollections::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[UseOfCollections::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[UseOfCollections::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[UseOfCollections::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def test_non_leap_year_1_march_falls_on_18_phagun\n assert Nanakshahi.from_gregorian(2001, 3, 1) == Nanakshahi.new(532, 12, 18)\n end", "def validate_date(spreadsheet_id)\n date = get_date_array(spreadsheet_id)\n if date[0].to_i >= 1 and date[0].to_i <= 12 and date[1].to_i == 1 and date[2].to_i >= 2016 and get_start_day(date[3]) != nil\n return true\n else\n return false\n end\nend", "def check_date\n\t\tif self.hasError\n\t\t\terrors.add(\"\", \"You entered Invalid date: \\n - \"+self.interviewer.name)\n\t\t\t# puts \"===================CHECKDATE===================\"\n\t\telsif Time.at(self.sched_end.to_i) <= Time.at(self.sched_start.to_i)\n\t\t\terrors.add(\"\", \"Start time cannot be greater than end time \\n - \"+self.interviewer.name)\n\t\tend\n\tend", "def check_dates\n if start_end_dates.count > 0 && !start_end_dates.nil?\n start_end_dates.each do |d|\n return true if d.check_date_ranges\n end\n\n false\n else\n true\n end\n end", "def attested_for?(date)\n last_attested_on && last_attested_on > date.to_time\n end", "def include? date\n @resolution = nil\t\n return true if check_anchor? && date == @anchor \n return mismatch(:day) unless day_of_week_matches?(date)\n return mismatch(:year) unless year_matches?(date) if @unit == :years\n return mismatch(:month) unless month_matches?(date) if [:months, :years].include?(@unit)\n return mismatch(:week) unless week_matches?(date) if [:years, :months, :weeks].include?(@unit)\n if [:years, :months, :weeks, :days].include?(@unit)\n return mismatch(:day) unless day_matches?(date)\n\t return mismatch(:time) unless time_matches?(date)\n end\n if @unit == :hours\n\t return mismatch(:hour) unless hour_matches?(date)\n\t return mismatch(:sub_hour) unless sub_hour_matches?(date)\n end\n if @unit == :minutes\n\t return mismatch(:minute) unless minute_matches?(date)\n\t return mismatch(:second) unless second_matches?(date)\n end\n @resolution = nil\t\n true\n end", "def check_result_has_date(li_arr)\n puts \"#{@@info_indicate} start checking post date\"\n li_arr.each do |li|\n assert_not_nil(get_post_time(li),\"#{@@warning_indicate}Could not found time tag//n\")\n end\n end", "def test_validate_invalid_date\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: '2009-',\n is_hidden: false)\n assert !g.valid?\n end", "def is_target_date?(date) \n d = date.to_date\n check = false\n if d >= @dStart && d <= @dEnd\n check = true\n end\n return check\n end", "def validate_date(input_date) \n too_early = Date.parse(\"31 December 2019\")\n too_late = (Date.today)+1\n raise DateError unless ((input_date > too_early) && (input_date < too_late))\n end", "def test_holidays_year\n years = Services::Holiday::DATES.map do |d|\n Date.parse(d).strftime('%Y')\n end.uniq\n\n current_year = Services::Holiday.current_date.strftime('%Y')\n\n assert(years.include?(current_year))\n end", "def is_target_date? ( date ) \n d = date.to_date\n check = false\n if d >= @dStart.to_date && d <= @dEnd.to_date\n check = true\n end\n return check\n end", "def validate_dates\n if start_at && end_at\n errors.add(:end_at, 'should be greater than start date') if end_at <= start_at\n end\n end", "def valid_dates\n device_request = DeviceRequest.find(device_request_id)\n current_date = Date.today\n if self.on_date.present?\n self.errors.add :on_date, \"Quotation date can't be future\" if self.on_date > current_date\n self.errors.add :on_date, \"Quotation date should be onwards #{device_request.on_date}\" if self.on_date < device_request.on_date\n end\n end", "def test_validation_expiration_dates\n an_account = OrderAccount.new\n #an_account.cc_number = '1234567890'\n \n # An order account must have valid expiration month and year.\n assert !an_account.valid?\n assert an_account.errors.invalid?(:expiration_month), \"Should have an error in expiration_month\"\n assert an_account.errors.invalid?(:expiration_year), \"Should have an error in expiration_year\"\n \n assert_same_elements [\"is not a number\", \"Please enter a valid expiration date.\"], an_account.errors.on(:expiration_month)\n assert_equal \"is not a number\", an_account.errors.on(:expiration_year)\n\n an_account.expiration_month = 1.month.ago.month\n an_account.expiration_year = 1.year.ago.year\n \n an_account.errors.clear\n assert !an_account.valid?\n \n assert an_account.errors.invalid?(:expiration_month), \"Should have an error in expiration_month\"\n assert_equal \"Please enter a valid expiration date.\", an_account.errors.on(:expiration_month)\n end", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def inconsistent?(x)\n if @date_added > @date_modified or\n x.date_added > x.date_modified\n# @date_added != x.date_added or\n# @date_modified > x.date_modified\n\n return true\n end\n false\n end", "def check_date_ranges\n today = Date.today\n !!today.between?(start_date.to_date, end_date.to_date)\n end", "def test_get_date\n assert_equal(0,@day_count.get_date())\n end", "def legacy?\n date < Date.new(2014, 06, 06)\n end", "def enter_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n logger.info \"Entering use date data set at index #{index}: #{date}\"\n wait_for_element_and_type(use_date_input(index), date[CoreUseOfCollectionsData::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def test_non_member_registering_early_bird\n\t\tnon_member = Enrollments.new(:participantID => participants(:non_member_one).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_nil participants(:non_member_one).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-11-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def check_dates_are_valid\n if @start_date.present? && @end_date.present?\n errors.add(:end_date, \"can't be before the start date\") if @end_date < @start_date\n end\n end", "def check_dates_are_valid\n if @start_date.present? && @end_date.present?\n errors.add(:end_date, \"can't be before the start date\") if @end_date < @start_date\n end\n end", "def registration_passed?\n d = @data_object\n today = Date.today\n d.aff_reg_end.to_date < today\n end", "def date_validation\n\t\tif start_date >= end_date\n \t\terrors.add(:end_date, \"must be greater than start date\")\n \tend\n end", "def validate_dates(dates)\n date_format = /(2009|201[0-5])-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])/\n dates.each do |d|\n date_format.match(d).nil? \\\n ? false : true\n end\n end", "def valid_dates?\n if enddate && startdate && enddate <= startdate\n errors.add(:enddate, \"is before startdate\")\n end\n end", "def check_valid_date(date)\n status = false\n if date.count('/') == 2\n removed_slash_day = date.tr('/', '')\n unless removed_slash_day =~ /\\D/\n if (8..10).include? date.length\n month_31days = [1, 3, 5, 7, 8, 10, 12]\n month_30days = [4, 6, 9, 11]\n first_slash_index = date.index('/')\n second_slash_index = date.rindex('/')\n\n dd_length = first_slash_index\n mm_length = second_slash_index - first_slash_index - 1\n yyyy_length = date.length - second_slash_index - 1\n\n dd = date.slice(0, dd_length).to_i\n mm = date.slice(first_slash_index + 1, mm_length).to_i\n yyyy = date.slice(second_slash_index + 1, yyyy_length).to_i\n\n if yyyy.to_s.length == 4\n if month_31days.include? mm\n status = true if dd >= 1 && dd <= 31\n elsif month_30days.include? mm\n status = true if dd >= 1 && dd <= 30\n elsif mm == 2\n if yyyy % 4 == 0\n status = true if dd >= 1 && dd <= 29\n else\n status = true if dd >= 1 && dd <= 28\n end\n end\n end\n end\n end\n end\n status\n end", "def check_date_consistency(date_from_timepicker)\n\t\tparams_ok = true\n\t\tbegin\n\t\t\tdate_from_timepicker.to_datetime\n\t\trescue ArgumentError\n\t\t\tparams_ok = false\n\t\tend\n\n\t\tif date_from_timepicker == \"\"\n\t\t\tparams_ok = false\n\t\tend\n\t\tparams_ok\n\tend", "def test_validate_date_in_the_past\n g = GradeEntryForm.new(short_identifier: 'T1',\n date: 1.day.ago,\n is_hidden: false)\n assert g.valid?\n end", "def test_day_of_scheduled_reminders\n @reminder.scheduled_reminders.each{|x| assert_equal x.run_at.mday, @reminder.fq_day }\n end", "def date_match?(date, h)\n h[:months].include?(date.month) and h[:days].include?(date.day) and h[:wdays].include?(date.wday)\n end", "def check_date(dt)\n\t# Delimit the string using the slash character: \"/\"\n\tdelimited_date = dt.split('/')\n=begin\n\tPrecondition\n\tIf the delimited date does not have three arguments for month, day,\n\tand year, indicate that the date is invalid\n=end\n\tif 3 > delimited_date.length\n\t\traise \"Invalid date has less than 3 fields.\"\n\tend\n\t\n\t# Check if month is less than 1, or greater than 12\n\tif (1 > delimited_date[0].to_i) or ($num_mths < delimited_date[0].to_i)\n\t\traise \"Values for month in the date must lie between 1 and 12, inclusive.\"\n\tend\n\t\n\t# Check if day is less than 1, or greater than 31\n\tif (1 > delimited_date[1].to_i) or ($num_days_31mth < delimited_date[1].to_i)\n\t\traise \"Values for day in the date must lie between 1 and 31, inclusive.\"\n\tend\n\t\n\t# If the month is Feb, check if day > 29\n\tif ($index_of_feb == delimited_date[0].to_i) and ($num_mths < delimited_date[1].to_i)\n\t\traise \"Day in the date must be < 30 for February.\"\n\tend\n\t\n\t# If the month is Feb and it is not a leap year, check if day > 29\n\tif ($index_of_feb == delimited_date[0].to_i) and (0 != (delimited_date[2].to_i).modulo($leap_num_yr)) and ($num_days_28feb < delimited_date[1].to_i)\n\t\tputs \"delimited_date[0].to_i).modulo(4)::\"+delimited_date[0].to_i.modulo($leap_num_yr).to_s\n\t\traise \"Day in the date must be < 29 for February when it is not a leap year.\"\n\tend\n\t\n\t# Check if a 30-day month has been indicated with >30 days\n\tif ($mth30.include?(delimited_date[0].to_i)) and ($num_days_30mth < delimited_date[1].to_i)\n\t\traise \"Selected month \"+delimited_date[0]+\" should not have >30 days.\"\n\tend\n\t\n\t# Check if year < 2009\n\tif 2009 > delimited_date[2].to_i\n\t\traise \"Values for year must be after 2008.\"\n\tend\n\t\n\t# Extract the current day, month, and year\n\textract_day_mth_yr(dt)\nend", "def is_date_valid?\n\t\tunless self.date_of_booking >= Time.zone.now.beginning_of_day \n\t\t\tself.errors[:date_validation] << \"=> You can't book resource for previous day\"\n\t\tend\n\tend", "def check_dates\n date_now = DateTime.now.in_time_zone\n start_date = nil\n end_date = nil\n if !@contestproblem.nil? && @contestproblem.at_least(:in_progress)\n start_date = @contestproblem.start_time\n elsif !params[:contestproblem][:start_time].nil?\n start_date = Time.zone.parse(params[:contestproblem][:start_time])\n end\n if !@contestproblem.nil? && @contestproblem.at_least(:in_correction)\n end_date = @contestproblem.end_time\n elsif !params[:contestproblem][:end_time].nil?\n end_date = Time.zone.parse(params[:contestproblem][:end_time])\n end\n @date_problem = false\n \n if (@contestproblem.nil? || @contestproblem.at_most(:in_progress)) && !end_date.nil? && date_now >= end_date\n flash.now[:danger] = \"La deuxième date ne peut pas être dans le passé.\"\n @date_problem = true\n elsif (@contestproblem.nil? || @contestproblem.at_most(:not_started_yet)) && !start_date.nil? && date_now >= start_date\n flash.now[:danger] = \"La première date ne peut pas être dans le passé.\"\n @date_problem = true\n elsif !start_date.nil? && !end_date.nil? && start_date >= end_date\n flash.now[:danger] = \"La deuxième date doit être strictement après la première date.\"\n @date_problem = true\n elsif start_date.min != 0\n flash.now[:danger] = \"La première date doit être à une heure pile#{ '(en production)' if Rails.env.development?}.\"\n @date_problem = true if !Rails.env.development?\n end\n end", "def right_date_scope(arr)\n return false unless arr[0].to_i.between?(2000, 2100)\n return false unless arr[1].to_i.between?(1, 12)\n return false unless arr[2].to_i.between?(1, 31)\n true\n end", "def check_date_format\n err = \"is not valid date.\"\n errors[\"from_date\"] << err unless is_date(from_date)\n errors[\"to_date\"] << err if(to_date.present? && !is_date(to_date))\n end", "def test_registration_date\n value = DateTime.now\n @reg.registration_date = value\n assert_equal(value.to_s, @reg.registration_date.to_s, \"Registration date incorrect\")\n end", "def test_ID_25840_edit_profile_resident_since\n login_as_user1\n go_to_edit_profile_page\n verify_day_can_only_be_selected_from_1_to_31 \"test_ID_25835_edit_profile_desc\", 1, 31\n verify_month_can_only_be_selected_from_Jan_to_Dec \"test_ID_25835_edit_profile_desc\", 1, 12\n time = Time.new\n verify_year_can_only_be_selected_from_1900_to_current_year \"test_ID_25835_edit_profile_desc\", \"1900\", \"#{time.year}\"\n verify_user_can_save_date \"March\",\"18\",\"1981\"\n verify_user_can_return_date_to_the_default \"Month\",\"Day\",\"Year\"\n verify_user_is_not_able_to_specify_only_the_month_drop_down \"March\",\"Day\",\"Year\"\n verify_user_is_not_able_to_specify_only_the_day_drop_down \"Month\",\"12\",\"Year\"\n #verify_user_is_not_able_to_specify_only_the_year_drop_down \"Month\",\"Day\",\"1970\" Bug\n end" ]
[ "0.83223957", "0.7540422", "0.75246006", "0.7374537", "0.7211184", "0.7193179", "0.7189002", "0.70658135", "0.67955405", "0.6784354", "0.6760487", "0.6750339", "0.66987586", "0.66741383", "0.6640236", "0.65985096", "0.6556969", "0.649744", "0.6467938", "0.6462258", "0.6452838", "0.642637", "0.640525", "0.64012694", "0.64012694", "0.63844013", "0.63839644", "0.638315", "0.6366365", "0.6335357", "0.63179976", "0.63105327", "0.6304132", "0.6290799", "0.6286127", "0.6275876", "0.6270919", "0.6261071", "0.6244351", "0.6220561", "0.62184703", "0.6206228", "0.62040937", "0.61824065", "0.6180751", "0.6174212", "0.61669105", "0.61643803", "0.61521256", "0.6143797", "0.6142373", "0.6138863", "0.61172944", "0.61071634", "0.6104047", "0.60959303", "0.60921353", "0.60816896", "0.60808223", "0.60806817", "0.60726744", "0.6060185", "0.60593903", "0.60559064", "0.6043832", "0.603626", "0.6027481", "0.60131973", "0.6010736", "0.5980126", "0.59715", "0.59645146", "0.59458774", "0.59390986", "0.59291697", "0.59291697", "0.5924742", "0.5916693", "0.5915528", "0.59124774", "0.5911915", "0.5903484", "0.5891135", "0.5891135", "0.58861256", "0.58816814", "0.58801883", "0.5877815", "0.5866341", "0.58641016", "0.5859071", "0.5857062", "0.585675", "0.5845036", "0.5843691", "0.5839518", "0.58379817", "0.5829924", "0.5804703", "0.5781201" ]
0.8342175
0
END DATE Enters or removes a UoC end date per a given set of test data
def enter_end_date(test_data) hide_notifications_bar logger.info "Entering end date '#{test_data[CoreUseOfCollectionsData::END_DATE.name]}'" wait_for_element_and_type(end_date_input, test_data[CoreUseOfCollectionsData::END_DATE.name]) hit_enter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "def enter_end_date(test_data)\n hide_notifications_bar\n wait_for_element_and_type(end_date_input, test_data[UseOfCollections::END_DATE.name])\n hit_enter\n end", "def determine_end_date\n self.end_date = start_date.next_month.yesterday\n end", "def end_date\n @end_date ||= respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil\n end", "def set_end_date val=PIXI_DAYS\r\n ListingDataProcessor.new(self).set_end_date val\r\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def end_date=(date)\n date = IncompleteDate.new date unless date.is_a? IncompleteDate or date.nil?\n @end_date = date\n end", "def end_date\n @end_date ||= respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil\n end", "def update_end_date(ds)\n actual_duration = (self.end_date - self.start_date).to_i\n days_worked = self.advance_percentage / 100.0 * (actual_duration) \n if delay_end(end_date + ds.days)\n self.update(advance_percentage: (days_worked / (actual_duration + ds) * 100).to_i)\n dependent_tasks_id = Precedent.where(predecessor_id: id).pluck(:dependent_id)\n dependent_tasks_id.each do |t_id|\n Task.find(t_id).update_start_date(end_date)\n end\n # else \n # if advance(end_date + ds.days)\n # dependent_tasks_id = Precedent.select(:dependent_id).where(predecessor_id: id)\n # dependent_tasks_id.each do |t_id|\n # t = Task.find(t_id)\n # end\n # end\n end\n end", "def extend_empty_end_date\n if self.end_date == self.start_date && !self.repeat_mode.rule.empty?\n self.end_date = Date.today + 10.year\n end\n return self\n end", "def end_date\n @end_date ||= Date.new()\n end", "def unitdate_end(unitdate)\n unitdate_parts(unitdate).last\n end", "def end_date=(end_date)\n if !end_date.nil? && end_date.to_s.length > 10\n fail ArgumentError, 'invalid value for \"end_date\", the character length must be smaller than or equal to 10.'\n end\n\n @end_date = end_date\n end", "def end_date=(end_date)\n validate_end_date_type(end_date)\n validate_history_range(start_date, end_date)\n @end_date = end_date\n end", "def convert_to_est\n self.start_date += 18000\n self.end_date += 18000\n end", "def ending_at(date)\n set_end_date_and_raise_error_if_end_is_eariler_than_start(date)\n self\n end", "def end_date\n Date.new((@number + 1), 1, 1).tuesday? ? Date.new((@number + 1), 1, 1) : Date.new(@number, 12, 31)\n end", "def end_date=(end_date)\n assert_unloaded\n raise ArgumentError, \"you have already set end_time\" if @end_time\n @end_date = end_date\n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def end_date\n Date.new(date.year, 12, 31)\n end", "def end_date\n return ends if support_deal.nil?\n self.ends ||= support_deal.end_date\n return support_deal.end_date < ends ? support_deal.end_date : ends\n end", "def check_end_date\n # if self.category.eql?(\"appointment\")\n unless self.start_date.nil? or self.end_date.nil?\n if (self.end_date < self.start_date)\n self.category.eql?(\"appointment\")? self.errors.add(' ', 'End Date can\\'t be before Start Date') : self.errors.add(' ', 'Due Date can\\'t be before Start Date')\n end\n if self.end_date == self.start_date\n self.errors.add(' ', 'End Time can not be before start time') if (self.end_date.to_time < self.start_date.to_time)\n end\n end\n # end\n end", "def get_end_date\n \n \nend", "def fy_end(date)\n year = date.year\n # are we in the first three months of the year?\n if(date.month < 4)\n Date.new(date.year,3,31)\n else\n Date.new(date.year+1,3,31)\n end\n end", "def get_end_date\n end_date\n end", "def effective_end_datetime\n end_date + 1.day + roster.switchover.minutes\n end", "def estimated_end_date\n start_date + 12.days\n end", "def end_date\n \"Calculate End Date\"\n end", "def end(value)\n merge(ucend: value.iso8601)\n end", "def synthesize_end_date(params)\n Date.civil(params[:end_time][:year].to_i, params[:end_time][:month].to_i,\n params[:end_time][:day].to_i)\n end", "def valid_end_date\n self.end_date - self.start_date > 0 ? true : false\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def ends_today\n all.select {|event| event.ends == (@date_for_test || Date.today)}\n end", "def adjust_order_end_dates(_patient, orders, optimized_hanging_pills)\n orders.each do |order|\n drug_order = order.drug_order\n drug = drug_order&.drug\n next unless drug_order && drug\n\n next unless drug&.tb_drug? && optimized_hanging_pills[drug.id]\n\n hanging_pills = optimized_hanging_pills[drug.id]&.to_f\n\n additional_days = (hanging_pills / order.drug_order&.equivalent_daily_dose || 0).to_i\n next unless additional_days >= 1\n\n order.void_reason = order.auto_expire_date\n # We assume the patient starts taking drugs today thus we subtract one day\n order.auto_expire_date = order.start_date + (additional_days + drug_order.quantity_duration - 1).days\n\n order.save\n drug_order.save\n end\n end", "def end_date\n Time.parse(@end_date) if @end_date\n end", "def end_date\n Time.parse(@end_date) if @end_date\n end", "def end_interrupt!(end_date)\n update_attribute('interrupted_on', nil)\n if end_date.is_a? Hash\n end_date = Time.local(end_date['year'].to_i,\n end_date['month'].to_i,\n end_date['day'])\n end\n end_date = end_date.end_of_month unless interrupt.start_on_day\n\n interrupt.update_attribute('finished_on', end_date)\n end", "def set_dates(start_date = nil, end_date = nil)\n\n\t if (start_date.nil? and not end_date.nil?)\n\n\t\t start_date = (@utils.get_date_object(end_date)) - (MAX_HISTORICAL_DAYS * (24 * 60 * 60))\n\n\t\t @start_date = start_date.to_s\n\t\t @end_date = end_date.to_s\n\n\t elsif (not start_date.nil? and end_date.nil?)\n\n\t\t end_date =(@utils.get_date_object(start_date)) + (MAX_HISTORICAL_DAYS * (24 * 60 * 60))\n\n\t\t if end_date > Time.new.utc\n\t\t\tend_date = nil #Let API default to Now.\n\t\t end\n\n\t\t @start_date = start_date.to_s\n\t\t @end_date = end_date.to_s if not end_date.nil?\n\n\t end\n end", "def estimated_end_date\n Date.today + remaining_days\n end", "def end\n dates = self.children.map(&:end).compact\n #self.children.each { |c| \n # dates.push(c.end) unless c.end.nil?\n #}\n # set the end-date for this movie series if it has been changed\n # (like a child has been added or an existing has been removed)\n # Changing the :end attribute does not fire a logging, as :end\n # is set to be unloggable for series.\n last = dates.sort.last\n update_attribute_with_validation_skipping( :end, last ) unless self.attributes[\"end\"] == last or self.class == Season\n last\n end", "def calculate_end_date(start_date, end_date)\n end_date_from_start_date = start_date + 3.years\n\n return end_date_from_start_date if end_date.nil?\n\n end_date < end_date_from_start_date ? end_date : end_date_from_start_date\n end", "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end", "def end_date_is_bigger?\n return if [endDate.blank?, startDate.blank?].any?\n\n errors.add(:base, 'The end time must be later than the start time') if endDate < startDate\n end", "def end_measures_for(tame)\n Measure.national\n .with_measure_type(tame.measure_type)\n .valid_before(tame.fe_tsmp)\n .with_tariff_measure_number(tame.tar_msr_no)\n .not_terminated\n .each do |measure|\n\n end_date = if (measure.associated_to_non_open_ended_gono? &&\n record.fe_tsmp > measure.goods_nomenclature.validity_end_date)\n measure.goods_nomenclature.validity_end_date\n else\n record.fe_tsmp\n end\n\n update_record(measure,\n validity_end_date: end_date,\n justification_regulation_id: measure.measure_generating_regulation_id,\n justification_regulation_role: measure.measure_generating_regulation_role,\n operation_date: operation_date)\n end\n end", "def end_date_icalendar\n\t\treturn end_date.utc.strftime(\"%Y%m%dT%H%M%S\")\n\tend", "def valid_end_date\n errors.add(:end_date, 'The end date cannot be parsed.') unless end_date_is_valid?\n end", "def end_date\n (Time.parse(@end_date).in_time_zone(@timezone).to_datetime if @end_date) || Date.today + 7.days\n end", "def end_date\n @end_date ||= respond_to?(:partyMembershipEndDate) ? DateTime.parse(partyMembershipEndDate) : nil\n end", "def setEndDate(endDate)\r\n\t\t\t\t\t@endDate = endDate\r\n\t\t\t\tend", "def end_date\n weekday = end_of_month.cwday\n offset = weekday == 7 ? 0 : (7 - weekday).days\n end_of_month + offset\n end", "def dt_end\n return nil unless valid\n\n @current_date + @event_duration\n end", "def end_date\n @end_date ||= respond_to?(:parliamentPeriodEndDate) ? DateTime.parse(parliamentPeriodEndDate) : nil\n end", "def end(value)\n merge(leend: value.iso8601)\n end", "def end(value)\n merge(bkend: value.iso8601)\n end", "def end(value)\n merge(rvend: value.iso8601)\n end", "def end_date_after_start_date\n if start_date && end_date && end_date < start_date\n errors.add :end_date, \"must be after the start date\"\n errors.add :start_date, \"must be before the end date\"\n end\n end", "def end_date_after_start_date\n\t\tif end_date < start_date\n\t\t\terrors.add :end_date, \"Must be after Start Date\"\n\t\tend\n\tend", "def date_end # originally date_start\n\tdate = Date.today\n\t(1..7).each do |n|\n\t\tdate = Date.today - n#.days\n\t\tbreak if date.wday == 6 # 0 = Sun, 1 = Mon ... 6 = Sat\n\tend\n\tdate\nend", "def end(value)\n merge(orend: value.iso8601)\n end", "def date_verify\n if end_date && start_date.nil?\n errors.add(:end_date, \"cannot only specify end date\")\n elsif all_day && start_date.nil?\n errors.add(:all_day, \"cannot specify without date\")\n elsif (start_date && end_date) && (start_date > end_date)\n errors.add(:start_date, \"cannot larger than end date\")\n end\n end", "def set_project_end_date\n if state_was == STATE['Completed']\n end_date = nil\n active = true\n else\n active = false\n end_date = Date.current\n end\n end", "def end_date_is_valid?\n begin\n date = USDateParse(self.end_date)\n self.end_date = date.strftime(\"%m/%d/%y\")\n rescue\n return false\n end\n return true\n end", "def claim_statement_period_end(*options)\n claim_start_date = @classified_eob.get_date_for_netwrx(:end_date, @claim)\n return nil if claim_start_date.nil?\n return claim_start_date if @classified_eob.is_claim_eob? && claim_start_date.eql?('00000000')\n claim_start_date if can_print_service_date(claim_start_date)\n end", "def end(value)\n merge(gadrend: value.iso8601)\n end", "def end_date(ends)\n if ends.nil?\n \"end\" + time_str(Time.now)\n elsif ends.kind_of?(Time)\n \"end\" + time_str(ends)\n end\n end", "def complete_termination\n self.deleted_at = Time.now.utc\n self.end_date = Date.today\n end", "def ends_at(user)\n tz = ActiveSupport::TimeZone.new(user.time_zone)\n\n if end_date.nil?\n tz.local(start_date.year, start_date.month, start_date.day).end_of_day\n else\n tz.local(end_date.year, end_date.month, end_date.day).end_of_day\n end\n end", "def change_dates start_date, finish_date\n set_dates start_date, finish_date\n\n set_calendar\n end", "def day_end\n\t\tself.at_beginning_of_day + 86399.999999\n\tend", "def set_dates_and_duration\n if start_date && end_date && !duration\n self.duration = (end_date - start_date).to_i + 1 # if it's same date, duration should be 1\n elsif start_date && !end_date && duration\n self.end_date = start_date + (duration - 1).days\n elsif !start_date && end_date && duration\n self.start_date = end_date - (duration - 1).days\n end\n end", "def end(value)\n merge(cmend: value.iso8601)\n end", "def end(value)\n merge(grcend: value.iso8601)\n end", "def end_date\n self.end_at if self.respond_to?(:end_at)\n end", "def end_date\n\t\tself.next.start_date - 1\n\tend", "def setEndDateFormat(endDateFormat)\r\n\t\t\t\t\t@endDateFormat = endDateFormat\r\n\t\t\t\tend", "def calcs_for_date_range(start_date, end_date, abandon_rate)\n puts \"\\tFrom #{start_date} to #{end_date} inclusive:\"\n\n total_registrations = WasteExemptionsEngine::Registration.where(\n created_at: start_date.beginning_of_day..end_date.end_of_day\n ).count\n total_registrations_s = number_with_delimiter(total_registrations)\n puts \"\\tTotal registrations: #{total_registrations}, of which:\"\n\n assisted_digital_registrations = WasteExemptionsEngine::Registration.where(\n created_at: start_date.beginning_of_day..end_date.end_of_day,\n assistance_mode: \"full\"\n ).count\n assisted_digital_registrations_s = number_with_delimiter(assisted_digital_registrations)\n puts \"\\t... assisted digital: #{assisted_digital_registrations_s}\"\n\n fully_digital_registrations = WasteExemptionsEngine::Registration.where(\n created_at: start_date.beginning_of_day..end_date.end_of_day,\n assistance_mode: nil\n ).count\n fully_digital_registrations_s = number_with_delimiter(fully_digital_registrations)\n puts \"\\t... fully digital: #{fully_digital_registrations}\"\n\n delta = total_registrations - assisted_digital_registrations - fully_digital_registrations\n puts \"\\t(delta of #{delta} is due to some registrations not having metaData.route set)\" unless delta.zero?\n\n abandon_rate_s = number_to_percentage(100.0 * abandon_rate, precision: 0)\n non_abandon_rate_s = number_to_percentage(100.0 * (1 - abandon_rate), precision: 0)\n\n total_registrations_started = (total_registrations / (1.0 - abandon_rate)).round(0)\n total_registrations_started_s = number_with_delimiter(total_registrations_started.to_i)\n\n total_registrations_completed = fully_digital_registrations + assisted_digital_registrations + delta\n total_registrations_completed_s = number_with_delimiter(total_registrations_completed)\n\n total_registrations_started_online = (fully_digital_registrations / (1.0 - abandon_rate)).round(0)\n total_registrations_started_online_s = number_with_delimiter(total_registrations_started_online)\n\n total_registrations_abandoned = total_registrations_started - total_registrations_completed\n total_registrations_abandoned_s = number_with_delimiter(total_registrations_abandoned)\n\n puts \"\\tSo including abandoned attempts, estimated orders started = \" \\\n \"#{total_registrations_s} / (1 - #{abandon_rate_s}) = #{total_registrations_started_s}, of which: \"\n puts \"\\t... completed: #{total_registrations_completed_s}\"\n puts \"\\t... abandoned: #{total_registrations_abandoned_s}\"\n\n puts \"\\nSummary:\"\n puts \"\\t1. Total number of transactions started and completed online only: #{fully_digital_registrations_s}\"\n puts \"\\t2. Total number of transactions started online: ESTIMATED: #{total_registrations_started_online_s}\"\n puts \"\\t\\t(Estimated dropoff rate for the last 30 days: #{abandon_rate_s}\"\n puts \"\\t\\t so estimated completion (non-abandoned) rate for the last 30 days: #{non_abandon_rate_s}\"\n puts \"\\t\\t so given #{fully_digital_registrations_s} fully digital orders, \" \\\n \"estimated total orders started online = \" \\\n \"(#{fully_digital_registrations_s}/#{non_abandon_rate_s}) = #{total_registrations_started_online_s})\"\n puts \"\\t3. Number of online claims: #{fully_digital_registrations_s}\"\n puts \"\\t4. Total number of claims (online + offline + unknown): \" \\\n \"#{fully_digital_registrations_s} + #{assisted_digital_registrations_s} + \" \\\n \"#{delta} = #{total_registrations_completed_s}\"\n\n puts \"====================================================================================================\"\n end", "def assign_trial_end_date\n self.trial_end_date = 2.weeks.from_now\n save!\n end", "def ensure_end_date_is_valid\n return true if end_date.blank?\n unless start_date.blank?\n return true if end_date > start_date\n end\n\n errors.add(:end_date, :invalid)\n end", "def validate_end_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{last} before #{start}\"\n errors.add(:end_date, \"can't be before the start date\") if last < start\n end", "def add_to_dates(start_date, end_date, new_occupancy)\n current_date = start_date.dup\n \n until current_date == end_date\n date_obj = find_date(current_date)\n \n if date_obj \n date_obj.add_occupancy(new_occupancy)\n else\n new_date_obj = Hotel::Date.new(current_date)\n @dates << new_date_obj\n new_date_obj.add_occupancy(new_occupancy)\n end\n \n current_date += 1\n end\n end", "def sa_end_date\n instrument_end_date.try(:strftime, '%Y-%m-%d')\n end", "def enter_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n logger.info \"Entering use date data set at index #{index}: #{date}\"\n wait_for_element_and_type(use_date_input(index), date[CoreUseOfCollectionsData::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date\n self.start_date + self.length.month\n end", "def valid_effective_end_date?\n\n if effective_end_date.present?\n if effective_end_date < Date.civil(1900, 1, 1)\n errors[:base] << \"End date must be after 1900.\"\n return false\n else\n # Rule: Employment Master End date should be greater than current date.\n # Employment data entry is needed to know if client is currently working or not, so End date should be null or if entered it should be greater than current date.\n if effective_end_date > Date.today\n return true\n else\n errors[:base] << \"Currently working employment should have future end date\"\n end\n\n end\n else\n return true\n end\n end", "def scd_end_date_field\n configuration[:scd][:end_date_field] || :end_date if scd?\n end", "def final_date\n self.end_date.strftime('%m-%d-%Y')\n end", "def check_end_date\n if end_date < Date.today\n \n errors.add(:end_date, \"End Date can only be later than today\")\n end\n end", "def pro_rata_end_date\n (subscription_start_date - 1.day).to_date # unless subscription_start_date.blank?\n end", "def enter_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::USE_DATE_GRP.name)], dates)\n dates.each_with_index do |date, index|\n wait_for_element_and_type(use_date_input(index), date[UseOfCollections::USE_DATE.name])\n hit_enter\n wait_for_element_and_type(use_date_time_note(index), date[UseOfCollections::USE_DATE_TIME_NOTE.name])\n wait_for_element_and_type(use_num_visitors_input(index), date[UseOfCollections::USE_DATE_NUM_VISITORS.name])\n wait_for_element_and_type(use_hours_spent_input(index), date[UseOfCollections::USE_DATE_HOURS_SPENT.name])\n wait_for_element_and_type(use_note_input(index), date[UseOfCollections::USE_DATE_VISITOR_NOTE.name])\n end\n end", "def end_time=(end_time)\n assert_unloaded\n raise ArgumentError, \"you have already set end_date\" if @end_date\n @end_time = end_time\n end", "def end_date\n\t \tTime.at(self.end_time) rescue nil\n\t end", "def multi_day_end_event_for(assignment)\n attribs = event_attribs(assignment)\n attribs[:name] = \"#{attribs[:name]} (End)\"\n attribs[:starts_at] = attribs[:ends_at] - 1.day + 1.second\n events.build(attribs)\n end", "def end_date_for_top_line\n if(end_date < Date.today) #If it is an old project.\n end_date_for_top_line = [project.maximum_chart_date(self), self.end_date].max\n else\n end_date_for_top_line = [project.maximum_chart_date(self), self.end_date, estimate_at_completion_duration.week.from_now].max\n end\n end", "def end_date\n return (start and duration_days and duration_hours) ? (start + duration_days.days + duration_hours.hours) : nil\n end", "def ends_at\n @ends_at ||= begin\n if period == :quarter\n starts_at.advance months: length * 3\n else\n starts_at.advance periods => length\n end\n end\n end", "def end_of_year\n @end_of_year ||= date_calc.end_of_year(year)\n end", "def end_date_time=(value)\n @end_date_time = value\n end" ]
[ "0.71782464", "0.71765155", "0.6536046", "0.6271381", "0.6169916", "0.61282", "0.60889465", "0.6064384", "0.6063975", "0.6035453", "0.60273093", "0.5982766", "0.59401584", "0.5926396", "0.58647066", "0.585268", "0.58213115", "0.58041376", "0.580068", "0.57866025", "0.57765037", "0.5762897", "0.57440495", "0.5728002", "0.57275325", "0.5715283", "0.5709675", "0.5708452", "0.56472874", "0.56446755", "0.56349796", "0.56237906", "0.55968046", "0.5595623", "0.5580827", "0.5576579", "0.5559915", "0.5559915", "0.5558993", "0.5558758", "0.55357164", "0.5529968", "0.5519473", "0.5509263", "0.55084807", "0.5491034", "0.547977", "0.5473379", "0.5465654", "0.5461021", "0.5460022", "0.54472715", "0.5438244", "0.5436726", "0.54265296", "0.5408458", "0.5404648", "0.53918886", "0.53850055", "0.53845644", "0.537842", "0.53614146", "0.533934", "0.5337325", "0.53347474", "0.53303665", "0.53274465", "0.5323837", "0.5322391", "0.5321861", "0.5320136", "0.5310847", "0.5303976", "0.52977353", "0.5296589", "0.5296491", "0.52948576", "0.528025", "0.5279254", "0.5273656", "0.52713037", "0.5271274", "0.5256792", "0.52541536", "0.5254122", "0.52413774", "0.5237725", "0.5236852", "0.52360684", "0.5215102", "0.52149785", "0.5214128", "0.52121747", "0.52093816", "0.52071166", "0.5204872", "0.5197978", "0.51936406", "0.51932955", "0.51908904" ]
0.6616113
2
Verifies that the end date matches test data
def verify_end_date(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def test_end_date_after_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.tomorrow\r\n @moderated_search.cobrand_id = Cobrand.root.id\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size == 0\r\n end", "def valid_end_date\n self.end_date - self.start_date > 0 ? true : false\n end", "def test_end_date_before_start_date\r\n @moderated_search.start_date = Date.today\r\n @moderated_search.end_date = Date.yesterday\r\n @moderated_search.save\r\n \r\n assert @moderated_search.errors.size > 0\r\n assert @moderated_search.errors.on(:end_date) \r\n end", "def date_verify\n if end_date && start_date.nil?\n errors.add(:end_date, \"cannot only specify end date\")\n elsif all_day && start_date.nil?\n errors.add(:all_day, \"cannot specify without date\")\n elsif (start_date && end_date) && (start_date > end_date)\n errors.add(:start_date, \"cannot larger than end date\")\n end\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def correct?\n starts_at < ends_at && starts_at.to_date == ends_at.to_date\n end", "def verify_date_completed(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_COMPLETED.name], element_value(date_completed_input))\n end", "def end_date_is_bigger?\n return if [endDate.blank?, startDate.blank?].any?\n\n errors.add(:base, 'The end time must be later than the start time') if endDate < startDate\n end", "def end_date_is_valid?\n begin\n date = USDateParse(self.end_date)\n self.end_date = date.strftime(\"%m/%d/%y\")\n rescue\n return false\n end\n return true\n end", "def check_end_date\n # if self.category.eql?(\"appointment\")\n unless self.start_date.nil? or self.end_date.nil?\n if (self.end_date < self.start_date)\n self.category.eql?(\"appointment\")? self.errors.add(' ', 'End Date can\\'t be before Start Date') : self.errors.add(' ', 'Due Date can\\'t be before Start Date')\n end\n if self.end_date == self.start_date\n self.errors.add(' ', 'End Time can not be before start time') if (self.end_date.to_time < self.start_date.to_time)\n end\n end\n # end\n end", "def validate_end_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{last} before #{start}\"\n errors.add(:end_date, \"can't be before the start date\") if last < start\n end", "def ensure_end_date_is_valid\n return true if end_date.blank?\n unless start_date.blank?\n return true if end_date > start_date\n end\n\n errors.add(:end_date, :invalid)\n end", "def date_consistency\n\t\treturn if [start_date.blank?, end_date.blank?].any?\n\t\terrors.add(:end_date, 'must be after start_date') if start_date > end_date\n\tend", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def valid_end_date?\n if @end_date >= @start_date\n return true\n else\n return [false, \"Start date must be before end date\"]\n end\nend", "def check_dates\n # TODO the init_time must be less then the end_time\n true\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def valid_start_and_end_dates?\n return false unless start.present? && self.end.present?\n start <= self.end\n end", "def validate_date?(start_date,end_date)\n\t\tstart_date <= end_date\n\tend", "def check_end_date\n if end_date < Date.today\n \n errors.add(:end_date, \"End Date can only be later than today\")\n end\n end", "def validate_start_date\n start = Date.parse(start_date.to_s)\n last = Date.parse(end_date.to_s)\n puts \"is date #{start} after #{last}\"\n errors.add(:start_date, \"can't be after the end date\") if start > last\n end", "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "def verify_dissolution_date(test_data)\n errors = []\n text_values_match?(test_data[Org::DISSOLUTION_DATE.name], element_value(dissolution_date_input), errors)\n errors\n end", "def date_validation\n\t\tif start_date >= end_date\n \t\terrors.add(:end_date, \"must be greater than start date\")\n \tend\n end", "def virtually_over?\n end_date < Date.today\n end", "def verify_date_requested(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def validate_dates\n if start_at && end_at\n errors.add(:end_at, 'should be greater than start date') if end_at <= start_at\n end\n end", "def dates_not_same\n if start_date == end_date\n errors.add(:start_date, 'start date can not equal end date')\n errors.add(:end_date, 'end date can not equal start date')\n end\n end", "def enter_end_date(test_data)\n hide_notifications_bar\n wait_for_element_and_type(end_date_input, test_data[UseOfCollections::END_DATE.name])\n hit_enter\n end", "def enter_end_date(test_data)\n hide_notifications_bar\n logger.info \"Entering end date '#{test_data[CoreUseOfCollectionsData::END_DATE.name]}'\"\n wait_for_element_and_type(end_date_input, test_data[CoreUseOfCollectionsData::END_DATE.name])\n hit_enter\n end", "def date_valid?(date)\n valid_dates = Date.parse(DATA_START_DATE)..Date.today\n if valid_dates.cover?(date)\n return true\n else\n puts \"\\nDate must be after #{DATA_START_DATE} and before today.\"\n return false\n end\nend", "def verify_date_requested(test_data)\n verify_values_match(test_data[UseOfCollections::DATE_REQUESTED.name], element_value(date_requested_input))\n end", "def end_date_after_start_date\n\t\tif end_date < start_date\n\t\t\terrors.add :end_date, \"Must be after Start Date\"\n\t\tend\n\tend", "def valid_end_date\n errors.add(:end_date, 'The end date cannot be parsed.') unless end_date_is_valid?\n end", "def team_registration_passed?\n d = @data_object\n today = Date.today\n d.aff_team_reg_end.to_date < today\n end", "def test_date\n if test_execution_date and test_delivery_date\n if test_execution_date > test_delivery_date\n errors.add(:test_delivery_date, \"should be greater then test date.\")\n end\n end\n end", "def date_combination_valid\n\n # just make sure we work on something valid and existing\n\n return false unless date_from?\n\n set_nil_default( :date_until, date_from )\n\n if date_until < date_from\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_period' ))\n return false\n end\n\n if date_from.year != date_until.year\n errors.add( :date_until, I18n.t( 'holidays.msg.bad_years' ))\n return false\n end\n\n # all tests passed\n\n write_attribute( :year_period, date_from.year )\n return true\n end", "def test_if_correct_date\n skip\n potluck = Potluck.new(\"7-13-18\")\n expected =\n actual = potluck\n\n assert_equal expected, actual\n end", "def period_dates\n end_date = @doc.xpath(\"//*[@name='uk-bus:EndDateForPeriodCoveredByReport']\")&.first&.text&.strip\n if end_date && (Time.parse(end_date) > Time.parse(\" 2011-12-31\"))\n \"valid\"\n else\n \"invalid: Period End Date is #{end_date} but must be 2011-12-31 or later\"\n end\n end", "def same_day?\n start_date == end_date\n end", "def same_date\n return unless start_at? && end_at?\n return unless start_at.to_date != end_at.to_date\n\n errors.add(:start_at, :same_date)\n errors.add(:end_at, :same_date)\n end", "def check_future\n current_start = DateTime.strptime(self.start_time,\"%m/%d/%y %H:%M\").to_time\n current_end = DateTime.strptime(self.end_time,\"%m/%d/%y %H:%M\").to_time \n\n # checks start time of appt is before end time #\n if current_start < current_end\n if current_start > Time.now && current_end > Time.now\n @valid = true\n else\n @valid = false\n end\n end\n @valid\n p @valid\n end", "def test_date_formats_and_ranges\n batch = Batch.new(:id => 20,\n :batchid=>20,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :eob => 30,\n :facility=> facilities(:facility1),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\"\n )\n\n # Assert the validity of tommorrow, mm/dd/YYYY format, and sixty days prior\n assert_valid(batch, :date, [(Date.today + 1).to_s, Date.today.strftime(\"%m/%d/%Y\"), (Date.today - 60).to_s])\n # Assert the invalidity of three days from today, more than sixty days ago, mm/dd/yy, and yy/mm/dd formats\n assert_invalid(batch, :date, [(Date.today + 4).to_s, (Date.today - 61).to_s, Date.today.strftime(\"%m/%d/%y\"), Date.today.strftime(\"y/%m/%d\")])\n end", "def is_season_ended_at(evaluation_date = Date.today)\n if end_date\n end_date <= evaluation_date\n else\n false\n end\n end", "def validate_end_date_before_start_date\n return if date_out.nil? \n if date_out && date_in\n errors.add(:date_in, \": could not be after than Date out\") if date_out < date_in\n end\n end", "def end_date_after_start_date\n if start_date && end_date && end_date < start_date\n errors.add :end_date, \"must be after the start date\"\n errors.add :start_date, \"must be before the end date\"\n end\n end", "def date_range_valid?(start_date, end_date)\n\tif start_date > end_date\n\t\tputs \"Start date must be before end date\"\n\t\treturn false\n\telsif start_date + MAX_DAYS < end_date\n\t\tputs \"\\n No more than #{MAX_DAYS}. Be nice to the remote server.\"\n\t\treturn false\n\tend\n\treturn true\nend", "def valid_effective_end_date?\n\n if effective_end_date.present?\n if effective_end_date < Date.civil(1900, 1, 1)\n errors[:base] << \"End date must be after 1900.\"\n return false\n else\n # Rule: Employment Master End date should be greater than current date.\n # Employment data entry is needed to know if client is currently working or not, so End date should be null or if entered it should be greater than current date.\n if effective_end_date > Date.today\n return true\n else\n errors[:base] << \"Currently working employment should have future end date\"\n end\n\n end\n else\n return true\n end\n end", "def valid_dates?\n if enddate && startdate && enddate <= startdate\n errors.add(:enddate, \"is before startdate\")\n end\n end", "def test_valid_with_attributes\r\n fee_schedule = FeeSchedule.new\r\n fee_schedule.start_date = fee_schedules(:fee_schedule_00001).start_date\r\n fee_schedule.end_date = fee_schedules(:fee_schedule_00001).end_date\r\n assert fee_schedule.valid?, fee_schedule.errors.full_messages \r\n end", "def check_dates\n if start_end_dates.count > 0 && !start_end_dates.nil?\n start_end_dates.each do |d|\n return true if d.check_date_ranges\n end\n\n false\n else\n true\n end\n end", "def in_renewal_span?\n (0..7).include?(end_date.to_date - Time.zone.now.to_date)\n end", "def registration_passed?\n d = @data_object\n today = Date.today\n d.aff_reg_end.to_date < today\n end", "def begin_date_cannot_be_greater_than_end_date\n if effective_end_date.present? && effective_end_date > Date.civil(1900, 1, 1) && effective_begin_date.present? && effective_begin_date > Date.civil(1900, 1, 1)\n if (effective_begin_date > effective_end_date)\n local_message = \"Begin date can't be before end date.\"\n errors[:base] << local_message\n return false\n else\n return true\n end\n else\n return true\n end\n end", "def end_date_after_start_date\n return if end_date.blank? || start_date.blank?\n if end_date < start_date\n errors.add(:end_date, 'must be after the start date.')\n end\n end", "def validate_temporal_sanity\n errors.add(:end_time, \"Must be after Start Time.\") unless self.start_time < self.end_time\n end", "def valid_end_date?\n\t\tif effective_end_date.present?\n\t\t\tif effective_end_date < Date.civil(1900,1,1)\n\t\t\t\terrors.add(:effective_end_date, \"must be after 1900.\")\n return false\n else\n \t return true\n end\n\t\telse\n\t\t\t return true\n\t\tend\n\tend", "def effective_end_date_has_passed\n if effective_end_date.present? && (effective_end_date > Time.zone.now)\n errors.add(:effective_end_date, 'must be in the past')\n end\n end", "def has_ended?\n Date.current > end_date\n end", "def date_valid?(date)\n\tvalid_dates = Date.parse(DATA_START_DATE)..Date.today\n\tif valid_dates.cover?(date)\n\t\treturn true\n\telse\n\t\tputs \"\\n Date must be after #{DATA_START_DATE} and before today.\"\n\t\treturn false\n\tend\nend", "def one_day?\n @start_date == @end_date\n end", "def dates_valid?\n date_check(params[:start_date]) && date_check(params[:end_date]) && dates_sequential?\n end", "def dates_are_correct\n errors.add(:begins, _(\"%{fn} can't be blank\")) if begins.nil?\n errors.add(:finishes, _(\"%{fn} can't be blank\")) if finishes.nil?\n\n dates_in_order?(begins, finishes) or\n errors.add(:begins, _('Conference must end after its start date'))\n\n dates_in_order?(cfp_open_date, cfp_close_date) or\n errors.add(:cfp_open_date, _('Call for papers must end after its ' +\n 'start date'))\n dates_in_order?(cfp_close_date, begins) or\n errors.add(:cfp_close_date, _('Call for papers must finish before ' +\n 'the conference begins'))\n\n dates_in_order?(reg_open_date, reg_close_date) or\n errors.add(:reg_open_date, _('Registration must end after its ' +\n 'start date'))\n dates_in_order?(reg_close_date, finishes) or\n errors.add(:reg_close_date, _('Registration must finish before the ' +\n 'conference ends'))\n end", "def check_date()\n event = Event.find_by(id: self.event_id) \n if Time.now > event.start_date then\n halt msg: 'check_date() fail' \n false\n else\n true\n end\n end", "def end_date_after_start_date\n return if duration_start.blank? || duration_end.blank?\n\n if duration_end < duration_start\n errors.add(:end_date, \"must be after the start date\")\n end\n end", "def check_date\n\t\tif self.hasError\n\t\t\terrors.add(\"\", \"You entered Invalid date: \\n - \"+self.interviewer.name)\n\t\t\t# puts \"===================CHECKDATE===================\"\n\t\telsif Time.at(self.sched_end.to_i) <= Time.at(self.sched_start.to_i)\n\t\t\terrors.add(\"\", \"Start time cannot be greater than end time \\n - \"+self.interviewer.name)\n\t\tend\n\tend", "def finished\n if self.end_date < Date.today\n return true\n else\n return false\n end\nend", "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end", "def is_target_date? ( date ) \n d = date.to_date\n check = false\n if d >= @dStart.to_date && d <= @dEnd.to_date\n check = true\n end\n return check\n end", "def more_than_a_day_passed?(start_time, end_time)\n end_time - start_time > 60 * 60 * 24\n end", "def current?\n validity_end_date.blank? || validity_end_date >= point_in_time\n end", "def cover?(other)\n return false unless other.is_a?(Date)\n\n other = other.day_precision\n\n case\n when unknown_start?\n max.day_precision! == other\n when unknown_end?\n min.day_precision! == other\n when open_end?\n min.day_precision! <= other\n else\n min.day_precision! <= other && other <= max.day_precision!\n end\n end", "def is_target_date?(date) \n d = date.to_date\n check = false\n if d >= @dStart && d <= @dEnd\n check = true\n end\n return check\n end", "def reservation_dates_must_make_sense\n\t if end_date <= start_date\n\t\t errors.add(:start_date, \"has to be before the end date\")\n\t end\n\tend", "def end_time_is_valid?\n return false unless not_nil_and_string(self.end_time)\n return self.end_time.length > 0\n end", "def has_valid_date?\n self.time_event < Time.now.advance(days: 1)\n end", "def test_non_member_registering_early_bird\n\t\tnon_member = Enrollments.new(:participantID => participants(:non_member_one).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_nil participants(:non_member_one).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-11-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def start_date_before_end_date\n begin\n date_start = USDateParse(self.start_date)\n date_end = USDateParse(self.end_date)\n rescue\n errors.add(:start_date, 'Could not verify that the start date is before the end date because the start and/or end dates are not parsable.')\n return\n end\n if date_start >= date_end\n errors.add(:start_date, \"Start date must be before end date.\")\n end\n end", "def correct_dates?(object)\n object.date_from <= object.date_to\n end", "def test_raises_error_with_invalid_dates\n assert_raises DataWrangler::Configuration::Error do\n _new_validator(\n {\n \"from\" => @invalid_date_string,\n \"to\" => Date.today.to_s\n }\n )\n end\n end", "def check_dates_are_valid\n if @start_date.present? && @end_date.present?\n errors.add(:end_date, \"can't be before the start date\") if @end_date < @start_date\n end\n end", "def check_dates_are_valid\n if @start_date.present? && @end_date.present?\n errors.add(:end_date, \"can't be before the start date\") if @end_date < @start_date\n end\n end", "def validate_start_date_before_end_date\n\t\tif end_time <= start_time\n\t\t\terrors.add(:end_time, \"must be after start time\")\n\t\tend\n\tend", "def between_dates(sd, es)\n return true if sd <= self.start_date && es >= self.end_date \n return false\n end", "def is_correct_time? #:doc:\n if(self.endTime && self.startTime && (self.endTime<=>self.startTime)==-1)\n errors.add([:starTime,:endTime],\"Attenzione l'ora di inizio è piu grande dell'ora di fine\")\n end\n end", "def finish_day_ok?(start_day, finish_day)\n finish = start_day + @max_duration\n return finish_day <= finish\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def validate_dated_around_now\n self.errors.add(:exam_date, \"ist kein korrektes Datum, bitte versuche es erneut.\") unless ((Date.today)..(5.years.from_now)).include?(self.exam_date)\n end", "def validate_end_time\n if self.end_time.present? && self.end_time < self.start_time\n errors.add(:end_time, \"can't be before start time\")\n end\n end", "def test_member_register_after_early_bird\n\t\tmember = Enrollments.new(:participantID => participants(:six).participantID,:courseID => \"run12345\", :startDate => '2013-10-18' )\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tassert_operator Date.today, :<=, participants(:six).expirydate, \"Member is not a member\"\n\t\tassert_not_nil participants(:six).expirydate, \"Member is not a member\"\n\n\t\tearly_bird_last_date = '2013-09-01'\n\n\t\t#Date.today since creating the enrollment will of today\n\t\tassert_operator Date.today, :<, Date.parse(early_bird_last_date), \"Member registered too late for early bird\"\n\tend", "def check_date_ranges\n today = Date.today\n !!today.between?(start_date.to_date, end_date.to_date)\n end", "def past?\n (end_date < Date.today)\n end", "def confirm_date(start_date, end_date)\n confirm = 0\n for booking in @bookings\n if start_date >= booking[0] && start_date < booking[1]\n confirm += 1\n elsif end_date > booking[0] && end_date <= booking[1]\n confirm += 1\n elsif start_date <= booking[0] && end_date >= booking[1]\n confirm += 1\n end\n end\n return confirm\n # if confirmation is 1 then there is a clash. 0 if not.\n end", "def validate_start_and_end_date\n self.errors.add(:event_start_date, \"should not be in past\") if self.event_start_date < Date.today\n self.errors.add(:event_end_date, \"should not be in past\") if self.event_end_date < Date.today\n self.errors.add(:event_end_date, \"start date should not be after end date\") if self.event_end_date < self.event_start_date\n self.errors.add(:event_end_time, \"end time should not be before start time\") if (self.event_end_date == self.event_start_date and self.event_end_time < self.event_start_time)\n return self\n end", "def is_closed_at?(evaluation_date = Date.today)\n get_end_date < evaluation_date\n end", "def period_ended_after_start\n invalid = false\n if period_started_at.present? and period_ended_at.present? and not period_ended_at > period_started_at\n errors.add( :period_ended_at, :end_before_start )\n invalid = true\n end\n invalid\n end", "def validate(record)\n if !record.start_time.nil? && !record.end_time.nil? && record.start_time >= record.end_time\n record.errors[:end_time] << 'End date should be greater that start date!'\n end\n \n if !record.start_time.nil? && record.start_time < Time.now\n record.errors[:start_time] << 'Start time must be greater than current time'\n end\n end" ]
[ "0.84818196", "0.7233434", "0.7230404", "0.7134945", "0.70578676", "0.69782734", "0.696285", "0.6957164", "0.6913282", "0.68879133", "0.68874925", "0.68628925", "0.6856296", "0.68358004", "0.68188196", "0.68188196", "0.670295", "0.6698731", "0.66931", "0.6664221", "0.6654288", "0.66492426", "0.66456556", "0.6615388", "0.6611021", "0.6552037", "0.6533836", "0.6530044", "0.648966", "0.64795196", "0.64707756", "0.64579684", "0.64576375", "0.6455597", "0.6441425", "0.64408433", "0.6394372", "0.6371241", "0.637119", "0.6370533", "0.6370019", "0.6363437", "0.63420844", "0.6329323", "0.63150907", "0.6279692", "0.6265163", "0.6258556", "0.6256338", "0.6249838", "0.62437487", "0.6224234", "0.620286", "0.61990285", "0.61930966", "0.61903214", "0.61888844", "0.61573577", "0.61560327", "0.6151924", "0.6140176", "0.61399627", "0.61339056", "0.610831", "0.61043084", "0.6101631", "0.60982347", "0.6085928", "0.60791034", "0.6077133", "0.60573554", "0.6056239", "0.6049911", "0.604668", "0.604596", "0.60439336", "0.60429966", "0.6040325", "0.60349715", "0.6027798", "0.60234845", "0.60188663", "0.6016643", "0.60136724", "0.60136724", "0.6013589", "0.6009903", "0.6004847", "0.5982698", "0.59804434", "0.59804434", "0.59785324", "0.59749734", "0.59545475", "0.59505004", "0.5947562", "0.59410954", "0.59359837", "0.5934121", "0.59275687" ]
0.8507463
0
STAFF Enters staff per a given set of test data
def enter_staff(test_data) staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::STAFF_GRP.name)], staff) staff.each_with_index do |staf, index| logger.info "Entering staff data set at index #{index}: #{staf}" enter_auto_complete(staff_name_input(index), staff_name_options(index), staf[CoreUseOfCollectionsData::STAFF_NAME.name], 'Local Persons') wait_for_options_and_select(staff_role_input(index), staff_role_options(index), staf[CoreUseOfCollectionsData::STAFF_ROLE.name]) wait_for_element_and_type(staff_hours_spent_input(index), staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name]) wait_for_element_and_type(staff_note_input(index), staf[CoreUseOfCollectionsData::STAFF_NOTE.name]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def enter_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::STAFF_GRP.name)], staff)\n staff.each_with_index do |staf, index|\n enter_auto_complete(staff_name_input(index), staff_name_options(index), staf[UseOfCollections::STAFF_NAME.name], 'Local Persons')\n wait_for_options_and_select(staff_role_input(index), staff_role_options(index), staf[UseOfCollections::STAFF_ROLE.name])\n wait_for_element_and_type(staff_hours_spent_input(index), staf[UseOfCollections::STAFF_HOURS_SPENT.name])\n wait_for_element_and_type(staff_note_input(index), staf[UseOfCollections::STAFF_NOTE.name])\n end\n end", "def verify_staff(test_data)\n staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def enter_pahma_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::STAFF_GRP.name)], staff)\n staff.each_with_index do |staf, index|\n enter_auto_complete(staff_name_input(index), staff_name_options(index), staf[UseOfCollections::STAFF_NAME.name], 'PAHMA Persons')\n wait_for_options_and_select(staff_role_input(index), staff_role_options(index), staf[UseOfCollections::STAFF_ROLE.name])\n wait_for_element_and_type(staff_hours_spent_input(index), staf[UseOfCollections::STAFF_HOURS_SPENT.name])\n wait_for_element_and_type(staff_note_input(index), staf[UseOfCollections::STAFF_NOTE.name])\n end\n end", "def staff\n group.staff + group.group_type.courses.map(&:convenor)\n end", "def create_staff_at_ed_org_work_orders(type)\n @world[type].each_index do |ed_org_index|\n ed_org = @world[type][ed_org_index]\n ed_org_id = ed_org[\"id\"]\n sessions = ed_org[\"sessions\"]\n\n # create staff members for the current education organization\n if !ed_org[\"staff\"].nil? and ed_org[\"staff\"].size > 0\n ed_org[\"staff\"].each do |member|\n year_of = Date.today.year - random_on_interval(25, 65)\n @queue.push_work_order({:type=>Staff, :id=>member[\"id\"], :year=>year_of, :name=>member[\"name\"]})\n\n if !sessions.nil? and sessions.size > 0\n # create staff members for {elementary, middle, high} schools and local education agencies in the same way\n # -> use their published (or inherited) sessions\n # -> perform no date manipulation (sets offset to zero)\n offset = 0\n else\n # state education agencies are not publishing sessions, so find a local education agency whose parent is\n # the state education agency being processed, and use its sessions (with minor manipulations)\n sessions = find_sessions_from_child_district(ed_org_id)\n offset = 30\n end\n create_staff_ed_org_associations_for_sessions(sessions, offset, member, ed_org_id, type)\n create_staff_program_associations_for_sessions(sessions, offset, member, ed_org[\"programs\"])\n end\n end\n\n\n # create teachers for the current education organization\n if !ed_org[\"teachers\"].nil? and ed_org[\"teachers\"].size > 0\n ed_org[\"teachers\"].each_index do |teacher_index|\n teacher = ed_org[\"teachers\"][teacher_index]\n year_of = Date.today.year - random_on_interval(25, 65)\n grades = teacher[\"grades\"]\n subjects = teacher[\"subjects\"]\n\n if grades.nil? or grades.size == 0\n grades = [DataUtility.get_random_grade_for_type(@prng, type)]\n @world[type][ed_org_index][\"teachers\"][teacher_index][\"grades\"] = grades\n end\n if subjects.nil? or subjects.size == 0\n subjects = DataUtility.get_random_academic_subjects_for_type(@prng, type)\n @world[type][ed_org_index][\"teachers\"][teacher_index][\"subjects\"] = subjects\n end\n @log.info \"assigning teacher from catalog: #{teacher[\"id\"]} to education organization: #{ed_org_id}\"\n end\n end\n end\n end", "def teach(trainers)\n trainers.each {|trainer|\n case trainers\n when Yoda\n trainer.meditate(padawans)\n when MaceWindu\n trainer.be_a_badass(padawans)\n when Anakin\n trainer.be_a_murder(padawans)\n trainer.join_sidious(sith_lord)\n end\n }\n end", "def set_staff_team\n @staff_team = StaffTeam.includes({ staff_team_members: { registration: [:user, :scramble_events, :registration_detail] }}).find(params[:id] || params[:staff_team_id])\n end", "def create_teachers_for_education_organization(required)\n teachers = []\n if !required.nil? and required.size > 0\n required[\"staff\"].each do |member|\n # skip this entry if its not an Educator --> handled in 'create_staff' method\n next if [\"Student\", \"IT Administrator\", \"Leader\", \"Aggregate Viewer\"].include? member[:role]\n\n @num_teachers += 1\n teachers << {\"id\" => member[:staff_id], \"name\" => member[:name]}\n end\n end\n teachers\n end", "def pass_student(student, test_name)\n BoatingTest.all.select{|bt| bt.instructor == self }.select{|bt| bt.student == student && bt.test_name == test_name}.each{|bt| bt.test_status = 'passed'}\n end", "def staff\n [\n \"jessicacroysdale@yahoo.com\", \n \"margynewton@comcast.net\", \n \"brantallen@earthlink.net\", \n \"ksunmark@yahoo.com\", \n \"gorakr@comcast.net\", \n \"lhpilcher@frontier.com\", \n \"mmr@brantallen.com\", \n \"manbeardo@gmail.com\", \n \"jcermak53@gmail.com\"\n ]\nend", "def staff\n [\n \"jessicacroysdale@yahoo.com\", \n \"margynewton@comcast.net\", \n \"brantallen@earthlink.net\", \n \"ksunmark@yahoo.com\", \n \"gorakr@comcast.net\", \n \"lhpilcher@frontier.com\", \n \"mmr@brantallen.com\", \n \"manbeardo@gmail.com\", \n \"jcermak53@gmail.com\"\n ]\nend", "def pass_student(student_name, test_name)\n boating_tests.map do |test|\n test.boating_test_status = \"Passed\"\n end\n end", "def man_staffs\n prepareBaseContext\n @members = ShelterStaff.where('staff_type = ?', 'MEMBER')\n @volunteers = ShelterStaff.where('staff_type = ?', 'VOLUNTEER')\n render 'petshelter/management/staffs'\n end", "def create_staff_for_education_organization(roles, required)\n members = []\n if !required.nil? and required.size > 0\n required[\"staff\"].each do |member|\n # skip this entry if its an Educator --> handled in 'create_teachers' method\n next if [\"Student\", \"Educator\"].include? member[:role]\n\n @num_staff_members += 1\n members << {\"id\" => member[:staff_id], \"role\" => member[:role], \"name\" => member[:name], \"begin\" => member[:begin], \"end\" => member[:end]}\n for index in (0..(roles.size - 1)) do\n if Roles.to_string(roles[index]) == member[:role]\n @log.info \"Removing role: #{member[:role]} from default roles --> specified by member in staff catalog.\"\n roles.delete_at(index)\n break\n end\n end\n end\n end\n if !roles.nil? and roles.size > 0\n for index in (0..(roles.size - 1)) do\n @num_staff_members += 1\n members << {\"id\" => @num_staff_members, \"role\" => roles[index]}\n end\n end\n members\n end", "def fellow_staff\n User.any_staff_admin_for_agencies(agencies)\n end", "def set_staff\n @staff = Staff.friendly.find(params[:id])\n end", "def set_staff\r\n @staff = Staff.find(params[:id])\r\n\r\n # In this situation where staff can only access their profile unless admin\r\n # The record must be given, that is: @staff\r\n authorize(@staff)\r\n end", "def pass_student (student_name, test_name)\n test_to_change = BoatingTest.all.select {|test|\n test.name == test_name &&\n test.student.first_name == student_name &&\n test.instructor == self\n }\n\n if test_to_change[0] == nil\n test_to_change << BoatingTest.new(Student.find_student(student_name),test_name, \"passed\", self)\n else\n test_to_change[0].status = \"passed\"\n end\n test_to_change\n end", "def employ_staff(user, role)\n old_role = unit_roles.where(\"user_id=:user_id\", user_id: user.id).first\n return old_role if not old_role.nil?\n\n if (role != Role.student) && user.has_tutor_capability?\n new_staff = UnitRole.new\n new_staff.user_id = user.id\n new_staff.unit_id = id\n new_staff.role_id = role.id\n new_staff.save!\n new_staff\n end\n end", "def teaching_staff?\n TEACHING_STAFF_ROLES.include?(CourseUser.roles[role.to_sym])\n end", "def create_staff_for_state_education_agency(members = nil)\n create_staff_for_education_organization(get_default_state_education_agency_roles, members)\n end", "def staff_ids=(value)\n @staff_ids = value\n end", "def is_on_staff?(team)\n self.teams.include?(team)\n end", "def setup_battle_test_members\n @actors = []\n for battler in $data_system.test_battlers\n actor = $game_actors[battler.actor_id]\n actor.change_level(battler.level, false)\n actor.change_equip_by_id(0, battler.weapon_id, true)\n actor.change_equip_by_id(1, battler.armor1_id, true)\n actor.change_equip_by_id(2, battler.armor2_id, true)\n actor.change_equip_by_id(3, battler.armor3_id, true)\n actor.change_equip_by_id(4, battler.armor4_id, true)\n actor.recover_all\n @actors.push(actor.id)\n end\n @items = {}\n for i in 1...$data_items.size\n if $data_items[i].battle_ok?\n @items[i] = 99 unless $data_items[i].name.empty?\n end\n end\n end", "def unit_members#(current_unit, current_staff, current_roles)\n #Academicians & Mgmt staff : \"Teknologi Maklumat\", \"Perpustakaan\", \"Kewangan & Akaun\", \"Sumber Manusia\",\"logistik\", \"perkhidmatan\" ETC.. - by default staff with the same unit in Position will become unit members, whereby Ketua Unit='unit_leader' role & Ketua Program='programme_manager' role.\n #Exceptional for - \"Kejuruteraan\", \"Pentadbiran Am\", \"Perhotelan\", \"Aset & Stor\" (subunit of Pentadbiran), Ketua Unit='unit_leader' with unit in Position=\"Pentadbiran\" Note: whoever within these unit if wrongly assigned as 'unit_leader' will also hv access for all ptdos on these unit staff\n\n current_staff=staff\n exist_unit_of_staff_in_position = Position.find(:all, :conditions => ['unit is not null and staff_id is not null']).map(&:staff_id).uniq\n if exist_unit_of_staff_in_position.include?(current_staff)\n\n current_unit=staff.position.unit #staff.positions.first.unit\n #replace current_unit value if academician also a Unit Leader (23)\n #current_roles=User.where(userable_id: userable_id).first.roles.map(&:name) ##\"Unit Leader\" #userable.roles.map(&:role_id)\n current_roles=roles.map(&:name)\n current_unit=unit_lead_by_academician if current_roles.include?(\"Unit Leader\") && Programme.roots.map(&:name).include?(current_unit)\n\n if current_unit==\"Pentadbiran\"\n unit_members = Position.find(:all, :conditions => ['unit=? OR unit=? OR unit=? OR unit=?', \"Kejuruteraan\", \"Pentadbiran Am\", \"Perhotelan\", \"Aset & Stor\"]).map(&:staff_id).uniq-[nil]+Position.find(:all, :conditions => ['unit=?', current_unit]).map(&:staff_id).uniq-[nil]\n elsif [\"Teknologi Maklumat\", \"Pusat Sumber\", \"Kewangan & Akaun\", \"Sumber Manusia\"].include?(current_unit) || Programme.roots.map(&:name).include?(current_unit)\n unit_members = Position.find(:all, :conditions => ['unit=?', current_unit]).map(&:staff_id).uniq-[nil]\n else #logistik & perkhidmatan inc.\"Unit Perkhidmatan diswastakan / Logistik\" or other UNIT just in case - change of unit name, eg. Perpustakaan renamed as Pusat Sumber\n unit_members = Position.find(:all, :conditions => ['unit ILIKE(?)', \"%#{current_unit}%\"]).map(&:staff_id).uniq-[nil]\n end\n else\n unit_members = []#Position.find(:all, :conditions=>['unit=?', 'Teknologi Maklumat']).map(&:staff_id).uniq-[nil]\n end\n unit_members #collection of staff_id (member of a unit/dept) - use in model/user.rb (for auth_rules)\n #where('staff_id IN(?)', unit_members) ##use in ptdo.rb (controller - index)\n end", "def fs_and_sc_list\n field_staffs + staffing_companies.collect{|sc| sc.staffs }.flatten\n end", "def participant_staff(participant)\n if participant && participant.completed_event?(screener_event)\n staff_name(originating_staff_id(participant))\n end\n end", "def staff?\n STAFF_ROLES.include?(CourseUser.roles[role.to_sym])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def set_staff\n @staff = Staff.find(params[:id])\n end", "def create_staff_association_work_orders\n ['seas', 'leas', 'elementary', 'middle', 'high'].each{|type|\n create_staff_at_ed_org_work_orders(type)\n }\n create_staff_cohort_associations\n end", "def create_staff_for_local_education_agency(members = nil)\n create_staff_for_education_organization(get_default_local_education_agency_roles, members)\n end", "def teach(cohort) #check what happens with an arrage\n cohort.each {|student| student.learn } #this will put learn into each\n end", "def is_on_staff\n self.teams\n end", "def oversight_staff?\n staff? && agencies.any? { |a| a.oversight? }\n end", "def staff_params\n params.require(:staff).permit(:sam_staff_id, :first_name, :last_name, :card_id, practical_ids)\n end", "def unit_members\n #Academicians & Mgmt staff : \"Teknologi Maklumat\", \"Perpustakaan\", \"Kewangan & Akaun\", \"Sumber Manusia\",\"logistik\", \"perkhidmatan\" ETC.. - by default staff with the same unit in Position will become unit members, whereby Ketua Unit='unit_leader' role & Ketua Program='programme_manager' role.\n #Exceptional for - \"Kejuruteraan\", \"Pentadbiran Am\", \"Perhotelan\", \"Aset & Stor\" (subunit of Pentadbiran), Ketua Unit='unit_leader' with unit in Position=\"Pentadbiran\", Note: whoever within these unit if wrongly assigned as 'unit_leader' will also hv access for all ptdos on these unit staff\n \n exist_unit_of_staff_in_position = Position.find(:all, :conditions =>['unit is not null and staff_id is not null']).map(&:staff_id).uniq\n if exist_unit_of_staff_in_position.include?(Login.current_login.staff_id)\n current_unit = Position.find_by_staff_id(Login.current_login.staff_id).unit\n \n #replace current_unit value if academician also a Unit Leader\n current_roles=Login.current_login.roles.map(&:name)\n current_unit=unit_lead_by_academician if current_roles.include?(\"Unit Leader\") && Programme.roots.map(&:name).include?(current_unit)\n \n if current_unit==\"Pentadbiran\"\n unit_members = Position.find(:all, :conditions=>['unit=? OR unit=? OR unit=? OR unit=?', \"Kejuruteraan\", \"Pentadbiran Am\", \"Perhotelan\", \"Aset & Stor\"]).map(&:staff_id).uniq-[nil]+Position.find(:all, :conditions=>['unit=?', current_unit]).map(&:staff_id).uniq-[nil]\n elsif [\"Teknologi Maklumat\", \"Pusat Sumber\", \"Kewangan & Akaun\", \"Sumber Manusia\"].include?(current_unit) || Programme.roots.map(&:name).include?(current_unit)\n unit_members = Position.find(:all, :conditions=>['unit=?', current_unit]).map(&:staff_id).uniq-[nil]\n else #logistik & perkhidmatan inc. \"Unit Perkhidmatan diswastakan / Logistik\" or other UNIT just in case - change of unit name, eg. Perpustakaan renamed as Pusat Sumber\n unit_members = Position.find(:all, :conditions=>['unit ILIKE(?)', \"%#{current_unit}%\"]).map(&:staff_id).uniq-[nil] \n end\n else\n unit_members = []#Position.find(:all, :conditions=>['unit=?', 'Teknologi Maklumat']).map(&:staff_id).uniq-[nil]\n end\n unit_members #collection of staff_id (member of a unit/dept)\n end", "def demonstrator_list\n @hash = {}\n # retrieves courses which are supervised by the course coordinator\n @courses = current_staff.courses\n @courses.each do |course|\n # starts building a hash containing the neccessary information\n @hash[course.course_title] = {}\n # retrieves all the practicals for the course\n course.practicals.each do |practical|\n @hash[course.course_title][practical.start_time] = {}\n # retrieves the demonstrators for the practicals\n demonstrators_on_given_practical = Demonstrator.where(\"practical_id = ?\", practical.id)\n # counts how many demonstrators will be on the practical\n counter = demonstrators_on_given_practical.count\n # initialising a hash for each demonstrator\n counter.times do |i|\n @hash[course.course_title][practical.start_time][i] = {}\n end\n counter = 0\n # goes through each demonstrator for a practical and restrieves their necessary information\n demonstrators_on_given_practical.each do |demonstrate_on|\n # checks whether the demonstrator is a staff member or a student\n demonstrator = Student.find_by(sam_student_id: demonstrate_on.sam_demonstrator_id)\n if demonstrator.nil?\n demonstrator = Staff.find_by(sam_staff_id: demonstrate_on.sam_demonstrator_id)\n end\n # stores the details of the demonstrator which will be presented in the corresponding view\n @hash[course.course_title][practical.start_time][counter][:sam_demonstrator_id] = demonstrate_on.sam_demonstrator_id\n @hash[course.course_title][practical.start_time][counter][:first_name] = demonstrator.first_name\n @hash[course.course_title][practical.start_time][counter][:last_name] = demonstrator.last_name\n @hash[course.course_title][practical.start_time][counter][:email] = demonstrator.email\n counter = counter + 1\n end\n end\n end\n end", "def create_staff_and_teachers_for_school(members = nil)\n staff = create_staff_for_education_organization(get_default_school_roles, members)\n teachers = create_teachers_for_education_organization(members)\n return staff, teachers\n end", "def reg_participants\n puts \"#{self.thread_name} engine particpant setup\"\n # SETUP MUST BE CALLED.\n # ANY exceptions or errors in the participants aborts the workflow and are hard to find. YOU HAVE BEEN WARNED\n self.wfe_engine.register_participant :setup do |workitem|\n puts \"------> setup got a workitem...\" if @debug\n target = ['scott.sproule@cure.com.ph', 'jan.ardosa@cure.com.ph']\n workitem.sms_source = \"992\"\n workitem.my_hostname = Socket.gethostname \n workitem.sms_message = \"no message\"\n workitem.email_target = target\n # workitem.email_from = \"scott.sproule@cure.com.ph\"\n workitem.workflow_status = \"false\"\n workitem.process_result = \"false\"\n workitem.final_response=\"failure\"\n puts \"<------- end of setup\" if @debug\n end\n # self.wfe_engine.register_participant( \n # 'bal_transfer', \n # OpenWFE::Extras::ActiveStoreParticipant.new('bal_transfer\n#self.wfe_engine.register_participant :bal_transfer do |workitem|\n# puts \"bal_transfer got a workitem...\"\n# workitem.particpant = 'bal_transfer'\n# workitem.store = 'bal_transfer'\n# workitem.save\n#end\n#FIX LATER\n s=%w(bal_transfer pasaload dispense_pin dealer_load load process2 )\n s.each {|i|# self.wfe_engine.register_participant( \"#{i}_store\", ActiveTracker.new(\"#{i}\")) \n puts \"---REG PARticipant #{i}_store \"\n self.wfe_engine.register_participant \"#{i}_store\" do |workitem|\n puts \"#{i}_store got a workitem...\"\n #workitem.monkey_comment = \"this thing looks interesting\"\n end \n }\n \n self.wfe_engine.register_participant :credit do |workitem|\n puts \"----> credit action got a workitem...\" if @debug\n workitem.credit_result=false\n res= self.billing_action('credit',workitem.credit_msisdn,workitem.peso_value )\n puts \"action credit msisdn #{workitem.credit_msisdn} value #{workitem.peso_value} RES: #{res}\"\n puts \"<----credit action finished res #{res}...\" if @debug\n workitem.process_result=res\n end\n self.wfe_engine.register_participant :pasaload do |workitem|\n puts \"----> pasaload action got a workitem...\" if @debug\n workitem.process_result=false\n workitem.sms_source = \"992\"\n puts \"before action pasaload msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('pasaload',workitem.source_msisdn,workitem.value, workitem.dest_msisdn)\n puts \"action pasaload msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res}\"\n puts \"<----pasaload action finished res #{res}...\" if @debug\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n \n end\n self.wfe_engine.register_participant :dealer_load do |workitem|\n puts \"----> dealer load action got a workitem...\" if @debug\n workitem.process_result=false\n workitem.sms_source = \"913\"\n puts \"before action dealer load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('dealer_load',workitem.source_msisdn,workitem.value, workitem.dest_msisdn)\n puts \"action dealer load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res}\"\n puts \"<----dealer load action finished res #{res}...\" if @debug\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n end\n self.wfe_engine.register_participant :load do |workitem|\n puts \"----> load action got a workitem...\" if @debug\n workitem.process_result=false\n workitem.sms_source = \"990\"\n puts \"before action load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('load',workitem.source_msisdn,workitem.value, workitem.dest_msisdn)\n puts \"action load msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res}\"\n puts \"<----load action finished res #{res}...\" if @debug\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n workitem.loadvalue=res[1] if res[0]=='true'\n \n end\n self.wfe_engine.register_participant :dispense_pin do |workitem|\n puts \"----> dispense_pin action got a workitem...\" if @debug\n workitem.process_result=false\n puts \"before action dispense_pin msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn}\"\n res= self.billing_action('dispense_pin', workitem.source_msisdn, workitem.value, workitem.dest_msisdn)\n puts \"action dispense_pin msisdn #{workitem.source_msisdn} value #{workitem.value} dest: #{workitem.dest_msisdn} RES: #{res.to_s}\"\n puts \"<----load action finished res #{res}...\" if @debug\n # result = YAML.load\n workitem.process_message=res.to_yaml\n workitem.final_response=\"all ok\" if res[0]=='true'\n workitem.pin=res[1] if res[0]=='true'\n \n end\n \n \n self.wfe_engine.register_participant :debit do |workitem|\n puts \"----> debit action got a workitem...\" if @debug\n workitem.debit_result=false \n # peso charge -- could be variable\n value=-1*workitem.peso_value.to_i-1\n res=self.billing_action('debit',workitem.debit_msisdn,value.to_s )\n puts \"action debit msisdn #{workitem.debit_msisdn} value #{workitem.peso_value} RES: #{res}\"\n workitem.process_result=res\n workitem.process_message=res\n puts \"<----debit action finsihed res #{res}...\" if @debug\n end\n self.wfe_engine.register_participant :monkey do |workitem|\n puts \"monkey got a workitem...\"\n workitem.monkey_comment = \"this thing looks interesting\"\n end\n self.wfe_engine.register_participant :intprocess2 do |workitem|\n puts \"process2 got a workitem...\"\n workitem.process2_comment = \"yeah process 2\"\n end\n self.wfe_engine.register_participant :bob do |workitem|\n puts \"bob got a workitem...\"\n workitem.bob_comment = \"not for me, I prefer VB\"\n workitem.bob_comment2 = \"Bob rules\"\n workitem.final_response = \"all ok\"\n self.final_response[workitem.fei.workflow_instance_id.to_s] = workitem.final_response\n end\n self.wfe_engine.register_participant :sms do |workitem|\n puts \"sms got a workitem...\"\n puts \"sms #{workitem.sms_destination} message: #{workitem.sms_message}\"\n res=send_sms(workitem.sms_message,workitem.sms_destination, workitem.sms_source)\n workitem.problem=!res \n end\n # needs workitem.email_target set\n mailp=OpenWFE::MailParticipant.new(\n :smtp_server => \"mail2.cure.com.ph\",\n :smtp_port => 25,\n :from_address => \"scott.sproule@cure.com.ph\"\n ) do |workitem|\n puts \"----> mail got workitem\"\n s = \"\"\n duration=Time.now-self.start_time\n s << \"Subject: Workflow PROCESS [#{workitem.process_name}] [#{workitem.final_response}]\\n\\n\"\n s << \"result is #{workitem.final_response}\\n\"\n s << \"Processing Time so far: #{duration} \\n\"\n s << \"summary of process #{workitem.fei.workflow_instance_id}\\n\"\n workitem.attributes.each do |k, v|\n s << \" - #{k} : '#{v}'\\n\"\n end \n s << \"Time: #{Time.new.to_s}\\n\"\n puts \"----> leaving mail\"\n s\n end\n self.wfe_engine.register_participant( \n \"mail\", mailp)\n \n \n self.wfe_engine.register_participant :debug do |workitem|\n puts \"--->debug got a workitem...\"\n puts \"--status of process #{workitem.fei.workflow_instance_id}\"\n workitem.attributes.each do |k, v|\n puts \" - #{k} : '#{v}'\"\n end\n puts '<------end of debug'\n end\n # summarize must be called to set final_response\n self.wfe_engine.register_participant :summarize do |workitem|\n puts \"---->Summarize got a workitem...\"\n # workitem.final_response=\"all ok\" if workitem.attributes['process_result']=='true' \n puts \"result is #{workitem.final_response}\"\n self.final_response[workitem.fei.workflow_instance_id.to_s] = workitem.process_message\n puts \"summary of process #{workitem.fei.workflow_instance_id}\"\n workitem.attributes.each do |k, v|\n # next unless k.match \".*_comment$\"\n puts \" - #{k} : '#{v}'\"\n end\n puts '<-------end of summary'\n end\n self.wfe_engine.register_participant :reverse_charges do |workitem|\n puts \"-----> reverse got a workitem...\"\n res=false\n if workitem.attributes['debit_result']=='true'\n value=1*workitem.peso_value.to_i+1\n res=self.billing_action('credit',workitem.debit_msisdn,value.to_s )\n puts \"return from reversing debit: #{res}\"\n end\n if workitem.attributes['credit_result']=='true'\n res= self.billing_action('debit',workitem.credit_msisdn,workitem.peso_value )\n puts \"return from reversing credit: #{res}\"\n end\n puts 'end of reverse charges'\n end\n self.wfe_engine.register_participant :process_failure do |workitem|\n puts \"----> process_failure got a workitem...\"\n res=false\n # res=send_sms(\"There was a problem with your request (process id:'#{workitem.fei.workflow_instance_id})'. Call *999 if you require further information\", workitem.source_msisdn, workitem.sms_source)\n puts \"<------ out of process failure\"\n end\n self.wfe_engine.register_participant :inform_success_pasa do |workitem|\n puts \"---->Inform_success_pasa got a workitem...\"\n res=true\n if workitem.final_response==\"all ok\"\n # res=send_sms(\"You have sent #{workitem.value} pesos to #{workitem.dest_msisdn}: (process id:'#{workitem.fei.workflow_instance_id})'\", workitem.source_msisdn, workitem.sms_source)\n res=send_sms(\"You have received #{workitem.value} pesos from #{workitem.source_msisdn}: To check your balance, text BAL to 991\", workitem.dest_msisdn,workitem.sms_source) and res\n #(process id:#{workitem.fei.workflow_instance_id})\n end\n puts \"<---- end inform_sucess\"\n res\n end\n self.wfe_engine.register_participant :inform_success_dispense_pin do |workitem|\n puts \"---->Inform_success_dispense_pin got a workitem...\"\n res=false\n if workitem.final_response==\"all ok\"\n res=send_sms(\"Your pin is #{workitem.loadvalue} via tracking process id:'#{workitem.fei.workflow_instance_id}'\", workitem.source_msisdn, workitem.sms_source)\n \n end\n puts \"<---- end inform_success_dispense_pin\"\n res\n end\n self.wfe_engine.register_participant :inform_success_load do |workitem|\n puts \"---->Inform_success_load got a workitem...\"\n res=false\n if workitem.final_response==\"all ok\"\n # res=send_sms(\"You have loaded #{workitem.loadvalue} pesos (process id: #{workitem.fei.workflow_instance_id})\", workitem.source_msisdn, workitem.sms_source)\n \n end\n puts \"<---- end inform_sucess\"\n res\n end\n self.wfe_engine.register_participant :inform_success do |workitem|\n puts \"Inform_success got a workitem...\"\n res=false\n if workitem.final_response==\"all ok\"\n res=send_sms(\"You have sent #{workitem.peso_value} peso to #{workitem.credit_msisdn}: (process id:'#{workitem.fei.workflow_instance_id}')\", workitem.debit_msisdn, workitem.sms_source)\n res=send_sms(\"You have received #{workitem.peso_value} pesos from #{workitem.debit_msisdn}: tracking process id:'#{workitem.fei.workflow_instance_id}' \",workitem.credit_msisdn,workitem.sms_source) and res\n end\n end\n \nend", "def man_staff\n prepareBaseContext\n @staff = ShelterStaff.find(params[:staff_id])\n @people = People.find(@staff.people_id)\n @shelters = Shelter.all\n render 'petshelter/management/staff'\n end", "def update_instructor_subject(instructor, new_subject, school)\n school[:instructors].select do |instructor_hash| \n if instructor_hash[:name] == instructor\n ap instructor_hash[:subject] = new_subject\n end\n end\nend", "def update_census_employee_records(person, current_user)\n person.employee_roles.each do |employee_role|\n ce = employee_role.census_employee\n if current_user.has_hbx_staff_role? && ce.present?\n ce.ssn = person.ssn\n ce.dob = person.dob\n ce.save!(validate: false)\n end\n end\n end", "def test_employee_added_to_a_human_resources\n human_resources = Department.new(\"Human Resources\")\n danai = Employee.new(name: \"Danai\",email: \"danai@live.com\", phone_number: \"307-555-5555\", salary: 100)\n anna = Employee.new(name: \"Anna\",email: \"anna@live.com\", phone_number: \"919-555-5555\", salary: 5000)\n turner = Employee.new(name: \"Turner\", email: \"turner@live.com\", phone_number: \"303-555-5555\", salary: 500)\n\n assert human_resources.assign(danai)\n assert human_resources.assign(anna)\n assert human_resources.assign(turner)\n\n assert_equal [danai,anna,turner], human_resources.department_staff\n end", "def staff_ids\n return @staff_ids\n end", "def set_enrollments\n @enrollments = Enrollment.where(section_id: params[:id])\n .includes(:student).order('students.family_name')\n @active = @enrollments.where(dropped_course: nil)\n @dropped = @enrollments.where.not(dropped_course: nil)\n end", "def fname_cleaner\n urls = Indexer.where(template: \"Dealer.com\").map(&:clean_url).uniq\n staffers = Staffer.where(domain: urls)\n\n staffers.each do |staffer|\n fname = staffer.fname\n lname = staffer.lname\n fullname = staffer.fullname\n\n if fname && lname && fullname\n merged_name = fname + \" \" + lname\n\n if fullname != merged_name\n puts \"\\n\\nOLD First Name: #{fname}\\nNEW First Name: #{fullname.split(\" \")[0]}\\n\\n\"\n staffer.update_attributes(fname: fullname.split(\" \")[0])\n end\n end\n end\n end", "def set_daw_staff\n @daw_staff = DawStaff.find(params[:id])\n end", "def change_subject(school, instructor_name2, new_subject)\n school[:instructors].each do |instructor|\n if instructor_name2 == instructor[:name]\n instructor[:subject] = new_subject\n puts \"#{instructor_name2}'s subject has been updated to #{new_subject}\"\n end\n end\nend", "def check_is_staff_member!\n if email_changed? && blocked_as_staff_member == nil\n Rails.logger.info(\"CHECK_IS_STAFF_MEMBER\")\n # email will match on any casing in staff_members table as email column is citext\n if matching_staff_members.any?\n self.blocked_as_staff_member = true\n end\n end\n end", "def staff\n staff = self.users.where(\"participants.role_id < 4\").all\n return staff\n end", "def update_instructor(list, name, subject)\n\tlist.each do |instructor|\n\t\tif instructor[:name] == name\n\t\t\tinstructor[:subject] = subject\n\t\tend\n\tend\nend", "def populate_judge_team_for_testing(judge_team, judge_user, attorneys)\n judge_team.users << judge_user\n attorneys.each do |u|\n judge_team.users << u\n end\n judge_orguser = OrganizationsUser.existing_record(judge_user, judge_team)\n judge_orguser.update!(admin: true)\n end", "def test\nspongebob = Student.new(\"Spongebob\")\npatrick = Student.new(\"Patrick\")\nplankton = Student.new(\"Plankton\")\n\nmrs_puff = Instructor.new(\"Mrs. Puff\")\nsquidward = Instructor.new(\"Squidward Tentacles\")\n\nspongebob_test1 = spongebob.add_boating_test(\"parking_test\", \"Fail\", mrs_puff)\nspongebob.add_boating_test(\"braking_test\", \"Fail\", mrs_puff)\nspongebob.add_boating_test(\"speeding_test\", \"Pass\", squidward)\n\npatrick.add_boating_test(\"parking_test\", \"Fail\", mrs_puff)\npatrick.add_boating_test(\"speeding_test\", \"Pass\", squidward)\n\nplankton.add_boating_test(\"parking_test\", \"Pass\", squidward)\nplankton.add_boating_test(\"braking_test\", \"Pass\", squidward)\n\nputs \"Student Test\"\nputs \"------------\"\nprint \"Student has first name: \"\nputs spongebob.first_name == \"Spongebob\"\nprint \"Student.all returns all student objects: \"\nputs Student.all == [spongebob, patrick, plankton]\nprint \"#add_boating_test creates a new boating test: \"\nputs spongebob_test1.class == BoatingTest\n\nputs \"------------\"\nputs \"Instructor Test\"\nputs \"------------\"\nprint \"Instructor has name: \"\nputs squidward.name == \"Squidward Tentacles\"\nprint \"Instructor.all returns all instructors: \"\nputs Instructor.all == [mrs_puff, squidward]\nprint \"#pass students: \"\nmrs_puff.pass_student(spongebob, \"parking_test\")\nputs spongebob_test1.status == \"Pass\"\nprint \"#fail_student\"\nmrs_puff.fail_student(spongebob, \"parking_test\")\nputs spongebob_test1.status == \"Fail\"\n\nputs \"------------\"\nputs \"BoatingTest Test\"\nputs \"------------\"\nprint \"has a student: \"\nputs spongebob_test1.student == spongebob\nprint \"has a name: \"\nputs spongebob_test1.test_name == \"parking_test\"\nprint \"has a status: \"\nputs spongebob_test1.status == \"Fail\"\nprint \"has an instructor: \"\nputs spongebob_test1.instructor == mrs_puff\n\nend", "def set_staff_role(agency)\n if agency && staff_agency != agency\n self.remove_role(:staff)\n self.add_role(:staff, agency)\n r = self.roles.last\n elsif agency.nil?\n self.remove_role(:staff)\n r = self.roles.last\n end\n end", "def staff_params\n params.require(:staff).permit(:first_name, :last_name, :email, :age, :designation, :phone_number, :admin, :super_admin, :department_id, accessible_department_ids: [])\n end", "def set_lec_staff\n @lec_staff = LecStaff.find(params[:id])\n end", "def setup_for_etc_test_by_diff_client\n client1 = clients(:Triad)\n facility1 = Facility.create!(:name => \"Test facility1\",:sitecode => 8234,:client => client1)\n\t\t@batch_for_triad_client = Batch.create!(:batchid => 31120601,\n :facility => facility1,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now.tomorrow - 64.minutes}\",\n :status => \"New\",\n :manual_override\t=> false)\n\n\t\tclient2 = clients(:Apria)\n facility2 = Facility.create(:name => \"Test facility2\",:sitecode => 8294,:client => client2)\n\t\t@batch_for_other_client = Batch.create!(:batchid => 31120602,\n :facility => facility2,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now.tomorrow - 64.minutes}\",\n :status => \"New\",\n :manual_override\t=> false)\n\n\t\t@processor1 = User.create!(:name => 'pro', :userid => 'pro_one', :password => 'pro', :role => 'Processor',\n :processing_rate_triad => 20, :processing_rate_others => 30)\n\t\t@processor2 = User.create!(:name => 'anu', :userid => 'anu_one', :password => 'anu', :role => 'Processor',\n :processing_rate_triad => 10, :processing_rate_others => 20)\n\t\t@qa = User.create!(:name => 'anu2', :userid => 'anu2_one', :password => 'anu2', :role => 'QA')\n\n end", "def set_staff\n @staff = User.find(params[:id])\n @this_dojo = Dojo.find(params[:dojo_id])\n end", "def update(instructor, subject, school)\n school[:instructors].each do |i|\n i[:subject] = subject if i[:name] == instructor\n end\nend", "def attendee\n @training_records = @training.training_records\n end", "def update_instructor(school,name,new_subject)\n school[:instructors].each do |instructor|\n if instructor.has_value?(name)\n instructor[:subject] = new_subject\n end\n end\nend", "def standby_team(config); end", "def index\n @authoriziedstaffs = Authorizedstaff.all\n end", "def staff?\n roles.where(name: Ability.staff_group_name).exists?\n end", "def set_staff_code\n @staff_code = StaffCode.find(params[:id])\n end", "def staff_params\n params.require(:staff).permit(:title, :first_name, :last_name, :gender, :date_of_birth, :religious_denomination, :marital_status, :photo, :phone, :joining_date, :staff_department_id, :specialization, :employment_id, :sssnit_no, :employee_id, :employment_date, :portal_access, :rank, :registered_no, :qualification, staff_addresses_attributes: [:id, :street_address, :city, :region, :postal_code], staff_contacts_attributes: [:id, :mobile_phone, :home_phone, :office_phone, :work_email, :personal_email])\n end", "def participation employer_name, employer_id, total, enrolled, waived, plan_years, contacts\n total_employees = total_employees employer_name\n summary = summary_details employer_name, total_employees\n employer_details = summary.clone\n employer_util = ::EmployerUtil.new details: employer_details, plan_years: plan_years, total_employees: total_employees\n employer_util.add_plan_details\n\n employee_util = ::EmployeeUtil.new use_case_directory: @use_case_directory,\n employer_name: employer_name,\n enrolled: enrolled, plan_years: plan_years,\n total_employees: total_employees, waived: waived\n roster = employee_util.add_roster\n add_to_summary contacts, employer_util, plan_years, roster, summary, total_employees\n summary\n end", "def update_subject(school, instructor_name, new_subject)\n school[:instructors].collect do |instructor|\n if instructor[:name] == instructor_name\n instructor[:subject] = new_subject\n end\n end\nend", "def pass_student(student_lookup, testname_lookup)\n boating_test = BoatingTest.all.find { |bt| bt.student == student_lookup && bt.testname == testname_lookup }\n if boating_test == nil\n boating_test = BoatingTest.new(testname_lookup, \"passed\", student_lookup, self)\n end\n boating_test.teststatus = \"passed\"\n boating_test\n end", "def select_winner(passengers)\n # add the code snippet here!\n winner = \"\"\n passengers.each do |suite, name|\n if suite == :suite_a && name.start_with?(\"A\")\n winner = name\n end\n end\n\n winner\nend", "def pass_student(student, test_name)\n\n # if BoatingTest.all.select {|bt|bt.test_name == test_name} && BoatingTest.all.select {|bt|bt.student == student}\n # status = \"passed\"\n # else\n # BoatingTest.new(student, test_name, status = \"passed\", instructor = nil)\n # end\n\n arr = BoatingTest.all.select {|bt|bt.student == student}\n\n matched = arr.find {|bt| bt.test_name == test_name}\n\n if matched\n matched.status = 'passed'\n else\n BoatingTest.new(student,test_name,'passed',self) \n end \n\n def fail_student(student, test_name)\n\n # if BoatingTest.all.select {|bt|bt.test_name == test_name} && BoatingTest.all.select {|bt|bt.student == student}\n # status = \"passed\"\n # else\n # BoatingTest.new(student, test_name, status = \"passed\", instructor = nil)\n # end\n \n arr = BoatingTest.all.select {|bt|bt.student == student}\n \n matched = arr.find {|bt| bt.test_name == test_name}\n \n if matched\n matched.status = 'failed'\n else\n BoatingTest.new(student,test_name,'failed',self) \n end\n end\n\n\n\nend", "def staff_params\n params.require(:staff).permit(:name, :grade, :staffgivenname)\n end", "def set_test\n @tests = Test.by_student_id params[:student_id]\n end", "def login_as_staff\n user = FactoryBot.create(:user, role: :staff)\n login_as(user)\n end", "def participant_admins(participant,school)\n @participant = participant\n @school = school\n admin_user_ids = Participant.where(\"school_id = ? and role_id < ?\",@school.id,3).all.map(&:user_id)\n schooladmins = User.where(id: admin_user_ids).all.map(&:email)\n @applicant = User.find(@participant.user_id)\n applicant_email = \"#{@applicant.fullname} <#{@applicant.email}>\"\n\n mail to: schooladmins,\n from: applicant_email,\n reply_to: applicant_email,\n subject: @applicant.fullname + \" has registered to \" + @school.name + \" and is waiting for acceptance.\"\n end", "def create_all_instructor_sandbox_site(zip_file_name, logger, server_api_url, account_number, practice_course_subaccount)\n\t# create a hash for all unique teachers SIS ids\n\tset_teacher_sis_ids = get_teacher_sis_ids_set(zip_file_name, logger)\n\tlogger.info \"found total #{set_teacher_sis_ids.size} users with teaching role\"\n\n\t# now that we have a set of allteacher sis ids, we will create sandbox site for those users\n\t# counter\n\tcount_teachers = 0\n\tset_teacher_sis_ids.each {\n\t\t|user_mpathway_id|\n\t\tcount_teachers = count_teachers+1\n\t\tlogger.info \"#{count_teachers}/#{set_teacher_sis_ids.size} found user #{user_mpathway_id}\"\n\t\t# find user canvas id\n\t\tuser_details_json = Canvas_API_GET(\"#{server_api_url}accounts/#{account_number}/users?search_term=#{user_mpathway_id}\")\n\t\tif (!user_details_json.nil? && user_details_json.size == 1)\n\t\t\t# found user in Canvas\n\t\t\tuser_canvas_id = user_details_json[0][\"id\"]\n\t\t\tuser_sis_login_id = user_details_json[0][\"login_id\"]\n\t\t\tuser_name = user_details_json[0][\"name\"]\n\n\t\t\t# 1. see whether there is an sandbox site for this user\n\t\t\tprevious_user_sandbox_site = Canvas_API_GET(\"#{server_api_url}accounts/#{practice_course_subaccount}/courses?search_term=#{PREVIOUS_USER_SANDBOX_NAME.gsub(USERNAME, user_name)}\")\n\t\t\tif (previous_user_sandbox_site.nil? || previous_user_sandbox_site.length == 0)\n\t\t\t\t# 2. create new sandbox site with new name format\n\t\t\t\tcreate_instructor_new_sandbox_site(user_canvas_id, user_name, user_sis_login_id, logger, practice_course_subaccount, server_api_url)\n\t\t\telse\n\t\t\t\t# 3. need to rename the previous course with new course title format\n\t\t\t\tcourse_id=previous_user_sandbox_site[0][\"id\"]\n\t\t\t\trename_course_site(course_id, user_name, user_sandbox_site_name, user_sis_login_id, logger)\n\t\t\tend\n\t\telse\n\t\t\tlogger.warn \"Cannot find user with id #{user_mpathway_id}\"\n\t\tend\n\t}\nend", "def set_admin_staff\n @admin_staff = Admin::Staff.find(params[:id])\n end", "def subject_change(instructor, nu_subject, school_hash) #b. i.\n\tschool_hash[:instructors].each{|k| k[:subject]=nu_subject if k[:name]==instructor} \nend", "def tests\n BoatingTest.all.select do |test|\n test.instructor == self\n end\n end", "def show_all_staff_members\n\t\tputs \"\\nAll Staff Members\\n\"\n\t\tStaffMember.all.each do |staff_member|\n\t\t\tputs \"#{staff_member.id} #{staff_member.name}\"\n\t\tend\nend", "def edit_staff_member(selected)\n\tedit_staff_member_name(selected)\n\tedit_staff_member_email_address(selected)\nend", "def boating_tests\n BoatingTest.all.select{|test| \n test.instructor == self\n }\n end", "def train\n super\n puts \"#{@role} #{@last_name} supports the team during the training\"\n end", "def update_staffers_sfdc_id(core)\n url = core.sfdc_clean_url\n sfdc_id = core.sfdc_id\n return if url.nil? || sfdc_id.nil?\n\n staffers = Staffer.where(domain: url).where(cont_source: \"Web\")\n staffers.each do |staffer|\n staffer.update_attribute(:sfdc_id, sfdc_id)\n end\n end", "def set_staff_member\n @staff_member = StaffMember.find(params[:id])\n end", "def set_staffevent\n @staffevent = Staffevent.find(params[:id])\n end", "def staff_params\n params.require(:staff).permit(:staff_code, :position, :status, :branch_id, \n user_attributes: [:id, :firstname, :lastname, :phone, :role, :email, :password, :password_confirmation])\n end", "def enter_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::FEE_GRP.name)], fees)\n fees.each_with_index do |fee, index|\n logger.info \"Entering fee data set at index #{index}: #{fee}\"\n wait_for_options_and_select(fee_currency_input(index), fee_currency_options(index), fee[CoreUseOfCollectionsData::FEE_CURRENCY.name])\n wait_for_element_and_type(fee_value_input(index), fee[CoreUseOfCollectionsData::FEE_VALUE.name])\n wait_for_element_and_type(fee_note_input(index), fee[CoreUseOfCollectionsData::FEE_NOTE.name])\n wait_for_element_and_click(fee_paid_input(index)) if fee[CoreUseOfCollectionsData::FEE_PAID.name]\n end\n end" ]
[ "0.7007298", "0.69529206", "0.69408417", "0.6672082", "0.60582364", "0.58644193", "0.56636554", "0.5658313", "0.5651512", "0.55732346", "0.5560925", "0.5560925", "0.5532442", "0.5531731", "0.55038667", "0.54973894", "0.54571545", "0.53950775", "0.538978", "0.533669", "0.531732", "0.530531", "0.5296524", "0.5288026", "0.5279654", "0.52794695", "0.52713203", "0.52467114", "0.52230227", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.52184284", "0.5213812", "0.51990145", "0.5179319", "0.5175775", "0.5151617", "0.51504385", "0.51498747", "0.5124239", "0.5080319", "0.5075351", "0.5066714", "0.506402", "0.50613695", "0.5059997", "0.50590026", "0.5040194", "0.50316036", "0.50171155", "0.5015138", "0.5014497", "0.50103277", "0.5003053", "0.49941084", "0.4989745", "0.4976793", "0.49324316", "0.49279094", "0.4924454", "0.49197114", "0.49191388", "0.49155247", "0.49088457", "0.49014536", "0.48998675", "0.48905855", "0.48871806", "0.48841766", "0.48768103", "0.48747498", "0.48710272", "0.48673114", "0.48660088", "0.48655903", "0.4860887", "0.48545992", "0.4844922", "0.48440355", "0.484056", "0.48348606", "0.4830555", "0.48291788", "0.48258796", "0.4820184", "0.48193857", "0.48180902", "0.4801097", "0.47981793", "0.47977224", "0.47973612" ]
0.6878165
3
Verifies staff match test data
def verify_staff(test_data) staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff] staff.each_with_index do |staf, index| verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index)) verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index)) verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index)) verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def verify\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def verify\n\n end", "def verify\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def verify_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def verify()\n # TODO\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def verify_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[UseOfCollections::USER.name], element_value(user_name_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[UseOfCollections::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def check_against(unit_test)\n grade_sheet = unit_test.execute(src_code) \n Feedback.on(grade_sheet)\n end", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def verify_users(test_data)\n users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def validate_same_number_of_sts_in_p_and_f(asp_w_f_sts)\n p_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[0].count('@') }\n f_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[1].count('@') }\n if p_st_count != f_st_count\n if debug\n puts asp_w_f_sts.ai(indent: -2)\n puts \"\\n\\n\\n\\n\"\n puts \"mismatches:\".color(:red)\n asp_w_f_sts.each { |(primary,foreign,conf)|\n pr_st_count = primary.count('@')\n fo_st_count = foreign.count('@')\n if pr_st_count != fo_st_count\n puts '-' * 10\n p primary\n puts \"pr_st_count: #{ pr_st_count }\"\n p foreign\n puts \"fo_st_count: #{ fo_st_count }\"\n puts \"conf: #{ conf.inspect }\"\n end\n }\n end\n raise \"Mismatch in subtitle counts: primary has #{ p_st_count } and foreign has #{ f_st_count }\"\n end\n true\n end", "def test_truth\n end", "def verify_contact_names(test_data)\n test_names = test_data[Org::CONTACT_NAMES.name]\n errors = []\n test_names = [{ Org::CONTACT_NAME.name => ''}] unless test_names\n test_names.each_with_index do |test_name, index|\n text_values_match?(test_name[Org::CONTACT_NAME.name], element_value(contact_name_input(index)), errors)\n end\n errors\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def compare_profile_data\n puts \"Step 11: Comparing Freelancer Profile data\"\n parent = $freelancers_card_data[@index]\n child = @profile_data\n puts \"for freelancer #{parent[:name]}, comparing results page fields with internal page fields:\"\n [:description, :title, :skills].each do |field|\n verify_details(parent, child, field, parent[:name])\n end\n puts \"All results are printed successfully\"\n\n end", "def test_csv_table_match(subject)\n # Compare the fields\n if !subject.empty?\n subject_fields = subject[0].keys\n master_fields = @golden_master.headers\n\n if subject_fields.count != master_fields.count\n throw_no_match \"Expected #{master_fields.count} field(s), got #{subject_fields.count}\"\n end\n\n master_fields.each_with_index do |column, index|\n if column != subject_fields[index]\n throw_no_match \"Expected field \\\"#{column}\\\", got field \\\"#{subject_fields[index]}\\\"\"\n end\n end\n end\n\n # Compare the number of records\n subject_record_count = subject.count\n master_record_count = @golden_master.inject(0){|count| count += 1}\n if subject_record_count != master_record_count\n throw_no_match \"Expected #{master_record_count} record(s), got #{subject_record_count}\"\n end\n\n # Compare the values of the golden master with the subject\n current_row = 0\n @golden_master.each do |row|\n row.each do |field, master_string|\n subject_value = subject[current_row][field]\n if !match_values?(master_string, subject_value)\n throw_no_match \"Field \\\"#{field}\\\", Record #{current_row + 1}: Expected value #{master_string.nil? ? '<NULL>' : \"\\\"#{master_string}\\\"\"}, got #{subject_value.nil? ? '<NULL>' : \"\\\"#{subject_value}\\\"\"}\"\n end\n end\n current_row += 1\n end\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def verify_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n errors = []\n test_terms.each_with_index do |test_term, index|\n text_values_match?(test_term[Org::TERM_DISPLAY_NAME.name], element_value(org_display_name_input index), errors)\n text_values_match?(test_term[Org::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[Org::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[Org::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[Org::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[Org::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[Org::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[Org::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[Org::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "def test_person_validity\n assert people(:valid_person).valid?\n end", "def test_seqence_valid19\n result = engine(\"TrumppasswORd12%\")\n refute(result, \"'Trump1%' should not be valid because it contains password.\")\n end", "def verify\n\t\t#puts \"INSIDE DEF: vERIFY IN ORDER CONCERN.\"\n\t\tself.reports.each do |report|\n\t\t\treport.a_test_was_verified = false\n\t\t\tif report.consider_for_processing?(self.history_tags)\n\t\t\t#puts \"checking report: #{report.name}\"\n\t\t\t#puts \"report verify all is: #{report.verify_all},,, #{Diagnostics::Report::VERIFY_ALL}\"\n\t\t\t\tif report.verify_all == Diagnostics::Report::VERIFY_ALL\n\t\t\t\t\t#puts \"reprot verify all is true\"\n\t\t\t\t\tif report.impression.blank?\n\t\t\t\t\t\t#puts \"impression is balnk\"\n\t\t\t\t\t\treport.tests.each do |test|\n\t\t\t\t\t\t\t#puts \"Calling verify if normal on test: #{test.name}\"\n\t\t\t\t\t\t\tunless test.verify_if_normal(self.current_user).blank?\n\t\t\t\t\t\t\t\treport.a_test_was_verified = true\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\treport.tests.each do |test|\n\t\t\t\t\t\t\tunless test.verify.blank?\n\t\t\t\t\t\t\t\treport.a_test_was_verified = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def verify\n # nothing to do here, so just return\n end", "def verify\n head :ok\n end", "def verify_iss; end", "def verify_iss; end", "def verify_freelancer_profile(freelancers)\n Logbook.step(\"Verify freelancer #{@freelancer_profile[:name]} profile\")\n freelancer = freelancers.find { |freelancer| freelancer[:name] == @freelancer_profile[:name] }\n Logbook.message(\"*****Profile page of #{freelancer[:name]}*****\")\n @freelancer_profile.each do |key, value|\n if value.include?(freelancer[key.to_sym])\n Logbook.message(\"+ Profile field #{key} matches with the same field from preview.\")\n else\n Logbook.message(\"- Profile field #{key} does not match with the same field from preview.\")\n end\n end\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def is_correct?\n self.match.final_result == selected_result\n end", "def test_exercise_1111\n verify_method :exercise_1111,\n :with => [{param: [[true]], expect: \" 1\\n1*\\n\"},\n {param: [[false]], expect: \" 1\\n1 \\n\"},\n {param: [[true, false]], expect: \" 12\\n1* \\n\"},\n {param: [[true, false], [true, false]], expect: \" 12\\n1* \\n2* \\n\"}]\n end", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def verify_selected_freelancer_details(nth_result,keyword)\n\n puts \"Retrieve Freelancer name , title ,overview and skills\"\n selected_freelancer_name = get_selected_freelancer_name_from_slider\n selected_freelancer_title = get_selected_freelancer_title_from_slider\n selected_skill_arr = get_selected_freelancer_skills_from_slider\n\n get_selected_freelancer_overview_from_slider\n\n puts \"=============== Compare Name ==========================\"\n puts selected_freelancer_name+\" , \"+@@search_result_information[nth_result]['name']\n if (selected_freelancer_name.eql? @@search_result_information[nth_result]['name'])\n puts selected_freelancer_name+\"'s name matches with the stored data \"\n end\n puts \"=======================================================\"\n\n puts \"=============== Compare Title ==========================\"\n puts selected_freelancer_title+\" , \"+@@search_result_information[nth_result]['title']\n\n if (selected_freelancer_title.eql? @@search_result_information[nth_result]['title'])\n puts selected_freelancer_name+\"'s title matches with the stored data \"\n end\n puts \"========================================================\"\n\n puts \"=============== Compare Skills ==========================\"\n if (selected_skill_arr.eql? @@search_result_information[nth_result]['skills'])\n puts selected_freelancer_name+\"'s skills matches with the stored data \"\n end\n puts \"=========================================================\"\n\n verify_if_selected_slider_contains(keyword)\n\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def assert_valid\n @validator = validator\n assert @validator.validate(data_sample, fail_fast: true)\n assert @validator.validate(data_sample, fail_fast: false)\n end", "def verify(state) ; end", "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def test_user\n add_test_judgement\n assert(@gold_standard.contains_user? :id => \"John Doe\")\n end", "def test_idempotency_validation\n FootballData::Scrape.get_team_year(1, '1999-2000')\n assert_equal FootballData::RawGame.count, @count\n end", "def verify_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[UseOfCollections::LOCATION.name], element_value(location_input index)) }\n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def check_data_validation\r\n if @tx_interest.text.to_f > 0 and \r\n @tx_interest.text.to_f < 0.1 and\r\n @tx_amount.text.to_i >= 1000 and\r\n @tx_years.text.to_i >= 1 then\r\n tf = true\r\n else\r\n tf = false\r\n end\r\n return tf\r\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def test_validity\r\n assert @valid_skill.valid?\r\n end", "def enter_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::STAFF_GRP.name)], staff)\n staff.each_with_index do |staf, index|\n enter_auto_complete(staff_name_input(index), staff_name_options(index), staf[UseOfCollections::STAFF_NAME.name], 'Local Persons')\n wait_for_options_and_select(staff_role_input(index), staff_role_options(index), staf[UseOfCollections::STAFF_ROLE.name])\n wait_for_element_and_type(staff_hours_spent_input(index), staf[UseOfCollections::STAFF_HOURS_SPENT.name])\n wait_for_element_and_type(staff_note_input(index), staf[UseOfCollections::STAFF_NOTE.name])\n end\n end", "def test_ensure_mail_wasnt_sent_when_grader_takes_on_report\n login_as :donna\n post :auto_assign\n assert_equal(0, @emails.size)\n\n=begin\n\n email = @emails.first\n assert_match(/A grader has picked up your report on/ , email.subject)\n assert_match(/Once the grader has completed grading your report, you will get another email notification/, email.body)\n\n=end\n\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def verify_locations(test_data)\n locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[CoreUseOfCollectionsData::LOCATION.name], element_value(location_input index)) }\n end", "def test_contains_13_eachsuit\n assert true == false\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify( *suspect_words )\n\t\tsuspect_words.flatten.sort == @banned_words\n\tend", "def test_ID_25839_edit_profile_home_patch\n login_as_user1\n go_to_edit_profile_page\n verify_users_default_town_name_displayed_as_home_patch \"test_ID_25835_edit_profile_desc\" , \"Bellmore Patch\"\n verify_hometown_change_is_saved \"Bellmore Patch\",\"Garden City Patch\"\n end", "def test_ID_25839_edit_profile_home_patch\n login_as_user1\n go_to_edit_profile_page\n verify_users_default_town_name_displayed_as_home_patch \"test_ID_25835_edit_profile_desc\" , \"Bellmore Patch\"\n verify_hometown_change_is_saved \"Bellmore Patch\",\"Garden City Patch\"\n end", "def test_valid_with_attributes\r\n responsible_party = ResponsibleParty.new\r\n responsible_party.first_name = @responsible_party.first_name\r\n responsible_party.last_name = @responsible_party.last_name\r\n responsible_party.address = @responsible_party.address\r\n responsible_party.city = @responsible_party.city\r\n responsible_party.state = @responsible_party.state\r\n responsible_party.zipcode = @responsible_party.zipcode\r\n assert responsible_party.valid?, responsible_party.errors.full_messages\r\n end", "def refute_valid\n @validator = validator\n refute @validator.validate(data_sample, fail_fast: true)\n refute @validator.validate(data_sample, fail_fast: false)\n end", "def test_save\n verify_save(@pnt)\n end", "def test_check_food_liking_true\n result = check_food_liking(@person3, \"stew\")\n assert_equal(true, result)\n end", "def verify (description, bool_expression)\n puts \"\\n*** #{description} ***\"\n $test_count += 1\n if bool_expression\n puts \"PASS: #{description}\"\n $pass_count += 1\n return 1\n else\n puts \"FAIL: #{description}\"\n $fail_count += 1\n return 0\n end\nend", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_document\n add_test_judgement\n assert(@gold_standard.contains_document? :id => \"doc1\")\n end", "def verify_groups(test_data)\n test_groups = test_data[Org::GROUPS.name]\n errors = []\n test_groups = [{ Org::GROUP.name => ''}] unless test_groups\n test_groups.each_with_index do |test_grp, index|\n text_values_match?(test_grp[Org::GROUP.name], element_value(group_input(index)), errors)\n end\n errors\n end", "def test_existing_file\n assert verify_parameters(['verifier_tests.rb'])\n end", "def test_checks_customer_is_too_drunk__true\n assert_equal(true, @pub1.customer_is_too_drunk(@customer3))\n end", "def test_valid_non_member_registering_in_class\n\t\tregistering_non_member = Enrollment.new(:participantID => participants(:non_member_one).participantID, :courseID => \"nap12345\", :startDate => '18-10-2013')\n\t\tassert Participant.find_by(participantID: registering_non_member.participantID), \"Non Member was not found in Participant database\"\n\t\tassert Course.find_by(courseID: registering_non_member.courseID), \"Course is not in Courses database\"\n\t\t\n\t\t# Checking if the member exists by the expiry date to be greater than tomorrow's date, but if nil or expired date, then participant is not a member\n\t\tmember = Participant.find_by(participantID: registering_non_member.participantID)\n\t\tassert_nil member.expirydate, \"Non Member is a member\"\n\n\t\t# Checking the existence of the pair (courseID,startDate) \n\t\texpected = registering_non_member.startDate\n\t\tactual = Course.find_by(courseID: registering_non_member.courseID)\n\t\tassert_equal expected, actual.startDate, \"Registering Course does not have valid startDate\"\n\n\t\t# Checking the capacity of the course\n\t\tcurrent_enrollment = Enrollments.where(courseID: registering_non_member.courseID).count\n\t\tassert_operator current_enrollment, :<, actual.size, \"The size of the course is full\"\n\n\t\t# Adding proper values before saving\n\t\tregistering_non_member.waitlist_status = 0\n\n\t\tassert registering_non_member.save, \"registering a new valid non member was not saved\"\n\tend", "def verify_functions(test_data)\n test_functions = test_data[Org::FUNCTIONS.name]\n errors = []\n test_functions = [{ Org::FUNCTION.name => ''}] unless test_functions\n test_functions.each_with_index do |test_function, index|\n text_values_match?(test_function[Org::FUNCTION.name], element_value(function_input(index)), errors)\n end\n errors\n end", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end", "def test_is_valid\n\t\ttest_main = Main.new(3, 4, 6)\n\t\tassert_equal test_main.valid_location(\"Enumberable Canyon\"), 0\n\tend", "def test_seqence_valid14\n result = contains_password?(\"password1\")\n refute(result, \"'passwrd123*' should not be valid because it contains a sequence\")\n end", "def verify_authorizations(test_data)\n authorizations = test_data[CoreUseOfCollectionsData::AUTHORIZATION_GRP.name] || [CoreUseOfCollectionsData.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[CoreUseOfCollectionsData::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def test_relevant\n add_test_judgement\n assert(@gold_standard.relevant? :document => \"doc1\", :query => \"query1\")\n end", "def test_gender_with_valid_examples\n person = @valid_person\n Person::VALID_GENDERS.each do |valid_gender|\n person.gender = valid_gender\n assert person.valid?, \"#{valid_gender} should pass validation but doesn't.\"\n end\n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end" ]
[ "0.7881304", "0.6380798", "0.6353641", "0.6246095", "0.6234794", "0.62119454", "0.61281", "0.6124484", "0.6103201", "0.6087095", "0.6020533", "0.6010558", "0.59397715", "0.5916913", "0.58997613", "0.585314", "0.58262813", "0.5813097", "0.58024675", "0.5764486", "0.57613873", "0.57595307", "0.5746539", "0.5741956", "0.5737222", "0.5721643", "0.57117313", "0.57071596", "0.5703168", "0.56837034", "0.5678913", "0.5646133", "0.56439286", "0.56434304", "0.56434304", "0.56419444", "0.56364685", "0.5619074", "0.5615115", "0.5608875", "0.5590518", "0.5587736", "0.55809104", "0.5569922", "0.5555673", "0.5546337", "0.5531183", "0.5527191", "0.5515207", "0.55063635", "0.5502594", "0.55022424", "0.5496533", "0.54929584", "0.5486762", "0.54860115", "0.54842263", "0.5483207", "0.54767996", "0.54686576", "0.546673", "0.54597664", "0.54496455", "0.5446759", "0.5446759", "0.54463464", "0.5444575", "0.5442138", "0.54320866", "0.5431705", "0.542985", "0.5418296", "0.541649", "0.54111207", "0.54108566", "0.54079473", "0.54051524", "0.54037434", "0.5403251", "0.53967947", "0.538365", "0.5373806", "0.53565925", "0.5352037", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169", "0.5350169" ]
0.7840825
1
LOCATIONS Enters locations per a given set of test data
def enter_locations(test_data) locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::LOCATION_LIST.name)], locations) locations.each_with_index do |location, index| logger.info "Entering location data set at index #{index}: #{location}" enter_auto_complete(location_input(index), location_options(index), location[CoreUseOfCollectionsData::LOCATION.name], 'Local Places') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::LOCATION_LIST.name)], locations)\n locations.each_with_index do |location, index|\n enter_auto_complete(location_input(index), location_options(index), location[UseOfCollections::LOCATION.name], 'Local Places')\n end\n end", "def verify_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[UseOfCollections::LOCATION.name], element_value(location_input index)) }\n end", "def verify_locations(test_data)\n locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[CoreUseOfCollectionsData::LOCATION.name], element_value(location_input index)) }\n end", "def seed_locations\n\t\t\tOrganization.find_each do |organization|\n\t\t\t\tadd_two_locations(organization)\n\t\t\tend\n\t\tend", "def enter_pahma_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::LOCATION_LIST.name)], locations)\n locations.each_with_index do |location, index|\n enter_auto_complete(location_input(index), location_options(index), location[UseOfCollections::LOCATION.name], 'PAHMA Places')\n end\n end", "def test_location_1\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 1, locations)\r\n\t\tassert_equal hospital, driver.location\r\n\tend", "def locations; end", "def load_locations\n add_location('Bangalore', 'Belgaum', 24)\n add_location('Bangalore', 'Mysore', 71)\n add_location('Belgam', 'Tumkur', 59)\n add_location('Mandya', 'Mangalore', 141)\n add_location('Tumkur', 'Mandya', 65.5)\n add_location('Mandya', 'Mysore', 101)\n add_location('Belgaum', 'Chickmangalur', 103)\n add_location('Mandya', 'Tumkur', 65)\n add_location('Mangalore', 'Mysore', 169)\n add_location('Mysore', 'Tumkur', 134)\n end", "def test_location_2\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 2, locations)\r\n\t\tassert_equal cathedral, driver.location\r\n\tend", "def test_location_3\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 3, locations)\r\n\t\tassert_equal museum, driver.location\r\n\tend", "def test_update_location_errors\n params = update_params_from_loc(locations(:albion))\n params[:location][:north] = 100\n update_location_error(params)\n end", "def test_location_0\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 0, locations)\r\n\t\tassert_equal hillman, driver.location\r\n\tend", "def locations=(value)\n @locations = value\n end", "def locations=(value)\n @locations = value\n end", "def test_all_locations\r\n\t\toakland = City::new\r\n\t\tfour_locations = [\"Museum\", \"Cathedral\", \"Hospital\", \"Hillman\"]\r\n\t\tassert_includes four_locations, oakland.all_locations[0], oakland.all_locations[1]\r\n\t\tassert_includes four_locations, oakland.all_locations[2], oakland.all_locations[3]\r\n\tend", "def map_locs\n [location]\n end", "def map_locs\n [location]\n end", "def init_paths(locations)\n locations['Enumerable Canyon'].add_paths_to(locations['Duck Type Beach'],\n locations['Monkey Patch City'])\n locations['Duck Type Beach'].add_paths_to(locations['Enumerable Canyon'],\n locations['Matzburg'])\n locations['Monkey Patch City'].add_paths_to(locations['Enumerable Canyon'],\n locations['Matzburg'],\n locations['Nil Town'])\n locations['Nil Town'].add_paths_to(locations['Monkey Patch City'],\n locations['Hash Crossing'])\n locations['Matzburg'].add_paths_to(locations['Duck Type Beach'],\n locations['Monkey Patch City'],\n locations['Hash Crossing'],\n locations['Dynamic Palisades'])\n locations['Hash Crossing'].add_paths_to(locations['Nil Town'],\n locations['Matzburg'],\n locations['Dynamic Palisades'])\n locations['Dynamic Palisades'].add_paths_to(locations['Matzburg'],\n locations['Hash Crossing'])\n rescue StandardError\n raise 'Locations not correctly initialized.'\n end", "def test_update_location_name_errors\n params = update_params_from_loc(locations(:albion))\n params[:location][:display_name] = \"Somewhere Dubious\"\n update_location_error(params)\n end", "def test_sitemap_geos_and_queries\n geos = ['ca', 'co', 'il', 'ny']\n\n geos.each do |loc|\n # Step 1\n params = {\n 'g' => loc,\n 'h_geos' => 0,\n 'h_queries' => 0\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(0, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(0, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 2\n params = {\n 'g' => loc,\n 'h_geos' => 10,\n 'h_queries' => 30\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(10, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(30, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 3\n params = {\n 'g' => loc,\n 'h_geos' => 50,\n 'h_queries' => 100\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(50, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(100, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 4\n params = {\n 'g' => loc\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(50, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(50, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 5\n params = {\n 'g' => loc,\n 'h_geos' => 100,\n 'h_queries' => 1000\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(50, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(100, @parsed_response['Queries']['NumFound'], @parsed_response)\n end\n end", "def locations\n locations_res.data.locations.map {|loc| location_res_to_map(loc)}\n end", "def test_update_location_user_merge\n to_go = locations(:burbank)\n to_stay = locations(:albion)\n params = update_params_from_loc(to_go)\n params[:location][:display_name] = to_stay.display_name\n loc_count = Location.count\n desc_count = LocationDescription.count\n past_loc_count = Location::Version.count\n past_desc_count = LocationDescription::Version.count\n post_requires_login(:edit_location, params)\n assert_response(:action => :show_location)\n assert_equal(loc_count-1, Location.count)\n assert_equal(desc_count, LocationDescription.count)\n assert_equal(past_loc_count-1, Location::Version.count)\n assert_equal(past_desc_count, LocationDescription::Version.count)\n assert_equal(10 - @new_pts, @rolf.reload.contribution)\n end", "def test_success_multiple_results\n return unless prepare_response(:success_multiple_results)\n\n location = Location.new(\n :street => \"Queen St W\",\n :locality => \"Toronto\",\n :region => \"ON\",\n :postal_code => nil,\n :country => \"CA\",\n :longitude => -79.4125590,\n :latitude => 43.6455030,\n :precision => :street\n )\n assert_equal location, @geocoder.locate('Queen St West, Toronto, ON CA')\n end", "def update!(**args)\n @location_names = args[:location_names] if args.key?(:location_names)\n end", "def update!(**args)\n @location_names = args[:location_names] if args.key?(:location_names)\n end", "def update!(**args)\n @location_names = args[:location_names] if args.key?(:location_names)\n end", "def locations_to_coverage_and_placenames\n [lambda {|d|\n d.locations? and d.locations.size > 0 },\n lambda {|d|\n d.coverage = d.locations.select {|l|\n l.north? and l.east? and l.south? and l.west?\n }.map {\n |l|\n { :north => l.north, :east => l.east, :south => l.south, :west => l.west }\n }\n d.placenames = d.locations.map {|l| l.area}.map {|area|\n case area\n when \"dronning_maud_land\"\n {\"placename\"=>\"Dronning Maud Land\", \"country\" => \"AQ\" }\n when \"svalbard\"\n {\"placename\"=>\"Svalbard\", \"country\" => \"NO\" }\n else {\"placename\"=>area}\n end\n }.select{|p|not p.nil? and not p[\"placename\"] =~ /norway|arctic|antartic/ }.uniq\n d.delete :locations\n d\n }]\n end", "def in_game_tests_suite\n :locations\n end", "def set_locations(items, location)\n items.each do |item|\n item.move_to(location)\n item.save\n end\n end", "def set_Locations(value)\n set_input(\"Locations\", value)\n end", "def fill_locations\n location_id = Location.where(:id => params[:id], :sti_type => params[:sti_type].camelize).first\n location_code = params[:code].present? ? Location.where(:code => params[:code], :sti_type => params[:sti_type].camelize).first : nil\n @location = location_id.nil? ? location_code : location_id\n if @location\n @ok = true\n @locations = @location.select_with_selected(false)\n else\n @ok = false\n end\n end", "def locations\n # blank\n end", "def client_locations\n @entries = @locations\n end", "def perform(locs)\n Location.create_all(self, locs[0..LOCS_LIMIT])\n results = []\n self.locations.each do |loc|\n results_in_loc = self.call_api(loc)\n results_in_loc.each do |item| \n results << self.simplify(item)\n end\n end\n results.uniq.sort_by_date\n end", "def find_lat_long_for_many_sites(missing_lat_long_sites)\n missing_lat_long_sites.each do |missing_lat_long_site|\n find_lat_long_for_individual_site(missing_lat_long_site)\n end\nend", "def update_location\n # Get all empty records\n to_update = Restaurant.where(longitude: [false, nil, 1.0])\n # Update each\n to_update.each do |restaurant|\n restaurant.address\n long_lat = Location.long_lat(restaurant.address)\n Restaurant.where({id: restaurant.id}).update_all({longitude: long_lat[:longitude], latitude: long_lat[:latitude]})\n end\n end", "def locations\n @locations = Location.where(fragment: @scenario.fragments).order(:id).page params[:page]\n end", "def update!(**args)\n @locations = args[:locations] if args.key?(:locations)\n end", "def update!(**args)\n @locations = args[:locations] if args.key?(:locations)\n end", "def update!(**args)\n @locations = args[:locations] if args.key?(:locations)\n end", "def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n validLocations = []\n\n validLocations = Location.where(\"latitude > ? AND latitude < ? AND longitude > ? AND longitude < ?\", swlat, nelat, swlng, nelng)\n validLocations = validLocations.sort_by { |k| k[\"latitude\"] }\n validLocations = validLocations[0..49]\n\n validLocations.each do|loc|\n @locations << loc.to_hash_with_follow(user_id)\n end\n\n end", "def create_simple_locations(locations)\n simple_locations = []\n unless locations.blank?\n locations.each do |location|\n next unless location.geocoded?\n\n simple_locations.push create_simple_location(location)\n end\n end\n simple_locations\n end", "def locations\n locations = Occi::Core::Locations.new\n\n all(params[:entity]).each do |bt|\n bt_ids = backend_proxy_for(bt).identifiers\n locations_from(bt_ids, bt, locations)\n end\n return if locations.empty?\n\n respond_with locations\n end", "def map_locs\n itineraries.collect(&:location)\n end", "def test_other_start_location_false\r\n\t\tmock_driver = Minitest::Mock::new\r\n\t\tdef mock_driver.get_start_location; 3; end\r\n\t\toakland = City::new\r\n\t\tstart_loc = oakland.all_locations[mock_driver.get_start_location]\r\n\t\trefute_includes start_loc, oakland.downtown[0]\r\n\t\trefute_includes start_loc, oakland.monro[0]\r\n\tend", "def update!(**args)\n @location_list = args[:location_list] if args.key?(:location_list)\n end", "def create_locations\n LOGGER.add 0, 'INFO: Beginning location generation'\n overpass = OverpassAPI.new(timeout: TIMEOUT, json: true)\n\n row = 0\n total = 0\n\n # rubocop:disable Metrics/BlockLength\n (GLOBAL_BOUNDARIES[:s]...GLOBAL_BOUNDARIES[:n]).step(STEP) do |ns|\n row += 1\n column = 0\n\n (GLOBAL_BOUNDARIES[:w]...GLOBAL_BOUNDARIES[:e]).step(STEP) do |ew|\n column += 1\n total += 1\n attempts = 0\n boundaries = { s: ns, n: ns + STEP, w: ew, e: ew + STEP }\n LOGGER.add 0, \"INFO: Beginning row #{row}, column #{column} (#{boundaries})\"\n\n begin\n attempts += 1\n overpass.query(query(boundaries)).slice_before { |result| result[:type] == 'node' }.each do |node_set|\n node_group = node_set.group_by { |item| item[:type] }\n\n streets = node_group['way']\n next if streets.blank?\n\n # We're only concerned with certain streets\n streets = streets.select { |way| way[:tags][:highway].present? }\n streets = streets.select { |way| way[:tags][:name].present? }\n streets = streets.select { |way| %w[footway cycleway path service track].exclude? way[:tags][:highway] }\n\n # Deduplicate names on four fields if they are present\n streets = streets.uniq { |way| strip_direction(way[:tags][:name]) }\n streets = streets.uniq { |way| strip_direction(way[:tags][:name_1]) || rand }\n streets = streets.uniq { |way| way[:tags][:'tiger:name_base'] || rand }\n streets = streets.uniq { |way| way[:tags][:'tiger:name_base_1'] || rand }\n\n streets = streets.map { |way| way[:tags][:name] }\n streets = streets.sort_by { |way| way.scan(/(?=\\d)/).length }.reverse\n\n node = node_group['node'].first\n next if node.blank?\n\n lat_lon_duplicate = Location.where(latitude: node[:lat], longitude: node[:lon]).first\n\n street_duplicate = Location.where(\n '(street1 = ? AND street2 = ?) OR (street2 = ? AND street1 = ?)',\n streets.first,\n streets.second,\n streets.first,\n streets.second,\n ).first\n\n if lat_lon_duplicate.present?\n LOGGER.add(\n 0,\n 'WARN: Found multiple street pairs at same lat/lon. '\\\n \"Found #{streets.first} & #{streets.last}, had #{street_duplicate}\",\n )\n elsif streets.try(:length) != 2\n LOGGER.add 0, \"WARN: Node didn't have 2 ways #{streets} (#{node[:lat]}, #{node[:lon]})\"\n elsif street_duplicate.present?\n LOGGER.add(\n 0,\n \"INFO: Adding #{humanize_street(streets.first)} & #{humanize_street(streets.second)} \"\\\n 'at midpoint & removed previous location',\n )\n Location.create!(\n latitude: (street_duplicate.latitude + node[:lat]) / 2,\n longitude: (street_duplicate.longitude + node[:lon]) / 2,\n active: false,\n street1: streets.first,\n street2: streets.second,\n name: \"#{humanize_street(streets.first)} & #{humanize_street(streets.second)}\",\n )\n street_duplicate.destroy!\n else\n LOGGER.add 0, \"INFO: Adding #{humanize_street(streets.first)} & #{humanize_street(streets.second)}\"\n Location.create!(\n latitude: node[:lat],\n longitude: node[:lon],\n active: false,\n street1: streets.first,\n street2: streets.second,\n name: \"#{humanize_street(streets.first)} & #{humanize_street(streets.second)}\",\n )\n end\n end\n rescue StandardError => e\n if attempts <= RETRIES\n LOGGER.add 0, \"WARN: Encountered error, retry #{attempts} of #{RETRIES}\"\n sleep(attempts < RETRIES ? PAUSE : TIMEOUT)\n retry\n else\n LOGGER.add 0, \"ERROR: #{e.message}\"\n end\n ensure\n sleep(PAUSE)\n end\n end\n # rubocop:enable Metrics/BlockLength\n end\n LOGGER.add 0, \"INFO: Total requests: #{total}\"\n end", "def map_locations # :nologin: :norobots:\n @query = find_or_create_query(:Location)\n if @query.flavor == :all\n @title = :map_locations_global_map.t\n else\n @title = :map_locations_title.t(:locations => @query.title)\n end\n @query = restrict_query_to_box(@query)\n @timer_start = Time.now\n columns = %w(name north south east west).map {|x| \"locations.#{x}\"}\n args = { :select => \"DISTINCT(locations.id), #{columns.join(', ')}\" }\n @locations = @query.select_rows(args).map do |id, name, n,s,e,w|\n MinimalMapLocation.new(id, name, n,s,e,w)\n end\n @num_results = @locations.count\n @timer_end = Time.now\n end", "def initialize\n @locations = []\n l00 = Location.new\n l00.coordinates.insert(0, 0, 0)\n l03 = Location.new\n l03.coordinates.insert(0, 0, 3)\n l06 = Location.new\n l06.coordinates.insert(0, 0, 6)\n l11 = Location.new\n l11.coordinates.insert(0, 1, 1)\n l13 = Location.new\n l13.coordinates.insert(0, 1, 3)\n l15 = Location.new\n l15.coordinates.insert(0, 1, 5)\n l22 = Location.new\n l22.coordinates.insert(0, 2, 2)\n l23 = Location.new\n l23.coordinates.insert(0, 2, 3)\n l24 = Location.new\n l24.coordinates.insert(0, 2, 4)\n l30 = Location.new\n l30.coordinates.insert(0, 3, 0)\n l31 = Location.new\n l31.coordinates.insert(0, 3, 1)\n l32 = Location.new\n l32.coordinates.insert(0, 3, 2)\n l34 = Location.new\n l34.coordinates.insert(0, 3, 4)\n l35 = Location.new\n l35.coordinates.insert(0, 3, 5)\n l36 = Location.new\n l36.coordinates.insert(0, 3, 6)\n l42 = Location.new\n l42.coordinates.insert(0, 4, 2)\n l43 = Location.new\n l43.coordinates.insert(0, 4, 3)\n l44 = Location.new\n l44.coordinates.insert(0, 4, 4)\n l51 = Location.new\n l51.coordinates.insert(0, 5, 1)\n l53 = Location.new\n l53.coordinates.insert(0, 5, 3)\n l55 = Location.new\n l55.coordinates.insert(0, 5, 5)\n l60 = Location.new\n l60.coordinates.insert(0, 6, 0)\n l63 = Location.new\n l63.coordinates.insert(0, 6, 3)\n l66 = Location.new\n l66.coordinates.insert(0, 6, 6)\n @locations.push([l00, nil, nil, l03, nil, nil, l06])\n @locations.push([nil, l11, nil, l13, nil, l15, nil])\n @locations.push([nil, nil, l22, l23, l24, nil, nil])\n @locations.push([l30, l31, l32, nil, l34, l35, l36])\n @locations.push([nil, nil, l42, l43, l44, nil, nil])\n @locations.push([nil, l51, nil, l53, nil, l55, nil])\n @locations.push([l60, nil, nil, l63, nil, nil, l66])\n end", "def editable_locations\n if is_super_admin?\n Location.by_name\n elsif self.region\n res = []\n region.locations.each do |lok|\n res += [lok] + lok.locations\n end\n res\n elsif self.location\n [location] + self.location.locations\n else\n []\n end\n end", "def test_get_location_many\n loc = MiniTest::Mock.new(\"target location\")\n def loc.name; @delegator; end\n @mp.add_location loc\n\n (1..30).each do |i|\n location = MiniTest::Mock.new(\"location #{i}\")\n def location.name; @delegator; end\n @mp.add_location location\n end\n\n assert_equal loc, @mp.get_location(\"target location\")\n end", "def compare_locations?(locatin_from, location_to)\n\t\t# location_to.title == locatin_from.title &&\n\t\tlocation_to.city == locatin_from.city &&\t\t\n\t\tlocation_to.custom_address == locatin_from.custom_address &&\n\t\t# location_to.custom_address_use == locatin_from.custom_address_use &&\n\t\t# location_to.gmap_use == locatin_from.gmap_use &&\n\t\t# location_to.gmaps == locatin_from.gmaps &&\n\t\tlocation_to.latitude == locatin_from.latitude &&\n\t\tlocation_to.longitude == locatin_from.longitude\n\t\t# location_to.title == locatin_from.title\n end", "def index\n @specific_locations = SpecificLocation.all\n end", "def printLocations\n puts(\"Locations for #{@arguments[@arguments.length - 1]}:\")\n # print each location on its own line\n for i in 0..@locations.length - 1 \n puts(\"\\t#{@locations[i]}\")\n end # -- end for loop for printing locations \n end", "def locate_pins(location); end", "def list_locations\n query = create_query(:Location, :all, by: default_sort_order)\n show_selected_locations(query, link_all_sorts: true)\n end", "def link_to_locations\n\n # Remove any existing links\n # (this method is used in both create and update)\n Visit.where(tour_id: @tour.id).each(&:destroy)\n\n # Create new links\n got_start_location = false\n (1..10).each do |i|\n\n # Grab a location id from the parameters\n # Be forgiving\n # No such key? Okay, set to -1 (flag for no location in this itinerary slot)\n selected_location_id =\n tour_params[\"location\" + i.to_s] ?\n tour_params[\"location\" + i.to_s].to_i :\n -1\n\n # Create visits relationship (or skip to next iteration)\n next unless selected_location_id.positive?\n new_visits_rel = Visit.new(\n tour_id: @tour.id,\n location_id: selected_location_id\n )\n new_visits_rel.save\n\n # Create starts at relationship (or skip to next iteration)\n next if got_start_location\n new_start_at_rel = StartAt.new(\n tour_id: @tour.id,\n location_id: selected_location_id\n )\n new_start_at_rel.save\n got_start_location = true\n\n end\n\n # Gotta have at least one location in the itinerary\n # https://stackoverflow.com/questions/5320934/how-to-add-custom-errors-to-the-user-errors-collection\n unless got_start_location\n @tour.errors[:base] << \"A tour must have at least one location\"\n end\n\n end", "def locations\n self.veterinarians.pluck(:name, :location).map {|x| x.join(\" \")}\n end", "def set_remote_locations(locations:)\n {\n method: \"Target.setRemoteLocations\",\n params: { locations: locations }.compact\n }\n end", "def npc_unit_locations\n fields = \"location_x, location_y\"\n without_locking do\n Unit.in_zone(self).select(fields).group(fields).where(:player_id => nil).\n c_select_all\n end.each_with_object(Set.new) do |row, set|\n set.add SolarSystemPoint.new(id, row['location_x'], row['location_y'])\n end\n end", "def list\n # list possible locations \n\n @location_suggest = get_location_suggest\n\n if params[:location]\n locations = WoeidHelper.search_by_name params[:location]\n if not locations.nil? and locations.count == 1\n set_location locations[0]\n else\n @location_asked = locations\n end\n end\n end", "def cleanup_locations\n Location.all.each do |location|\n location.destroy if has_different_location_uid?(location)\n end\n end", "def locations\n profile = \"http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-InsurancePlanLocation\"\n bundle = @client.search(FHIR::Location, search: { parameters: { _profile: profile } }).resource&.entry || []\n areas = bundle.each_with_object({}) do |entry, areahashbyid|\n areahashbyid[entry.resource.id] = Location.new(entry.resource)\n end\n\n areas.deep_symbolize_keys\n end", "def load_location_setup\n location_json = JSON.parse '{\"name\": \"test\", \"max_rubies\": 5, \"max_fake_rubies\": 10}'\n @json_location = Location.load_location(location_json)\n end", "def save_locations(locations)\n File.open('location_data.json', 'w') do |file|\n file.puts locations\n end\n end", "def test_republicize\n locations = UserLocation.find_public_by_user(users(:quentin))\n locations.each do |l|\n assert l.publicize!\n end\n end", "def test_new_location\n\t\t@new_driver.location 'Cathedral'\n\t\tassert_equal 'Hillman', @new_driver.location('Hillman')\n\tend", "def test_create_all_locations\n\t\ttest_main = Main.new(3, 4, 6)\n\t\ttest_graph = Graph.new(10)\n\t\ttest_main.create_all_locations(test_graph)\n\t\tassert_equal test_main.num_locations(test_graph), 7\n\tend", "def xref_locations_and_team_members\n locations = {}\n @site_data['team'].each do |unused_name, member|\n member_location = member['location']\n if member_location\n unless locations.member? member_location\n locations[member_location] = []\n end\n locations[member_location] << member\n end\n end\n locations = locations.to_a\n @site_data['locations'] = locations.sort! unless locations.empty?\n end", "def locationsPrepare(locationsAdded)\n locations_edit = []\n locationsAdded.each do |location|\n loc = location\n if location.include? ','\n loc = to_state(location[-2..-1])\n end\n locations_edit.push(loc) unless locations_edit.include? loc\n end\n return locations_edit\n end", "def test_locations_of_fourth_ave\n\t\tassert_equal \"Cathedral\", @road2.locations[0]\n\tend", "def update\n @locations = []\n @errors = []\n @hide_map = true\n if params.has_key? :id\n location = Location.find(params[:id])\n @locations = [ location ]\n location_params = params.clone\n [:created_at, :id, :updated_at, :category, :subcategories, :markerVisible, :action, :controller, :location].each do |param|\n location_params.delete param\n end\n location.update_attributes location_params\n @errors = location.errors\n elsif params.has_key? :locations\n params[:locations][:location].each do |data|\n l = Location.find data[0]\n if not l.update_attributes data[1]\n pp l.errors\n @errors.push l.errors\n end\n @locations.push l\n end\n end\n\n respond_to do |format|\n if @errors.empty?\n format.html { redirect_to :locations, :notice => 'Locations successfully updated.'}\n format.json { head :no_content }\n else\n format.html { render :action =>\"edit\" }\n format.json { render :json => @errors, :status => :unprocessable_entity }\n end\n end\n end", "def each\n @locations.each do |x|\n yield(x)\n end\n end", "def test_monkey_patch_city\n initialize_map\n monkey_patch_city = @locations.get_location 'Monkey Patch City'\n assert_equal 'Monkey Patch City', monkey_patch_city.name_reader\n\n assert_equal 1, monkey_patch_city.max_real_reader\n assert_equal 1, monkey_patch_city.max_fake_reader\n\n assert_equal 'Enumerable Canyon', monkey_patch_city.neighbors_reader[0].name_reader\n assert_equal 'Matzburg', monkey_patch_city.neighbors_reader[1].name_reader\n assert_equal 'Nil Town', monkey_patch_city.neighbors_reader[2].name_reader\n end", "def get_related_locations(location_ids, output_directory)\n specific_locations = LOCATIONS.find_all { |loc| location_ids.include?(loc[:id]) }\n generate_ndjson(\"Location\", specific_locations, output_directory)\nend", "def get_locations\n location_references =\n lighthouse_appointments.each_with_object({}) do |appt, acc|\n reference = appt.resource.participant.first.actor.reference\n location_id = reference.match(ID_MATCHER)[1]\n\n acc[location_id] ||= []\n acc[location_id] << appt\n end\n\n clinic_identifiers = location_references&.keys&.join(',')\n location_response = location_service.search(_id: clinic_identifiers, _count: '100')\n\n location_response&.resource&.entry\n end", "def get_all_locations\n @locations = []\n results = Location.all\n results.each do |loc|\n @locations << loc.to_hash\n end\n end", "def test_all\n coords = all_combos\n coords.each do |c|\n find_route(c[0], c[1])\n end\nend", "def location_changed!\n east = location.east_units\n west = location.west_units\n\n north = location.north_units\n south = location.south_units\n\n # NOTE: expectation is 1 of the paired directions will be zero.\n calculate_location_opposite east: east, west: west, north: north, south: south\n calculate_location_right east: east, west: west, north: north, south: south\n calculate_location_left\n end", "def test_list_locations()\n\n # Perform the API call through the SDK function\n result = @controller.list_locations()\n\n # Test response code\n assert_equal(200, @response_catcher.response.status_code)\n end", "def get_all_locations\n @locations = []\n Location.all.each do |loc|\n @locations << loc.to_hash\n end\n end", "def index\n @finder_locations = Location.select { |location| location.finder_id == current_user.id }\n @target_locations = Location.select { |location| location.target_id == current_user.id }\n end", "def test_driver_checkLocation_mid\n\t\td = Driver::new(\"Driver 1\",1)\n\t\td.checkLocation\n\t\t# assert_equal d.classes, 2\n\t\td.setLocation 1 #from cathedral go to museum\n\t\td.checkLocation\n\t\tassert_equal [2,1], [d.classes,d.dinotoys]\n\t\t#assert_equal d.dinotoys, 1\n\tend", "def set_current_weather(locations)\n lower_bound = Time.zone.now - 30.minutes\n loc_ids = []; distances = []\n locations.each do |loc, i|\n if !loc[:loc].last_update.nil? and loc[:loc].last_update > lower_bound\n loc_ids << loc[:id]\n distances << loc[:distance]\n end\n end\n loc_ids = loc_ids[0..1]; distances = distances[0..1]\n return if !loc_ids.compact.any?\n MEASUREMENTS.each do |m|\n values = []\n loc_ids.each do |lid|\n obs = Observation.where(location_id: lid).last\n return if obs.nil?\n values << obs.rainfall.intensity if (m == \"rain\")\n values << obs.temperature.temp if (m == \"temp\")\n values << obs.wind.speed if (m == \"wind_speed\")\n values << obs.wind.bearing if (m == \"wind_direction\")\n end\n agg = Observation.aggregate(values, distances).round(2)\n agg = agg.abs.to_s + \"mm/h\" if(m == \"rain\")\n agg = agg.abs.to_s + \"km/h\" if(m == \"wind_speed\")\n agg = Wind.bearing_to_cardinal(agg).to_s if (m == \"wind_direction\")\n agg = agg.to_s if (m == \"temp\")\n @data[\"0\"][m][\"value\"] = agg\n @data[\"0\"][m][\"probability\"] = \"1\"\n\n end\n end", "def locations\n unless defined?(@locations)\n @locations=[]\n for loc in Location.order(\"id ASC\").includes(:bottom_right_coordinate, :top_left_coordinate)\n @locations << loc if do_overlap_with?(loc.area)\n end \n end \n @locations\n end", "def locations\n locations_params = Hashie::Mash.new( {f: params.f} )\n response = make_request(LOCATIONS_BASE, locations_params)\n return not_available (response) unless response.status == 200\n response_body = Hashie::Mash.new(JSON.parse(response.body))\n response_body.data\n end", "def each\n return enum_for(:each) unless block_given?\n locations.each do |location|\n yield location\n end\n end", "def setupLocation(_map) \n raise \"not defined\" ;\n end", "def get_locations( fsl = true )\n loc = run( 'http://' + domain + '/redetrack/bin/mylocations.php?pid=249&rnd=3865&uid=2366&org=33&rdt_site_id=222&si=243')\n loc.column(1).delete\n loc.range('D:G').delete\n loc.insert_rows( 1, 1 )\n loc['A1:C1'] = [ 'Name', 'City', 'Parent Location' ]\n hash = {}\n loc.rows(2) do |row|\n hash[ row['A'].upcase.strip ] = if row['B'].nil? || row['B'] !~ /Milton Keynes/i \n fsl ? 'FSL' : ( row['B'].nil? ? 'Blank' : row['B'] )\n else \n 'MILTON KEYNES'\n end\n end\n hash\n end", "def list_locations # :nologin:\n query = create_query(:Location, :all, :by => :name)\n show_selected_locations(query, :link_all_sorts => true)\n end", "def list_dubious_locations # :nologin:\n query = create_query(:Location, :all, :by => :name)\n show_selected_locations(query, :link_all_sorts => true,\n :action => :list_dubious_locations, :num_per_page => 1000)\n end", "def get_locations(user_entered_location)\n if user_entered_location.include? \"Arat kilo\"\n user_entered_location = \"4 Kilo\"\n end\n location = user_entered_location.to_s + \" Addis Ababa Ethiopia\"\n location = location.gsub!(\" \", \"+\")\n @google_locations = HTTParty.get(URI::encode(API_BASE_URL + location.to_s + APP_KEY))\n #Get Results from Google\n @result = Array.new\n @google_location_names = Array.new\n @google_locations['results'].each do |google_location|\n if(google_location['address_components'][0]['long_name'] != \"Addis Ababa\")\n location = Hash.new\n location['name'] = google_location['address_components'][0]['long_name']\n location['lat'] = google_location['geometry']['location']['lat']\n location['long'] = google_location['geometry']['location']['lng']\n @google_location_names.push(location['name'])\n @result.push(location)\n end\n end\n #Get Results from system\n @sys_locations = Location.where(\"location_name Like '%#{user_entered_location}%'\")\n @sys_locations.each do |sys_location|\n if(! @google_location_names.include? sys_location.location_name)\n location = Hash.new\n location['name'] = sys_location.location_name\n location['lat'] = sys_location.latitude\n location['long'] = sys_location.longitude\n @result.push(location)\n end\n end\n return @result\n end", "def set_map\n # Sets locations on the map\n @map = [\n ['Enumerable Canyon', 'Duck Type Beach', 'Monkey Patch City'],\n ['Duck Type Beach', 'Enumerable Canyon', 'Matzburg'],\n ['Monkey Patch City', 'Nil Town', 'Enumerable Canyon', 'Matzburg'],\n ['Nil Town', 'Monkey Patch City', 'Hash Crossing'],\n ['Matzburg', 'Monkey Patch City', 'Duck Type Beach', 'Hash Crossing', 'Dynamic Palisades'],\n ['Hash Crossing', 'Matzburg', 'Nil Town', 'Dynamic Palisades'],\n ['Dynamic Palisades', 'Matzburg', 'Hash Crossing']\n ]\n end", "def set_location_coordinates\n address = \"#{self.address.gsub('|', '+')}+\" +\n \", #{self.city}+\" +\n \", #{self.state unless self.state.nil?}+\" +\n \"#{self.country}\"\n address.gsub!(' ', '+')\n GetLocationCoordinatesJob.perform_later(self, address)\n end", "def define_locations_weights(entities)\n locations = []\n locations_weights = {}\n is_areas = false\n is_populations = false\n\n max_population = 0\n max_population_location = nil\n\n ru_locations = []\n\n entities.each do |entity|\n entity.locations.each do |location|\n locations << location\n locations_weights[location] = 0.5\n\n if location.category == COUNTRY\n locations_weights[location] = 0.75\n else\n if location.category == RUSSIA\n unless ru_locations.include?(location)\n ru_locations << location\n end\n elsif not is_areas and location.fclass != POPULATION_CLASS\n is_areas = true\n end\n\n if location.category != WORLD_POPULATION and location.fclass == POPULATION_CLASS\n is_populations = true\n if location.population > max_population\n max_population = location.population\n max_population_location = location\n end\n end\n end\n end\n end\n\n # delete Russia from location if there are russian areas or towns in locations\n if ru_locations.present? and (is_areas or is_populations)\n ru_locations.each do |ru_loc|\n locations_weights.delete(ru_loc)\n locations.delete(ru_loc)\n end\n end\n\n unless max_population_location.nil?\n locations_weights[max_population_location] = 0.9\n end\n\n if locations.count == 1\n locations_weights[locations.first] = 0.95\n else\n locations.each do |location|\n if locations.count(location) > 1\n locations_weights[location] = 0.8\n end\n\n if location.fclass == POPULATION_CLASS\n flag = false\n\n # remove areas which contain this population\n locations.each do |l|\n if l.acode == location.acode and l.fclass != POPULATION_CLASS\n locations_weights[location] = 0.9\n locations_weights.delete(l)\n locations.delete(l)\n\n flag = true\n end\n end\n\n if flag\n # save only population which belongs to some area\n # and delete other populations with that name\n locations.each do |loc|\n if loc.name == location.name and loc.geonameid != location.geonameid\n locations_weights.delete(loc)\n locations.delete(loc)\n end\n end\n end\n\n if not flag and not is_areas and locations_weights[location] < 0.7\n locations_weights[location] = 0.7\n end\n end\n end\n end\n\n deleted = []\n\n # if there are populations with same names\n # save only one with max population\n locations.each_with_index do |loc, index|\n if deleted.include?(loc)\n next\n end\n\n (index + 1).upto(locations.count - 1) do |index2|\n loc2 = locations[index2]\n\n if deleted.include?(loc2)\n next\n end\n\n if loc.name == loc2.name and loc != loc2\n if loc.fclass == ADMINISTRATIVE_CLASS and loc2.fclass == POPULATION_CLASS\n deleted << loc2\n next\n end\n\n # global toponyms have more priority than russian\n if loc2.category == COUNTRY\n deleted << loc\n else\n if loc.population >= loc2.population\n deleted << loc2\n else\n deleted << loc\n end\n end\n end\n\n # delete similar locations with different names\n if loc.geonameid == loc2.geonameid and loc.name != loc2.name\n deleted << loc2\n end\n end\n end\n\n deleted.each do |d|\n locations_weights.delete(d)\n end\n\n locations_weights.sort_by {|k,v| v}.reverse[0...3]\n end", "def test_possible_location_from_museum_if_rand_is_one\r\n\t\toakland = City::new\r\n\t\trand_val = 1\r\n\t\thillman = oakland.generate_museum_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal hillman[0], \"Hillman\"\r\n\t\tassert_equal hillman[1][0], \"Fifth Ave.\"\r\n\tend", "def get_all_locations\n @locations = []\n\n Location.all.each do|loc|\n @locations << loc.to_hash\n end\n end", "def locations\n\t\t[]\n\tend", "def index\n\t\t# Set a variable for all approved locations that a user can add.\n\t\t@approved_locations = Location.where(verified: true) - current_user.locations\n\n\t\t# Set a variable for all locations that are still pending admin approval\n\t\t@pending_locations = Location.where(verified: false)\n\t\n\t\t# Current user locations sorted alphabetically\n\t\tuser = User.find(current_user)\n\t\t@my_locations = user.locations.sort! { |a,b| a.name <=> b.name }\n\tend", "def test_possible_location_from_museum_if_rand_is_zero\r\n\t\toakland = City::new\r\n\t\trand_val = 0\r\n\t\tcathedral = oakland.generate_museum_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal cathedral[0], \"Cathedral\"\r\n\t\tassert_equal cathedral[1][0], \"Bar St.\"\r\n\tend" ]
[ "0.7358205", "0.7197582", "0.7186002", "0.66445935", "0.66213596", "0.65132487", "0.65008503", "0.6458574", "0.64343363", "0.64279574", "0.6394133", "0.6322496", "0.6299176", "0.6299176", "0.6274033", "0.61833894", "0.61833894", "0.61792886", "0.6113836", "0.6078811", "0.6038804", "0.6027931", "0.5978116", "0.59388", "0.59388", "0.59388", "0.59264064", "0.58898586", "0.58443063", "0.58396", "0.580322", "0.57860136", "0.57775474", "0.5775767", "0.57693094", "0.57500714", "0.5730062", "0.5728631", "0.5728282", "0.5728282", "0.5720522", "0.570568", "0.5689401", "0.5686605", "0.5676653", "0.56766313", "0.5660965", "0.5649089", "0.56445444", "0.5641249", "0.5630052", "0.5618874", "0.561513", "0.5608663", "0.5586783", "0.5574188", "0.5566459", "0.5527416", "0.55248284", "0.55017537", "0.5480776", "0.54802555", "0.5470826", "0.54614335", "0.5459274", "0.544999", "0.54477924", "0.544163", "0.54412585", "0.54361504", "0.54361075", "0.54348046", "0.54309946", "0.5430199", "0.54294664", "0.542515", "0.54223174", "0.54196584", "0.5416353", "0.54161423", "0.5413898", "0.5413677", "0.54103506", "0.5406114", "0.5399744", "0.53901505", "0.53882796", "0.53867817", "0.5384121", "0.53802353", "0.53780866", "0.5366044", "0.536403", "0.5356981", "0.53559256", "0.5354967", "0.53501904", "0.5348497", "0.5348118", "0.53415364" ]
0.7382622
0
Verifies locations match a given set of test data
def verify_locations(test_data) locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}] locations.each_with_index { |location, index| verify_values_match(location[CoreUseOfCollectionsData::LOCATION.name], element_value(location_input index)) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n locations.each_with_index { |location, index| verify_values_match(location[UseOfCollections::LOCATION.name], element_value(location_input index)) }\n end", "def test_success_multiple_results\n return unless prepare_response(:success_multiple_results)\n\n location = Location.new(\n :street => \"Queen St W\",\n :locality => \"Toronto\",\n :region => \"ON\",\n :postal_code => nil,\n :country => \"CA\",\n :longitude => -79.4125590,\n :latitude => 43.6455030,\n :precision => :street\n )\n assert_equal location, @geocoder.locate('Queen St West, Toronto, ON CA')\n end", "def test_all_locations\r\n\t\toakland = City::new\r\n\t\tfour_locations = [\"Museum\", \"Cathedral\", \"Hospital\", \"Hillman\"]\r\n\t\tassert_includes four_locations, oakland.all_locations[0], oakland.all_locations[1]\r\n\t\tassert_includes four_locations, oakland.all_locations[2], oakland.all_locations[3]\r\n\tend", "def compare_locations?(locatin_from, location_to)\n\t\t# location_to.title == locatin_from.title &&\n\t\tlocation_to.city == locatin_from.city &&\t\t\n\t\tlocation_to.custom_address == locatin_from.custom_address &&\n\t\t# location_to.custom_address_use == locatin_from.custom_address_use &&\n\t\t# location_to.gmap_use == locatin_from.gmap_use &&\n\t\t# location_to.gmaps == locatin_from.gmaps &&\n\t\tlocation_to.latitude == locatin_from.latitude &&\n\t\tlocation_to.longitude == locatin_from.longitude\n\t\t# location_to.title == locatin_from.title\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def test_location_3\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 3, locations)\r\n\t\tassert_equal museum, driver.location\r\n\tend", "def test_driver_checkLocation_mid\n\t\td = Driver::new(\"Driver 1\",1)\n\t\td.checkLocation\n\t\t# assert_equal d.classes, 2\n\t\td.setLocation 1 #from cathedral go to museum\n\t\td.checkLocation\n\t\tassert_equal [2,1], [d.classes,d.dinotoys]\n\t\t#assert_equal d.dinotoys, 1\n\tend", "def locationsCompare(arr1, arr2)\n if arr2.length == 0\n return false\n elsif arr1.length != arr2.length || arr1 & arr2 != arr1\n return true\n end\n return false\n end", "def test_locations_of_fourth_ave\n\t\tassert_equal \"Cathedral\", @road2.locations[0]\n\tend", "def test_location_1\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 1, locations)\r\n\t\tassert_equal hospital, driver.location\r\n\tend", "def verify_foundation_place(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_PLACE.name], element_value(foundation_place_input), errors)\n errors\n end", "def test_location_2\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 2, locations)\r\n\t\tassert_equal cathedral, driver.location\r\n\tend", "def enter_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::LOCATION_LIST.name)], locations)\n locations.each_with_index do |location, index|\n enter_auto_complete(location_input(index), location_options(index), location[UseOfCollections::LOCATION.name], 'Local Places')\n end\n end", "def test_is_valid\n\t\ttest_main = Main.new(3, 4, 6)\n\t\tassert_equal test_main.valid_location(\"Enumberable Canyon\"), 0\n\tend", "def test_other_start_location_false\r\n\t\tmock_driver = Minitest::Mock::new\r\n\t\tdef mock_driver.get_start_location; 3; end\r\n\t\toakland = City::new\r\n\t\tstart_loc = oakland.all_locations[mock_driver.get_start_location]\r\n\t\trefute_includes start_loc, oakland.downtown[0]\r\n\t\trefute_includes start_loc, oakland.monro[0]\r\n\tend", "def enter_locations(test_data)\n locations = test_data[CoreUseOfCollectionsData::LOCATION_LIST.name] || [{CoreUseOfCollectionsData::LOCATION.name => ''}]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::LOCATION_LIST.name)], locations)\n locations.each_with_index do |location, index|\n logger.info \"Entering location data set at index #{index}: #{location}\"\n enter_auto_complete(location_input(index), location_options(index), location[CoreUseOfCollectionsData::LOCATION.name], 'Local Places')\n end\n end", "def test_location_0\r\n\t\tdriver = Driver::new(\"Driver\")\r\n\t\t\r\n\t\thillman = Location.new(\"Hillman\", \"Foo St.\", \"Fifth Ave.\")\r\n\t\thospital = Location.new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location.new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location.new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\t\r\n\t\tlocations = [hillman, hospital, cathedral, museum]\r\n\t\t\r\n\t\trandom_start_location(driver, 0, locations)\r\n\t\tassert_equal hillman, driver.location\r\n\tend", "def test_location_has_neighbors\n @l1.add_neighbors([@l2, @l3])\n assert_equal @l1.neighbors, [@l2, @l3] # pass\n end", "def test_count_locations_of_fourth_ave\n\t\tassert_equal 1, @road2.locations.count\n\tend", "def assert_positions_match(position1,position2)\n\t\tassert_models_match(position1,position2)\n\tend", "def test_is_valid_2\n\t\ttest_main = Main.new(3, 4, 6)\n\t\tassert_equal test_main.valid_location(\"Animal Beach\"), -1\n\tend", "def test_create_all_locations\n\t\ttest_main = Main.new(3, 4, 6)\n\t\ttest_graph = Graph.new(10)\n\t\ttest_main.create_all_locations(test_graph)\n\t\tassert_equal test_main.num_locations(test_graph), 7\n\tend", "def run_tests\n check_solution(1, [6, 29, 18, 2, 72, 19, 18, 10, 37], 18, 2)\n check_solution(2, [6, 29, 18, 2, 72, 19, 18, 10, 37], 9, -1)\nend", "def test_is_applicable_to_test_models\n\t[\"LargeHotel-90.1-2010-ASHRAE 169-2006-3B.osm\", \"LargeOffice-90.1-2010-ASHRAE 169-2006-5A.osm\", \"MediumOffice-90.1-2010-ASHRAE 169-2006-5A.osm\", \"PrimarySchool-90.1-2007-ASHRAE 169-2006-2A.osm\", \"SecondarySchool-90.1-2010-ASHRAE 169-2006-4A.osm\", \"SmallHotel-90.1-2010-ASHRAE 169-2006-3B.osm\", \"SmallOffice-90.1-2010-ASHRAE 169-2006-2A.osm\"].each do |m|\n\t\tresult,_ = applytotestmodel(m)\n\t\tassert_equal(\"Success\", result.value.valueName)\n end\n end", "def test_get_location_index_valid\n finder = MapLocationFinder.new\n assert_equal 4, finder.get_location_index(\"Matzburg\")\n end", "def test_random_neighbor_is_valid\n @test_neighbor_list.each do |neighbor|\n @test_loc.connect neighbor\n end\n \t5.times { assert_includes @test_neighbor_list, @test_loc.random_neighbor? }\n end", "def test_valid_maps\r\n test = Prospect.new(0)\r\n assert_equal test.loc.name, 'Matzburg'\r\n end", "def test_address_validation\n response = nil\n assert_nothing_raised do\n #response = @carrier_prod.validate_addresses({'address_from' => @locations[:ottawa], 'address_to' => @locations[:beverly_hills]}, :test=>false)\n @carrier_prod.validate_addresses({'address_from' => Location.new(\n :country => 'US',\n :state => 'TX',\n :city => 'Houston',\n :address1 => '11811 North Freeway',\n :address2 => 'suite 500',\n :zip => '77060'), \n 'address_to' => Location.new(:country => 'US',\n :state => 'NY',\n :city => 'Brooklyn',\n :address1 => '7 Balfour pl',\n :address2 => 'Apt E3',\n :zip => '11225')})\n end\n end", "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def enter_pahma_locations(test_data)\n locations = test_data[UseOfCollections::LOCATION_LIST.name] || [{ UseOfCollections::LOCATION.name => ''}]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::LOCATION_LIST.name)], locations)\n locations.each_with_index do |location, index|\n enter_auto_complete(location_input(index), location_options(index), location[UseOfCollections::LOCATION.name], 'PAHMA Places')\n end\n end", "def test_e121_point_distance\n (1..30).each {#Idempotence verification\n verify_method :e121_point_distance,\n :with => [{\n param: 2,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(2, points_pairs, shortest)\n }},\n {\n param: 3,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(3, points_pairs, shortest) }\n },\n {\n param: 5,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(5, points_pairs, shortest) }\n },\n {\n param: 9,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(9, points_pairs, shortest) }\n },\n {\n param: 30,\n predicate: Proc.new { |points_pairs, shortest|\n check_points(30, points_pairs, shortest) }\n }]\n }\n end", "def contain?(location)\n @map.map.with_index { |v, i| i }.include? location.x and\n @map[location.x].map.with_index { |v, i| i }.include? location.y\n end", "def test_location_detection\n # Google geocoder isn't returning the postal code?\n # assert_equal \"80303\", @twitter_reporter.reports.create(:body => 'Long wait in #80303').location.postal_code\n \n assert_equal \"Boston, MA 02130, USA\", @twitter_reporter.reports.create(:body => 'Insane lines at #zip-02130').location.address\n assert_equal \"90 Church Rd, Arnold, MD 21012, USA\", @twitter_reporter.reports.create(:body => 'L:90 Church Road, Arnold, MD: bad situation').location.address\n # assert_equal \"21804\", @twitter_reporter.reports.create(:body => '#zip21804 weird stuff happening').location.postal_code\n assert_equal \"Church Hill\", @twitter_reporter.reports.create(:body => 'Things are off in L:Church Hill, MD').location.locality\n # assert_equal \"94107\", @twitter_reporter.reports.create(:body => 'No 94107 worries!').location.postal_code\n # assert_equal \"21012\", @twitter_reporter.reports.create(:body => 'going swimmingly l:21012-2423').zip\n assert_equal \"Severna Park, MD, USA\", @twitter_reporter.reports.create(:body => 'Long lines at l:severna park senior HS').location.address\n assert_equal \"New York 11215, USA\", @twitter_reporter.reports.create(:body => 'wait:105 in Park Slope, Brooklyn zip11215 #votereport').location.address\n assert_equal \"Courthouse, Virginia, USA\", @twitter_reporter.reports.create(:body => 'no joy and long wait in l:courthouse, va').location.address\n # with mis-spelling:\n assert_equal \"Boulder, CO, USA\", @twitter_reporter.reports.create(:body => 'long lines at courthouse L:Bolder CO').location.address\n end", "def exact_matches(loc=@counter)\n matches = 0\n 4.times{ |x| matches += 1 if @guessgrid[loc][x] == @code[x] }\n matches\n end", "def assert_equal_station station, sample_station\n if station.instance_of?(Station) && sample_station.instance_of?(Station)\n return assert(station.abbreviation == sample_station.abbreviation && station.est.include_all?(sample_station.est), \"Estimates should be equal\")\n end\n false\n end", "def verify_staff(test_data)\n staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def test_update_location_errors\n params = update_params_from_loc(locations(:albion))\n params[:location][:north] = 100\n update_location_error(params)\n end", "def test_validate_cities\n skip('this is a helper method for validating location names')\n # ignored cities are ones for which I don't know the location code\n # that the API accepts\n ignored_cities = %w(chongqing koln cologne dusseldorf eugene honolulu\n milan southbay)\n cities = %w(amsterdam austin berlin calgary columbus denver firenze\n frankfurt hamburg miami montreal muenchen\n newyorkcity portland rheinland roma sandiego seattle stockholm\n stuttgart torino toronto twincities vancouver washingtondc\n wien)\n\n cities.each do |city|\n @caruby2go = Caruby2go.new(ENV['CONSUMER_KEY'], city)\n puts \"#{city}\"\n payload = @caruby2go.gasstations\n puts \"#{city}:\\n#{payload}\"\n end\n puts \"Done with valid cities (#{cities.size})\"\n puts 'Did not look for the following cities as they have previously failed validation:'\n ignored_cities.each do |city|\n puts city\n end\n end", "def test_republicize\n locations = UserLocation.find_public_by_user(users(:quentin))\n locations.each do |l|\n assert l.publicize!\n end\n end", "def test_all\n coords = all_combos\n coords.each do |c|\n find_route(c[0], c[1])\n end\nend", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def test_new_location_fake_rubies\n assert_equal 10, @loc1.max_fake_rubies\n end", "def test_confirm_point_values\n[:A,:E,:I,:O,:N,:R,:T,:L,:S,:U].each{|num| assert_equal 1, TileBag.points_for(num.to_sym)}\n\n[:D,:G].each{|num| assert_equal 2, TileBag.points_for(num.to_sym)}\n[:B,:C,:M,:P].each{|num| assert_equal 3, TileBag.points_for(num.to_sym)}\n[:F,:H,:V,:W,:Y].each{|num| assert_equal 4, TileBag.points_for(num.to_sym)}\n[:K].each{|num| assert_equal 5, TileBag.points_for(num.to_sym)} \n[:J,:X].each{|num| assert_equal 8, TileBag.points_for(num.to_sym)} \n[:Q,:Z].each{|num| assert_equal 10, TileBag.points_for(num.to_sym)} \n end", "def test_sitemap_geos_and_queries\n geos = ['ca', 'co', 'il', 'ny']\n\n geos.each do |loc|\n # Step 1\n params = {\n 'g' => loc,\n 'h_geos' => 0,\n 'h_queries' => 0\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(0, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(0, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 2\n params = {\n 'g' => loc,\n 'h_geos' => 10,\n 'h_queries' => 30\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(10, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(30, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 3\n params = {\n 'g' => loc,\n 'h_geos' => 50,\n 'h_queries' => 100\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(50, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(100, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 4\n params = {\n 'g' => loc\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(50, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(50, @parsed_response['Queries']['NumFound'], @parsed_response)\n\n # Step 5\n params = {\n 'g' => loc,\n 'h_geos' => 100,\n 'h_queries' => 1000\n }\n\n get '/site_map/geos_and_queries', params\n assert_response(@response, :success)\n assert_equal(50, @parsed_response['Geos']['NumFound'], @parsed_response)\n assert_equal(100, @parsed_response['Queries']['NumFound'], @parsed_response)\n end\n end", "def field_test(accuracy)\n distance = (@mapsize - @measurement_border) / accuracy.to_f\n locations = []\n @test_area.float_step(distance) do |x|\n @test_area.float_step(distance) do |y|\n locations.push [x, y]\n end\n end\n locations.shuffle.each do |l|\n test(*l)\n end\n end", "def verification_coordonnees \n\tcoordonnees = [\"a1\", \"a2\", \"a3\", \"b1\", \"b2\", \"b3\", \"c1\", \"c2\", \"c3\"]\n\ttrue if coordonnees.include? @answer_play \n end", "def assert_google_location(data, loc)\n assert_equal :google, loc.geocoder\n assert_equal :hash, loc.raw_data_format\n\n assert_equal attribute_matching(\"locality\", data), loc.city\n assert_equal attribute_matching(\"administrative_area_level_1\", data), loc.state\n assert_equal attribute_matching(\"postal_code\", data), loc.post_code\n assert_equal attribute_matching(\"country\", data, :short_name), loc.country_code\n assert_equal data[\"geometry\"][\"location\"][\"lat\"], loc.lat\n assert_equal data[\"geometry\"][\"location\"][\"lng\"], loc.lng\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def test_possible_location_from_museum_if_rand_is_one\r\n\t\toakland = City::new\r\n\t\trand_val = 1\r\n\t\thillman = oakland.generate_museum_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal hillman[0], \"Hillman\"\r\n\t\tassert_equal hillman[1][0], \"Fifth Ave.\"\r\n\tend", "def run_tests\n check_solution(1, (100..200).to_a, 135, 35)\n check_solution(2, [13, 19, 24, 29, 32, 37, 43], 35, -1)\nend", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end", "def test_result_content_should_match_provided_array_content\n @scenarios.each do |scenario|\n expectation = scenario[:expectation].with_indifferent_access[:artworks]\n result = GoogleImageSearch.search(q: scenario[:search_keyword]).with_indifferent_access[:artworks]\n\n 0.upto(expectation.length - 1) do |index|\n assert_equal expectation[index], result[index], \"unexpected result at #{(index+1).ordinalize} thumbnail\"\n end\n end\n end", "def test_exercise_1115\n verify_method :exercise_1115,\n :with => [{params: [[0], 1], expect: [1]},\n {params: [[0], 2], expect: [1, 0]},\n {params: [[1, 1], 2], expect: [0, 2]},\n {params: [[1, 2, 3, 3, 3, 4], 5], expect: [0, 1, 1, 3, 1]}]\n end", "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend", "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend", "def run_tests()\n check_solution(1,\"aaabbc\", \"3a2bc\")\n check_solution(2, \"xxyyyyzz\", \"2x4y2z\")\n check_solution(3, \"qqqqq\", \"5q\")\n check_solution(4, \"mississippi\", \"mi2si2si2pi\")\nend", "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend", "def run_tests()\n check_solution(1, [1, 4, 10, 13, 15], true)\n check_solution(2, [1, 4, 10, 10, 13, 15], true)\n check_solution(3, [1, 2, 5, 3, 4 ], false)\nend", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def run_tests()\n check_solution(1, [1, 3, 5, 4], [5])\n check_solution(2, [4, 2, 3, 6, 10], [4, 10])\n check_solution(3, [4, 2, 11, 6, 10], [4, 11, 10])\nend", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def run_tests()\n check_solution(1, 'Pete,201,Student', ['Pete', '201', 'Student'])\n check_solution(2, \"Pete \\t 201 , TA\", ['Pete', '201', 'TA'])\n check_solution(3, \"Pete \\t 201\", ['Pete', '201'])\nend", "def test_locations_is_empty\n\t\tassert_equal [], @road.locations\n\tend", "def test_update_location_user_merge\n to_go = locations(:burbank)\n to_stay = locations(:albion)\n params = update_params_from_loc(to_go)\n params[:location][:display_name] = to_stay.display_name\n loc_count = Location.count\n desc_count = LocationDescription.count\n past_loc_count = Location::Version.count\n past_desc_count = LocationDescription::Version.count\n post_requires_login(:edit_location, params)\n assert_response(:action => :show_location)\n assert_equal(loc_count-1, Location.count)\n assert_equal(desc_count, LocationDescription.count)\n assert_equal(past_loc_count-1, Location::Version.count)\n assert_equal(past_desc_count, LocationDescription::Version.count)\n assert_equal(10 - @new_pts, @rolf.reload.contribution)\n end", "def verify_users(test_data)\n users = test_data[UseOfCollections::USER_GRP.name] || [UseOfCollections.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[UseOfCollections::USER.name], element_value(user_name_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[UseOfCollections::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[UseOfCollections::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def test_the_coordinates_are_valid\n assert_equal true, @board.valid_coordinate?(\"A1\")\n assert_equal false, @board.valid_coordinate?(\"ZZ\")\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def check_solution(test_number, array, expected)\n actual = find_peaks(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_construct_map\n create_single_locations\n val = construct_the_map\n assert_equal val.size, 7 # pass\n end", "def pass?\n expected_array.size == actual_array.size &&\n [expected_array, actual_array].transpose.all? do |expected_element, actual_value|\n expected_element.match_against_actual_value(actual_value)\n end\n end", "def test_mine_returns_two_values\n mine_results = @test_loc.mine\n assert_equal mine_results.count, 2\n end", "def multiple_locations?(holdings)\n locations = holdings.reject { |_k, h| h['library'] == 'Online' }.map { |_k, h| h['location'] }.uniq\n locations.length > 1\n end", "def test_location_connections_empty\n assert @loc1.neighbors.empty?\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_nodes_of_museum\n\t\tassert_equal @location, @location2.nodes[0]\n\tend", "def test_fun_city_locs\n\t@city = GoldRush::new\n\tassert_equal \"El Dorado Canyon\", @city.dorado.location\n\tassert_equal \"Midas\", @city.midas.location\n\tassert_equal \"Virginia City\", @city.virginia.location\n\tassert_equal \"Nevada City\", @city.nevada.location\n\tassert_equal \"Coloma\", @city.coloma.location\n\tassert_equal \"Angels Camp\", @city.angels.location\n\tassert_equal \"Sutter Creek\", @city.sutter.location\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def test_possible_location_from_museum_if_rand_is_zero\r\n\t\toakland = City::new\r\n\t\trand_val = 0\r\n\t\tcathedral = oakland.generate_museum_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal cathedral[0], \"Cathedral\"\r\n\t\tassert_equal cathedral[1][0], \"Bar St.\"\r\n\tend", "def test_random_neighbor_many_connections\n neighbor_list = [@loc2, @loc3, @loc4]\n\n @loc1.add_neighbor @loc2\n @loc1.add_neighbor @loc3\n @loc1.add_neighbor @loc4\n\n assert_includes neighbor_list, @loc1.random_neighbor\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def valid_for_lists?(coords, lists)\n # Must give exactly one index per list\n return false unless coords.length == lists.length\n coords.each_with_index.all? { |value, index| valid_index_in?(lists[index], value) }\n end", "def point_match(point, nominal)\n point[0].should be_within(0.01).of(nominal[0])\n point[1].should eq nominal[1]\nend", "def near_match\n (0..3).each do |guess_index|\n compare_for_near_match(guess_index)\n end\n end", "def validate()\n validation_errors = []\n @expected_results.each_pair do |key,expected_result|\n result_key = expected_result[\"population_ids\"].dup\n\n reported_result, errors = extract_results_by_ids(expected_result['measure_id'], result_key)\n @reported_results[key] = reported_result\n validation_errors.concat match_calculation_results(expected_result,reported_result)\n end\n\n validation_errors\n end", "def test_matzburg_neighbors\n assert_equal ['Monkey Patch City', 'Duck Type Beach', 'Hash Crossing', 'Dynamic Palisades'], @l.matzburg['neighbors']\n end", "def check_indices(data, num)\n data.length.should == num\n end", "def test_location_not_connected\n refute @loc1.connected? @loc2\n end", "def test_random_fake_rubies\n loc1 = Location.new(\"location 1\", 1000, 10)\n res = loc1.random_fake_rubies\n assert res >= 0 && res <= 10\n end", "def test_driver_drive_many_choices\n\t\tloc1 = Location::new(\"Location\", [\"Hogwarts\",\"Narnia\",\"Middle Earth\"])\n\t\tdriv = Driver::new(1, loc1)\n\t\tassert_includes driv.get_place.get_neighbors, driv.drive\n\tend", "def verify_users(test_data)\n users = test_data[CoreUseOfCollectionsData::USER_GRP.name] || [CoreUseOfCollectionsData.empty_user]\n users.each_with_index do |user, index|\n verify_values_match(user[CoreUseOfCollectionsData::USER.name], element_value(user_name_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION_ROLE.name], element_value(user_type_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_UOC_ROLE.name], element_value(user_role_input index))\n verify_values_match(user[CoreUseOfCollectionsData::USER_INSTITUTION.name], element_value(user_institution_input index))\n end\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_to_15_advanced\n validate_to_15_map(to_15_advanced_map)\n end", "def in_game_tests_suite\n :locations\n end", "def check_data_integrity(source, dest)\n\t\t\tstation_list = @graph.map {|x| x.first}\n\t\t\terrors = []\n\t\t\tif !station_list.include?(source)\n\t\t\t\terrors << source\n\t\t\tend\n\n\t\t\tif !station_list.include?(dest)\n\t\t\t\terrors << dest\n\t\t\tend\n\n\t\t\tif errors.size > 0\n\t\t\t\tputs \"The following stations were not found in the application: #{errors.join(\",\")}. Please, check your data.\"\n\t\t\t\texit\n\t\t\tend\n\t\tend", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def verify_tiles\n end", "def verify_groups(test_data)\n test_groups = test_data[Org::GROUPS.name]\n errors = []\n test_groups = [{ Org::GROUP.name => ''}] unless test_groups\n test_groups.each_with_index do |test_grp, index|\n text_values_match?(test_grp[Org::GROUP.name], element_value(group_input(index)), errors)\n end\n errors\n end" ]
[ "0.7846891", "0.6538321", "0.6509385", "0.61529636", "0.59977186", "0.597671", "0.59543914", "0.5935601", "0.59063804", "0.59042025", "0.58744466", "0.5868029", "0.5826107", "0.5803772", "0.5783328", "0.5753785", "0.57491106", "0.5711637", "0.56879723", "0.5683051", "0.56726015", "0.566053", "0.5650948", "0.5640702", "0.56362283", "0.56120384", "0.5578681", "0.5570593", "0.5568716", "0.55476743", "0.55471945", "0.5534436", "0.5502199", "0.54991114", "0.5488645", "0.5487787", "0.54874694", "0.54773605", "0.54736805", "0.5464527", "0.5451156", "0.5440682", "0.543582", "0.5428166", "0.54246575", "0.542293", "0.5418984", "0.54004985", "0.53977525", "0.53929865", "0.53747547", "0.5374587", "0.53739643", "0.53717655", "0.5356259", "0.5339646", "0.53353196", "0.53353196", "0.53353196", "0.5334827", "0.5334827", "0.5334508", "0.5328032", "0.53096896", "0.53090674", "0.53038126", "0.52903414", "0.5286783", "0.52845967", "0.52796793", "0.52741647", "0.5272386", "0.5266604", "0.5262575", "0.52565473", "0.5245436", "0.5241296", "0.5234844", "0.5228718", "0.52273554", "0.52107424", "0.52077353", "0.52044463", "0.51918066", "0.519064", "0.51690006", "0.51677966", "0.51608104", "0.5154975", "0.51542616", "0.51525724", "0.51521635", "0.51518047", "0.5140729", "0.51376736", "0.5117934", "0.51137865", "0.5111845", "0.51076376", "0.5096031" ]
0.78097284
1
FEE Enters fees per a given set of test data
def enter_fees(test_data) fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee] hide_notifications_bar prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::FEE_GRP.name)], fees) fees.each_with_index do |fee, index| logger.info "Entering fee data set at index #{index}: #{fee}" wait_for_options_and_select(fee_currency_input(index), fee_currency_options(index), fee[CoreUseOfCollectionsData::FEE_CURRENCY.name]) wait_for_element_and_type(fee_value_input(index), fee[CoreUseOfCollectionsData::FEE_VALUE.name]) wait_for_element_and_type(fee_note_input(index), fee[CoreUseOfCollectionsData::FEE_NOTE.name]) wait_for_element_and_click(fee_paid_input(index)) if fee[CoreUseOfCollectionsData::FEE_PAID.name] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def verify_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def enter_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::FEE_GRP.name)], fees)\n fees.each_with_index do |fee, index|\n wait_for_options_and_select(fee_currency_input(index), fee_currency_options(index), fee[UseOfCollections::FEE_CURRENCY.name])\n wait_for_element_and_type(fee_value_input(index), fee[UseOfCollections::FEE_VALUE.name])\n wait_for_element_and_type(fee_note_input(index), fee[UseOfCollections::FEE_NOTE.name])\n wait_for_element_and_click(fee_paid_input(index)) if fee[UseOfCollections::FEE_PAID.name]\n end\n end", "def fees\n total_input - total_output\n end", "def fees\n @fees ||= {\n \"insurance_fee\" => (commission * ASSURANCE_SHARE).round(0),\n \"assistance_fee\" => (ASSISTANCE_COST * rental.duration).round(0)\n }.tap { |fees| fees[\"drivy_fee\"] = commission - fees.values.inject(:+) }\n end", "def fees\n raise Sibit::NotSupportedError, 'Btc.com doesn\\'t provide recommended fees'\n end", "def fees\n raise Sibit::NotSupportedError, 'Blockchair doesn\\'t implement fees()'\n end", "def add_fees\n @proposal.fees.each do |bank_account, amounts_by_category|\n amounts_by_category.each do |category, amount|\n category_for_key = category&.downcase&.gsub(' ', '_') || 'none'\n run_task \"add_fees_#{bank_account}_#{category_for_key}\" do\n if transaction = add_fee_transaction(bank_account, amount, category)\n current_state[:transaction_id] = transaction['BankTransactionID']\n end\n end\n end\n end\n end", "def fees(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/fees\", options).body)\n fees = response.key?('fees') ? response['fees'] : []\n fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }\n end", "def fees(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/fees\", options).body)\n fees = response.key?('fees') ? response['fees'] : []\n fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }\n end", "def fees(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/fees\", options).body)\n fees = response.key?('fees') ? response['fees'] : []\n fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }\n end", "def apply_fees\n remove_fees\n unless waive_fees\n #CHALKLE\n self.chalkle_gst_number = Finance::CHALKLE_GST_NUMBER\n self.chalkle_fee = course.chalkle_fee_no_tax\n self.chalkle_gst = course.chalkle_fee_with_tax - chalkle_fee\n \n self.processing_fee = course.processing_fee\n self.processing_gst = course.processing_fee*3/23\n self.processing_fee = course.processing_fee-self.processing_gst\n\n #TEACHER FEE\n if provider_pays_teacher?\n self.teacher_fee = 0\n self.teacher_gst = 0\n else\n if fee_per_attendee?\n self.teacher_fee = course.teacher_cost\n elsif flat_fee?\n confirmed_booking_count = course.bookings.fees_not_waived.paid.confirmed.count\n if confirmed_booking_count > 0\n self.teacher_fee = course.teacher_cost / confirmed_booking_count\n else\n self.teacher_fee = course.teacher_cost\n end\n end\n end\n\n #TEACHER TAX\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst_number = course.teacher.tax_number\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n else\n self.teacher_gst = 0\n self.teacher_gst_number = nil\n end\n\n #PROVIDER\n self.provider_fee = course.provider_fee\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n\n #adjust in case calc_cost is not course cost, should only happen if flat_fee\n difference = course.cost - calc_cost\n if difference != 0\n self.provider_fee = course.provider_fee + difference\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n end\n\n #adjust in case payment has been made already\n difference = cost - calc_cost\n if difference != 0\n #adjust processing_fee\n self.processing_fee = cost * course.provider_plan.processing_fee_percent\n self.processing_gst = self.processing_fee*3/23\n self.processing_fee = self.processing_fee-self.processing_gst\n\n #reset difference to adjust for processing_fee changes\n difference = cost - calc_cost\n\n #if payment exists then adjust provider fee to ensure the payment amount matches calc_cost\n adjustment_for_provider = difference\n adjustment_for_teacher = 0\n\n if provider_fee+provider_gst+difference < 0\n #if adjusted provider_fee is negative then deduct that negative amount from teacher_fee and make provider_fee 0\n adjustment_for_teacher = provider_fee+provider_gst+difference \n self.provider_fee = 0\n self.provider_gst = 0\n else\n self.provider_fee = provider_fee+provider_gst+adjustment_for_provider\n if provider.tax_registered?\n self.provider_gst = provider_fee*3/23\n self.provider_fee = provider_fee - provider_gst\n end\n end\n \n if adjustment_for_teacher != 0\n self.teacher_fee = teacher_fee+teacher_gst+adjustment_for_teacher\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n end\n end\n end\n end\n cost\n end", "def all_fees\n services.map{|el| el[:fee]}\n end", "def fee\n params['amount_fee']\n end", "def fees(period = (Time.now.beginning_of_month - 1).beginning_of_month .. (Time.now.beginning_of_month - 1).end_of_month)\n subscription_payments.where({ :created_at => period }).collect(&:affiliate_amount).sum\n end", "def addFees(filename)\n\tresponseText = open(Rails.root.join(\"db\", \"seed_data\", filename)).read\n\tresponseText.each_line do |curRow|\n\t\tcurRow = curRow.strip.downcase # get rid of new lines and make everything lowercase\n\n\t\t# split the excel sheet into individual variables using split\n\t\t# Note that each fee is itself a list of fees separated by commas.\n\t\tstate, city, airportName, airportCode, fboName, phoneNumbers, hasFees, classificationDesc, otherClassification, landingFee, rampFee, tieDownFee, facilityFee, callOutFee, hangarFee, otherFee, changeFrequency, feesWaived, fuelNeeded, contactPerson, callDate, infoQuality, hasFeeSheet, feeSheetLink, additionalInfo = curRow.split(\"\\t\")\n\t\t# If the FBO didn't or wouldn't answer, then we have no data for them and we should skip forward\n\t\tnext if hasFees == \"did not/would not answer\"\n\n\t\t#feeClassification = Classification.find_by( :classification_description => classificationDesc )\n\n\t\tcurAirport = Airport.find_by( :name => airportName)\n\t\tif curAirport.nil?\n\t\t\tcurAirport = Airport.find_by( :airport_code => airportCode )\n\t\t\t# If the airport wasn't found, try adding a k to the front of the airport code and try again\n\t\t\tif curAirport.nil? and airportCode.length == 3\n\t\t\t\tnewCode = \"k\" + airportCode\n\t\t\t\tcurAirport = Airport.find_by( :airport_code => newCode )\n\t\t\telsif curAirport.nil? and airportCode.length == 4\n\t\t\t# If the airport wasn't found, try removing the k from the front and trying again\n\t\t\t\tnewCode = airportCode[1..3]\n\t\t\t\tcurAirport = Airport.find_by( :airport_code => newCode )\n\t\t\tend\n\t\tend\n\n# I guess hypothetically this wouldn't work if there were two FBOs at an airport with the same name, but I don't think that has ever happened yet.\n\t\tcurFbo = Fbo.find_by(:name => fboName, :airport => curAirport)\n\n\t\tif !curFbo.nil?\n\t\t\t# this is what should happen\n\t\t\tif !hasFees.nil? and hasFees.strip == \"no\"\n\t\t\t\t#curFbo.update( :classification => Classification.find_by( :classification_description => \"flat rate\"))\n\t\t\t\tFeeType.find_each do |curFeeType|\n\t\t\t\t\tif curFeeType.fee_type_description == \"call out\"\n\t\t\t\t\t\tsingleFeeHelper(callOutFee, curFbo, curFeeType.fee_type_description, \"flat rate\")\n\t\t\t\t\telsif curFeeType.fee_type_description == \"hangar\"\n\t\t\t\t\t\t# do nothing\n\t\t\t\t\telse\n\t\t\t\t\t\tsingleFeeHelper(\"0\", curFbo, curFeeType.fee_type_description, \"flat rate\")\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t#elsif feeClassification.nil?\n\t\t\t\t#puts curFbo.name\n\t\t\t\t# do nothing\n\n\t\t\t# If the FBO has fees, so most of the time.\n\t\t\telse\n\t\t\t\t#curFbo.update( :classification => feeClassification )\n\t\t\t\t\n\t\t\t\t# For each type of fee, if it isn't nil, the split it up into its individual fees, then call the fee helper method on those fees.\n\t\t\t\t# landing fees\n\t\t\t\tif !landingFee.nil?\n\t\t\t\t\tlandingFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"landing\", classificationDesc)\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# ramp fees\n\t\t\t\tif !rampFee.nil?\n\t\t\t\t\trampFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"ramp\", classificationDesc)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\n\t\t\t\t# tie down fees\n\t\t\t\tif !tieDownFee.nil?\n\t\t\t\t\ttieDownFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"tie down\", classificationDesc)\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# facility fees\n\t\t\t\tif !facilityFee.nil?\n\t\t\t\t\tfacilityFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"facility\", classificationDesc)\n\t\t\t\t\tend\t\n\t\t\t\tend\t\n\n\t\t\t\t# call out fees\n\t\t\t\tif !callOutFee.nil?\n\t\t\t\t\tcallOutFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"call out\", classificationDesc)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\t#puts fboName\n\t\tend\n\tend\nend", "def total_fee\n fee + fee2 + fee3 + fee4\n end", "def fees(period = (Time.now.beginning_of_month - 1).beginning_of_month .. (Time.now.beginning_of_month - 1).end_of_month)\n subscription_payments.all(:conditions => { :created_at => period }).collect(&:affiliate_amount).sum \n end", "def fees_report\n if validate_date\n #@batches= FinanceTransaction.total_fees(@start_date, @end_date)\n\n filter_by_account, account_id = account_filter\n\n if filter_by_account\n ft_joins = [:finance_transaction_receipt_record]\n filter_conditions = \"AND finance_transaction_receipt_records.fee_account_id #{account_id == nil ? 'IS' : '='} ?\"\n filter_values = [account_id]\n filter_select = \", finance_transaction_receipt_records.fee_account_id AS account_id\"\n else\n ft_joins = []\n filter_conditions = \"\"\n filter_values = []\n filter_select = \"\"\n end\n\n @target_action = \"fees_report\"\n fee_id = FinanceTransactionCategory.find_by_name(\"Fee\").id\n @grand_total = FinanceTransaction.all(:select => \"amount\",\n :joins => ft_joins,\n :conditions => [\"finance_type = 'FinanceFee' and category_id = #{fee_id} and\n transaction_date <= '#{@end_date}' and \n transaction_date >= '#{@start_date}' #{filter_conditions}\"] + filter_values).\n map { |x| x.amount.to_f }.sum\n\n @collections = FinanceFeeCollection.paginate(:page => params[:page], :per_page => 10,\n :joins => {:finance_fees => {:finance_transactions => ft_joins}}, :group => :fee_collection_id,\n :conditions => [\"finance_transactions.finance_type = 'FinanceFee' AND finance_transactions.category_id = ? AND\n (finance_transactions.transaction_date BETWEEN ? AND ?) #{filter_conditions}\",\n fee_id, @start_date.to_s, @end_date] + filter_values,\n :order => \"finance_fee_collections.id DESC\",\n :select => \"finance_fee_collections.id AS collection_id,\n finance_fee_collections.name AS collection_name,\n finance_fee_collections.tax_enabled,\n SUM(finance_transactions.amount) AS amount,\n IF(finance_fee_collections.tax_enabled,\n SUM(finance_transactions.tax_amount),0) AS total_tax,\n SUM(finance_transactions.fine_amount) AS total_fine #{filter_select}\")\n\n collection_ids = @collections.collect(&:collection_id) << 0\n conditions = [\"((`particular_payments`.`transaction_date` BETWEEN '#{@start_date}' AND\n '#{@end_date}') OR particular_payments.id is null) AND\n `ffc`.`id` IN (#{collection_ids.join(',')}) #{filter_conditions}\"] + filter_values\n\n joins = \"LEFT JOIN particular_payments\n ON particular_payments.finance_fee_particular_id = finance_fee_particulars.id AND\n particular_payments.is_active = true\n LEFT JOIN particular_discounts\n ON particular_discounts.particular_payment_id = particular_payments.id AND\n particular_discounts.is_active = true\n INNER JOIN finance_fees ff\n ON ff.id = particular_payments.finance_fee_id\n INNER JOIN finance_fee_collections ffc\n ON ffc.id = ff.fee_collection_id\"\n joins += filter_by_account ?\n \" LEFT JOIN finance_transactions ON finance_transactions.id = particular_payments.finance_transaction_id\n LEFT JOIN finance_transaction_receipt_records ON finance_transaction_receipt_records.id = finance_transactions.id\" : \"\"\n\n tax_select = \",(SELECT SUM(tax_amount) FROM tax_payments WHERE\ntax_payments.taxed_entity_id = particular_payments.finance_fee_particular_id AND\ntax_payments.taxed_entity_type = 'FinanceFeeParticular' AND\ntax_payments.taxed_fee_id = particular_payments.finance_fee_id AND\ntax_payments.taxed_fee_type = 'FinanceFee') AS tax_paid\"\n\n collection_and_particulars = FinanceFeeParticular.find(:all, :joins => joins, :conditions => conditions,\n :select => \"finance_fee_particulars.name, ffc.id AS collection_id,\n (SUM(particular_payments.amount)) AS amount_paid,\n IFNULL(SUM(particular_discounts.discount),0) AS discount_paid #{tax_select} #{filter_select}\",\n :group => \"finance_fee_particulars.name, ffc.id\")\n\n @collection_and_particulars = collection_and_particulars.group_by(&:collection_id)\n\n if request.xhr?\n render(:update) do |page|\n page.replace_html \"fee_report_div\", :partial => \"fees_report\"\n end\n end\n else\n render_date_error_partial\n end\n #fees_id = FinanceTransactionCategory.find_by_name('Fee').id\n #@fee_collections = FinanceFeeCollection.find(:all,:joins=>\"INNER JOIN finance_fees ON finance_fees.fee_collection_id = finance_fee_collections.id INNER JOIN finance_transactions ON finance_transactions.finance_id = finance_fees.id AND finance_transactions.transaction_date >= '#{@start_date}' AND finance_transactions.transaction_date <= '#{@end_date}' AND finance_transactions.category_id = #{fees_id}\",:group=>\"finance_fee_collections.id\")\n end", "def sum_of_test_fee_based_on_category\n patient_test_info ={}\n self.user.test_categories.each do |test_category|\n patient_test_info[test_category.id.to_s] = line_tests.find_all{|line_item| line_item.test_category_id == test_category.id}.inject(0){|sum,line_test| (sum + line_test.test_fee)}\n end\n patient_test_info\n end", "def fees_defaulters\n @courses = Course.all(\n :joins => {\n :batches => [\n {:students => :finance_fees}, :finance_fee_collections\n ]\n },\n :conditions => [\"courses.is_deleted=? and finance_fees.balance > ? and finance_fee_collections.is_deleted=? and finance_fee_collections.due_date < ? and batches.is_active =?\", false, 0, false, Date.today, true],\n :group => \"courses.id\")\n @batchs = []\n @dates = []\n end", "def request_entry_fee(guests, room)\n # for each guest in the guests array pay the entry_fee for the room\n # pay_entry_fee method checks if they can afford it\n guests.each { |guest| guest.pay_entry_fee(room.entry_fee()) }\n end", "def fee_filter\n [\n ['Equal','equal'],\n ['Greater than','greater_than'],\n ['Less than','less_than']\n ]\n\n end", "def fee\n @fee || DEFAULT_FEE\n end", "def compute_fee(fee_rate: DEFAULT_FEE_RATE)\n self.class.compute_fee(self.data.bytesize, fee_rate: fee_rate)\n end", "def total_insured_fees\n services.select{|i| i[:btype] && i[:btype] < CASH_BILLING}.sum{|s| s[:fee]} rescue 0\n end", "def fixed_fees\n fixed_fee.nil? ? [] : [fixed_fee]\n end", "def calculate(t, fraud, type)\r\n#\t\tpp \"1\"\r\n\t\treturn 0.0 if type == 'billable' && self.bid_fee #if this fee is a bid fee and we are not looking at the bid fees then return 0, else continue on\r\n\t#\tpp \"2\"\r\n \t\r\n \tfee = self.fixed if self.price_type == 'F'\r\n \r\n fee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) if self.price_type == 'V' #calculate the fee\r\n \r\n return fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\r\n\t\t#if we get here we know we are dealing with a variable fee\r\n\t\t#puts (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min)\r\n\t#\tfee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) #calculate the fee\r\n\t#\tpp fee\r\n\t#\tpp \"3\"\r\n\t#\treturn fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\t\r\n\t\t#otherwise we need to determine the sign and threshold before we can return\r\n\t\tcase self.sign\r\n\t\t\twhen '>'\r\n\t\t\t #pp \">\"\r\n\t\t\t\treturn fee if t.amount > self.threshold\r\n\t\t\twhen '>='\r\n\t\t\t #pp \">=\"\r\n\t\t\t\treturn fee if t.amount >= self.threshold\r\n\t\t\twhen '<'\r\n\t\t\t #pp \"<\"\r\n\t\t\t\treturn fee if t.amount < self.threshold\r\n\t\t\twhen '<='\r\n\t\t\t #pp \"<=\"\r\n\t\t\t\treturn fee if t.amount <= self.threshold\r\n\t\t\telse\r\n\t\t\t #pp \"4\"\r\n\t\t\t\treturn 0.0\r\n\t\tend\r\n\t\t\r\n\t\t#if we get here then we have no idea what to do so just return 0\r\n\t\treturn 0.0\r\n\tend", "def run_fe_tests\n end", "def node_fee(fee_base_msat, fee_proportional_millionths, amount_to_forward)\n fee_base_msat + (amount_to_forward * fee_proportional_millionths) / 1000000\n end", "def get_fee_params(npo_ein = '68-0480736')\n {\n DonationLineItems: {\n DonationItem: {\n NpoEin: npo_ein,\n Designation: 'annual_fund',\n Dedication: 'For my grandfather',\n donorVis: 'ProvideAll',\n ItemAmount: 100.00,\n RecurType: 'NotRecurring',\n AddOrDeduct: 'Add',\n TransactionType: 'Donation'\n }\n },\n TipAmount: 1.00,\n CardType: 'Visa'\n }\nend", "def fee\n (amount * 0.005) if amount\n end", "def get_fee(detail_page)\n fee_array = []\n first_table = detail_page.search('div#ctl00_MainBodyContent_group_19 table.ContentPanel')\n if first_table != nil\n list_tr = first_table.search('tr')\n for i in 1..list_tr.length-1\n list_td = list_tr[i].search('td')\n fee_obj = {}\n fee_obj[:application_fee_type] = clean_whitespace(list_td[0].inner_text)\n fee_obj[:accepted_fee_amount] = clean_whitespace(list_td[1].inner_text)\n fee_obj[:paid] = clean_whitespace(list_td[2].inner_text)\n fee_obj[:balance] = clean_whitespace(list_td[3].inner_text)\n fee_array << fee_obj\n end\n else\n return \"\"\n end\n return fee_array\nend", "def get_fee(detail_page)\n fee_array = []\n first_table = detail_page.search('div#ctl00_MainBodyContent_group_19 table.ContentPanel')\n if first_table != nil\n list_tr = first_table.search('tr')\n for i in 1..list_tr.length-1\n list_td = list_tr[i].search('td')\n fee_obj = {}\n fee_obj[:application_fee_type] = clean_whitespace(list_td[0].inner_text)\n fee_obj[:accepted_fee_amount] = clean_whitespace(list_td[1].inner_text)\n fee_obj[:paid] = clean_whitespace(list_td[2].inner_text)\n fee_obj[:balance] = clean_whitespace(list_td[3].inner_text)\n fee_array << fee_obj\n end\n else\n return \"\"\n end\n return fee_array\nend", "def fee\n\tparams['mc_fee']\n end", "def fulfillment_fee\n\t line_items.inject(0.0) {|charge, line_item| charge = charge + (line_item.fulfillment_fee)}\n end", "def calculate_fee_amount base_amount\n (base_amount * SITE_FEE_PERCENTAGE).round(2)\n end", "def membership_fee\n if business_admin?\n {\"amount\" => 29900, \"id\" => \"business-29900\"}\n elsif church_admin?\n {\"amount\" => 9900, \"id\" => \"church-9900\"}\n elsif alliance_admin?\n {\"amount\" => 9900, \"id\" => \"alliance-9900\"}\n else\n {\"amount\" => 4900, \"id\" => \"individual-4900\"}\n end\n end", "def calculate_fee\n Application::courses_fee(course_selections_count > 1 ? :multiple : :single)\n end", "def sum_eft_amount (opt=true)\n total_eft_amt = 0\n if @client.name.upcase == \"GOODMAN CAMPBELL\"\n @checks.each do |check|\n if check.payment_method == 'EFT'\n get_gcbs_insurance_eobs(check)\n check_amount = complete_check_amount_condition ? check.check_amount.to_f : check.eob_amount_calculated(@eobs, @nextgen_insurance)\n total_eft_amt += check_amount.to_f\n else\n total_eft_amt += 0.00\n end\n end\n @total_eft_amount = @total_eft_amount + total_eft_amt if opt\n else\n @checks.each do |check|\n if check.payment_method == 'EFT'\n total_eft_amt += check.check_amount.to_f\n else\n total_eft_amt += 0.00\n end\n end\n @total_eft_amount = @total_eft_amount + total_eft_amt if opt\n end\n total_eft_amt\n end", "def add_fee(args)\n result = Spreedly.post(\"/subscribers/#{id}/fees.xml\", :body => Spreedly.to_xml_params(:fee => args))\n\n case result.code.to_s\n when /2../\n when '404'\n raise \"Not Found\"\n when '422'\n raise \"Unprocessable Entity - #{result.body}\"\n else\n raise \"Could not add fee to subscriber: result code #{result.code}.\"\n end\n end", "def pvcycle_total_fees\n pvcycle_membership_fee + pvcycle_contribution_fee\n end", "def fulfillment_fee\n begin\n if variant.product_costs.where(:retailer_id => self.order.retailer_id).first.fulfillment_fee > 0\n variant.product_costs.where(:retailer_id => self.order.retailer_id).first.fulfillment_fee * quantity\n else\n self.order.retailer.fulfillment_fee * quantity\n end\n rescue\n begin\n self.order.retailer.fulfillment_fee * quantity\n rescue\n 0.0\n end\n end\n end", "def fundingdistribution\n @fundingdistribution = {}\n @sourceoffunds.each do |sof|\n @fundingdistribution[sof.name] = budget * (sof.percentage.to_f / 100)\n end\n @fundingdistribution \n end", "def miscellaneous_fees\n object.fees.each_with_object([]) do |fee, memo|\n misc_fee_adapter.call(fee).tap do |f|\n memo << f if f.claimed?\n end\n end\n end", "def update_fee\n\t\tmoney_info = money_info()\n\t\t@fee = money_info['Trade_Fee'] / 100.0\n\tend", "def test_find_DEDUCCIONES_SIN_DETALLE\n \n deduccion_conyuge = RevenueParameter.find(:first, :conditions => \"name = 'CONYUGE' \") \n assert_in_delta(8000.0, deduccion_conyuge.value, 0.01)\n \n deduccion_minimo_no_imponible = RevenueParameter.find(:first, :conditions => \"name = 'MINIMO_NO_IMPONIBLE' \") \n assert_in_delta(7500.0, deduccion_minimo_no_imponible.value, 0.01)\n \n end", "def fee\n params['mc_fee']\n end", "def fee\n params['mc_fee']\n end", "def host_fee\n (total - net_rate).round(2)\n end", "def set_fee\n @book = Book.find(params[:book_id])\n @fee = @book.fees.find(params[:id])\n end", "def revenue_and_profit(cust_id, start_date = nil, end_date = nil)\n\n start_date = Date.parse('0000-01-01') if (start_date.nil?)\n end_date = Date.parse('3000-01-01') if (end_date.nil?)\n\n order_data = CustomerOrder.find_by_sql(\"SELECT SUM(price) AS total,\n COUNT(1) AS copies,\n COUNT(DISTINCT(orders.orderID)) AS orders\n FROM orders, lineItem\n WHERE orders.customer_id = #{cust_id}\n AND orders.orderID = lineItem.orderID\n AND lineItem.live = 1\n AND orderDate >= '#{start_date.to_s}'\n AND orderDate <= '#{end_date.to_s}'\")[0]\n\n revenue = order_data.total.to_f\n copies = order_data.copies.to_f\n orders = order_data.orders.to_f\n\n costs = 0.0\n\n ##############################################\n # Processing costs, as percent of total inflow\n ##############################################\n\n # 2.19% credit card processing fees\n processing_fee_perc = 0.0219\n\n costs += revenue * processing_fee_perc\n\n #################\n # Per order costs\n #################\n\n # $0.49 per-transaction credit card processing fee\n processing_fee_flat = 0.49\n\n costs += orders * processing_fee_flat\n\n ###############\n # Per DVD costs\n ###############\n\n # $1.50 / DVD depreciation\n depreciation = 1.50\n\n # $0.50 / DVD shipping labor\n shipping_labor = 0.50\n\n costs += copies * (depreciation + shipping_labor)\n\n ####################\n # Per shipment costs\n ####################\n\n # $0.04 outgoing label (label and laser)\n outgoing_label = 0.04\n\n # $0.05 return label\n return_label = 0.05\n\n # $0.06 instructions\n instructions = 0.06\n\n # $0.11 adhesive tabs\n adhesive_tabs = 0.11\n\n # $0.13 postage machine rental and ink\n postage_machine = 0.13\n\n # Mail shipping rates, based on number of DVDs\n shipping_rates = { 1 => 0.87, 2 => 0.87, 3 => 1.11, 4 => 1.35, 5 => 1.83,\n 6 => 2.07, 7 => 2.31, 8 => 2.31, 9 => 2.55, 10 => 2.79 }\n\n # Shipping containers, based on number of DVDs\n shipping_containers = { 1 => 0.46, 2 => 0.46, 3 => 0.46, 4 => 0.46 }\n # Everything not 1-4 costs 0.60\n shipping_containers.default = 0.60\n\n # lookup table for cost per shipment, based on shipment size\n\n shipment_costs = Hash.new(10.00) # default for customers with > 10 items left to ship, might be low?\n\n shipping_rates.each_key do |size|\n shipment_costs[size] = (shipping_rates[size] * 2) + shipping_containers[size] + outgoing_label +\n return_label + instructions + adhesive_tabs + postage_machine\n end\n\n # Note: this assumes all unshipped items will be bundled together\n shipments = CustomerOrder.find_by_sql(\"SELECT shipmentID, count(1) as size\n FROM orders, lineItem\n WHERE orders.customer_id = #{cust_id}\n AND orders.orderID = lineItem.orderID\n AND lineItem.live = 1\n AND orderDate >= '#{start_date.to_s}'\n AND orderDate <= '#{end_date.to_s}'\n GROUP BY shipmentID\")\n\n shipments.each { |shipment| costs += shipment_costs[shipment.size.to_i] }\n\n # We don't need to include reship rate, since reshipments have line\n # items that are included here, with $0.00 revenue attached\n\n profit = revenue - costs\n\n return revenue, profit, copies, orders, shipments.size.to_i\n\nend", "def retrieve_fees\n return if stripe_charge_id.nil?\n\n transaction = Stripe::BalanceTransaction.retrieve(stripe_charge.balance_transaction)\n return if transaction.nil?\n\n self.fee = transaction.fee / 100.0\n self.received_amount = transaction.net / 100.0\n save\n end", "def fee_received_by_referral_medium\n #Get list of all referral sources by lawfirm.\n all_referral_sources = Origination.all_referral_sources(current_user)\n amounts = []\n\n #Sum the total_fee_received of all closed cases by referral source,\n # => using params[:range] if provided, 3 otherwise\n all_referral_sources.each do |ref|\n amounts << Graph.fee_estimate_by_origination(current_user, ref, 'medium_estimate')\n end\n final_fee_by_origination_source = all_referral_sources.zip(amounts)\n\n #Remove elements from the array that are less than or = to amount us Graph.method(array, amount)\n #Do not 0 amount items in array cluttering the pie chart\n @fee_by_origination_source_medium = Graph.remove_arrays_less_than_or_equal_to(final_fee_by_origination_source,0)\n\n #Repeat for High and Low Fee Estimates\n amounts = []\n all_referral_sources.each do |ref|\n amounts << Graph.fee_estimate_by_origination(current_user, ref, 'high_estimate')\n end\n final_fee_by_origination_source = all_referral_sources.zip(amounts)\n @fee_by_origination_source_high = Graph.remove_arrays_less_than_or_equal_to(final_fee_by_origination_source,0)\n\n amounts = []\n all_referral_sources.each do |ref|\n amounts << Graph.fee_estimate_by_origination(current_user, ref, 'low_estimate')\n end\n final_fee_by_origination_source = all_referral_sources.zip(amounts)\n @fee_by_origination_source_low = Graph.remove_arrays_less_than_or_equal_to(final_fee_by_origination_source,0)\n end", "def subtotal\n fees = [ticket_fees_in_cents].sum\n\n discounted_total + fees\n end", "def fee_params\n params.require(:fee).permit(:student_id, :amount, :user_id, :month)\n end", "def fees_submission_student\n if params[:date].present?\n @date = @fee_collection = FinanceFeeCollection.find(params[:date])\n @transaction_date= params[:transaction_date].present? ? Date.parse(params[:transaction_date]) : Date.today_with_timezone.to_date\n @target_action='fees_submission_student'\n @target_controller='finance'\n @student = Student.find(params[:id])\n \n # calculating total collected advance fee amount\n @advance_fee_used = @fee_collection.finance_fees.all(:conditions => {:student_id => @student.id, :batch_id => @student.batch.id}).collect(&:finance_transactions).flatten.compact.sum(&:wallet_amount).to_f\n \n @fee = @student.finance_fee_by_date(@date)\n @fine_waiver_val = params[:fine].present? && params[:fine][:is_fine_waiver].present?? params[:fine][:is_fine_waiver] : 'false'\n financial_year_check\n unless @fee.nil?\n @particular_wise_paid = (@date.discount_mode != \"OLD_DISCOUNT\" && @fee.finance_transactions.map(&:trans_type).include?(\"particular_wise\"))\n # @particular_wise_paid = @fee.finance_transactions.map(&:trans_type).include?(\"particular_wise\")\n flash.now[:notice]=\"#{t('particular_wise_paid_fee_payment_disabled')}\" if @particular_wise_paid\n @batch = @fee.batch\n @financefee = @student.finance_fee_by_date @date\n # @financefee.update_attributes(:is_fine_waiver=>true) if params[:is_fine_waiver]\n # @linking_required = @fee_collection.has_linked_unlinked_masters(false, @student.id) if @student.present? and !@financefee.is_paid\n @due_date = @fee_collection.due_date\n @paid_fees = @fee.finance_transactions\n @fee_category = FinanceFeeCategory.find(@fee_collection.fee_category_id, :conditions => [\"is_deleted = false\"])\n @fine=nil\n @fine=params[:fine][:fee] if (params[:fine].present? and params[:fine][:fee].present?)\n particular_and_discount_details\n bal=(@total_payable-@total_discount).to_f\n days=(@transaction_date-@date.due_date.to_date).to_i\n auto_fine=@date.fine\n if days > 0 and auto_fine and !@financefee.is_fine_waiver\n if Configuration.is_fine_settings_enabled? && @financefee.balance <= 0 && @financefee.is_paid == false && !@financefee.balance_fine.nil?\n @fine_amount = @financefee.balance_fine\n else\n @fine=params[:fine][:fee].to_f if params[:fine].present? and params[:fine][:fee].present? and params[:fine][:fee].to_f > 0.0\n @fine_rule=auto_fine.fine_rules.find(:last, :conditions => [\"fine_days <= '#{days}' and created_at <= '#{@date.created_at}'\"], :order => 'fine_days ASC')\n @fine_amount=@fine_rule.is_amount ? @fine_rule.fine_amount : (bal*@fine_rule.fine_amount)/100 if @fine_rule\n if @fine_rule and @financefee.balance==0\n @fine_amount=@fine_amount-@financefee.paid_auto_fine\n end\n end\n elsif @financefee.is_fine_waiver \n @fine_amount =0.0\n end\n @fine_amount=0 if @financefee.is_paid\n render :update do |page|\n if params[:add_fine].present?\n page.replace_html 'modal-box', :partial => 'individual_fine_submission'\n page << \"Modalbox.show($('modal-box'), {title: ''});\"\n elsif @fine.nil? or @fine.to_f > 0\n # page.replace_html \"fee_submission\",\n # :partial => \"finance/fees_payment/#{@linking_required ? 'notice_link_particulars' : 'fees_submission_form'}\",\n # :with => @fine\n page.replace_html \"fee_submission\",\n :partial => \"finance/fees_payment/fees_submission_form\", :with => @fine\n page << \"Modalbox.hide();\"\n elsif @fine.to_f <=0\n page.replace_html 'modal-box', :text => 'fine_submission'\n page.replace_html 'form-errors', :text => \"<div id='error-box'><ul><li>#{t('finance.flash24')}</li></ul></div>\"\n end\n end\n else\n render :update do |page|\n page.replace_html \"fee_submission\", :text => '<p class=\"flash-msg\">No students have been assigned this fee.</p>'\n end\n end\n else\n render :update do |page|\n page.replace_html \"fee_submission\", :text => ''\n end\n end\n\n end", "def fee_cents\n (fee.to_f * 100.0).round\n end", "def total_affiliate_fee\n total = 0.0\n @lines.each {|line| total += (line.li_aff_fee * line.li_qty) }\n total\n end", "def fee\n @ipn['mc_fee']\n end", "def sum_attorney_fees\n (invoice_lines.sum(:total_attorney_fee)).round(2)\n end", "def fee_params\n params.require(:fee).permit(:user_id, :name, :price, :serial, :end_at, :deleted_at)\n end", "def total_non_insured_fees\n total_fee - total_insured_fees\n end", "def submit_fees\n raise('to be implemented by caller')\n end", "def insurance_fee\n (COMMISSION_RATE * INSURANCE_PART_RATE * price).round\n end", "def calculate_fee(transaction, params = {})\n amount = transaction.base_amount\n\n if @interchange\n use_payment_source = params[:use_payment_source].to_s == 'true' #todo: better pattern here?\n if use_payment_source\n payment_source = transaction.payor.payment_source_for_type(@payment_service.payment_type)\n bin = payment_source&.get_data_field(:bin)\n else\n card = params[:card_number]\n bin = card ? card[0..5] : nil\n end\n\n if bin.present?\n data = estimate_fee(amount, bin)\n fee = data[:estimated_fee]\n else\n # returns a range when card prefix not provided\n fee_range(amount) # note, returns an array with low/high range when params are missing\n end\n else\n apply_rate(amount)\n end\n end", "def getFees(airplane, fbo, timeUnit = nil, timeLength = 0, landingTime = nil)\n\n\t\tif !landingTime.nil?\n\t\t\tlandingTime = timeToMinutes(landingTime)\n\t\tend\n\n\t\tfees = Fee.where( :fbo => fbo )\n\t\tisEstimate = false\n\n\t\tfees.each do |curFee|\n\n\t\t\tclassificationDesc = curFee.classification.classification_description\n\t\t\tcurCategory = curFee.category.category_description\n\n\t# Figure out if categories are missing so that the data retrieval is more complete\n\t# WWWWHHHEEEEEEEEE\n\t\t\tif classificationDesc == \"engine type\"\n\t# doesn't have piston multi light\n\t\t\t\tif !hasCategory(fees, \"piston multi light\") and hasCategory(fees, \"piston multi heavy\") and airplane.engine_class == \"piston multi light\"\n\t\t\t\t\tairplane.engine_class = \"piston multi heavy\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have piston multi heavy\n\t\t\t\telsif !hasCategory(fees, \"piston multi heavy\") and hasCategory(fees, \"piston multi light\") and airplane.engine_class == \"piston multi heavy\"\n\t\t\t\t\tairplane.engine_class = \"piston multi light\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have turboprop single heavy\n\t\t\t\telsif !hasCategory(fees, \"turboprop single heavy\") and hasCategory(fees, \"turboprop single light\") and airplane.engine_class == \"turboprop single heavy\"\n\t\t\t\t\tairplane.engine_class = \"turboprop single light\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have turboprop single light\n\t\t\t\telsif !hasCategory(fees, \"turboprop single light\") and hasCategory(fees, \"turboprop single heavy\") and airplane.engine_class == \"turboprop single light\"\n\t\t\t\t\tairplane.engine_class = \"turboprop single heavy\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have turboprop twin light\n\t\t\t\telsif !hasCategory(fees, \"turboprop twin light\") and hasCategory(fees, \"turboprop twin medium\") and airplane.engine_class == \"turboprop twin light\"\n\t\t\t\t\tairplane.engine_class = \"turboprop twin medium\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"turboprop twin light\") and hasCategory(fees, \"turboprop twin heavy\") and airplane.engine_class == \"turboprop twin light\"\n\t\t\t\t\tairplane.engine_class = \"turboprop twin heavy\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have turboprop twin medium\n\t\t\t\telsif !hasCategory(fees, \"turboprop twin medium\") and hasCategory(fees, \"turboprop twin heavy\") and airplane.engine_class == \"turboprop twin medium\"\n\t\t\t\t\tairplane.engine_class = \"turboprop twin heavy\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"turboprop twin medium\") and hasCategory(fees, \"turboprop twin light\") and airplane.engine_class == \"turboprop twin medium\"\n\t\t\t\t\tairplane.engine_class = \"turboprop twin light\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have turboprop twin heavy\n\t\t\t\telsif !hasCategory(fees, \"turboprop twin heavy\") and hasCategory(fees, \"turboprop twin medium\") and airplane.engine_class == \"turboprop twin heavy\"\n\t\t\t\t\tairplane.engine_class = \"turboprop twin medium\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"turboprop twin heavy\") and hasCategory(fees, \"turboprop twin light\") and airplane.engine_class == \"turboprop twin heavy\"\n\t\t\t\t\tairplane.engine_class = \"turboprop twin light\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have light jet\n\t\t\t\telsif !hasCategory(fees, \"light jet\") and hasCategory(fees, \"midsize jet\") and airplane.engine_class == \"light jet\"\n\t\t\t\t\tairplane.engine_class = \"midsize jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"light jet\") and hasCategory(fees, \"super midsize jet\") and airplane.engine_class == \"light jet\"\n\t\t\t\t\tairplane.engine_class = \"super midsize jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"light jet\") and hasCategory(fees, \"heavy jet\") and airplane.engine_class == \"light jet\"\n\t\t\t\t\tairplane.engine_class = \"heavy jet\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have midsize jet\n\t\t\t\telsif !hasCategory(fees, \"midsize jet\") and hasCategory(fees, \"super midsize jet\") and airplane.engine_class == \"midsize jet\"\n\t\t\t\t\tairplane.engine_class = \"super midsize jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"midsize jet\") and hasCategory(fees, \"light jet\") and airplane.engine_class == \"midsize jet\"\n\t\t\t\t\tairplane.engine_class = \"light jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"midsize jet\") and hasCategory(fees, \"heavy jet\") and airplane.engine_class == \"midsize jet\"\n\t\t\t\t\tairplane.engine_class = \"heavy jet\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have super midsize jet\n\t\t\t\telsif !hasCategory(fees, \"super midsize jet\") and hasCategory(fees, \"heavy jet\") and airplane.engine_class == \"super midsize jet\"\n\t\t\t\t\tairplane.engine_class = \"heavy jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"super midsize jet\") and hasCategory(fees, \"midsize jet\") and airplane.engine_class == \"super midsize jet\"\n\t\t\t\t\tairplane.engine_class = \"midsize jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"super midsize jet\") and hasCategory(fees, \"light jet\") and airplane.engine_class == \"super midsize jet\"\n\t\t\t\t\tairplane.engine_class = \"light jet\"\n\t\t\t\t\tisEstimate = true\n\t# doesn't have heavy jet\n\t\t\t\telsif !hasCategory(fees, \"heavy jet\") and hasCategory(fees, \"super midsize jet\") and airplane.engine_class == \"heavy jet\"\n\t\t\t\t\tairplane.engine_class = \"super midsize jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"heavy jet\") and hasCategory(fees, \"midsize jet\") and airplane.engine_class == \"heavy jet\"\n\t\t\t\t\tairplane.engine_class = \"midsize jet\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\telsif !hasCategory(fees, \"heavy jet\") and hasCategory(fees, \"light jet\") and airplane.engine_class == \"heavy jet\"\n\t\t\t\t\tairplane.engine_class = \"light\"\n\t\t\t\t\tisEstimate = true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tfees = fees.reject do |curFee|\n\t\t\tclassificationDesc = curFee.classification.classification_description\n\t\t\tcurCategory = curFee.category.category_description\n\n\t\t\tif classificationDesc == \"engine type\" and curCategory != \"flat rate\" and curCategory != \"no fee\" and curCategory != \"weight\" and curCategory != \"weight range\"\n\t\t\t\tif curCategory == \"jet\"\n\t\t\t\t\t!airplane.engine_class =~ /jet/\n\t\t\t\telsif curCategory == \"turboprop\"\n\t\t\t\t\t!airplane.engine_class =~ /turboprop/\n\t\t\t\telsif curCategory == \"turboprop single\"\n\t\t\t\t\t!airplane.engine_class =~ /turboprop single/\n\t\t\t\telsif curCategory == \"turboprop multi\"\n\t\t\t\t\t!airplane.engine_class =~ /turboprop multi/\n\n\t\t\t\telsif curCategory == \"piston\"\n\t\t\t\t\t!airplane.engine_class =~ /piston/\n\t\t\t\telsif curCategory == \"piston multi\"\n\t\t\t\t\t!airplane.engine_class =~ /piston multi/\n\n\t\t\t\telse\n\t\t\t\t\tcurCategory != airplane.engine_class\n\t\t\t\tend\n\t\t\tend\n\n\t\tend\n\n\t\t# For fees with the wrong engine type\n\t\tfees = fees.reject do |curFee|\t\n\t\t\tif isEstimate\n\t\t\t\tcurFee.is_estimate = true\n\t\t\tend\n\t\t\tcurCategory = curFee.category.category_description\n\t\t\tclassificationDesc = curFee.classification.classification_description\n\n\t\t\tif classificationDesc == \"engine type\" and curCategory != \"flat rate\" and curCategory != \"no fee\" and curCategory != \"weight\" and curCategory != \"weight range\"\n\t\t\t\tif curCategory == \"jet\"\n\t\t\t\t\t!airplane.engine_class =~ /jet/\n\n\t\t\t\telsif curCategory == \"turboprop\"\n\t\t\t\t\t!airplane.engine_class =~ /turboprop/\n\t\t\t\telsif curCategory == \"turboprop single\"\n\t\t\t\t\t!airplane.engine_class =~ /turboprop single/\n\t\t\t\telsif curCategory == \"turboprop multi\"\n\t\t\t\t\t!airplane.engine_class =~ /turboprop multi/\n\n\t\t\t\telsif curCategory == \"piston\"\n\t\t\t\t\t!airplane.engine_class =~ /piston/\n\t\t\t\telsif curCategory == \"piston multi\"\n\t\t\t\t\t!airplane.engine_class =~ /piston multi/\n\n\t\t\t\telse\n\t\t\t\t\tcurCategory != airplane.engine_class\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# For fees that have a start time and end time that are in the wrong range\n\t\tfees = fees.reject do |curFee|\n\t\t\tcurCategory = curFee.category.category_description\n\t\t\tclassificationDesc = curFee.classification.classification_description\n\n\t\t\tif !curFee.start_time.nil? and !curFee.end_time.nil? and !landingTime.nil? # If the fee has a start time and an end time, make sure it falls in the right time period.\n\t\t\t\t\n\t\t\t\tstartTime = curFee.start_time\n\t\t\t\tendTime = curFee.end_time\n\t\t\t\t# If the fee skips over midnight, add 1440 minutes (1 day) to the end time so the comparison works properly\n\t\t\t\tif startTime > endTime\n\t\t\t\t\tendTime += 1440\n\t\t\t\tend\n\n\t\t\t\tlandingTime < startTime or landingTime > endTime\n\t\t\tend\n\t\tend\n\n\t\t# For fees that use the wrong time unit\n\t\tfees = fees.reject do |curFee|\n\t\t\tif !curFee.time_unit.nil? # reject fees that use the wrong time unit\n\t\t\t\tcurFee.time_unit != timeUnit\n\t\t\tend\n\t\tend\n\n\t\t# For fees that are the wrong make/model\n\t\tfees = fees.reject do |curFee|\n\t\t\tcurCategory = curFee.category.category_description\n\t\t\tclassificationDesc = curFee.classification.classification_description\n\n\t\t\tif classificationDesc == \"make and model\" and curCategory != \"flat rate\" and curCategory != \"no fee\" and curCategory != \"weight\" and curCategory != \"weight range\"\n\t\t\t\tcurCategory != airplane.model\n\t\t\tend\n\t\tend\n\n\t\t# For fees where the airplane weight doesn't fall in the weight range\n\t\tfees = fees.reject do |curFee|\n\t\t\tcurCategory = curFee.category.category_description\n\n\t\t\tif curCategory == \"weight range\" and !curFee.unit_minimum.nil? and !curFee.unit_maximum.nil?\n\t\t\t\tairplane.weight < curFee.unit_minimum or airplane.weight > curFee.unit_maximum # reject fees if the airplane weight is less than the minimum or greater than the maximum\n\t\t\tend\n\t\tend\n\n\t\tfees = applyConditionalFees(airplane, fees, timeUnit, timeLength, landingTime)\n\t\tif fees.nil? or fees.length == 0\n\t\t\tputs \"check\"\n\t\t\treturn nil\n\t\telse\n\t\t\treturn fees\n\t\tend\n\tend", "def estimate_fee(amount, bin = nil)\n raise \"invalid bin\" if bin.starts_with?('9')\n unless bin && bin.length >= 6\n # fee_str = card_fee_str(amount)\n fee_str = fee_range_str(amount)\n #fee_range(amount) # note, returns an array with low/high range when params are missing\n return {fee_str: fee_str}\n end\n\n bin = bin[0..5] if bin.length > 6 # trim just in case we were given a full number\n\n binbase = Binbase.find_by(bin: bin)\n puts \"binbase: #{binbase}\"\n base = 0.30\n percent = 2.9\n message = nil\n\n amount = BigDecimal(amount)\n\n # return {error: 'BIN not found'} unless binbase\n unless binbase\n # placeholder default fee calculation\n # fee = apply_rate(amount, INTERCHAGNE_DEFAULT_BASE, INTERCHANGE_DEFAULT_PERCENT)\n\n # if unable to match bin, assume lowest fee. (don't want to overcharge)\n # todo: figure out best way to message this\n # todo: log non-matched bins for later investigation / stats\n fee = fee_range_low(amount)\n return {estimated_fee: fee, fee_str: \"unknown\"}\n end\n\n if binbase.card_brand == 'AMEX'\n base = 0.30\n percent = 3.5\n message = \"Tip: AMEX has the highest fees!\"\n end\n\n if binbase.card_brand == 'VISA' || binbase.card_brand == 'MASTERCARD'\n if binbase.card_type == 'DEBIT'\n base = 0.22\n if binbase.is_regulated\n percent = 0.05\n message = \"Good choice, Debit Cards have the lowest fees!\"\n else\n percent = 0.80\n message = \"Good choice, Debit Cards have lower fees.\"\n end\n else\n base = 0.12\n message = \"Tip: Debit Cards generally have lower fees than Credit Cards\"\n if binbase.card_category == 'PLATINUM' || binbase.card_category == 'BUSINESS'\n percent = 2.9\n message += \", and Rewards Cards have the highest fees.\"\n elsif binbase.card_category == 'GOLD'\n percent = 2.2\n message += \", and Rewards Cards have higher fees.\"\n else\n percent = 1.8\n end\n end\n end\n if amount < 20\n message = \"\"\n end\n\n fee = apply_rate(amount, base, percent)\n\n fee_str = \"$#{format_amount(fee)}\"\n fee_str += \" (#{message})\" if message.present?\n\n puts \"calcfee - #{bin}, base: #{base}, %: #{percent} = #{fee} - tip: #{message}\"\n {\n estimated_fee: fee,\n fee_tip: message,\n fee_str: fee_str, # combined and formatted string\n card_brand: binbase.card_brand,\n issuing_org: binbase.issuing_org,\n card_type: binbase.card_type,\n card_category: binbase.card_category,\n is_regulated: binbase.is_regulated,\n }\n end", "def fee_params\n params.require(:fee).permit(:description, :amount)\n end", "def rev_by_fee_type_medium\n @contingency_expected = Graph.revenue_by_fee_type_estimated(current_user,\"Contingency\",'estimated_conclusion_expected','medium_estimate')\n @mixed_expected = Graph.revenue_by_fee_type_estimated(current_user,\"Mixed\",'estimated_conclusion_expected','medium_estimate')\n @fixed_fee_expected = Graph.revenue_by_fee_type_estimated(current_user,\"Fixed Fee\",'estimated_conclusion_expected','medium_estimate')\n @hourly_expected = Graph.revenue_by_fee_type_estimated(current_user,\"Hourly\",'estimated_conclusion_expected','medium_estimate')\n\n @contingency_fast = Graph.revenue_by_fee_type_estimated(current_user,\"Contingency\",'estimated_conclusion_fast','medium_estimate')\n @mixed_fast = Graph.revenue_by_fee_type_estimated(current_user,\"Mixed\",'estimated_conclusion_fast','medium_estimate')\n @fixed_fee_fast = Graph.revenue_by_fee_type_estimated(current_user,\"Fixed Fee\",'estimated_conclusion_fast','medium_estimate')\n @hourly_fast = Graph.revenue_by_fee_type_estimated(current_user,\"Hourly\",'estimated_conclusion_fast','medium_estimate')\n\n @contingency_slow = Graph.revenue_by_fee_type_estimated(current_user,\"Contingency\",'estimated_conclusion_slow','medium_estimate')\n @mixed_slow = Graph.revenue_by_fee_type_estimated(current_user,\"Mixed\",'estimated_conclusion_slow','medium_estimate')\n @fixed_fee_slow = Graph.revenue_by_fee_type_estimated(current_user,\"Fixed Fee\",'estimated_conclusion_slow','medium_estimate')\n @hourly_slow = Graph.revenue_by_fee_type_estimated(current_user,\"Hourly\",'estimated_conclusion_slow','medium_estimate')\n end", "def fees_particulars_new\n @finance_fee_particular = FinanceFeeParticular.new(params[:finance_fee_particular])\n @master_fee_particulars = MasterFeeParticular.core\n @tax_slabs = TaxSlab.all if @tax_enabled\n fy_id = current_financial_year_id\n @fees_categories = FinanceFeeCategory.all(:select => \"DISTINCT finance_fee_categories.*\",\n :joins => \"INNER JOIN category_batches ON category_batches.finance_fee_category_id = finance_fee_categories.id\n INNER JOIN batches ON batches.id = category_batches.batch_id AND batches.is_active = true AND batches.is_deleted = false\",\n :conditions => [\"finance_fee_categories.is_deleted = 0 AND finance_fee_categories.is_master = 1 AND\n financial_year_id #{fy_id.present? ? '=' : 'IS'} ?\", fy_id], :order => \"name ASC\")\n\n @student_categories = StudentCategory.active\n @all = true\n @student = false\n @category = false\n end", "def document_fee\n 0\n end", "def test\n \n @fedex = Fedex::Base.new(\n :auth_key => 'USPNgfkiu1RuPm4j',\n :security_code => 'LmMpuDePYA9Hv8dvrBXJiIUe8',\n :account_number => '510087720',\n :meter_number => '118543679', \n :debug => true,\n :label_image_type => 'PDF'\n )\n \n shipper = {\n :name => \"Your Name\",\n :phone_number => '5205551212'\n }\n recipient = {\n :name => \"Fedex\",\n :phone_number => '9013693600'\n }\n origin = {\n :street => '80 E. Rio Salado Pkwy. #711', # Off Madison Ave\n :city => 'Tempe',\n :state => 'AZ',\n :zip => '85281',\n :country => 'US'\n }\n destination = {\n :street => '942 South Shady Grove Road', # Fedex\n :city => 'Memphis',\n :state => 'TN',\n :zip => '38120',\n :country => 'US',\n :residential => false\n }\n pkg_count = 1\n weight = 10\n service_type = Fedex::ServiceTypes::FEDEX_GROUND\n \n begin\n @price, @label, @tracking_number = @fedex.label(\n :shipper => { :contact => shipper, :address => origin },\n :recipient => { :contact => recipient, :address => destination },\n :count => pkg_count,\n :weight => weight,\n :service_type => service_type\n )\n rescue => e\n puts e.backtrace\n end\n \n send_data(@label, :filename => \"yourlabel.pdf\", :type => \"application/pdf\")\n \n # @price = @fedex.price(\n # :shipper => { :contact => shipper, :address => origin },\n # :recipient => { :contact => recipient, :address => destination },\n # :count => pkg_count,\n # :weight => weight,\n # :service_type => service_type\n # )\n \n end", "def fees_submission_save\n @target_action='fees_submission_student'\n @target_controller='finance'\n @student = Student.find(params[:student])\n @date = @fee_collection = FinanceFeeCollection.find(params[:date])\n @financefee = @date.fee_transactions(@student.id)\n @due_date = @fee_collection.due_date\n @fee_category = FinanceFeeCategory.find(@fee_collection.fee_category_id, :conditions => [\"is_deleted IS NOT NULL\"])\n particular_and_discount_details\n total_fees = @financefee.balance.to_f+FedenaPrecision.set_and_modify_precision(params[:special_fine]).to_f\n unless params[:fine].nil?\n total_fees += FedenaPrecision.set_and_modify_precision(params[:fine]).to_f\n end\n @transaction_date= params[:transaction_date].present? ? Date.parse(params[:transaction_date]) : Date.today_with_timezone\n fine_waiver_value = params[:fine_waiver_val].present? ? params[:fine_waiver_val] : @financefee.is_fine_waiver? ? true :false\n financial_year_check\n if @financial_year_enabled\n if request.post?\n unless params[:fees][:fees_paid].to_f <= 0\n unless params[:fees][:payment_mode].blank?\n unless FedenaPrecision.set_and_modify_precision(params[:fees][:fees_paid]).to_f > FedenaPrecision.set_and_modify_precision(total_fees).to_f\n transaction = FinanceTransaction.new\n ActiveRecord::Base.transaction do\n # begin\n (@financefee.balance.to_f > params[:fees][:fees_paid].to_f) ? transaction.title = \"#{t('receipt_no')}. (#{t('partial')}) F#{@financefee.id}\" : transaction.title = \"#{t('receipt_no')}. F#{@financefee.id}\"\n transaction.category = FinanceTransactionCategory.find_by_name(\"Fee\")\n transaction.payee = @student\n transaction.finance = @financefee\n transaction.fine_included = true unless params[:fine].nil?\n transaction.amount = params[:fees][:fees_paid].to_f\n transaction.fine_amount = params[:fine].to_f\n transaction.transaction_type = 'SINGLE'\n if params[:special_fine] and total_fees==params[:fees][:fees_paid].to_f\n # transaction.fine_amount = params[:fine].to_f+params[:special_fine].to_f\n # transaction.fine_included = true\n @fine_amount=0\n end\n transaction.transaction_date = params[:transaction_date]\n transaction.payment_mode = params[:fees][:payment_mode]\n transaction.reference_no = params[:fees][:reference_no]\n transaction.cheque_date = params[:fees][:cheque_date] if params[:fees][:cheque_date].present?\n transaction.bank_name = params[:fees][:bank_name] if params[:fees][:bank_name].present?\n transaction.payment_note = params[:fees][:payment_note]\n transaction.fine_waiver = fine_waiver_value\n transaction.wallet_amount_applied = params[:fees][:wallet_amount_applied] if params[:fees][:wallet_amount_applied].present?\n transaction.wallet_amount = params[:fees][:wallet_amount] if params[:fees][:wallet_amount].present?\n transaction.safely_create\n # transaction.save\n if transaction.errors.present?\n flash[:notice] = \"#{t('fee_payment_failed')}\"\n transaction.errors.full_messages.each do |err_msg|\n @financefee.errors.add_to_base(err_msg)\n end\n raise ActiveRecord::Rollback\n else\n flash[:warning] = \"#{t('finance.flash14')}. <a href ='#' onclick='show_print_dialog(#{transaction.id})'>#{t('print_receipt')}</a>\"\n end\n # rescue Exception => e\n # puts e.inspect\n # raise ActiveRecord::Rollback\n # end\n end\n @financefee.reload\n # is_paid = @financefee.balance==0 ? true : false\n # @financefee.update_attributes(:is_paid => is_paid)\n # flash[:warning] = \"#{t('flash14')}. <a href ='http://#{request.host_with_port}/finance/generate_fee_receipt_pdf?transaction_id=#{transaction.id}' target='_blank'>#{t('print_receipt')}</a>\"\n\n flash[:notice]=nil\n else\n flash[:warning]=nil\n flash[:notice] = \"#{t('flash19')}\"\n end\n else\n flash[:warning]=nil\n flash[:notice] = \"#{t('select_one_payment_mode')}\"\n end\n else\n flash[:warning]=nil\n flash[:notice] = \"#{t('flash23')}\"\n end\n end\n end\n @paid_fees = @financefee.finance_transactions.all(:include => :transaction_ledger)\n bal=(@total_payable-@total_discount).to_f\n days=(@transaction_date - @date.due_date.to_date).to_i\n auto_fine=@date.fine\n if days > 0 and auto_fine and !@financefee.is_fine_waiver\n @fine_rule=auto_fine.fine_rules.find(:last, :conditions => [\"fine_days <= '#{days}' and created_at <= '#{@date.created_at}'\"], :order => 'fine_days ASC')\n if Configuration.is_fine_settings_enabled? && @financefee.balance <= 0 && @financefee.is_paid == false && @financefee.balance_fine.present?\n @fine_amount = @financefee.balance_fine\n else\n @fine_amount=@fine_rule.is_amount ? @fine_rule.fine_amount : (bal*@fine_rule.fine_amount)/100 if @fine_rule and @financefee.is_paid==false\n if @fine_rule and @financefee.balance==0\n @fine_amount=@fine_amount.to_f-@financefee.paid_auto_fine\n end\n end\n end\n\n @fine_amount=0 if @financefee.is_paid\n @transaction_date = Date.today_with_timezone if request.post?\n render :update do |page|\n page.replace_html \"fee_submission\", :partial => \"finance/fees_payment/fees_submission_form\"\n end\n end", "def tot_deposits_made\n Rails.logger.debug(\"*** tot_deposits_made\")\n # note cannot use database sum because big_deposit is not native to database\n dep_result = 0.0\n EmployeeBenefit.where(\n \"employee_id = ? and eff_month = ? and eff_year = ? and deposited_at IS NOT NULL\",\n self.employee_id.to_s,\n self.eff_month.to_s,\n self.eff_year.to_s\n ).each do |eb|\n dep_result += round_money(eb.deposit)\n end\n Rails.logger.debug(\"*** dep_result: #{dep_result.inspect}\")\n return dep_result\n end", "def fee_as_percentage\n (merchant.fee * 100).to_i\n end", "def total_amount_passed_to_field_worker\n # it is assumed that the setup fee is deducted from loan disbursement \n total_amount_passed = BigDecimal(\"0\")\n self.membership_to_receive_loan_disbursement.each do |glm|\n glp = glm.group_loan_product \n total_amount_passed += glp.loan_amount - glp.setup_payment_amount\n end\n \n return total_amount_passed\n end", "def generate_fee_receipt\n if params[:detailed].present? and params[:detailed] == \"true\"\n ledger = FinanceTransactionLedger.find(params[:transaction_id],\n :joins => \"LEFT JOIN finance_transactions ft ON ft.transaction_ledger_id = finance_transaction_ledgers.id\n INNER JOIN finance_transaction_receipt_records ftrr ON ftrr.finance_transaction_id = ft.id\n LEFT JOIN fee_accounts fa ON fa.id = ftrr.fee_account_id\",\n # :conditions => \"(ftrr.fee_account_id IS NULL OR (ftrr.fee_account_id IS NOT NULL AND fa.is_deleted = false))\",\n :conditions => \"#{active_account_conditions(true, 'ftrr')}\",\n :include => {:finance_transactions => :finance_transaction_receipt_record})\n finance_transactions = ledger.finance_transactions #.all(:include => :finance_transaction_receipt_record)\n else\n finance_transactions = FinanceTransaction.find_all_by_id(params[:transaction_id],\n :joins => \"INNER JOIN finance_transaction_receipt_records ftrr ON ftrr.finance_transaction_id = finance_transactions.id\n LEFT JOIN fee_accounts fa ON fa.id = ftrr.fee_account_id\",\n # :conditions => \"(ftrr.fee_account_id IS NULL OR (ftrr.fee_account_id IS NOT NULL AND fa.is_deleted = false))\",\n :conditions => \"#{active_account_conditions(true, 'ftrr')}\",\n :include => :finance_transaction_receipt_record)\n end\n template_ids = []\n @transactions = finance_transactions.map do |ft|\n receipt_data = ft.receipt_data\n template_ids << receipt_data.template_id = ft.fetch_template_id\n receipt_data.transaction_status = ft.transaction_ledger.status\n receipt_data\n end\n template_ids = template_ids.compact.uniq\n @data = {:templates => template_ids.present? ? FeeReceiptTemplate.find(template_ids).group_by(&:id) : {} }\n render :layout => \"print\"\n end", "def deliver(start_address, end_address)\n papertotal = 0\n\n\n\n if @side == \"even\"\n (start_address..end_address).each do |x|\n if x.even?\n papertotal += 1\n end\n end\n else\n (start_address..end_address).each do |x|\n if x.odd?\n papertotal += 1\n end\n end\n end\n\n if papertotal > quota\n @daypay = quota * 0.25 + (( papertotal - quota) * 0.5)\n @earnings += @daypay\n else\n @daypay = papertotal*0.25\n @earnings += @daypay - 2\n end\n @experience += papertotal\n return @daypay\n end", "def get_fee(price, currency=\"USD\")\n query_and_build \"marketplace/fee/#{price}/#{currency}\"\n end", "def build_detail_fee_based\n details = self.invoice_details.new(:created_user => self.created_user, :record_type => InvoiceDetail::FEE, :provider_name => 'a',\n :patient_name => 'a', :dos => Date.today, :disposition => InvoiceDetail::INCLUDE)\n end", "def fbo_email_fees(fbo, fbo_info)\n #information needed for email\n @fbo=fbo\n @email_from_fbo=fbo_info\n \n mail(to: 'madison@chartair.us', subject: 'FBO Price Information')\n end", "def batch_fees_report\n if validate_date\n filter_by_account, account_id = account_filter\n\n if filter_by_account\n ft_joins = [{:finance_transactions => :finance_transaction_receipt_record}]\n filter_conditions = \"AND finance_transaction_receipt_records.fee_account_id #{account_id == nil ? 'IS' : '='} ?\"\n filter_values = [account_id]\n filter_select = \", finance_transaction_receipt_records.fee_account_id AS account_id\"\n joins = [:finance_transaction_receipt_record]\n else\n ft_joins = [:finance_transactions]\n filter_conditions = \"\"\n filter_values = []\n filter_select = \"\"\n joins = []\n end\n\n @target_action=\"batch_fees_report\"\n @fee_collection = FinanceFeeCollection.find(params[:id])\n @batch = Batch.find(params[:batch_id])\n\n @grand_total = FinanceTransaction.all(:select => \"amount\", :joins => [:finance_fees] + joins,\n :conditions => [\"finance_fees.batch_id = ? AND finance_fees.fee_collection_id = ? AND\n (finance_transactions.transaction_date BETWEEN ? AND ?) #{filter_conditions}\",\n params[:batch_id], params[:id], @start_date.to_s, @end_date.to_s] + filter_values).map { |x| x.amount.to_f }.sum\n\n @transactions = FinanceTransaction.paginate(:page => params[:page], :per_page => 10,\n :include => :transaction_ledger, :select => \"finance_transactions.* #{filter_select}\",\n :joins => [:finance_fees, :transaction_ledger] + joins,\n :conditions => [\"finance_fees.batch_id = ? AND finance_fees.fee_collection_id = ? AND\n (finance_transactions.transaction_date BETWEEN ? AND ?) #{filter_conditions}\",\n params[:batch_id], params[:id], @start_date.to_s, @end_date.to_s] + filter_values)\n\n if request.xhr?\n render(:update) do |page|\n page.replace_html \"fee_report_div\", :partial => \"batch_fees_report\"\n end\n end\n else\n render_date_error_partial\n end\n end", "def test_payment_amount_for_output_with_sum_of_interest_and_payment\n eob = insurance_payment_eobs(:eob_57)\n facility = facilities(:facility_94)\n facility_output_config = facility_output_configs(:facility_config_226)\n total_payment_amount_for_output = eob.payment_amount_for_output(facility, facility_output_config)\n assert_equal(total_payment_amount_for_output, 48.00)\n end", "def validatable_basic_fee_types\n @fee_types.select do |fee_type|\n fee_type.calculated == true && !fee_type.defendant_uplift?\n end\n end", "def fixed_fee_quantity\n qty = billing_frequency.total_months\n sub_starting_at = subscriber.starting_at\n sub_ending_at = subscriber.ending_at\n if self.reading_type_id == ReadingType::RETIRADA && !self.reading_date.blank?\n sub_ending_at = self.reading_date.to_date\n end\n bp_billing_starting_date = billing_period.billing_starting_date\n bp_billing_ending_date = billing_period.billing_ending_date\n begin\n if sub_starting_at > bp_billing_starting_date && sub_starting_at < bp_billing_ending_date\n # Subscriber registerd during the period\n # qty = (bp_billing_ending_date - sub_starting_at).to_i.days.seconds / 1.month.seconds\n qty = ((bp_billing_ending_date - sub_starting_at).days.seconds / 1.month.seconds).round\n end\n if (!sub_ending_at.nil?) && (sub_ending_at > bp_billing_starting_date && sub_ending_at < bp_billing_ending_date)\n # Subscriber withdrawn during the period\n qty = ((sub_ending_at - bp_billing_starting_date).days.seconds / 1.month.seconds).round\n end\n rescue\n qty = billing_frequency.total_months\n end\n return qty\n end", "def calculate_fee\n cost = (shooter.current_member? or join_psac) ? 15 : 20\n has_shooter = persisted? ? match.has_more_than_one_shooter?(shooter) : match.has_shooter?(shooter)\n if has_shooter\n cost = 3\n self.squad = 5\n end\n if join_psac\n cost += 30\n end\n self.fee = cost\n end", "def pay_entry_fee(entry_fee)\n # if the guest has enough cash for entry_fee\n if @cash >= entry_fee\n # decrement guest cash by entry_fee\n @cash -= entry_fee\n # update guest entry_paid to true\n update_entry_paid()\n end\n end", "def test_standard_credit_results\n @standard_credit_Value.each { |key, value| assert_in_delta @calc_standard[@row_number][key], value, 0.03 }\n check_count @calc_standard\n end", "def trading_fee\n return exchange_trading_fee if exchange_trading_fee > 0\n system_calculated_trading_fee\n end", "def create_finance_fee(collection, student)\n last_receipt_no = FinanceFee.last.receipt_no if FinanceFee.last\n fee = FinanceFee.new\n fee.finance_fee_collection_id = collection\n fee.student_id = student\n fee.is_paid = false\n if last_receipt_no.nil?\n fee.receipt_no = 001\n else\n fee.receipt_no = last_receipt_no.next\n end\n fee.save\n end", "def order_fee extra_fee=false, bitcoin=false\n fee = APPLICATION_FEE\n fee += FAIL_FEE if extra_fee\n number = bitcoin ? bitcoin_amount : price\n ((number.to_f * fee) * 100.0).to_i\n end", "def fee_receipts\n unless params[:search].present?\n @start_date=@end_date=FedenaTimeSet.current_time_to_local_time(Time.now).to_date\n else\n @start_date=date_fetch('start_date_as')\n @end_date=date_fetch('end_date_as')\n end\n @search_params = params[:search] || Hash.new\n @search_params[:start_date_as] = @start_date\n @search_params[:end_date_as] = @end_date\n @search = fetched_fee_receipts.search(@search_params)\n @receipts=@search.concat AdvanceFeeCollection.fetch_advance_fees_receipts(@start_date, @end_date, params)\n @fee_receipts = @receipts.sort_by{|o| o.transaction_date.to_date}.reverse.paginate(\n :per_page => 20,\n :page => params[:page])\n @grand_total = 0.00\n @fee_receipts.each {|f| @grand_total += f.amount.to_f }\n end", "def book_royalty(period='enddate', basis=\"Net receipts\")\n royarray = []\n sales = self.book_sales(period, basis, false) # this calls the royalty calculation for net receipts\n sales.each do |sale|\n royarray << sale.royalty_by_band.inject(0) { |sum, i| sum + i.to_f unless i.nan? || i.nil? }\n end\n book_royalty = royarray.inject(0) { |sum, i| sum +i.to_f }\n end", "def test_processor_input_field_count_with_adjustment_amounts\n svc = service_payment_eobs(:service_line_26)\n total_field_count = svc.processor_input_field_count(facilities(:facility8), false)\n if $IS_PARTNER_BAC\n assert_equal(total_field_count, 15)\n else\n assert_equal(total_field_count, 11)\n end\n end", "def charge_fee\r\n\t\tif_member = Participant.find_by(participantID: participantID)\r\n\t\tif_course = Course.find_by(courseID: courseID)\r\n\t\t\r\n\t\tif if_course != nil && if_member != nil\r\n\t\t\tearlyBirdTime = if_course.startDate.months_ago(1)\r\n\t\t\tif if_member.expirydate > Date.today\r\n\t\t\t\tif Date.today >= earlyBirdTime && Date.today < if_course.startDate\r\n\t\t\t\t\treturn if_course.earlybirdPrice\r\n\t\t\t\telse\r\n\t\t\t\t\treturn if_course.memberPrice\r\n\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\treturn if_course.nonmemberPrice\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def usd_profit\n break_even(:usd).abs\n end", "def save_invoice_items(tariff, invoice, bill, cf, user_id)\n # Fixed\n fixed_fee_qty = fixed_fee_quantity\n if !tariff.fixed_fee.zero?\n tariff_code = tariff.try(:billable_item).try(:billable_concept).try(:code) rescue ''\n # tariff_price = tariff.fixed_fee / tariff.billing_frequency.total_months\n tariff_price = (tariff.fixed_fee / tariff.billing_frequency.total_months) * coefficient_by_users(tariff, 'F')\n if tariff_code == 'SUM' && should_bill_by_inhabitants_or_endowments?(tariff, 'F')\n tariff_price = tariff_price * subscriber.right_inhabitants_and_endowments\n end\n if tariff_code == 'DEP'\n tariff_price = tariff_price * subscriber.right_equiv_dwelling\n end\n create_invoice_item(tariff,\n invoice.id,\n \"CF\",\n tariff_price,\n fixed_fee_qty,\n tariff.billing_frequency.fix_measure_id,\n tariff.try(:tax_type_f_id),\n tariff.try(:discount_pct_f),\n user_id, '')\n elsif tariff.percentage_fixed_fee > 0 and !tariff.percentage_applicable_formula.blank?\n create_invoice_item(tariff,\n invoice.id,\n \"CF\",\n ((tariff.percentage_fixed_fee/100) * Invoice.find(invoice.id).total_by_concept_ff(tariff.percentage_applicable_formula)) / billing_frequency.total_months,\n fixed_fee_qty,\n tariff.billing_frequency.fix_measure_id,\n tariff.try(:tax_type_f_id),\n tariff.try(:discount_pct_f),\n user_id, '')\n end\n\n # Variables\n # block_frequency = billing_frequency.total_months.to_d / tariff.billing_frequency.total_months.to_d\n block_frequency = coefficient_for_billing_blocks(tariff, fixed_fee_qty)\n if !tariff.block1_limit.nil? && tariff.block1_limit > 0\n limit_before = 0\n block_limit = 0\n (1..8).each do |i|\n block_limit = ((tariff.instance_eval(\"block#{i}_limit\") + coefficient_by_inhabitants(tariff, 'V')) * block_frequency * coefficient_by_users(tariff, 'V')).round rescue nil\n # if limit nil (last block) or limit > consumption\n if block_limit.nil? || block_limit >= (cf || 0)\n create_invoice_item(tariff,\n invoice.id,\n \"BL\"+i.to_s,\n tariff.instance_eval(\"block#{i}_fee\"),\n ((cf || 0) - limit_before),\n tariff.billing_frequency.var_measure_id,\n tariff.try(:tax_type_b_id),\n tariff.try(:discount_pct_b),\n user_id, '')\n break\n else\n create_invoice_item(tariff,\n invoice.id,\n \"BL\"+i.to_s,\n tariff.instance_eval(\"block#{i}_fee\"),\n block_limit - limit_before,\n tariff.billing_frequency.var_measure_id,\n tariff.try(:tax_type_b_id),\n tariff.try(:discount_pct_b),\n user_id, '')\n limit_before = block_limit\n end\n end # (1..8).each\n elsif tariff.percentage_fee > 0 and !tariff.percentage_applicable_formula.blank?\n create_invoice_item(tariff,\n invoice.id,\n \"VP\",\n cf != 0.0 ? (tariff.percentage_fee/100) * Invoice.find(invoice.id).total_by_concept(tariff.percentage_applicable_formula, false) / cf : 0.0,\n cf,\n tariff.billing_frequency.var_measure_id,\n tariff.try(:tax_type_p_id),\n tariff.try(:discount_pct_p),\n user_id, '')\n elsif tariff.variable_fee > 0\n create_invoice_item(tariff,\n invoice.id,\n \"CV\",\n tariff.variable_fee,\n cf,\n tariff.billing_frequency.var_measure_id,\n tariff.try(:tax_type_v_id),\n tariff.try(:discount_pct_v),\n user_id, '')\n end # tariff.block1_limit > 0\n end", "def transaction_fee_cents(method_type)\n select_from_hash_array(TRANSACTION_METHODS, :transaction_fee_cents, :type => method_type.to_sym)\n end", "def fee_collection_new\n @fines = Fine.active\n fy_id = current_financial_year_id\n @fee_categories = FinanceFeeCategory.all(:select => \"DISTINCT finance_fee_categories.*\",\n :joins => [{:category_batches => :batch}, :fee_particulars],\n :conditions => [\"batches.is_active = 1 AND batches.is_deleted = 0 AND finance_fee_categories.is_deleted=0 AND\n finance_fee_particulars.is_deleted = 0 AND financial_year_id #{fy_id.present? ? '=' : 'IS'} ?\", fy_id])\n\n @finance_fee_collection = FinanceFeeCollection.new({:discount_mode => @school_discount_mode,\n :financial_year_id => fy_id})\n @start_date, @end_date = FinancialYear.fetch_current_range\n\n deliver_plugin_block :fedena_reminder do\n @finance_fee_collection.build_alert_settings\n end\n end" ]
[ "0.78026605", "0.7739401", "0.7490415", "0.71905243", "0.6995158", "0.6895972", "0.6779702", "0.6769731", "0.6651839", "0.6651839", "0.6651839", "0.6346239", "0.63112605", "0.629387", "0.62936807", "0.6267589", "0.6266887", "0.61886513", "0.6066112", "0.60280365", "0.60067075", "0.59426534", "0.5931873", "0.5931462", "0.5930551", "0.5878849", "0.58674556", "0.5863122", "0.5841482", "0.5829752", "0.5785008", "0.5759336", "0.575227", "0.575227", "0.5730093", "0.5709188", "0.5703869", "0.5687716", "0.5658236", "0.5636568", "0.5635842", "0.56235385", "0.55975753", "0.5597307", "0.5578746", "0.55537415", "0.55467963", "0.5540043", "0.5540043", "0.5537793", "0.55306226", "0.5523637", "0.55234927", "0.55206126", "0.54966885", "0.54906964", "0.5482275", "0.54776263", "0.54723656", "0.54666966", "0.5465016", "0.5464639", "0.5461989", "0.54552597", "0.54529756", "0.5450519", "0.54443294", "0.54437953", "0.5431292", "0.54212856", "0.53920656", "0.5381945", "0.5366192", "0.5349912", "0.5347523", "0.5331977", "0.53262645", "0.5320907", "0.5316282", "0.5311598", "0.5311131", "0.531068", "0.5303491", "0.5296853", "0.5272457", "0.52633095", "0.52519", "0.52483916", "0.5246299", "0.52434057", "0.5217222", "0.52156657", "0.5212621", "0.520674", "0.52056485", "0.52049476", "0.5200987", "0.5195864", "0.51885986", "0.51860446" ]
0.7189085
4
Verifies fees match test data
def verify_fees(test_data) fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee] fees.each_with_index do |fee, index| verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index)) verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index)) verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index)) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def fees\n total_input - total_output\n end", "def enter_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n prep_fieldsets_for_test_data([fieldset(UseOfCollections::FEE_GRP.name)], fees)\n fees.each_with_index do |fee, index|\n wait_for_options_and_select(fee_currency_input(index), fee_currency_options(index), fee[UseOfCollections::FEE_CURRENCY.name])\n wait_for_element_and_type(fee_value_input(index), fee[UseOfCollections::FEE_VALUE.name])\n wait_for_element_and_type(fee_note_input(index), fee[UseOfCollections::FEE_NOTE.name])\n wait_for_element_and_click(fee_paid_input(index)) if fee[UseOfCollections::FEE_PAID.name]\n end\n end", "def check_data_validation\r\n if @tx_interest.text.to_f > 0 and \r\n @tx_interest.text.to_f < 0.1 and\r\n @tx_amount.text.to_i >= 1000 and\r\n @tx_years.text.to_i >= 1 then\r\n tf = true\r\n else\r\n tf = false\r\n end\r\n return tf\r\n end", "def fees\n raise Sibit::NotSupportedError, 'Btc.com doesn\\'t provide recommended fees'\n end", "def enter_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n hide_notifications_bar\n prep_fieldsets_for_test_data([fieldset(CoreUseOfCollectionsData::FEE_GRP.name)], fees)\n fees.each_with_index do |fee, index|\n logger.info \"Entering fee data set at index #{index}: #{fee}\"\n wait_for_options_and_select(fee_currency_input(index), fee_currency_options(index), fee[CoreUseOfCollectionsData::FEE_CURRENCY.name])\n wait_for_element_and_type(fee_value_input(index), fee[CoreUseOfCollectionsData::FEE_VALUE.name])\n wait_for_element_and_type(fee_note_input(index), fee[CoreUseOfCollectionsData::FEE_NOTE.name])\n wait_for_element_and_click(fee_paid_input(index)) if fee[CoreUseOfCollectionsData::FEE_PAID.name]\n end\n end", "def fees\n raise Sibit::NotSupportedError, 'Blockchair doesn\\'t implement fees()'\n end", "def total_fee_is_valid\n errors.add(:total_fee,'The total fee is invalid.') unless total_fee_is_valid?\n end", "def test_standard_credit_results\n @standard_credit_Value.each { |key, value| assert_in_delta @calc_standard[@row_number][key], value, 0.03 }\n check_count @calc_standard\n end", "def free?\n self.setupFee == 0 && self.laborFee == 0 && self.oneTimeFee == 0 && self.recurringFee == 0 && self.hourlyRecurringFee == 0\n end", "def test_guest_funds\n assert_equal(200, @guest3.return_guest_funds)\n end", "def test_valid_with_attributes\r\n fee_schedule = FeeSchedule.new\r\n fee_schedule.start_date = fee_schedules(:fee_schedule_00001).start_date\r\n fee_schedule.end_date = fee_schedules(:fee_schedule_00001).end_date\r\n assert fee_schedule.valid?, fee_schedule.errors.full_messages \r\n end", "def fees\n @fees ||= {\n \"insurance_fee\" => (commission * ASSURANCE_SHARE).round(0),\n \"assistance_fee\" => (ASSISTANCE_COST * rental.duration).round(0)\n }.tap { |fees| fees[\"drivy_fee\"] = commission - fees.values.inject(:+) }\n end", "def test_total_cost\n assert_equal(46.0, @check_test.total_cost)\n end", "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def validateFI(vat_number)\r\n total = 0\r\n multipliers = [7,9,10,5,8,4,2]\r\n 0.upto(6) do |i|\r\n total += vat_number[i,1].to_i * multipliers[i]\r\n end\r\n # Establish the check digit\r\n total = 11 - total % 11\r\n total = 0 if total > 9\r\n return true if total == vat_number[7..8].to_i\r\n return false\r\n end", "def verify_use_dates(test_data)\n dates = test_data[UseOfCollections::USE_DATE_GRP.name] || [UseOfCollections.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[UseOfCollections::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[UseOfCollections::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[UseOfCollections::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def verify_staff(test_data)\n staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def test_receive_entry_fee\n @room.receive_entry_fee(10)\n assert_equal(110, @room.till_balance())\n end", "def run_fe_tests\n end", "def validate_funding\n # randomize funding method!\n validate_random_day 'Funding Method', EngagementRequest::FUNDING_METHODS[self.funding_method]\n\n # sponsor is funding it!\n if self.cost_center != self.sponsor.department.cost_center\n add_validation \"Cost Center should match the Sponsor's cost center\"\n end\n\n # detailed estimate must be funding approved!\n if self.detailed_estimate? && ! (self.approved? || self.budget?)\n add_validation EngagementRequest::ENGAGEMENT_TYPES[self.engagement_type] + ' must have budget ' +\n EngagementRequest::FUNDING_STATUSES[\"approved\"] + ' or ' +\n EngagementRequest::FUNDING_STATUSES[\"budget\"]\n end\n # scheduling or rescue must have budget!\n if (self.scheduling? || self.rescue?) && ! self.budget?\n add_validation EngagementRequest::ENGAGEMENT_TYPES[self.engagement_type] + ' must have ' +\n EngagementRequest::FUNDING_STATUSES[\"budget\"]\n end\n\n # must have a decent budget!\n if self.budget_allocated < 100_000\n add_validation 'Projects with a budget of less than $100,000 are not accepted'\n end\n end", "def verify_use_dates(test_data)\n dates = test_data[CoreUseOfCollectionsData::USE_DATE_GRP.name] || [CoreUseOfCollectionsData.empty_use_date]\n dates.each_with_index do |date, index|\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE.name], element_value(use_date_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_TIME_NOTE.name], element_value(use_date_time_note(index)))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_NUM_VISITORS.name], element_value(use_num_visitors_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_HOURS_SPENT.name], element_value(use_hours_spent_input index))\n verify_values_match(date[CoreUseOfCollectionsData::USE_DATE_VISITOR_NOTE.name], element_value(use_note_input index))\n end\n end", "def total_fee_is_valid?\n return ((self.total_fee != nil) and (self.total_fee >= 0))\n end", "def fee_for_additional_materials_is_valid\n errors.add(:fee_for_additional_materials, 'The fee for additional materials is invalid.') unless fee_for_additional_materials_is_valid?\n end", "def test_should_not_validate_double_claiming\n claiming = create_claiming\n assert claiming.valid?\n claiming = create_claiming\n assert !claiming.valid?\n end", "def verify\n end", "def test_num_transactions_correct_0_true\n assert_equal(false, @bv.num_transactions_correct?(0, [0,1]))\n end", "def verify_foundation_date(test_data)\n errors = []\n text_values_match?(test_data[Org::FOUNDING_DATE.name], element_value(foundation_date_input), errors)\n errors\n end", "def check_for_tot_bal\n val1 = @txt_val1.text.gsub(/[$]/, '$' => '')\n val2 = @txt_val2.text.gsub(/[$]/, '$' => '')\n val3 = @txt_val3.text.gsub(/[$]/, '$' => '')\n val4 = @txt_val4.text.gsub(/[$]/, '$' => '')\n val5 = @txt_val5.text.gsub(/[$]/, '$' => '')\n total_val_expected = [val1, val2, val3, val4, val5].map(&:to_f).inject(:+)\n total_val_actual = @txt_val_ttltext.gsub(/[$]/, '$' => '').to_f\n total_val_expected == total_val_actual\n end", "def fee_per_meeting_is_valid\n errors.add(:fee_per_meeting, 'The fee per meeting is invalid.') unless fee_per_meeting_is_valid?\n end", "def test_validate_patient_account_number_by_giving_valid_data\n eob = InsurancePaymentEob.new\n eob.patient_account_number= \"gh.gh-89\"\n eob.save\n assert eob.valid?, eob.errors.full_messages.to_s\n end", "def test_cost\n \n assert_equal(@check_test.cost, @check_test.cost.to_i)\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def test_valid_account\n assert_equal 0, elfproef(123456789)\n assert_equal 0, elfproef('12.34.56.789')\n assert_equal 0, elfproef('12 34 56 789')\n assert_equal 0, elfproef(1234567)\n assert_equal 0, elfproef('1234567')\n end", "def test_annuity_credit_results\n @annuity_credit_Value.each { |key, value| assert_in_delta @calc_annuity[@row_number][key], value, 0.03 }\n check_count @calc_annuity\n end", "def test_lend_money_transfers_money\n #Setup\n lender_before =\n lender_after =\n lendee_before =\n lendee_after =\n loan =\n #act\n #assert\n assert_equal(loan, lender_before - lender_after)\n assert_equal(loan, lendee_after- lendee_before)\nend", "def test_costo_cafe\n print validate(177.56, costo_cafe(100.0,7))\n print validate(1537.30, costo_cafe(1000.0,5)) \n print validate(363.0, costo_cafe(300.0,2)) \nend", "def test_num_transactions_correct_not_0_true\n assert @bv.num_transactions_correct?(1, [0,2,3])\n end", "def verify\n end", "def test_num_transactions_correct_0_true\n assert @bv.num_transactions_correct(0, [0])\n end", "def verify()\n # TODO\n end", "def validate_amounts_for state\n\t\tvalidate_confirmation_page\n\t\t\n\t\ttax_rate = state_tax_rate(state)\n\t\t \t\n \tsubtotal = @driver.find_element(:id, 'subtotal').text\n \ttaxes = @driver.find_element(:id, 'taxes').text\n \ttotal = @driver.find_element(:id, 'total').text\n \t\n \t# check the tax computation\n \tunless (currency_of taxes) == currency_limit((tax_rate) * (currency_of subtotal))\n \t\tp state + ' tax rate is incorrect'\n \tend\n \t\n \t# check the math while we're at it\n \texpect(currency_of total).to eq (currency_of subtotal) + (currency_of taxes)\n\tend", "def verify_fields(fbe_struct_size)\n fbe_current_size = 4 + 4\n\n if (fbe_current_size + currency.fbe_size) > fbe_struct_size\n return true\n end\n unless currency.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += currency.fbe_size\n\n if (fbe_current_size + amount.fbe_size) > fbe_struct_size\n return true\n end\n unless amount.verify\n return false\n end\n # noinspection RubyUnusedLocalVariable\n fbe_current_size += amount.fbe_size\n\n true\n end", "def fee_per_meeting_is_valid?\n return ((self.fee_per_meeting != nil) and (self.fee_per_meeting >= 0))\n end", "def check_free_venue\n if @total >= 20\n return true\n end\n end", "def fraud\n if !(@balance_total == @balance_checking + @balance_savings) then\n puts \"I am sorry there is a problem with your account.\"\n @balance_checking = \"#{@balance_checking}-frozen\" #converts to string\n @balance_savings = \"#{@balance_savings}-frozen\" #converts to string\n return true\n else\n return false\n end #if\n end", "def fee_for_additional_materials_is_valid?\n return ((self.fee_for_additional_materials != nil) and (self.fee_for_additional_materials >= 0))\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def verify\n\n end", "def fee\n params['amount_fee']\n end", "def free?\n\t\t\t\tnot(fee?)\n\t\t\tend", "def valid_test_taking()\n if current_user.tenant.pricing_plan.plan_group == \"assessment_only_plan\" then\n if current_user.tenant.remaining_learner_credit > 0 then\n return true\n else\n return false\n end\n else\n return true\n end\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def verify_token_count\n return if (@last_verified_block_number_for_total + 60 > @current_block_number) ||\n @total_token_sold_count.nil?\n\n total_tokens_in_wei_sold_in_db = PurchaseLog.select('sum(st_wei_value) as total_tokens_in_wei_sold').\n first.total_tokens_in_wei_sold.to_i\n pre_sale_st_tokens_in_wei_sold = SaleGlobalVariable.pre_sale_data[:pre_sale_st_token_in_wei_value]\n\n ApplicationMailer.notify(\n body: {},\n data: {\n current_block_number: @current_block_number,\n total_tokens_sold_in_db: total_tokens_in_wei_sold_in_db,\n total_token_sold_count_in_event: @total_token_sold_count,\n pre_sale_st_tokens_in_wei_sold: pre_sale_st_tokens_in_wei_sold\n },\n subject: 'Data Mismatch For total tokens sold'\n ).deliver if @total_token_sold_count != (total_tokens_in_wei_sold_in_db + pre_sale_st_tokens_in_wei_sold)\n\n SaleGlobalVariable.last_block_verified_for_tokens_sold_variable_kind.update_all(variable_data: @current_block_number.to_s)\n @last_verified_block_number_for_total = @current_block_number\n end", "def verify_freelancer_profile(freelancers)\n Logbook.step(\"Verify freelancer #{@freelancer_profile[:name]} profile\")\n freelancer = freelancers.find { |freelancer| freelancer[:name] == @freelancer_profile[:name] }\n Logbook.message(\"*****Profile page of #{freelancer[:name]}*****\")\n @freelancer_profile.each do |key, value|\n if value.include?(freelancer[key.to_sym])\n Logbook.message(\"+ Profile field #{key} matches with the same field from preview.\")\n else\n Logbook.message(\"- Profile field #{key} does not match with the same field from preview.\")\n end\n end\n end", "def validateES(vat_number)\r\n total = 0\r\n temp = 0\r\n multipliers = [2,1,2,1,2,1,2]\r\n esexp = [/^[A-H]\\d{8}$/,/^[N|P|Q|S]\\d{7}[A-Z]$/]\r\n 0.upto(6) do |i|\r\n temp = vat_number[i + 1].to_i * multipliers[i]\r\n if temp > 9\r\n total += (temp / 10) + (temp % 10)\r\n else\r\n total += temp\r\n end\r\n end \r\n # With profit company\r\n if not (vat_number =~ esexp[0]).nil?\r\n # Calculate the check digit\r\n total = 10 - total % 10\r\n total = 0 if total == 10\r\n return true if total == vat_number[8..9].to_i\r\n return false\r\n # Non-profit companies\r\n elsif not (vat_number =~ esexp[1]).nil?\r\n # Calculate the check digit\r\n total = 10 - total % 10\r\n total = (total + 64).chr\r\n return true if total == vat_number[8..9]\r\n return false\r\n end\r\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def verify\n @_buffer.shift(fbe_offset)\n fbe_result = verify_fields\n @_buffer.unshift(fbe_offset)\n fbe_result\n end", "def test_if_qualify(current_salary, monthly_payment)\n\tmonthly_salary = current_salary / 12\n\ttimes_greater = monthly_salary / monthly_payment\n\tif times_greater >= 2 \n\t\tanswer = true \n\telse\n\t\tanswer = false \n\tend\n\treturn answer\nend", "def validateFR(vat_number)\r\n return true if (vat_number =~ /^\\d{11}$/).nil?\r\n total = vat_number[2..11].to_i\r\n # Establish check digit\r\n total = (total*100+12) % 97\r\n return true if total == vat_number[0..2].to_i\r\n return false\r\n end", "def calculate(t, fraud, type)\r\n#\t\tpp \"1\"\r\n\t\treturn 0.0 if type == 'billable' && self.bid_fee #if this fee is a bid fee and we are not looking at the bid fees then return 0, else continue on\r\n\t#\tpp \"2\"\r\n \t\r\n \tfee = self.fixed if self.price_type == 'F'\r\n \r\n fee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) if self.price_type == 'V' #calculate the fee\r\n \r\n return fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\r\n\t\t#if we get here we know we are dealing with a variable fee\r\n\t\t#puts (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min)\r\n\t#\tfee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) #calculate the fee\r\n\t#\tpp fee\r\n\t#\tpp \"3\"\r\n\t#\treturn fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\t\r\n\t\t#otherwise we need to determine the sign and threshold before we can return\r\n\t\tcase self.sign\r\n\t\t\twhen '>'\r\n\t\t\t #pp \">\"\r\n\t\t\t\treturn fee if t.amount > self.threshold\r\n\t\t\twhen '>='\r\n\t\t\t #pp \">=\"\r\n\t\t\t\treturn fee if t.amount >= self.threshold\r\n\t\t\twhen '<'\r\n\t\t\t #pp \"<\"\r\n\t\t\t\treturn fee if t.amount < self.threshold\r\n\t\t\twhen '<='\r\n\t\t\t #pp \"<=\"\r\n\t\t\t\treturn fee if t.amount <= self.threshold\r\n\t\t\telse\r\n\t\t\t #pp \"4\"\r\n\t\t\t\treturn 0.0\r\n\t\tend\r\n\t\t\r\n\t\t#if we get here then we have no idea what to do so just return 0\r\n\t\treturn 0.0\r\n\tend", "def assert_valid\n @validator = validator\n assert @validator.validate(data_sample, fail_fast: true)\n assert @validator.validate(data_sample, fail_fast: false)\n end", "def test_find_DEDUCCIONES_SIN_DETALLE\n \n deduccion_conyuge = RevenueParameter.find(:first, :conditions => \"name = 'CONYUGE' \") \n assert_in_delta(8000.0, deduccion_conyuge.value, 0.01)\n \n deduccion_minimo_no_imponible = RevenueParameter.find(:first, :conditions => \"name = 'MINIMO_NO_IMPONIBLE' \") \n assert_in_delta(7500.0, deduccion_minimo_no_imponible.value, 0.01)\n \n end", "def fees(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/fees\", options).body)\n fees = response.key?('fees') ? response['fees'] : []\n fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }\n end", "def fees(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/fees\", options).body)\n fees = response.key?('fees') ? response['fees'] : []\n fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }\n end", "def fees(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/fees\", options).body)\n fees = response.key?('fees') ? response['fees'] : []\n fees.map { |attributes| Promisepay::Fee.new(@client, attributes) }\n end", "def consistency_checks\n unless certificate_serial_number == voucher_serial_number\n error_report << \"serial number mismatch certificate '#{certificate_serial_number}' vs '#{voucher_serial_number}'\"\n return false\n end\n # other tests here.\n return true\n end", "def success?\r\n\treturn true if @fund >= @target_fund\r\n\treturn false if @fund < @target_fund\r\nend", "def compare_profile_data\n puts \"Step 11: Comparing Freelancer Profile data\"\n parent = $freelancers_card_data[@index]\n child = @profile_data\n puts \"for freelancer #{parent[:name]}, comparing results page fields with internal page fields:\"\n [:description, :title, :skills].each do |field|\n verify_details(parent, child, field, parent[:name])\n end\n puts \"All results are printed successfully\"\n\n end", "def test_can_check_room_is_full_and_enter()\n @room1.guest_enter(@guest)\n @guest.venue_fee(10)\n assert_equal(1, @room1.guest.length)\n assert_equal(0, @guest.money)\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def verify_fields\n fbe_current_offset = 0\n\n currency.fbe_offset = fbe_current_offset\n fbe_field_size = currency.verify\n if fbe_field_size == FBE::Integer::MAX\n return FBE::Integer::MAX\n end\n fbe_current_offset += fbe_field_size\n\n amount.fbe_offset = fbe_current_offset\n fbe_field_size = amount.verify\n if fbe_field_size == FBE::Integer::MAX\n return FBE::Integer::MAX\n end\n fbe_current_offset += fbe_field_size\n\n # noinspection RubyUnnecessaryReturnValue\n fbe_current_offset\n end", "def test_promedio_edades\n n=5\n print validate(23.2, promedio_edades(n)) \nend", "def check_budget\n checks = []\n\n # Internal consistency\n checks << check_equal(\"Transferencias internas ingresos = gastos\", \n beautify(@income[:consolidado][:transferencias]),\n beautify(@expenses[:consolidado][:transferencias]) )\n\n # Expenses\n checks.concat check_expenses('R_6_2_801_1_3', \"Estado\", :estado)\n checks.concat check_expenses('R_6_2_802_1_3', \"Organismos Autónomos\", :ooaa)\n checks.concat check_expenses('R_6_2_803_1_3', \"Agencias estatales\", :agencias)\n checks.concat check_expenses('R_6_2_804_1_3', \"Otros organismos\", :otros)\n checks.concat check_expenses('R_6_2_805_1_3', \"Seguridad Social\", :seg_social)\n\n # Income\n checks.concat check_income('R_6_1_101_1_5_1', \"Estado\", :estado)\n checks.concat check_income('R_6_1_102_1_4_1', \"Organismos Autónomos\", :ooaa)\n checks.concat check_income('R_6_1_103_1_4_1', \"Agencias estatales\", :agencias)\n checks.concat check_income('R_6_1_104_1_4_1', \"Otros organismos\", :otros)\n checks.concat check_income('R_6_1_105_1_5_1', \"Seguridad Social\", :seg_social)\n\n # Return results\n checks.join(\"\\n\")\n end", "def addFees(filename)\n\tresponseText = open(Rails.root.join(\"db\", \"seed_data\", filename)).read\n\tresponseText.each_line do |curRow|\n\t\tcurRow = curRow.strip.downcase # get rid of new lines and make everything lowercase\n\n\t\t# split the excel sheet into individual variables using split\n\t\t# Note that each fee is itself a list of fees separated by commas.\n\t\tstate, city, airportName, airportCode, fboName, phoneNumbers, hasFees, classificationDesc, otherClassification, landingFee, rampFee, tieDownFee, facilityFee, callOutFee, hangarFee, otherFee, changeFrequency, feesWaived, fuelNeeded, contactPerson, callDate, infoQuality, hasFeeSheet, feeSheetLink, additionalInfo = curRow.split(\"\\t\")\n\t\t# If the FBO didn't or wouldn't answer, then we have no data for them and we should skip forward\n\t\tnext if hasFees == \"did not/would not answer\"\n\n\t\t#feeClassification = Classification.find_by( :classification_description => classificationDesc )\n\n\t\tcurAirport = Airport.find_by( :name => airportName)\n\t\tif curAirport.nil?\n\t\t\tcurAirport = Airport.find_by( :airport_code => airportCode )\n\t\t\t# If the airport wasn't found, try adding a k to the front of the airport code and try again\n\t\t\tif curAirport.nil? and airportCode.length == 3\n\t\t\t\tnewCode = \"k\" + airportCode\n\t\t\t\tcurAirport = Airport.find_by( :airport_code => newCode )\n\t\t\telsif curAirport.nil? and airportCode.length == 4\n\t\t\t# If the airport wasn't found, try removing the k from the front and trying again\n\t\t\t\tnewCode = airportCode[1..3]\n\t\t\t\tcurAirport = Airport.find_by( :airport_code => newCode )\n\t\t\tend\n\t\tend\n\n# I guess hypothetically this wouldn't work if there were two FBOs at an airport with the same name, but I don't think that has ever happened yet.\n\t\tcurFbo = Fbo.find_by(:name => fboName, :airport => curAirport)\n\n\t\tif !curFbo.nil?\n\t\t\t# this is what should happen\n\t\t\tif !hasFees.nil? and hasFees.strip == \"no\"\n\t\t\t\t#curFbo.update( :classification => Classification.find_by( :classification_description => \"flat rate\"))\n\t\t\t\tFeeType.find_each do |curFeeType|\n\t\t\t\t\tif curFeeType.fee_type_description == \"call out\"\n\t\t\t\t\t\tsingleFeeHelper(callOutFee, curFbo, curFeeType.fee_type_description, \"flat rate\")\n\t\t\t\t\telsif curFeeType.fee_type_description == \"hangar\"\n\t\t\t\t\t\t# do nothing\n\t\t\t\t\telse\n\t\t\t\t\t\tsingleFeeHelper(\"0\", curFbo, curFeeType.fee_type_description, \"flat rate\")\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t#elsif feeClassification.nil?\n\t\t\t\t#puts curFbo.name\n\t\t\t\t# do nothing\n\n\t\t\t# If the FBO has fees, so most of the time.\n\t\t\telse\n\t\t\t\t#curFbo.update( :classification => feeClassification )\n\t\t\t\t\n\t\t\t\t# For each type of fee, if it isn't nil, the split it up into its individual fees, then call the fee helper method on those fees.\n\t\t\t\t# landing fees\n\t\t\t\tif !landingFee.nil?\n\t\t\t\t\tlandingFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"landing\", classificationDesc)\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# ramp fees\n\t\t\t\tif !rampFee.nil?\n\t\t\t\t\trampFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"ramp\", classificationDesc)\n\t\t\t\t\tend\t\n\t\t\t\tend\n\n\t\t\t\t# tie down fees\n\t\t\t\tif !tieDownFee.nil?\n\t\t\t\t\ttieDownFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"tie down\", classificationDesc)\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# facility fees\n\t\t\t\tif !facilityFee.nil?\n\t\t\t\t\tfacilityFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"facility\", classificationDesc)\n\t\t\t\t\tend\t\n\t\t\t\tend\t\n\n\t\t\t\t# call out fees\n\t\t\t\tif !callOutFee.nil?\n\t\t\t\t\tcallOutFee.split(\",\").each do |curFee|\n\t\t\t\t\t\tsingleFeeHelper(curFee, curFbo, \"call out\", classificationDesc)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\t#puts fboName\n\t\tend\n\tend\nend", "def test_simple\n assert_equal(\"5/25\", Fraccion.new(3,4).to_s)\n assert_equal(\"23/19\", @f1.suma(@f2).to_s)\n assert_equal(\"-1/12\", @f1.resta(@f2).to_s)\n assert_equal(\"85/8\", @f1.producto(@f2).to_s)\n assert_equal(\"23/10\", @f1.division(@f2).to_s)\n end", "def test_05_dada_una_caja_de_ahorros_con_cantidad_de_extracciones_mensuales_igual_a_5_si_hago_una_extraccion_su_saldo_y_sus_extracciones_mensuales_no_deben_variar\n @una_caja_de_ahorros_nueva.depositar 200.pesos\n 5.times { @una_caja_de_ahorros_nueva.extraer 10.pesos }\n\n cantidad_de_extracciones_mensuales_inicial = @una_caja_de_ahorros_nueva.cantidad_de_extracciones_mensuales\n saldo_inicial = @una_caja_de_ahorros_nueva.saldo\n\n @una_caja_de_ahorros_nueva.extraer 10.pesos\n\n assert_equal saldo_inicial, @una_caja_de_ahorros_nueva.saldo\n assert_equal cantidad_de_extracciones_mensuales_inicial, @una_caja_de_ahorros_nueva.cantidad_de_extracciones_mensuales\n end", "def test_invoice_no_discount\r\n\r\n # Add an Invoice\r\n assert_difference 'Invoice.count' do\r\n \r\n #Create new Invoice and fill it up\r\n @user.creates_new_invoice\r\n fill_invoice_for @user \r\n\r\n #Customer Info \r\n current_customer = customers(\"heavy_user_customer_1\".to_sym)\r\n @user.enter_new_customer( \r\n :name => current_customer.name\r\n ) \r\n \r\n # quantity and price initial values\r\n quantity = 20\r\n price = 4.00\r\n \t \r\n #Add line items\r\n add_line_items(quantity, price)\r\n\t \r\n # Submit and verify\r\n assert_difference 'LineItem.count', @number_of_line_items do\r\n @user.submits \r\n end \r\n end \r\n end", "def fees(period = (Time.now.beginning_of_month - 1).beginning_of_month .. (Time.now.beginning_of_month - 1).end_of_month)\n subscription_payments.where({ :created_at => period }).collect(&:affiliate_amount).sum\n end", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def charge_fee\r\n\t\tif_member = Participant.find_by(participantID: participantID)\r\n\t\tif_course = Course.find_by(courseID: courseID)\r\n\t\t\r\n\t\tif if_course != nil && if_member != nil\r\n\t\t\tearlyBirdTime = if_course.startDate.months_ago(1)\r\n\t\t\tif if_member.expirydate > Date.today\r\n\t\t\t\tif Date.today >= earlyBirdTime && Date.today < if_course.startDate\r\n\t\t\t\t\treturn if_course.earlybirdPrice\r\n\t\t\t\telse\r\n\t\t\t\t\treturn if_course.memberPrice\r\n\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\treturn if_course.nonmemberPrice\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def edit_fee_fields_filled\n if !params[:edit_fees].nil?\n edit_fees_vals = params[:edit_fees].values\n edit_fees_vals.each_slice(3) do |fee, time, remove|\n if fee.empty? || time.empty?\n return false\n end\n end\n end\n return true\n end", "def total_non_insured_fees\n total_fee - total_insured_fees\n end", "def test(points, r1, r2)\n points = points.map do |pair, response|\n [response[:asks][0][\"price\"], response[:bids][0][\"price\"]]\n end.flatten\n\n puts \"UEBU correct\" if r1 == 1000 / points[0] * points[3] * points[5]\n puts \"UBEU correct\" if r2 == 1000 / points[4] / points[2] * points[1]\n end", "def test_purchase_and_credit_for_check_with_differing_amounts\n assert purchase = @gateway.purchase(10000, @check, @options)\n assert_success purchase\n assert_approved purchase\n \n assert void = @gateway.credit(500, purchase.authorization, @options)\n assert_success void\n assert_not_equal 'Approved', void.message\n end", "def test_guest_cannot_buy_drink_if_they_have_insufficient_funds\n @room1.add_drinks_to_stock(@drink1)\n @room1.add_drinks_to_stock(@drink2)\n guest6=Guest.new(\"Kaka\", 1.00, \"Always look on the bright side of life.\")\n guest6.show_tab\n expected = \"You can't afford this drink.\"\n assert_equal(expected, @room1.refuse_guest_drink_if_they_cannot_afford_it(guest6, @drink1))\n end", "def validateEE(vat_number)\r\n total = 0\r\n multipliers = [3,7,1,3,7,1,3,7]\r\n 0.upto(7) do |i|\r\n total += vat_number[i,1].to_i * multipliers[i]\r\n end\r\n # Establish check digit\r\n total = 10 - total % 10\r\n total = 0 if total == 10\r\n return true if total == vat_number[8..9].to_i\r\n return false\r\n end", "def validate_checksums(thesis, body, results)\n expected_checksums = convert_checksums(thesis)\n actual_checksums = collect_checksums(body)\n\n Rails.logger.info(\"Validating Checksums for #{thesis.id}\")\n\n # confirm etd record has files to validate. This should never be an issue, but will be super confusing to figure\n # out what happened if we don't check and it is an issue.\n return unless thesis_has_files?(thesis, results)\n\n if actual_checksums.map { |c| c.in?(expected_checksums) }.all?(true)\n Rails.logger.info(\"All DSpace checksums for thesis #{thesis.id} are valid\")\n\n # since all other validations have been performed by this point, we can confirm the thesis is ready for\n # preservation if its checksums are valid.\n results[:preservation_ready] << thesis\n else\n update_status_and_log_bad_checksums(thesis, results, actual_checksums, expected_checksums)\n end\n end", "def apply_fees\n remove_fees\n unless waive_fees\n #CHALKLE\n self.chalkle_gst_number = Finance::CHALKLE_GST_NUMBER\n self.chalkle_fee = course.chalkle_fee_no_tax\n self.chalkle_gst = course.chalkle_fee_with_tax - chalkle_fee\n \n self.processing_fee = course.processing_fee\n self.processing_gst = course.processing_fee*3/23\n self.processing_fee = course.processing_fee-self.processing_gst\n\n #TEACHER FEE\n if provider_pays_teacher?\n self.teacher_fee = 0\n self.teacher_gst = 0\n else\n if fee_per_attendee?\n self.teacher_fee = course.teacher_cost\n elsif flat_fee?\n confirmed_booking_count = course.bookings.fees_not_waived.paid.confirmed.count\n if confirmed_booking_count > 0\n self.teacher_fee = course.teacher_cost / confirmed_booking_count\n else\n self.teacher_fee = course.teacher_cost\n end\n end\n end\n\n #TEACHER TAX\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst_number = course.teacher.tax_number\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n else\n self.teacher_gst = 0\n self.teacher_gst_number = nil\n end\n\n #PROVIDER\n self.provider_fee = course.provider_fee\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n\n #adjust in case calc_cost is not course cost, should only happen if flat_fee\n difference = course.cost - calc_cost\n if difference != 0\n self.provider_fee = course.provider_fee + difference\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n end\n\n #adjust in case payment has been made already\n difference = cost - calc_cost\n if difference != 0\n #adjust processing_fee\n self.processing_fee = cost * course.provider_plan.processing_fee_percent\n self.processing_gst = self.processing_fee*3/23\n self.processing_fee = self.processing_fee-self.processing_gst\n\n #reset difference to adjust for processing_fee changes\n difference = cost - calc_cost\n\n #if payment exists then adjust provider fee to ensure the payment amount matches calc_cost\n adjustment_for_provider = difference\n adjustment_for_teacher = 0\n\n if provider_fee+provider_gst+difference < 0\n #if adjusted provider_fee is negative then deduct that negative amount from teacher_fee and make provider_fee 0\n adjustment_for_teacher = provider_fee+provider_gst+difference \n self.provider_fee = 0\n self.provider_gst = 0\n else\n self.provider_fee = provider_fee+provider_gst+adjustment_for_provider\n if provider.tax_registered?\n self.provider_gst = provider_fee*3/23\n self.provider_fee = provider_fee - provider_gst\n end\n end\n \n if adjustment_for_teacher != 0\n self.teacher_fee = teacher_fee+teacher_gst+adjustment_for_teacher\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n end\n end\n end\n end\n cost\n end", "def test_upgrade_credit\n #TODO: why does this need to be 0?\n Freemium.days_free_trial=0\n subscription = Factory(:paid_subscription, :paid_through => (Date.today + 20), :subscription_plan => Factory(:paid_plan, :rate_cents => 1300))\n new_plan = Factory(:paid_plan, :rate_cents => 3000)\n\n #assert_equal '2010-04-06', Date.today.to_s(:db)\n #assert_equal '2010-04-26', (Date.today + 20).to_s(:db)\n #assert_equal '2010-04-26', subscription.paid_through.to_s(:db)\n assert_equal 20, subscription.remaining_days\n assert_equal 42, subscription.subscription_plan.daily_rate.cents #$13/month\n assert_equal 840, subscription.remaining_value.cents #20 days * old_plan.daily_rate.cents\n assert_equal 98, new_plan.daily_rate.cents\n assert_equal 8, subscription.remaining_value.cents / new_plan.daily_rate.cents\n expected_paid_through = Date.today + (subscription.remaining_value.cents / new_plan.daily_rate.cents)\n subscription.subscription_plan = new_plan\n subscription.save!\n\n assert_equal expected_paid_through.to_s(:db), subscription.paid_through.to_s(:db)\n end", "def test_cantidad_cuotas\n print validate(36, cantidad_cuotas(16,1900.0))\n print validate(24, cantidad_cuotas(29,2100.0)) \n print validate(12, cantidad_cuotas(19,700.0)) \n print validate(6, cantidad_cuotas(20,1000.0))\n print validate(3, cantidad_cuotas(15,3200.0)) \nend", "def fee\n (amount * 0.005) if amount\n end", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def paycheck(hours_actually_editing, paycheck_total, hourly_charge = 50)\n\t(paycheck_total/hours_actually_editing) > hourly_charge\nend", "def test_37\n customer_hash = {\n 'orderId' => '37',\n 'amount' => '3001',\n 'orderSource'=>'telephone',\n 'billToAddress'=>{\n 'firstName' => 'Tom',\n 'lastName' => 'Black'},\n \n 'echeck'=>{\n 'accNum' =>'10@BC99999',\n 'accType' => 'Checking',\n 'routingNum' => '053100300'}\n }\n hash = customer_hash.merge(@@merchant_hash)\n echeck_response = CnpOnlineRequest.new.echeck_verification(hash)\n assert_equal('301', echeck_response.echeckVerificationResponse.response)\n assert_equal('Invalid Account Number', echeck_response.echeckVerificationResponse.message)\n end", "def test_invalid_with_empty_attributes\r\n fee_schedule = FeeSchedule.new\r\n assert !fee_schedule.valid?, fee_schedule.errors.full_messages\r\n assert fee_schedule.errors.invalid?(:start_date)\r\n assert fee_schedule.errors.invalid?(:end_date)\r\n end", "def test_update_cash\n assert_equal(60, @bakery.update_cash(10))\n end" ]
[ "0.83063674", "0.62973666", "0.6166606", "0.6162033", "0.5983335", "0.59627163", "0.5927743", "0.5905976", "0.58138597", "0.58053136", "0.5782406", "0.5765115", "0.5746944", "0.56767064", "0.5674568", "0.5674419", "0.5647779", "0.5635091", "0.5623951", "0.5619228", "0.56030613", "0.55855656", "0.5581663", "0.55680513", "0.55613065", "0.5561133", "0.55599934", "0.55583924", "0.5514585", "0.5488664", "0.54636824", "0.54633784", "0.545441", "0.54519355", "0.54487306", "0.54368025", "0.5431764", "0.54296684", "0.54281133", "0.5422386", "0.5415653", "0.54144436", "0.54121757", "0.5405324", "0.5401852", "0.5399938", "0.5392151", "0.5391916", "0.53820825", "0.5372919", "0.5368987", "0.5364477", "0.53605896", "0.53564227", "0.5355854", "0.5353253", "0.5353047", "0.5353047", "0.5353047", "0.5353047", "0.5332937", "0.5321607", "0.53205633", "0.53164756", "0.5314807", "0.5314581", "0.5314581", "0.5314581", "0.53101504", "0.5304532", "0.52960193", "0.5294539", "0.52930164", "0.5289414", "0.5280104", "0.5278755", "0.52767897", "0.5257763", "0.5256461", "0.5247433", "0.5246903", "0.52403724", "0.523781", "0.523377", "0.5232192", "0.5229348", "0.5229173", "0.5226912", "0.52243817", "0.52197707", "0.52196825", "0.5219526", "0.5218934", "0.5217015", "0.5210085", "0.52094007", "0.5207236", "0.51994526", "0.51987135", "0.5198668" ]
0.82692397
1
NOTE Enters or removes a UoC note per a given set of test data
def enter_note(test_data) hide_notifications_bar logger.info "Entering note '#{test_data[CoreUseOfCollectionsData::NOTE.name]}'" wait_for_element_and_type(note_text_area, test_data[CoreUseOfCollectionsData::NOTE.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end", "def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n #when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351', 'a']\n # Remove processinfo from 500\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'separatedmaterial'\n ['500','a']\n # we would prefer that information from both the note and subnote appear in subfields of a 506 element, like this:\n # <datafield ind1=\"1\" ind2=\" \" tag=\"506\">\n # <subfield code=\"a\">Restricted until 2020</subfield> <!-- from the subnote/text/content field -->\n # <subfield code=\"f\">Available</subfield> <!-- from the category list -->\n # </datafield>\n when 'accessrestrict'\n ind1 = note['publish'] ? '1' : '0'\n if note['publish'] || @include_unpublished\n if note['rights_restriction']\n result = note['rights_restriction']['local_access_restriction_type']\n if result != []\n result.each do |lart|\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']], ['f', lart])\n end\n else\n df('506', ind1).with_sfs(['a', note['subnotes'][0]['content']])\n end\n else\n ['506', ind1 ,'', 'a']\n end\n end\n when 'scopecontent'\n ['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', ' ', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','d']\n when 'bioghist'\n ['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n # Add processinfo to 583\n when 'appraisal', 'processinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished) and if there are not multiple local access restriction types (if there are, that's already handled above)\n unless note['type'] == 'accessrestrict' && note['rights_restriction']\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n end\n\n end\n end", "def test_form_notes_parts\n # no template and no notes\n obs = observations(:minimal_unknown_obs)\n parts = [\"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template and Other notes\n obs = observations(:detailed_unknown_obs)\n parts = [\"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template and orphaned notes\n obs = observations(:substrate_notes_obs)\n parts = %w[substrate Other]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template, and orphaned notes and Other notes\n obs = observations(:substrate_and_other_notes_obs)\n parts = %w[substrate Other]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and no notes\n obs = observations(:templater_noteless_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and other notes\n obs = observations(:templater_other_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and orphaned notes\n obs = observations(:templater_orphaned_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part\n obs = observations(:template_only_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part and Other notes\n obs = observations(:template_and_other_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part and orphaned part\n obs = observations(:template_and_orphaned_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part, orphaned part, Other,\n # with order scrambled in the Observation\n obs = observations(:template_and_orphaned_notes_scrambled_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption_1\",\n \"orphaned_caption_2\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n end", "def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351', 'b']\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'processinfo', 'separatedmaterial'\n ['500','a']\n when 'accessrestrict'\n ['506','a']\n #when 'scopecontent'\n #['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', '8', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','n']\n #when 'bioghist'\n #['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n when 'appraisal'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n when 'otherfindaid'\n ['555', '0', ' ', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished, true)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished)\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n\n end\n end", "def update_notes(teacher_set_notes_string)\n TeacherSetNote.where(teacher_set_id: self.id).destroy_all\n return if teacher_set_notes_string.blank?\n\n teacher_set_notes_string.split(',').each do |note_content|\n TeacherSetNote.create(teacher_set_id: self.id, content: note_content)\n end\n rescue StandardError => e\n raise TeacherSetNoteException.new(TEACHER_SET_NOTE_EXCEPTION[:code], TEACHER_SET_NOTE_EXCEPTION[:msg])\n end", "def handle_notes(notes)\n\n notes.each do |note|\n\n prefix = case note['type']\n when 'dimensions'; \"Dimensions\"\n when 'physdesc'; \"Physical Description note\"\n when 'materialspec'; \"Material Specific Details\"\n when 'physloc'; \"Location of resource\"\n when 'phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'physfacet'; \"Physical Facet\"\n when 'processinfo'; \"Processing Information\"\n when 'separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n #20160829LJD: Add additional note types for export.\n marc_args = case note['type']\n\n when 'arrangement', 'fileplan'\n ['351','b']\n when 'odd', 'dimensions', 'physdesc', 'materialspec', 'physloc', 'phystech', 'physfacet', 'processinfo', 'separatedmaterial'\n ['500','a']\n when 'accessrestrict'\n ['506','a']\n # when 'scopecontent'\n # ['520', '2', ' ', 'a']\n when 'abstract'\n ['520', '3', ' ', 'a']\n when 'prefercite'\n ['524', '8', ' ', 'a']\n when 'acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'relatedmaterial'\n ['544','n']\n # when 'bioghist'\n # ['545','a']\n when 'custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n when 'appraisal'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'accruals'\n ['584', 'a']\n when 'altformavail'\n ['535', '2', ' ', 'a']\n when 'originalsloc'\n ['535', '1', ' ', 'a']\n when 'userestrict', 'legalstatus'\n ['540', 'a']\n when 'langmaterial'\n ['546', 'a']\n # when 'otherfindaid'\n # ['555', '0', ' ', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n text = prefix ? \"#{prefix}: \" : \"\"\n text += ASpaceExport::Utils.extract_note_text(note, @include_unpublished, true)\n\n # only create a tag if there is text to show (e.g., marked published or exporting unpublished)\n if text.length > 0\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n\n end\n end", "def handle_agent_notes(notes)\n notes.each do |note|\n prefix = case note['jsonmodel_type']\n when 'note_dimensions'; \"Dimensions\"\n when 'note_physdesc'; \"Physical Description note\"\n when 'note_materialspec'; \"Material Specific Details\"\n when 'note_physloc'; \"Location of resource\"\n when 'note_phystech'; \"Physical Characteristics / Technical Requirements\"\n when 'note_physfacet'; \"Physical Facet\"\n when 'note_processinfo'; \"Processing Information\"\n when 'note_separatedmaterial'; \"Materials Separated from the Resource\"\n else; nil\n end\n\n marc_args = case note['jsonmodel_type']\n\n when 'arrangement', 'fileplan'\n ['351','b']\n when 'note_odd', 'note_dimensions', 'note_physdesc', 'note_materialspec', 'note_physloc',\n 'note_phystech', 'note_physfacet', 'note_processinfo', 'note_separatedmaterial'\n ['500','a']\n when 'accessrestrict'\n ['506','a']\n when 'note_scopecontent'\n ['520', '2', ' ', 'a']\n when 'note_abstract'\n #check settings for enabling tag 520 and indicator 3\n if(MarcExportSettings.m_export_settings['tag_520_ind1_3'])\n ['520', '3', ' ', 'a']\n end\n when 'note_prefercite'\n ['524', ' ', ' ', 'a']\n when 'note_acqinfo'\n ind1 = note['publish'] ? '1' : '0'\n ['541', ind1, ' ', 'a']\n when 'note_relatedmaterial'\n ['544','a']\n when 'note_bioghist'\n ['545', '1', ' ','a']\n when 'note_custodhist'\n ind1 = note['publish'] ? '1' : '0'\n ['561', ind1, ' ', 'a']\n when 'note_appraisal'\n ind1 = note['publish'] ? '1' : '0'\n ['583', ind1, ' ', 'a']\n when 'note_accruals'\n ['584', 'a']\n when 'note_altformavail'\n ['535', '2', ' ', 'a']\n when 'note_originalsloc'\n ['535', '1', ' ', 'a']\n when 'note_userestrict', 'note_legalstatus'\n ['540', 'a']\n when 'note_langmaterial'\n ['546', 'a']\n else\n nil\n end\n\n unless marc_args.nil?\n if handle_settings(marc_args)\n text = prefix ? \"#{prefix}: \" : \"\"\n #Strip hard returns\n if(MarcExportSettings.m_export_settings['tag_ss_1'])\n text += ASpaceExport::Utils.extract_note_text(note).delete(\"\\n\")\n else\n text += ASpaceExport::Utils.extract_note_text(note)\n end\n #add access restriction\n if(marc_args[0] == '506')\n if( MarcExportSettings.m_export_settings['tag_506_sc_a_ss_1'])\n urls = text.scan(/(?:http|https):\\/\\/[a-z0-9]+(?:[\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(?:(?::[0-9]{1,5})?\\/[^\\s]*)?/ix)\n unless urls.empty?\n text = text.gsub(/(\\. )[\\s\\S]*/, '. This collection has been digitized and is available online.')\n ead_text = if MarcExportSettings.m_export_settings['tag_856_ss_1'].nil? then MarcExportSettings.m_export_settings['tag_856_ss_1'] else \"Finding aid online:\" end\n df('856', '4', '2').with_sfs(\n ['z', ead_text],\n ['u', urls[0].chomp(\".\")]\n )\n end\n end\n end\n df!(*marc_args[0...-1]).with_sfs([marc_args.last, *Array(text)])\n end\n end\n end\n end", "def notes_from_training\n end", "def enter_note(test_data)\n hide_notifications_bar\n wait_for_element_and_type(note_text_area, test_data[UseOfCollections::NOTE.name])\n end", "def strip_note!(data_array)\n data_array.pop\n end", "def clean_notes\n for note in notes\n if note.comment.blank?\n note.destroy\n end\n end\n\n end", "def test_update_note\n notes = @database.get_not_deleted_notes\n assert_not_nil notes\n \n note = notes.first\n assert_not_nil note\n \n note.content = \"A new content\"\n note.modifydate = Time.new.to_f.to_s\n version = note.version\n syncnumber = note.syncnumber\n \n tags = [\"important\", \"todo\"]\n note.tags = tags\n note.version += 1\n note.syncnumber += 1\n \n note.save\n \n updated_note = @database.get_note_with_key note.key\n\n # Check if changes were forwared to the database correctly\n assert_equal updated_note.content, note.content\n assert_equal updated_note.modifydate, note.modifydate\n assert_equal updated_note.tags, note.tags\n end", "def test03_R1_post_note_TC_24423\n\t\t@msg = \"It's nice to see small businesses in #{$local_patch} #{random}\"\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\twait_for_ajax\n\t\tsleep 4\n\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n\t\tsleep 3\n\t\t$business_review_note_button.click\n\t\tsleep 2\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$business_review_text.set(@msg)\n\n\t\tsleep 2\n\t\t$business_review_post.fire_event(\"onclick\")\n\n\t\tsleep 5\n\t\tassert $browser.text.include? \"#{@msg}\"\n\tend", "def test_delete_footnote\n filename = 'Footnote.doc'\n remote_name = 'TestDeleteFootnote.docx'\n index = 0\n\n st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_test_folder + test_folder + '/' + filename, \"r\").read \n @storage_api.put_create st_request\n\n request = DeleteFootnoteRequest.new remote_name, index, remote_test_folder + test_folder\n result = @words_api.delete_footnote request\n assert_equal 200, result.code\n end", "def old_combine_notes\n notes = self.notes\n full_text = \"\"\n\n for note in notes\n full_text << \" //- \"\n full_text << note.body.strip\n # if @note != @notes[-1]\n # @full_text << \" //- \"\n # end\n end\n\n self.combined_notes = full_text\n puts self.combined_notes\n self.save \n end", "def play(notes)\n\n md = /(\\w):(.+)/.match(notes)\n \n notetype = @notes[md[1]]\n d = @seq.note_to_delta(notetype)\n\n # n.b channel is inverse of string - chn 0 is str 6 \n md[2].split('|').each_with_index do |fret, channel| \n if fret.to_i.to_s == fret\n fret = fret.to_i\n oldfret = @prev[channel]\n @prev[channel] = fret \n\n if oldfret\n oldnote = @tuning[channel] + oldfret\n @track.events << MIDI::NoteOffEvent.new(channel,oldnote,0,d)\n d = 0\n end\n \n noteval = @tuning[channel] + fret\n @track.events << MIDI::NoteOnEvent.new(channel,noteval,80 + rand(38),d)\n d = 0\n end\n end\n end", "def test_can_accept_multiple_notes\n p = players(:manny)\n assert_equal [], p.notes\n note1 = Note.create!(:body => \"note 1\")\n note2 = Note.create!(:body => \"note 2\")\n p.notes << note1\n p.notes << note2\n assert_equal [note1, note2], p.notes\n end", "def inferred_notes\n if scrubbed_notes?\n Rails.logger.debug \"not replacing scrubbed notes\"\n head_notes\n notes\n elsif head_notes.present?\n head_notes\n elsif notes.present? && ff?\n Rails.logger.debug \"not deleting old ff notes\"\n head_notes\n notes\n else\n head_notes\n end\n end", "def to_up_notes(raw_notes)\n raw_notes.present? ? { other: raw_notes } : Observation.no_notes\n end", "def remove_notes(remove_list)\n \n remove_list.each do |upload_id|\n upload = Upload.find(upload_id)\n if ( @document.uploads.include?(upload) )\n @document.uploads.delete(upload)\n end\n end\n end", "def delete_before_data(tests, object, test, rrefs)\n cust_before = @provider.get_code_multiline(tests, test[:path])\n if cust_before.nil?\n get = \"expect_network_get_#{test[:exists] ? 'success' : 'failed'}\"\n get_line = create_expectation(get, test[:has_name], object, 12)\n code = [get_line]\n\n if test[:exists]\n has_rrefs = !object.uri_properties\n .select { |p| p.is_a? Api::Type::ResourceRef }\n .empty?\n # Delete specifies name as a parameter, not as part of data\n params = []\n params = ['nil'] if test[:has_name] && has_rrefs\n params = ['\\'title0\\''] unless test[:has_name]\n\n code << create_expectation('expect_network_delete',\n true, object, 12, params, 1)\n\n unless object.async.nil?\n code << create_expectation('expect_network_get_async',\n test[:has_name], object, 12, [],\n 1)\n end\n end\n\n rrefs.each do |ref|\n next if ref.object == object\n name = Google::StringUtils.underscore(ref.object.name)\n # Puppet style refs include a seed\n code << create_expectation(\"expect_network_get_success_#{name}\",\n true, ref.object, 12, [],\n (ref.seed % MAX_ARRAY_SIZE) + 1)\n end\n\n code.flatten.uniq\n else\n # rubocop:disable Security/Eval\n eval(\"\\\"#{cust_before}\\\"\", binding, __FILE__, __LINE__)\n # rubocop:enable Security/Eval\n end\n end", "def test_028\n\n # login\n login\n # Open PU management page\n open_pu_management_page\n # Get total rows in PU table\n total_rows = get_xpath_count($xpath[\"pu\"][\"pu_list_row\"])\n # delete pu\n row_xpath = $xpath[\"pu\"][\"pu_list_row\"] + \"[#{total_rows}]\"\n result_link_xpath = row_xpath + \"/td[5]/a[2]\"\n result_name_xpath = row_xpath + \"/td[2]\"\n # clicks on link to delete PU\n click(result_link_xpath)\n # The dialog which checks deletion comes out.\n pj_name = get_text(result_name_xpath)\n strmsg1 = _(\"All information of \")\n strmsg2 = _(\" will be deleted.\\n<PJ,master, analysis task, analysis result, analysis log>\\n\")\n strmsg3 = _(\"Really\")\n strmsg4 = _(\"Are you sure you want to delete\")\n strmsg = ''\n if $lang == 'ja'\n strmsg = \"#{pj_name}\" +strmsg1 + strmsg2 + strmsg3 + \"#{pj_name}\" + strmsg4 +\"?\"\n else\n strmsg = strmsg1 + \"#{pj_name}\" + strmsg2 + strmsg4 + \" #{pj_name}\" +\"?\"\n end\n assert_equal(strmsg , get_confirmation)\n # logout\n logout\n make_original_pus\n end", "def note_contents=(notes)\n notes.each do |note|\n if note != \"\"\n self.notes << Note.find_or_create_by(content: note)\n end\n end\n\n end", "def update!(notes)\n fetch_notes\n show_notes\n push_notes(notes)\n end", "def note_contents=(notes)\n \tnotes.each do |content|\n \t\tself.notes << Note.find_or_create_by(content: content) unless content == \"\"\n \tend\n end", "def test05_NoteTwoComments_TC_24319\n\t\tcommentNotePop\n\t\tcommentPopSubmit\n\tend", "def test_notes_export_format\n assert_equal(\n \"\",\n observations(:minimal_unknown_obs).notes_export_formatted\n )\n\n assert_equal(\n \"Found in a strange place... & with śtrangè characters™\",\n observations(:detailed_unknown_obs).notes_export_formatted\n )\n assert_equal(\n \"substrate: soil\",\n observations(:substrate_notes_obs).notes_export_formatted\n )\n assert_equal(\n \"substrate: soil\\nOther: slimy\",\n observations(:substrate_and_other_notes_obs).notes_export_formatted\n )\n end", "def assert_note_a(index)\n within(all(\"li.note\")[index]) do\n assert_text \"Note A\"\n assert_text \"1 hour ago\"\n assert_link \"Edit\"\n assert_link \"Delete\"\n # TODO: Make a link to user profile show.\n assert_text \"Basic\"\n end\n end", "def test04_post_open_news_delete_note_post_TC24307\n\t\tlogin $editor_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open)\n\t\tpostNoteSetup(\"Delete post #{random}\")\n\t\tsleep 4\n\t\tdeleteNotePost\n\t\t\n\t\tassert $browser.text.include?(\"The post was successfully deleted.\")\n\tend", "def test05_post_closed_news_NoNoteRepostNote\n\t\trepostNotePop\n\t\tsleep 3\n \t\trepost \"\" #No note\n \t\tsleep 3\n\t\t\n\t\tassert $repost_confirmation.exists?\n\tend", "def cmd_db_fun_note(*args)\n\t\t\t# this should currently support mixed sets, unlike the rest of the code\n\n\t\t\t# the required hash elements for a good note:\n\t\t\t# required_elements = [ :data, :type]\n\t\t\t# note hash that we ultimately send to make_note, with default values\n\t\t\tnote_hash = @note_template.dup\n\n\t\t\t# Check if the database is active, otherwise crap out\n\t\t\tfmwk = self.framework\n\t\t\tif fmwk.db and fmwk.db.active\n\t\t\t\tbegin\n\t\t\t\t\tnote_hash[:workspace] = fmwk.db.workspace unless note_hash[:workspace]\n\t\t\t\trescue Exception => e\n\t\t\t\t\tprint_error \"Unable to determine active workspace, reason: #{e.to_s}\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t#do we just let them know, or raise an error... hrm for now:\n\t\t\t\traise RuntimeError.new \"Database is not active\"\n\t\t\tend\n\n\t\t\t# Lookin' good, let's populate the note hash with user supplied info\n\t\t\tcase args.length\n\t\t\twhen 1\n\t\t\t\tnote_hash[:data] = args[0]\n\t\t\t\t# assume it's a super simple note for the workspace and default everything else\n\t\t\t\tself.make_note(note_hash)\n\t\t\twhen 2\n\t\t\t\tid = args[0]\n\t\t\t\tnote_hash[:data] = args[1]\n\t\t\t\t# TODO: maybe support host & service ids too? if host_is set :host => id\n\t\t\t\t\n\t\t\t\t# if the first arg seems to be a set_id...\n\t\t\t\tif is_valid_set?(id)\n\t\t\t\t\t# loop over objects in set & make note for each\n\t\t\t\t\tprint_status \"Adding note to objects in set: #{id}\"\n\t\t\t\t\tretrieve_set(id).each do |obj|\n\t\t\t\t\t\tobj_type_sym = get_type(obj).downcase.to_sym\n\t\t\t\t\t\tnote_hash[obj_type_sym] = obj\n\t\t\t\t\t\tself.make_note(note_hash)\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tprint_error \"Could not find a valid set named #{id}\"\t\t\t\t\t\n\t\t\t\tend\t\t\t\t\n\t\t\telse\n\t\t\t\treturn fun_usage\n\t\t\tend\n\t\tend", "def create_notes\n end", "def note_contents=(notes)\n notes.each do |content|\n if content.strip != '' # => ignores blank notes\n self.notes.build(content: content) \n end\n end\n end", "def update_note(update_octave=true) # Update_octave=false used in generative parsing\n if self[:pc]\n self.merge!(get_ziff(self[:pc], self[:key], self[:scale],(update_octave ? (self[:octave] || 0) : false),(self[:add] || 0)))\n elsif self[:hpcs]\n notes = []\n self[:hpcs].each do |d|\n pc = d[:pc]\n notes.push(get_note_from_dgr(pc, d[:key], d[:scale], (d[:octave] || 0)) + (self[:add] || 0))\n end\n self[:pcs] = self[:hpcs].map {|h| h[:pc] }\n self[:notes] = notes\n end\n end", "def note_cleanup(xmldoc)\n q = \"//note[following-sibling::*[not(local-name() = 'note')]]\"\n xmldoc.xpath(q).each do |n|\n next if n[\"keep-separate\"] == \"true\"\n next unless n.ancestors(\"table\").empty?\n\n prev = n.previous_element || next\n n.parent = prev if ELEMS_ALLOW_NOTES.include? prev.name\n end\n xmldoc.xpath(\"//note[@keep-separate] | \"\\\n \"//termnote[@keep-separate]\").each do |n|\n n.delete(\"keep-separate\")\n end\n end", "def assign_notes_to_sets(sets,hw,book)\n notes = []\n stream_starts_at_set = 1\n hw.each { |stream|\n stream_starts_at_set = stream_starts_at_set+stream[\"delay\"].to_i\n if !(stream[\"notes\"].nil?) then\n stream[\"notes\"].each { |t,text|\n t = t.to_s\n p = nil\n if t=~/\\A(\\d+)\\Z/ then\n t = $1.to_i\n s = stream_starts_at_set+t\n else\n if !($label_to_num.has_key?(t)) then\n fatal_error(\"note is given for problem #{t}, but no such label is defined; text of note is #{text}\")\n end\n ch,num = $label_to_num[t]\n p = [ch,num]\n s = $problem_assigned_on_set[p]\n text.gsub!(/\\$\\$/) {\"#{ch}-#{num}\"}\n end\n if s.nil? then fatal_error(\"Error in note for problem #{t}, problem not assigned?\") end\n if notes[s].nil? then notes[s]=[] end\n notes[s].push([p,text])\n }\n end \n }\n 1.upto(sets.length-1) { |set_number|\n if notes[set_number].nil? then notes[set_number]=[] end\n }\n return notes\nend", "def enter_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n prep_fieldsets_for_test_data([fieldset(Org::HISTORY_NOTES.name)], test_histories)\n\n test_histories.each_with_index do |test_history, index|\n wait_for_element_and_type(history_input(index), test_history[Org::HISTORY_NOTE.name])\n end\n end", "def set_note(n)\n @note = 0\n end", "def test_update_name_merge_no_notes_into_description_notes\n old_name = names(:mergeable_no_notes)\n new_name = names(:mergeable_description_notes)\n notes = new_name.description.notes\n params = {\n id: old_name.id,\n name: {\n text_name: new_name.text_name,\n author: new_name.author,\n rank: new_name.rank,\n citation: \"\",\n deprecated: (old_name.deprecated ? \"true\" : \"false\")\n }\n }\n login(\"rolf\")\n put(:update, params: params)\n\n assert_flash_success\n assert_redirected_to(name_path(new_name.id))\n assert_no_emails\n assert(new_name.reload)\n assert_not(Name.exists?(old_name.id))\n assert_equal(notes, new_name.description.notes)\n end", "def test_notes_parts_values\n obs = observations(:template_and_orphaned_notes_scrambled_obs)\n assert_equal(\"red\", obs.notes_part_value(\"Cap\"))\n assert_equal(\"pine\", obs.notes_part_value(\"Nearby trees\"))\n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def test_cleanup_failed\n setup_new_order()\n @o.order_line_items << @li\n @o.order_status_code = order_status_codes(:cart)\n @o.notes = \"test test\"\n assert @o.save\n \n notes_before = @o.notes.dup\n\n @o.cleanup_failed(\"A message!\")\n \n # Status code should be updated.\n assert_equal @o.order_status_code, order_status_codes(:on_hold_payment_failed)\n # A new note should be added.\n notes_after = @o.notes\n assert_not_equal notes_before, notes_after\n end", "def test02_R1_disappointed_TC_24423\n\t\t@msg = \"The office isn't open at 3 AM! I am disappointed times #{random}!!\"\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\twait_for_ajax\n\t\tsleep 3\n\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n\t\tsleep 3\n\t\t$business_review_disappointed.click\n\t\tsleep 2\n\t\t$business_review_text.set(@msg)\n\t\t$business_review_post.fire_event(\"onclick\")\n\n\t\tsleep 2\n\t\tassert $browser.text.include? \"#{@msg}\"\n\t\tassert $browser.text.include? \"disappointed times\"\n\n\tend", "def note_contents=(notes)\n notes.each do |content|\n if content.strip != ''\n self.notes.build(content: content)\n end\n end\n end", "def set_note\n @note = Note.where(test_id: params[:test_id], student_id: params[:student_id]).first\n end", "def _Notes\n while true\n\n _save1 = self.pos\n while true # choice\n _tmp = apply(:_Note)\n break if _tmp\n self.pos = _save1\n _tmp = apply(:_SkipBlock)\n break if _tmp\n self.pos = _save1\n break\n end # end choice\n\n break unless _tmp\n end\n _tmp = true\n set_failed_rule :_Notes unless _tmp\n return _tmp\n end", "def test04_R1_post_note_photo_TC_24423\n\t\t@msg = \"It's nice to see small businesses in #{$local_patch} #{random}\"\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\twait_for_ajax\n\t\tsleep 4\n\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n\t\tsleep 2\n\t\t$business_review_note_button.click\n\t\tsleep 2\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$business_review_text.set(@msg)\n\t\t#$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\tsleep 2\n\t\t$business_review_photo.fire_event(\"onclick\")\n\t\tfile_upload \"valid.JPG\"\n\t\tsleep 2\n\t\t$business_review_post.fire_event(\"onclick\")\n\n\t\tsleep 10\n\t\t#should have validation for photo too\n\t\tassert $browser.text.include? \"#{@msg}\"\n\tend", "def remove(notes, options = {})\n notes = [notes].flatten\n notes = sanitize_input_notes(notes, MIDIMessage::NoteOff, options)\n @sequence.remove(notes)\n end", "def add_note # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity\n @bib.biblionote.each do |n|\n case n.type\n when \"annote\" then @item.annote = n.content\n when \"howpublished\" then @item.howpublished = n.content\n when \"comment\" then @item.comment = n.content\n when \"tableOfContents\" then @item.content = n.content\n when nil then @item.note = n.content\n end\n end\n end", "def serialize_did_notes(data, xml, fragments)\n data.notes.each do |note|\n next if note[\"publish\"] === false && !@include_unpublished\n next unless data.did_note_types.include?(note['type']) # and note[\"publish\"] == true)\n\n audatt = note[\"publish\"] === false ? {:audience => 'internal'} : {}\n content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n att = { :id => prefix_id(note['persistent_id']) }.reject {|k,v| v.nil? || v.empty? || v == \"null\" }\n att ||= {}\n\n case note['type']\n when 'dimensions', 'physfacet'\n xml.physdesc(audatt) {\n #xml.physdesc {\n xml.send(note['type'], att) {\n sanitize_mixed_content( content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) )\n }\n }\n else\n xml.send(note['type'], att) {\n sanitize_mixed_content(content, xml, fragments,ASpaceExport::Utils.include_p?(note['type']))\n }\n end\n end\n end", "def delete_testds(testds)\n not_found = []\n testds.each do |testd_td|\n descriptor = Testd.where({ 'testd.name' => testd_td['name'],\n 'testd.vendor' => testd_td['vendor'],\n 'testd.version' => testd_td['version'] }).first\n if descriptor.nil?\n logger.error 'Test Descriptor not found ' + testd_td.to_s\n not_found << testd_td\n else\n if descriptor['pkg_ref'] == 1\n descriptor.destroy\n del_ent_dict(descriptor, :testd)\n else descriptor.update_attributes(pkg_ref: descriptor['pkg_ref'] - 1)\n end\n end\n end\n not_found\n end", "def serialize_did_notes(data, xml, fragments)\n data.notes.each do |note|\n next if note[\"publish\"] === false && !@include_unpublished\n next unless (data.did_note_types.include?(note['type']) and note[\"publish\"] == true)\n\n #audatt = note[\"publish\"] === false ? {:audience => 'internal'} : {}\n content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)\n\n att = { :id => prefix_id(note['persistent_id']) }.reject {|k,v| v.nil? || v.empty? || v == \"null\" }\n att ||= {}\n\n case note['type']\n when 'dimensions', 'physfacet'\n #xml.physdesc(audatt) {\n xml.physdesc {\n xml.send(note['type'], att) {\n sanitize_mixed_content( content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) )\n }\n }\n else\n xml.send(note['type'], att) {\n sanitize_mixed_content(content, xml, fragments,ASpaceExport::Utils.include_p?(note['type']))\n }\n end\n end\n end", "def note_contents=(array)\n array.each do |i|\n if !i.empty?\n note = Note.find_or_create_by(content: i)\n self.notes << note\n end\n end\n end", "def test_should_remove_second_line_item_from_invoice\r\n assert_no_difference 'Invoice.count' do\r\n assert_difference 'LineItem.count', -1 do\r\n @basic_user.edits_invoice(invoices(:invoice_with_line_items).id)\r\n \r\n #get first row in the table.\r\n trows = @basic_user.line_items_rows\r\n assert_equal 2, trows.length\r\n tr2 = trows[::WatirBrowser.item_index(2)]\r\n assert tr2.exists?\r\n @basic_user.populate(tr2.text_field(:name, \"invoice[line_items_attributes][][description]\"),\"Removed Description two\")\r\n\r\n #remove the second line item\r\n tr2.link(:name, 'remove').click\r\n\r\n @basic_user.submits\r\n end\r\n end\r\n \r\n invoice = Invoice.find(invoices(:invoice_with_line_items).id)\r\n assert_equal 1, invoice.line_items.count\r\n assert_equal line_items(:line_item_one).description, invoice.line_items[0].description \r\n \r\n end", "def note_contents=(notes)\n notes.each do |note|\n if note.strip != \"\"\n content = self.notes.build(content: note)\n content.save\n end\n end\n end", "def remove_from_notifications\n notifications.find_all { |n| n.noti_read == 'N' }.each do |n|\n remove_from_notification(n)\n end # each n\n end", "def to_up_notes(raw_notes)\n raw_notes.present? ? { Other: raw_notes } : {}\n end", "def alter_description(description, additions, subtractions)\n new_description = description\n additions.each do |addition|\n stylized_weights = addition.weights&.join('->')\n if stylized_weights == '' || stylized_weights.nil?\n stylized_weights = 'body weight'\n end\n\n # This will look off for things I do 1 set or rep of,\n # but I'm ok with that - it makes eventually parsing\n # a dump of my data from Strava in the future easier.\n new_description << <<~EOF\n #{addition.exercise}: #{addition.num_sets} sets of #{addition.num_reps} reps at #{stylized_weights} lbs\n EOF\n end\n subtractions.each do |subtraction|\n new_description_array = new_description.split(\"\\n\").reject do |line|\n line.index(subtraction) == 0\n end\n new_description = new_description_array.join(\"\\n\")\n end\n\n new_description\nend", "def notes_generated(notes)\n puts green(\"Release notes generated: #{notes}\")\n end", "def unlink_notes \n if self.notes\n self.notes.each do | note | \n note.objects[:Group].delete(self.id.to_s)\n note.save\n end\n end\n end", "def old_add_note_to_combined(new_note)\n new_piece = \" //- \" << new_note.body.strip\n combined = self.combined_notes + new_piece\n #puts @combined\n self.update_attribute(:combined_notes, combined);\n self.reload\n end", "def test_the_application_can_update_a_previous_item_description_on_our_to_do_list\n #Implement the test\n #Implement the controller action\n end", "def delete_note(note)\n logger.info \"Deleting note '#{note.id}'\"\n expand_note note\n wait_for_update_and_click delete_note_button(note)\n wait_for_update_and_click confirm_delete_button_element\n note.deleted_date = Time.now\n end", "def generate_dummy_data_for_presentation(pt1,user)\n\n#generate the exercises:\n# For the legs session type\n legs1 = Exercise.new(\"Full Squat\", \"Legs\", true, 10, 5, 1.2,4,3) \n legs2 = Exercise.new(\"Barbell Lunge\", \"Legs\", false, 15, 5, 1.1,4,2) \n legs3 = Exercise.new(\"Deadlift\", \"Legs\", true, 15, 5, 1.3,2,4) \n legs4 = Exercise.new(\"Leg Press\", \"Legs\", false, 20, 5, 1.25,6,5) \n legs5 = Exercise.new(\"Ham String Curl\", \"Legs\", true, 12, 5, 1.15,4,4) \n # For the Biceps, Triceps, Forearms and Abs (aka BTFA) session type \n btfa1 = Exercise.new(\"Bicep Curls\", \"BTFA\",true, 10, 5, 1.2,4,3) \n btfa2 = Exercise.new(\"Shoulder Press\", \"BTFA\", false, 10, 5, 1.2,4,3) \n btfa3 = Exercise.new(\"Bench Press\", \"BTFA\", true, 10, 5, 1.2,4,3) \n btfa4 = Exercise.new(\"Triceps Extension\", \"BTFA\", false, 10, 5, 1.2,4,3) \n btfa5 = Exercise.new(\"Sit Up\", \"BTFA\", true, 10, 5, 1.2,4,3) \n # For the Shoulders and Traps session type\n shoulders_traps1 = Exercise.new(\"Dumbell Shoulder Press\", \"Shoulders and Traps\",true, 10, 5, 1.2,4,3) \n shoulders_traps2 = Exercise.new(\"Upright Barbell Row\", \"Shoulders and Traps\", false, 10, 5, 1.2,4,3) \n shoulders_traps3 = Exercise.new(\"Seated Bent-over Rear Delt Raise\", \"Shoulders and Traps\", true, 10, 5, 1.2,4,3) \n shoulders_traps4 = Exercise.new(\"Side Lateral Raise\", \"Shoulders and Traps\", false, 10, 5, 1.2,4,3) \n shoulders_traps5 = Exercise.new(\"Barbell Shrug\", \"Shoulders and Traps\", true, 10, 5, 1.2,4,3) \n # For the Back session type\n back1 = Exercise.new(\"Barbell Deadlift\", \"Back\", true, 10, 5, 1.2,4,3) \n back2 = Exercise.new(\"Wide-Grip Pull Up\", \"Back\", false, 10, 5, 1.2,4,3) \n back3 = Exercise.new(\"Bent-Over Barbell Deadlift\", \"Back\", true, 10, 5, 1.2,4,3) \n back4 = Exercise.new(\"Standing T-Bar Row\", \"Back\", false, 10, 5, 1.2,4,3) \n # For the Chest session type\n chest1 = Exercise.new(\"Barbell Bench Press\", \"Chest\", true, 10, 5, 1.2,4,3) \n chest2 = Exercise.new(\"Flat Bench Dumbbell Press\", \"Chest\", false, 10, 5, 1.2,4,3) \n chest3 = Exercise.new(\"Seated Machine Chest Press\", \"Chest\", true, 10, 5, 1.2,4,3) \n chest4 = Exercise.new(\"Incline Dumbbell Press\", \"Chest\", false, 10, 5, 1.2,4,3) \n chest5 = Exercise.new(\"Machine Decline Press\", \"Chest\", true, 10, 5, 1.2,4,3) \n\n# add exercises to the PT object so that it's aware of them\n pt1.add_exercises(legs1)\n pt1.add_exercises(legs2)\n pt1.add_exercises(legs3)\n pt1.add_exercises(legs4)\n pt1.add_exercises(legs5)\n pt1.add_exercises(btfa1)\n pt1.add_exercises(btfa2)\n pt1.add_exercises(btfa3)\n pt1.add_exercises(btfa4)\n pt1.add_exercises(btfa5)\n pt1.add_exercises(shoulders_traps1)\n pt1.add_exercises(shoulders_traps2)\n pt1.add_exercises(shoulders_traps3)\n pt1.add_exercises(shoulders_traps4)\n pt1.add_exercises(shoulders_traps5)\n pt1.add_exercises(back1)\n pt1.add_exercises(back2)\n pt1.add_exercises(back3)\n pt1.add_exercises(back4)\n pt1.add_exercises(chest1)\n pt1.add_exercises(chest2)\n pt1.add_exercises(chest3)\n pt1.add_exercises(chest4)\n pt1.add_exercises(chest5)\n\n\n # establish id for user\n user.username = \"jim\"\n user.password = \"password\"\n user.first_name = \"Jimmy\"\n user.last_name = \"Coder\"\n user.gender = \"Male\"\n user.body_type = \"Mesomorph\"\n user.goal = \"musclebuild\"\n user.disclaimer = \"accept\"\n user.date_of_birth = Date.new(1990,9,9)\n # binding.pry\n user.weight = 56\n user.goal_weight = 75\n\n#establish some dummy workout history for our user:\n # (weight, completed_reps, exercise_performed, duration, date, session_number, session_type)\n workout_history_for_user = ExerciseInput.new(10, 8, chest1.name, 10, Date.new(2017,8,1), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(10, 9, chest1.name, 10, Date.new(2017,8,1), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(10, 10, chest1.name, 10, Date.new(2017,8,1), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(10, 11, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 9, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 9, chest1.name, 10, Date.new(2017,8,2), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,3), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,4), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 5, chest1.name, 10, Date.new(2017,8,5), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(15, 8, chest1.name, 10, Date.new(2017,8,6), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(20, 8, chest1.name, 10, Date.new(2017,8,7), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(20, 10, chest1.name, 10, Date.new(2017,8,8), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 7, chest1.name, 10, Date.new(2017,8,9), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 8, chest1.name, 10, Date.new(2017,8,10), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 9, chest1.name, 10, Date.new(2017,8,11), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n workout_history_for_user = ExerciseInput.new(25, 10, chest1.name, 10, Date.new(2017,8,12), 1, chest1.session_type)\n user.add_completed_session(workout_history_for_user)\n #\n\n\nend", "def notes=(value)\n @notes = value\n end", "def notes=(value)\n @notes = value\n end", "def notes=(value)\n @notes = value\n end", "def notes=(value)\n @notes = value\n end", "def test_post_footnote\n filename = 'Footnote.doc'\n remote_name = 'TestPostFootnote.docx'\n index = 0\n footnote = Footnote.new({:Text => 'new text is here'})\n\n st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_test_folder + test_folder + '/' + filename, \"r\").read \n @storage_api.put_create st_request\n\n request = PostFootnoteRequest.new remote_name, footnote, index, remote_test_folder + test_folder\n result = @words_api.post_footnote request\n assert_equal 200, result.code\n end", "def processEvents(events)\n notes(events) do |type, note, velocity, delta|\n case type\n when :all_notes_off;\n tools.note_off # we have only one note here\n when :note_on;\n if velocity == 0 && note == tools.currentNote\n tools.note_off\n else\n tools.note_on(note, velocity, delta)\n end\n end\n end\n 1 # want more\n end", "def test_update_name_merge_both_notes\n old_name = names(:mergeable_description_notes)\n new_name = names(:mergeable_second_description_notes)\n old_notes = old_name.description.notes\n new_notes = new_name.description.notes\n params = {\n id: old_name.id,\n name: {\n text_name: new_name.text_name,\n author: new_name.author,\n rank: new_name.rank,\n deprecated: (new_name.deprecated ? \"true\" : \"false\"),\n citation: \"\"\n }\n }\n login(\"rolf\")\n put(:update, params: params)\n\n assert_flash_success\n assert_redirected_to(name_path(new_name.id))\n assert_no_emails\n assert(new_name.reload)\n assert_not(Name.exists?(old_name.id))\n assert_equal(new_notes, new_name.description.notes)\n # Make sure old notes are still around.\n other_desc = (new_name.descriptions - [new_name.description]).first\n assert_equal(old_notes, other_desc.notes)\n end", "def destroy\n\n if @note.about_person\n @aboutPerson = @note.about_person\n @aboutPerson.destroy\n end\n\n if @note.about_event\n @about_event = @note.about_event\n @about_event.destroy\n end\n\n\n @rn = RemovedNote.new(:sequence_number => @note.id, :person_id => @note.person_id)\n @rn.save\n\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to notes_url }\n format.json { head :no_content }\n end\n end", "def test02_post_open_news_CancelDeleteNoteOneComment_TC_24319\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_news_post_open_note)\n\t\t\n\t\tsleep 2\n\t\tcommentPopSubmit \"Test Comment #{random}\"\n\t\tsleep 2\n\t\tcommentCancelDelete\n\t\t\n\t\tassert $comment_delete_link.exists?\n\tend", "def test_acknowledgement \n end", "def update_reasons(hash)\n reasons_array.each do |reason|\n if hash.key?(reason.num)\n reason.notes = hash[reason.num].to_s\n else\n reason.delete\n end\n end\n end", "def verify_note(note)\n logger.debug \"Verifying visible data for note ID #{note.id}\"\n\n # Verify data visible when note is collapsed\n collapsed_note_el(note).when_present Utils.medium_wait\n collapse_note note\n visible_data = visible_collapsed_note_data note\n expected_short_updated_date = \"Last updated on #{expected_note_short_date_format note.updated_date}\"\n wait_until(1, \"Expected '#{note.subject}', got #{visible_data[:subject]}\") { visible_data[:subject] == note.subject }\n wait_until(1, \"Expected '#{expected_short_updated_date}', got #{visible_data[:date]}\") { visible_data[:date] == expected_short_updated_date }\n\n # Verify data visible when note is expanded\n expand_note note\n visible_data.merge!(visible_expanded_note_data note)\n wait_until(1, \"Expected '#{note.body}', got '#{visible_data[:body]}'\") { visible_data[:body] == \"#{note.body}\" }\n wait_until(1, 'Expected non-blank advisor name') { !visible_data[:advisor].empty? }\n wait_until(1, 'Expected non-blank advisor role') { !visible_data[:advisor_role].empty? }\n wait_until(1, \"Expected '#{note.advisor.depts}', got #{visible_data[:advisor_depts]}\") { visible_data[:advisor_depts] == note.advisor.depts }\n\n # Topics\n note_topics = (note.topics.map { |t| t.name.upcase }).sort\n wait_until(1, \"Expected '#{note_topics}', got #{visible_data[:topics]}\") { visible_data[:topics] == note_topics }\n wait_until(1, \"Expected no remove-topic buttons, got #{visible_data[:remove_topics_btns].length}\") { visible_data[:remove_topics_btns].length.zero? }\n\n # Attachments\n non_deleted_attachments = note.attachments.reject &:deleted_at\n expected_file_names = non_deleted_attachments.map &:file_name\n wait_until(1, \"Expected '#{expected_file_names.sort}', got #{visible_data[:attachments].sort}\") { visible_data[:attachments].sort == expected_file_names.sort }\n\n # Check visible timestamps within 1 minute to avoid failures caused by a 1 second diff\n expected_long_created_date = \"Created on #{expected_note_long_date_format note.created_date}\"\n wait_until(1, \"Expected '#{expected_long_created_date}', got #{visible_data[:created_date]}\") do\n Time.parse(visible_data[:created_date]) <= Time.parse(expected_long_created_date) + 60\n Time.parse(visible_data[:created_date]) >= Time.parse(expected_long_created_date) - 60\n end\n expected_long_updated_date = \"Last updated on #{expected_note_long_date_format note.updated_date}\"\n wait_until(1, \"Expected '#{expected_long_updated_date}', got #{visible_data[:updated_date]}\") do\n Time.parse(visible_data[:updated_date]) <= Time.parse(expected_long_updated_date) + 60\n Time.parse(visible_data[:updated_date]) >= Time.parse(expected_long_updated_date) - 60\n end\n end", "def reject_notes_and_add_intervened\n self.intervened = false\n \n 1.upto(4).each do |n|\n note_content = self.send(\"note_#{n}\")\n if note_content == school.default_note_content\n self.send(\"note_#{n}=\", nil)\n elsif note_content.present?\n self.intervened = true\n end\n end\n \n count = 0\n interventions.each do |intervention|\n if intervention.content_blank?\n if count > 10\n intervention.destroy\n else\n count += 1\n end\n elsif !intervention.completed\n self.intervened = true\n end\n end\n \n true # Return true otherwise the before_save filter will abort the save.\n end", "def testSingleTrackWithCalibrationWithoutDCOffset\n execute_Clean_WithConf({\n :Recordings => {\n :EnvCalibration => {\n [ :Env1, :Env3 ] => {\n :CompareCuts => ['0.01s', '0.16s']\n }\n },\n :Tracks => {\n [1] => {\n :Env => :Env1,\n :CalibrateWithEnv => :Env3\n }\n }\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1_CalibEnv3),\n :FakeWSK => [\n # Clean Calibration Env1 Env3\n {\n :Input => '01_Source/Record/Calibration.Env1.Env3.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Calibration.Env1.Env3.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env1.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env1.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Calibration.Env1.Env3.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav',\n :Action => 'Cut',\n :Params => [ '--begin', '0.01s', '--end', '0.16s' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav',\n :Output => '02_Clean/Record/Calibration.Env1.Env3.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env1.Env3.04.NoiseGate.wav'\n },\n # Clean Calibration Env3 Env1\n {\n :Input => '01_Source/Record/Calibration.Env3.Env1.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Calibration.Env3.Env1.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env3.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'FFT',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'FFT/Env3.Silence.fftprofile' => 'fft.result' }\n },\n {\n :Input => '01_Source/Record/Env3.Silence.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env3.Silence.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Calibration.Env3.Env1.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-7601,7577', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env3.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav',\n :Action => 'Cut',\n :Params => [ '--begin', '0.01s', '--end', '0.16s' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '94' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav',\n :Output => '02_Clean/Record/Calibration.Env3.Env1.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-7507,7671', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env3.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Calibration.Env3.Env1.04.NoiseGate.wav'\n },\n # Clean Track 1\n {\n :Input => '01_Source/Record/Env1.1.wav',\n :Output => /^.*\\/Dummy\\.wav$/,\n :Action => 'Analyze',\n :UseWave => 'Empty.wav',\n :CopyFiles => { 'Analysis/Env1.1.analyze' => 'analyze.result' }\n },\n {\n :Input => '01_Source/Record/Env1.1.wav',\n :Output => '02_Clean/Record/Env1.1.01.SilenceRemover.wav',\n :Action => 'SilenceRemover',\n :Params => [ '--silencethreshold', '-3604,3607', '--attack', '0', '--release', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.1.01.SilenceRemover.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.1.01.SilenceRemover.wav',\n :Output => '02_Clean/Record/Env1.1.03.DCShifter.wav',\n :Action => 'DCShifter',\n :Params => [ '--offset', '2' ],\n :UseWave => '02_Clean/Record/Env1.1.03.DCShifter.wav'\n },\n {\n :Input => '02_Clean/Record/Env1.1.03.DCShifter.wav',\n :Output => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :Action => 'NoiseGate',\n :Params => [ '--silencethreshold', '-3602,3609', '--attack', '0.1s', '--release', '0.1s', '--silencemin', '1s', '--noisefft', 'Analyze/Record/Env1.Silence.fftprofile' ],\n :UseWave => '02_Clean/Record/Env1.1.04.NoiseGate.wav'\n }\n ]) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n assert File.exists?('Analyze/Record/Env1.1.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.analyze')\n assert File.exists?('Analyze/Record/Env1.Silence.fftprofile')\n assert File.exists?('Analyze/Record/Env3.Silence.analyze')\n assert File.exists?('Analyze/Record/Env3.Silence.fftprofile')\n assert File.exists?('Analyze/Record/Calibration.Env1.Env3.analyze')\n assert File.exists?('Analyze/Record/Calibration.Env3.Env1.analyze')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env3.01.SilenceRemover.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env3.02.Cut.0.01s_0.16s.wav')\n assert !File.exists?('02_Clean/Record/Calibration.Env1.Env3.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env1.Env3.04.NoiseGate.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.01.SilenceRemover.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Calibration.Env3.Env1.04.NoiseGate.wav')\n assert File.exists?('02_Clean/Record/Env1.1.01.SilenceRemover.wav')\n assert !File.exists?('02_Clean/Record/Env1.1.02.Cut.0.01s_0.16s.wav')\n assert File.exists?('02_Clean/Record/Env1.1.03.DCShifter.wav')\n assert File.exists?('02_Clean/Record/Env1.1.04.NoiseGate.wav')\n end\n end", "def test04_post_closed_blog_delete_note_post_TC24307\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_closed)\n\t\t\n\t\tpostNoteSetup(\"Delete post #{random}\")\n\t\t\n\t\t$post_delete_post.click\n\t\tsleep 2\n\t\t$post_delete_confirm.click\n\t\t\n\t\tassert $browser.text.include?(\"The post was successfully deleted.\")\n\tend", "def noteboard_delete(line_number)\n \n\n end", "def set_notes\n user_notes = current_user.notes\n @notes = user_notes.where.not(id: nil)\n @new_note = action_name != 'create' ? user_notes.build : user_notes.build(note_params)\n end", "def test_cleanup_successful\n setup_new_order()\n @o.order_line_items << @li\n @o.order_status_code = order_status_codes(:cart)\n @o.notes = \"test test\"\n assert @o.save\n\n # Make sure inventory control is enabled.\n assert Preference.find_by_name('store_use_inventory_control').is_true?\n # Make sure cc number obfuscation is enabled.\n assert Preference.find_by_name('cc_clear_after_order').is_true?\n \n initial_quantity = @li.item.quantity\n notes_before = @o.notes.clone\n \n @o.cleanup_successful\n @li.item.reload\n \n # Quantity should be updated.\n assert_equal @li.item.quantity, (initial_quantity - @li.quantity)\n # Status code should be updated.\n @o.reload\n assert_equal @o.order_status_code, order_status_codes(:ordered_paid_to_ship)\n \n # CC number should be obfuscated.\n number_len = @o.account.cc_number.length\n new_cc_number = @o.account.cc_number[number_len - 4, number_len].rjust(number_len, 'X')\n assert_equal @o.account.cc_number, new_cc_number\n \n # A new note should be added.\n notes_after = @o.notes\n assert_not_equal notes_before, notes_after\n end", "def test_ID_25863_comment_on_review()\n login_as_user1\n read_all_updates\n share_review(\"outside-in\")\n logout_common\n login_as_user2\n leave_comment_on_share_review_group(\"outside-in\")\n logout_common\n login_as_user1\n verify_updates\n end", "def fix_notes(condensed)\n\t condensed.each do |loc|\n\t ##Rails.logger.debug \"\\nes287_debug line(#{__LINE__}) location=#{loc['location_name']} #{loc['call_number']}\\n\"\n\t ##Rails.logger.debug \"\\nes287_debug line(#{__LINE__}) copies = \" + loc[\"copies\"][0].count.inspect\n\t if !loc[\"copies\"][0][\"items\"][\"Not Available\"].blank? and loc[\"copies\"][0][\"items\"][\"Not Available\"][\"status\"] == 'none'\n\t ##Rails.logger.debug \"\\nes287_debug line(#{__LINE__}) seems like there are no items, so copy notes,etc.\"\n\t ['orders','summary_holdings','supplements','indexes','notes',\n\t\t 'reproduction_note','current_issues'].each do |type|\n\t\tloc[\"copies\"][0][type] = loc[type] unless loc[type].blank?\n\t end\n\t end\n\t end\n\t condensed\n\t end", "def test_remove_promotion_multiple_items\n setup_new_order_with_items()\n editable_order_codes = (1..5)\n editable_order_codes.each do |status_id|\n o_status = OrderStatusCode.find(status_id)\n assert_kind_of OrderStatusCode, o_status\n\n @o.order_status_code = o_status\n assert @o.is_editable?\n \n promo = promotions(:fixed_rebate)\n @o.promotion_code = promo.code\n assert @o.save\n assert_kind_of OrderLineItem, @o.promotion_line_item\n # Add dupe line item.\n dupe_item = @o.promotion_line_item.clone\n @o.order_line_items << dupe_item\n assert_equal 2, @o.order_line_items.count(\n :conditions => [\"name = ?\", @o.promotion.description]\n )\n # Remove\n @o.remove_promotion()\n assert_nil @o.promotion_line_item\n end\n end", "def test_029\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n #Register a new PU\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n\n # Get total rows in PU table\n total_rows = get_xpath_count($xpath[\"misc\"][\"result_list_PU_row\"])\n\n # for all table...\n (1..total_rows).each do |row_index|\n row_xpath = $xpath[\"misc\"][\"result_list_PU_row\"] + \"[#{row_index}]\"\n result_link_xpath = row_xpath + \"/td[5]/a[2]\"\n result_name_xpath = row_xpath + \"/td[2]\"\n get_text(result_name_xpath)\n\n if row_index == 1\n choose_cancel_on_next_confirmation()\n else\n # PU name is deleted.\n choose_ok_on_next_confirmation()\n end\n\n # clicks on link to delete PU\n click(result_link_xpath)\n\n pj_name = get_text(result_name_xpath)\n strmsg1 = _(\"All information of \")\n strmsg2 = _(\" will be deleted.\\n<PJ,master, analysis task, analysis result, analysis log>\\n\")\n strmsg3 = _(\"Really\")\n strmsg4 = _(\"Are you sure you want to delete\")\n strmsg = ''\n if $lang == 'ja'\n strmsg = \"#{pj_name}\" +strmsg1 + strmsg2 + strmsg3 + \"#{pj_name}\" + strmsg4 +\"?\"\n else\n strmsg = strmsg1 + \"#{pj_name}\" + strmsg2 + strmsg4 + \" #{pj_name}\" +\"?\"\n end\n\n # The dialog which checks deletion comes out.\n assert_equal( strmsg,get_confirmation)\n\n @@pu.destroy\n\n end\n # logout\n logout\n make_original_pus\n end", "def note_fluorescent_plates(fluorescent_operations)\n long_list = fluorescent_operations[:dark_ops] + fluorescent_operations[:light_ops]\n show do \n title \"Make Note on Fluorescent Plates\"\n plates_to_note = long_list.reject { |op| op.temporary[:delete] }.map{ |op| op.input(\"Plate\").item.id }\n note \"Perform steps with the following plates: #{plates_to_note}\"\n note \"Place a small piece of tape on each plate\"\n note \"Make note on tape saying 'Select Circled Colonies'\"\n end\n end", "def notes; end", "def notes; end", "def notes; end", "def get_foot_notes subgroup_id\n ##puts \"ENTERING THE GET_FOOT_NOTES FUNCTION\\n\"\n footnotes = []\n # get all outcome data entries\n outcome_data_entries = OutcomeDataEntry.where(:outcome_id=>self.id, :subgroup_id=>subgroup_id, :study_id=>self.study_id, :extraction_form_id=>self.extraction_form_id)\n # for each data entry that we find...\n outcome_data_entries.each do |ocde|\n ##puts \"----------------------\\nWorking on ocde with id of #{ocde.id}...\\n\\n\"\n # get all the measures associated with the data entry\n oc_measures = ocde.outcome_measures\n oc_measures = oc_measures.collect{|x| x.id}\n\n # get the datapoints associated with the measure\n oc_dps = OutcomeDataPoint.find(:all,:conditions=>[\"outcome_measure_id IN (?) AND footnote_number > ? AND footnote <> ?\",oc_measures,0,\"\"], :select=>[\"id\",\"footnote\",\"footnote_number\"]) \n\n ##puts \"Found #{oc_dps.length} datapoints for this measure.\\n\"\n oc_dps.each do |dp|\n ##puts \"Starting on datapoint #{dp.id} and entering a footnote of #{dp.footnote}\\n\\n\"\n footnotes[dp.footnote_number-1] = dp\n end\n end \n\n # get all comparisons for the outcome\n comparisons = Comparison.where(:outcome_id=>self.id, :subgroup_id=>subgroup_id, :study_id=>self.study_id,\n :extraction_form_id=>self.extraction_form_id)\n # go through each comparison and pull out comparison measures \n comparisons.each do |comp|\n comp_measures = comp.comparison_measures\n comp_measures = comp_measures.collect{|x| x.id}\n # for each comparison measure in the comparison, find datapoints with footnotes\n comp_dps = ComparisonDataPoint.find(:all,:conditions=>[\"comparison_measure_id IN (?) AND footnote_number > ? \n AND footnote <> ?\",comp_measures,0,\"\"],:select=>[\"id\",\"footnote\",\"footnote_number\"])\n # for each datapoint found that has footnotes, add them to the array based on the footnote number\n comp_dps.each do |cmp_dp|\n footnotes[cmp_dp.footnote_number-1] = cmp_dp\n end\n end\n return footnotes\n end", "def delete_note id\n @nimble.delete \"contact/notes/#{id}\"\n end", "def test03_250RepostNote\n\t\trepostNotePop\n\t\tsleep 3\n \t\trepostPopulate250\n \t\tsleep 3\n\t\t\n\t\tbegin \n\t\tassert $repost_confirmation.exists?\n\t\t\trescue => e\n\t\t\tputs \"RS4T003: FAILED! User unable to repost!\"\n\t\t\tputs e\n\t\tend\n\tend", "def destroy_notes\n notes = Note.where('username = ? OR username IS ?', current_user.name, nil)\n notes.each do |note|\n if note.is_public == true\n note.update(username: nil)\n note.update(is_anon: true)\n else\n note.destroy\n end\n end\n end", "def notes\n run(helm('get', 'notes', name))\n end", "def note note, preview=nil\n preview ||= note[0..64]\n params = {\n contact_ids: [ self.id ],\n note: note,\n note_preview: preview\n }\n @nimble.post \"contacts/notes\", params\n end", "def assert_note_b_prime(index)\n within(all(\"li.note\")[index]) do\n assert_text \"Note B Prime\"\n assert_text \"1 day ago\"\n assert_link \"Edit\"\n assert_link \"Delete\"\n # TODO: Make a link to user profile show.\n assert_text \"Can Edit CIs/Outages\"\n end\n end", "def notes_table_cleanup(xmldoc)\n nomatches = false\n until nomatches\n q = \"//table/following-sibling::*[1][self::note]\"\n nomatches = true\n xmldoc.xpath(q).each do |n|\n n.previous_element << n.remove\n nomatches = false\n end\n end\n end", "def update!(**args)\n @summary_skipped_reasons = args[:summary_skipped_reasons] if args.key?(:summary_skipped_reasons)\n @summary_text = args[:summary_text] if args.key?(:summary_text)\n end" ]
[ "0.64049107", "0.6381191", "0.6062252", "0.59177274", "0.57676107", "0.574939", "0.57445514", "0.57286924", "0.5711052", "0.5585502", "0.5568033", "0.556653", "0.5539169", "0.5530218", "0.5509743", "0.5493581", "0.54554504", "0.5454089", "0.5432212", "0.5370264", "0.5351698", "0.5257598", "0.5256589", "0.5243306", "0.523181", "0.52281684", "0.52276933", "0.5221323", "0.5214787", "0.52123797", "0.51965356", "0.51937234", "0.5189356", "0.51891714", "0.5163987", "0.51565325", "0.5148755", "0.51437336", "0.51389974", "0.5138527", "0.5136558", "0.51300967", "0.51150745", "0.5110373", "0.5100479", "0.5097568", "0.50962377", "0.5095635", "0.5084166", "0.5081763", "0.50713956", "0.5058476", "0.5052729", "0.5052484", "0.50437874", "0.50331837", "0.5017098", "0.50135034", "0.50117034", "0.5008871", "0.5007949", "0.50032765", "0.50031185", "0.50015885", "0.5001105", "0.49977103", "0.49977103", "0.49977103", "0.49977103", "0.4996196", "0.4995616", "0.49823308", "0.4979014", "0.4978043", "0.49766815", "0.49754205", "0.49724317", "0.49722043", "0.49673647", "0.49571207", "0.4951719", "0.49477106", "0.493916", "0.4938054", "0.4934171", "0.49339563", "0.49273762", "0.4926942", "0.4919041", "0.4919041", "0.4919041", "0.4917353", "0.49120456", "0.49067912", "0.49047837", "0.4896173", "0.48949677", "0.48926932", "0.48840117", "0.48839125" ]
0.56930095
9
Verifies that the note matches test data
def verify_note(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def verify_note(note)\n logger.debug \"Verifying visible data for note ID #{note.id}\"\n\n # Verify data visible when note is collapsed\n collapsed_note_el(note).when_present Utils.medium_wait\n collapse_note note\n visible_data = visible_collapsed_note_data note\n expected_short_updated_date = \"Last updated on #{expected_note_short_date_format note.updated_date}\"\n wait_until(1, \"Expected '#{note.subject}', got #{visible_data[:subject]}\") { visible_data[:subject] == note.subject }\n wait_until(1, \"Expected '#{expected_short_updated_date}', got #{visible_data[:date]}\") { visible_data[:date] == expected_short_updated_date }\n\n # Verify data visible when note is expanded\n expand_note note\n visible_data.merge!(visible_expanded_note_data note)\n wait_until(1, \"Expected '#{note.body}', got '#{visible_data[:body]}'\") { visible_data[:body] == \"#{note.body}\" }\n wait_until(1, 'Expected non-blank advisor name') { !visible_data[:advisor].empty? }\n wait_until(1, 'Expected non-blank advisor role') { !visible_data[:advisor_role].empty? }\n wait_until(1, \"Expected '#{note.advisor.depts}', got #{visible_data[:advisor_depts]}\") { visible_data[:advisor_depts] == note.advisor.depts }\n\n # Topics\n note_topics = (note.topics.map { |t| t.name.upcase }).sort\n wait_until(1, \"Expected '#{note_topics}', got #{visible_data[:topics]}\") { visible_data[:topics] == note_topics }\n wait_until(1, \"Expected no remove-topic buttons, got #{visible_data[:remove_topics_btns].length}\") { visible_data[:remove_topics_btns].length.zero? }\n\n # Attachments\n non_deleted_attachments = note.attachments.reject &:deleted_at\n expected_file_names = non_deleted_attachments.map &:file_name\n wait_until(1, \"Expected '#{expected_file_names.sort}', got #{visible_data[:attachments].sort}\") { visible_data[:attachments].sort == expected_file_names.sort }\n\n # Check visible timestamps within 1 minute to avoid failures caused by a 1 second diff\n expected_long_created_date = \"Created on #{expected_note_long_date_format note.created_date}\"\n wait_until(1, \"Expected '#{expected_long_created_date}', got #{visible_data[:created_date]}\") do\n Time.parse(visible_data[:created_date]) <= Time.parse(expected_long_created_date) + 60\n Time.parse(visible_data[:created_date]) >= Time.parse(expected_long_created_date) - 60\n end\n expected_long_updated_date = \"Last updated on #{expected_note_long_date_format note.updated_date}\"\n wait_until(1, \"Expected '#{expected_long_updated_date}', got #{visible_data[:updated_date]}\") do\n Time.parse(visible_data[:updated_date]) <= Time.parse(expected_long_updated_date) + 60\n Time.parse(visible_data[:updated_date]) >= Time.parse(expected_long_updated_date) - 60\n end\n end", "def test_truth\n assert_kind_of InvoiceNote, invoice_notes(:first)\n end", "def verify_message(record, message_body)\n assert_equal 'messages', message_body['type']\n assert_equal record.id, message_body['id']\n assert_equal record.content, message_body['attributes']['content']\n assert_equal record.is_palindrome == 'true', message_body['attributes']['is_palindrome']\n end", "def test_update_note\n notes = @database.get_not_deleted_notes\n assert_not_nil notes\n \n note = notes.first\n assert_not_nil note\n \n note.content = \"A new content\"\n note.modifydate = Time.new.to_f.to_s\n version = note.version\n syncnumber = note.syncnumber\n \n tags = [\"important\", \"todo\"]\n note.tags = tags\n note.version += 1\n note.syncnumber += 1\n \n note.save\n \n updated_note = @database.get_note_with_key note.key\n\n # Check if changes were forwared to the database correctly\n assert_equal updated_note.content, note.content\n assert_equal updated_note.modifydate, note.modifydate\n assert_equal updated_note.tags, note.tags\n end", "def valid_notes?\n return true if @version >= 8 # Easy out if we've already identified the version\n\n # Just because my fingerprinting isn't great yet, adding in a more manual check for the key tables we need\n expected_tables = [\"ZICCLOUDSYNCINGOBJECT\",\n \"ZICNOTEDATA\"]\n @database.execute(\"SELECT name FROM sqlite_master WHERE type='table'\") do |row|\n expected_tables.delete(row[\"name\"])\n end\n\n return (expected_tables.length == 0)\n end", "def valid_notes?\n return true if @version >= IOS_LEGACY_VERSION # Easy out if we've already identified the version\n\n # Just because my fingerprinting isn't great yet, adding in a more manual check for the key tables we need\n expected_tables = [\"ZICCLOUDSYNCINGOBJECT\",\n \"ZICNOTEDATA\"]\n @database.execute(\"SELECT name FROM sqlite_master WHERE type='table'\") do |row|\n expected_tables.delete(row[\"name\"])\n end\n\n return (expected_tables.length == 0)\n end", "def test_exercise_1111\n verify_method :exercise_1111,\n :with => [{param: [[true]], expect: \" 1\\n1*\\n\"},\n {param: [[false]], expect: \" 1\\n1 \\n\"},\n {param: [[true, false]], expect: \" 12\\n1* \\n\"},\n {param: [[true, false], [true, false]], expect: \" 12\\n1* \\n2* \\n\"}]\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def descrips_match(expected, descrips)\n begin\n expected.zip(descrips).collect {\n |x, y| (x == :anything || x == y) }.inject(true) {\n |x, y| x && y }\n rescue TypeError => te\n puts \"TypeError: #{te}\"\n end\n end", "def test_notes_export_format\n assert_equal(\n \"\",\n observations(:minimal_unknown_obs).notes_export_formatted\n )\n\n assert_equal(\n \"Found in a strange place... & with śtrangè characters™\",\n observations(:detailed_unknown_obs).notes_export_formatted\n )\n assert_equal(\n \"substrate: soil\",\n observations(:substrate_notes_obs).notes_export_formatted\n )\n assert_equal(\n \"substrate: soil\\nOther: slimy\",\n observations(:substrate_and_other_notes_obs).notes_export_formatted\n )\n end", "def different_notes?\n if self.source_note.nil?\n return false\n end\n if self.target_note.nil?\n return false\n end\n return self.source_note != self.target_note\n end", "def test_notes_parts_values\n obs = observations(:template_and_orphaned_notes_scrambled_obs)\n assert_equal(\"red\", obs.notes_part_value(\"Cap\"))\n assert_equal(\"pine\", obs.notes_part_value(\"Nearby trees\"))\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def test_document\n add_test_judgement\n assert(@gold_standard.contains_document? :id => \"doc1\")\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def test_rec_number_positive\n @numbers.each do |value, expected|\n assert_equal expected, @TS_Rec.format(value)\n end\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def test_can_accept_multiple_notes\n p = players(:manny)\n assert_equal [], p.notes\n note1 = Note.create!(:body => \"note 1\")\n note2 = Note.create!(:body => \"note 2\")\n p.notes << note1\n p.notes << note2\n assert_equal [note1, note2], p.notes\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_ut_diff_warning_02\n assert_equal 2,@diff_warning.diff_status_id\n assert_equal 1,@diff_warning.diff_file_id\n assert_equal 1,@diff_warning.rule_set\n assert_equal 1,@diff_warning.warning_id\n assert_equal 1,@diff_warning.original_file_id\n end", "def assert_equal_station station, sample_station\n if station.instance_of?(Station) && sample_station.instance_of?(Station)\n return assert(station.abbreviation == sample_station.abbreviation && station.est.include_all?(sample_station.est), \"Estimates should be equal\")\n end\n false\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def verify()\n # TODO\n end", "def test_seqence_valid21\n result = engine(\"Trump123%\")\n refute(result, \"'Trump123%' should not be valid because it contains a sequence.\")\n end", "def test_form_notes_parts\n # no template and no notes\n obs = observations(:minimal_unknown_obs)\n parts = [\"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template and Other notes\n obs = observations(:detailed_unknown_obs)\n parts = [\"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template and orphaned notes\n obs = observations(:substrate_notes_obs)\n parts = %w[substrate Other]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # no template, and orphaned notes and Other notes\n obs = observations(:substrate_and_other_notes_obs)\n parts = %w[substrate Other]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and no notes\n obs = observations(:templater_noteless_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and other notes\n obs = observations(:templater_other_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and orphaned notes\n obs = observations(:templater_orphaned_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part\n obs = observations(:template_only_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part and Other notes\n obs = observations(:template_and_other_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part and orphaned part\n obs = observations(:template_and_orphaned_notes_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n\n # template and notes for a template part, orphaned part, Other,\n # with order scrambled in the Observation\n obs = observations(:template_and_orphaned_notes_scrambled_obs)\n parts = [\"Cap\", \"Nearby trees\", \"odor\", \"orphaned_caption_1\",\n \"orphaned_caption_2\", \"Other\"]\n assert_equal(parts, obs.form_notes_parts(obs.user))\n end", "def assert_equal(type,expected, actual)\n text1=get_text(type,expected)\n text2=$array1[\"#{actual}\"] \n puts text1\n puts text2\n if text1 == text2\n puts \"given text is available\"\n elsif \n $log.error \"given #{expected} text is not displayed\"\n raise(\"given #{expected} text is not displayed\")\n end\nend", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def test_seqence_valid14\n result = contains_password?(\"password1\")\n refute(result, \"'passwrd123*' should not be valid because it contains a sequence\")\n end", "def test_old\n assert_equal({\n \"shiva\"=>\"Shiva\",\n \"ganesha\"=>\"Ganesha\",\n \"surya\"=>\"Surya\",\n \"ganga\"=>\"Ganga\",\n \"shakti\"=>\"Shakti\",\n \"vishnu\"=>\"Vishnu\",\n \"shiva_desc\"=>\"Shiva is the god of transformation through destruction and the Lord of Dance.\",\n \"ganesha_desc\"=>\"Ganesha is the god of knowledge and beginnings, the Lord of Obstacles.\",\n \"surya_desc\"=>\"Surya is the god of the sun, courage and will.\",\n \"ganga_desc\"=>\"Ganga is the goddess of the sacred river, Ganges, who purifies and redeems.\",\n \"shakti_desc\"=>\"Shakti is the goddess of power and dynamic energy.\",\n \"vishnu_desc\"=>\"Vishnu is the all-pervading god who sustains the world.\",\n \"RV_NO_DEITY_TITLE\"=>\"No Current Deity.\",\n \"RV_NO_DEITY_DESC\"=>\"Hinduism allows you to select which god to follow as your main deity. Each deity will come with its own effects and last until your monarch changes.\",\n \"RV_PICK_DEITY_THIS\"=>\"Follow $NAME|Y$\",\n \"RV_PICK_DEITY\"=>\"Select Deity\",\n }, FakeYaml.load(sample(\"religion_l_english\")))\n end", "def verify(event_data)\n true\n end", "def verify\n end", "def test_should_not_validate_double_claiming\n claiming = create_claiming\n assert claiming.valid?\n claiming = create_claiming\n assert !claiming.valid?\n end", "def verify_iss; end", "def verify_iss; end", "def test_ut_diff_warning_01\n assert @diff_warning.save\n assert @diff_warning.valid?\n diff_warning_copy = DiffWarning.find(@diff_warning.id)\n assert_equal @diff_warning.diff_file_id, diff_warning_copy.diff_file_id\n assert @diff_warning.destroy\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def verify_contents_using_regular_matcher!(contents_matcher, actual)\n return false if values_match?(contents_matcher, actual.value.to_h)\n\n @failure_message = \"Contents in #{actual.value.class} do not match\"\n @expected = contents_matcher\n @actual = actual.value.to_h\n\n true\n end", "def assert_note_a(index)\n within(all(\"li.note\")[index]) do\n assert_text \"Note A\"\n assert_text \"1 hour ago\"\n assert_link \"Edit\"\n assert_link \"Delete\"\n # TODO: Make a link to user profile show.\n assert_text \"Basic\"\n end\n end", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def verify(entry)\n\t\treturn \"save\" if entry == \"save\"\n\t\tif entry.length != 2\n\t\t\tputs \"wrong type of entry\"\n\t\t\treturn false\n\t\tend\n\t\treturn true\n\tend", "def checkMagazine(magazine, note)\n # 1) store every word in magazine to hash\n dict = Hash.new()\n magazine.each do |word|\n if dict[word].nil?\n dict[word] = 1\n else\n dict[word] += 1\n end\n end\n\n # 2) iterate through note if word does not exist in hash, return false\n note.each do |word|\n if dict[word].nil? || dict[word] == 0\n return \"No\"\n else\n dict[word] -= 1\n end\n end\n\n # 3) otherwise return true\n return \"Yes\"\nend", "def test_check_good_time\n assert_output '' do\n time = '1553188611.560418000'\n prev_time = '1553188612.100418000'\n line_num = 0\n @verify.check_time(time, prev_time, line_num)\n end\n end", "def verify_staff(test_data)\n staff = test_data[UseOfCollections::STAFF_GRP.name] || [UseOfCollections.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[UseOfCollections::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[UseOfCollections::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[UseOfCollections::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[UseOfCollections::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def test_validate_reason_code_with_valid_data\n reason_code1 = ReasonCode.new\n reason_code1.reason_code = \"RC.S-A_\"\n reason_code1.save\n assert reason_code1.valid?, reason_code1.errors.full_messages.to_s\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[UseOfCollections::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def validate_same_number_of_sts_in_p_and_f(asp_w_f_sts)\n p_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[0].count('@') }\n f_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[1].count('@') }\n if p_st_count != f_st_count\n if debug\n puts asp_w_f_sts.ai(indent: -2)\n puts \"\\n\\n\\n\\n\"\n puts \"mismatches:\".color(:red)\n asp_w_f_sts.each { |(primary,foreign,conf)|\n pr_st_count = primary.count('@')\n fo_st_count = foreign.count('@')\n if pr_st_count != fo_st_count\n puts '-' * 10\n p primary\n puts \"pr_st_count: #{ pr_st_count }\"\n p foreign\n puts \"fo_st_count: #{ fo_st_count }\"\n puts \"conf: #{ conf.inspect }\"\n end\n }\n end\n raise \"Mismatch in subtitle counts: primary has #{ p_st_count } and foreign has #{ f_st_count }\"\n end\n true\n end", "def test_validate_pass_978d0d13d149505d0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"978-0-13-149505-0\"))\r\n\tend", "def test_validate_pass_978d0d13d149505d0_returns_true\r\n\t\tassert_equal(true, validate_isbn?(\"978-0-13-149505-0\"))\r\n\tend", "def matches_expected? pi\n pi.patient_identifier == expected.patient_identifier &&\n pi.affinity_domain == expected.affinity_domain\n end", "def verify\n\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def test05_post_closed_news_NoNoteRepostNote\n\t\trepostNotePop\n\t\tsleep 3\n \t\trepost \"\" #No note\n \t\tsleep 3\n\t\t\n\t\tassert $repost_confirmation.exists?\n\tend", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def verify_provisos(test_data)\n verify_values_match(test_data[UseOfCollections::PROVISOS.name], element_value(provisos_text_area))\n end", "def verify\n end", "def test_valid_doi\n File.foreach File.dirname(__FILE__) + '/fixtures/good-doi.txt' do |doi|\n assert SimpleDOI.valid?(doi), \"#{doi} should be considered a valid DOI\"\n end\n end", "def test_sequence_valid13\n result = contains_password?(\"passwrd12*\")\n assert(result, \"'passwrd12*' should be valid because it doesn't contain a sequence\")\n end", "def eql?(other_note)\n other_note.instance_of?(self.class) and self == other_note\n end", "def verify_staff(test_data)\n staff = test_data[CoreUseOfCollectionsData::STAFF_GRP.name] || [CoreUseOfCollectionsData.empty_staff]\n staff.each_with_index do |staf, index|\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NAME.name], element_value(staff_name_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_ROLE.name], element_value(staff_role_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_HOURS_SPENT.name], element_value(staff_hours_spent_input index))\n verify_values_match(staf[CoreUseOfCollectionsData::STAFF_NOTE.name], element_value(staff_note_input index))\n end\n end", "def test_valid_with_attributes\r\n patient = Patient.new\r\n patient.first_name = @patient.first_name\r\n patient.last_name = @patient.last_name\r\n patient.dob = @patient.dob\r\n patient.ssn = @patient.ssn\r\n patient.address = @patient.address\r\n patient.apt_suite = @patient.apt_suite\r\n patient.address_line1 = @patient.address_line1\r\n patient.city = @patient.city\r\n patient.state = @patient.state\r\n patient.zipcode = @patient.zipcode\r\n patient.sex = @patient.sex\r\n assert patient.valid?, patient.errors.full_messages \r\n end", "def ==(other_note)\n self.tone == other_note.tone\n end", "def test_validate_patient_name_by_giving_valid_data\n eob = InsurancePaymentEob.new\n eob.patient_first_name = \"gh.gh\"\n eob.patient_last_name = \"h-gfhj\"\n eob.patient_middle_initial = \"hj\"\n eob.save\n assert eob.valid?, eob.errors.full_messages.to_s\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def test_validate_patient_name_and_account_number_by_giving_invalid_data\n image_type_record = ImageType.new\n image_type_record.patient_first_name = \"RAJ.jk*-9\"\n image_type_record.patient_last_name = \"C)C.9-\"\n image_type_record.patient_account_number= \"gh.gh-&&89\"\n image_type_record.image_type = \"EOB\"\n image_type_record.save\n assert !image_type_record.valid?, image_type_record.errors.full_messages.to_s\n end", "def pass?\n expected_array.size == actual_array.size &&\n [expected_array, actual_array].transpose.all? do |expected_element, actual_value|\n expected_element.match_against_actual_value(actual_value)\n end\n end", "def assert_file_content_match(refFile,resContent, explanationstring=\"\")\n if explanationstring.empty?\n explanationstring=explanationstring + \": \"\n end\n\n refContArr = File.open(refFile,\"r\").read.split(/\\n/)\n resContArr = resContent.split(/\\n/)\n assert_equal(refContArr.size,resContArr.size,explanationstring + \"Line count assertions : asnswer file: #{refFile}: \")\n for count in 0...refContArr.size\n re = refContArr[count]\n assert_match(/#{re}/,resContArr[count],explanationstring + \"At line :\" + count.to_s + \": answer file: #{refFile}\")\n end\n end", "def test_rental_details_for_title\n rental_details = @library1.rental_details_for_title(\"lord_of_the_rings\")\n assert_equal({student_name: \"Jeff\", date: \"25/05/19\"}, rental_details)\n end", "def check_entry(entry, expected_name, expected_number, expected_email)\n expect(entry.name).to eq expected_name\n expect(entry.phone_number).to eq expected_number\n expect(entry.email).to eq expected_email\n end", "def test03_R1_post_note_TC_24423\n\t\t@msg = \"It's nice to see small businesses in #{$local_patch} #{random}\"\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\twait_for_ajax\n\t\tsleep 4\n\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n\t\tsleep 3\n\t\t$business_review_note_button.click\n\t\tsleep 2\n\t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('Automated Text')\")\n\t\t$business_review_text.set(@msg)\n\n\t\tsleep 2\n\t\t$business_review_post.fire_event(\"onclick\")\n\n\t\tsleep 5\n\t\tassert $browser.text.include? \"#{@msg}\"\n\tend", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end", "def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data record! -- sample #{id}\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[0]} --\", \"#{dose_unit_text(values[values.keys[0]])}/day,\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[1]} --\", \"#{dose_unit_text(values[values.keys[1]])}/day.\", \"|\"]\n puts \"%s%7s\" % [\"| Sample #{id} will not include in the analysis!\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n data.delete(id)\n end\n end\n data\n end", "def validate_todo_data(todo_data)\n ##----------------\n ## Required values\n ##----------------\n required = %i{ todo_base\n source\n workspace\n compressed_destination\n glacier_description\n glacier_vault\n application\n method\n }\n missing = required.select { |key| todo_data[key].to_s.strip.empty? }.map(&:inspect)\n raise \"Required todo values missing: #{missing.join(', ')}\" unless missing.empty?\n\n ##------------------------------------\n ## Verify compressed archived checking\n ##------------------------------------\n verify = todo_data[:verify_compressed_archive].to_s.strip.downcase\n return if ['', 'false'].include?(verify) # No verification to do; end validation\n # We have a non-false verify value; unless it's 'true', it's not a valid value.\n raise \":verify_compressed_archive must be '', 'true'. or 'false'; got: '#{verify}'\" unless verify == 'true'\n\n # ':verify_compressed_archive' is true; make sure :verification_destination\n # is defined.\n if todo_data[:verification_destination].to_s.strip.empty?\n raise \"':verification_destination' must be supplied if ':verify_compressed_archive' is 'true'\"\n end\n\n end", "def test_validate_patient_name_and_account_number_with_consecutive_occurrence_of_valid_special_characters\n image_type_record = ImageType.new\n image_type_record.patient_first_name = \"RAJ..p\"\n image_type_record.patient_last_name = \"mek..ha\"\n image_type_record.patient_account_number= \"A89--990\"\n image_type_record.image_type = \"NOT\"\n image_type_record.save\n assert !image_type_record.valid?, image_type_record.errors.full_messages.to_s\n end", "def check_entry(entry, expected_name, expected_number, expected_email)\n expect(entry.name).to eq expected_name\n expect(entry.phone_number).to eq expected_number\n expect(entry.email).to eq expected_email\n end", "def test_truth\n end", "def test_seqence_valid19\n result = engine(\"TrumppasswORd12%\")\n refute(result, \"'Trump1%' should not be valid because it contains password.\")\n end", "def check_entry(entry, expected_name, expected_number, expected_email)\n expect(entry.name).to eq expected_name\n expect(entry.phone_number).to eq expected_number\n expect(entry.email).to eq expected_email\n end", "def note?\n first_element_child.text =~ /\\A\\s*Note:\\s/\n end", "def test_save\n verify_save(@pnt)\n end", "def invalid?\n\t\treturn ( major.text.include?('Success') and minor.text.include?('IncorrectSignature') )\n\tend", "def check_entry(entry, expected_name, expected_phone, expected_email)\n expect(entry.name).to eq(expected_name)\n expect(entry.phone_number).to eq(expected_phone)\n expect(entry.email).to eq(expected_email)\n end", "def test_csv_table_match(subject)\n # Compare the fields\n if !subject.empty?\n subject_fields = subject[0].keys\n master_fields = @golden_master.headers\n\n if subject_fields.count != master_fields.count\n throw_no_match \"Expected #{master_fields.count} field(s), got #{subject_fields.count}\"\n end\n\n master_fields.each_with_index do |column, index|\n if column != subject_fields[index]\n throw_no_match \"Expected field \\\"#{column}\\\", got field \\\"#{subject_fields[index]}\\\"\"\n end\n end\n end\n\n # Compare the number of records\n subject_record_count = subject.count\n master_record_count = @golden_master.inject(0){|count| count += 1}\n if subject_record_count != master_record_count\n throw_no_match \"Expected #{master_record_count} record(s), got #{subject_record_count}\"\n end\n\n # Compare the values of the golden master with the subject\n current_row = 0\n @golden_master.each do |row|\n row.each do |field, master_string|\n subject_value = subject[current_row][field]\n if !match_values?(master_string, subject_value)\n throw_no_match \"Field \\\"#{field}\\\", Record #{current_row + 1}: Expected value #{master_string.nil? ? '<NULL>' : \"\\\"#{master_string}\\\"\"}, got #{subject_value.nil? ? '<NULL>' : \"\\\"#{subject_value}\\\"\"}\"\n end\n end\n current_row += 1\n end\n end", "def enter_note(test_data)\n hide_notifications_bar\n wait_for_element_and_type(note_text_area, test_data[UseOfCollections::NOTE.name])\n end", "def enter_note(test_data)\n hide_notifications_bar\n logger.info \"Entering note '#{test_data[CoreUseOfCollectionsData::NOTE.name]}'\"\n wait_for_element_and_type(note_text_area, test_data[CoreUseOfCollectionsData::NOTE.name])\n end", "def verify_reference_nbr(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::REFERENCE_NBR.name], element_value(reference_nbr_input))\n end", "def test_contains_recipe\n @fdb = setup\n assert(@fdb.contains_recipe?(\"PB&J Sandwich\") == true, \"Database does not contain recipe when it should\")\n assert(@fdb.contains_recipe?(\"Lemon Pie\") == false, \"False positive found\")\n end", "def notes?\n result = false\n self.class.all_note_fields.each do |field|\n result = send(field).to_s.match(/\\S/)\n break if result\n end\n result\n end", "def test02_R1_disappointed_TC_24423\n\t\t@msg = \"The office isn't open at 3 AM! I am disappointed times #{random}!!\"\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\twait_for_ajax\n\t\tsleep 3\n\t\t$post_activate_note.when_present.fire_event(\"onclick\")\n\t\tsleep 3\n\t\t$business_review_disappointed.click\n\t\tsleep 2\n\t\t$business_review_text.set(@msg)\n\t\t$business_review_post.fire_event(\"onclick\")\n\n\t\tsleep 2\n\t\tassert $browser.text.include? \"#{@msg}\"\n\t\tassert $browser.text.include? \"disappointed times\"\n\n\tend", "def verify( *suspect_words )\n\t\tsuspect_words.flatten.sort == @banned_words\n\tend", "def test_relevant\n add_test_judgement\n assert(@gold_standard.relevant? :document => \"doc1\", :query => \"query1\")\n end", "def test_answer_check_works\n assert_equal(true, @question.check_answer?(\"Pavel\"))\n assert_equal(false, @question.check_answer?(\"Wrong Answer\"))\n end", "def test_05_1_show_me_how_TC_24406\n\t\t\n\t\tprofileLogin\n\t\t$browser.goto($patch_note)\n\t\t$help_post_note.when_present.click\n\t\tsleep 4 \n\t\t$browser.window(:title, /Post a Note/).use do\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include?(\"Post a Note\")\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"J1_T5.1: FAILED! User unable to navigate to zendesk.\"\n\t\tend\n\t\tend\n\tend", "def test_update_name_merge_matching_notes2\n old_name = names(:russula_brevipes_author_notes)\n new_name = names(:conocybe_filaris)\n old_citation = old_name.citation\n old_notes = old_name.notes\n old_desc = old_name.description.notes\n params = {\n id: old_name.id,\n name: {\n text_name: new_name.text_name,\n author: \"\",\n rank: old_name.rank,\n citation: old_name.citation,\n notes: old_name.notes,\n deprecated: (old_name.deprecated ? \"true\" : \"false\")\n }\n }\n login(\"rolf\")\n put(:update, params: params)\n\n assert_flash_success\n assert_redirected_to(name_path(new_name.id))\n assert_no_emails\n assert(new_name.reload)\n assert_not(Name.exists?(old_name.id))\n assert_equal(\"\", new_name.author) # user explicitly set author to \"\"\n assert_equal(old_citation, new_name.citation)\n assert_match(/#{old_notes}\\Z/, new_name.notes,\n \"old_name notes should be appended to target name's notes\")\n assert_not_nil(new_name.description)\n assert_equal(old_desc, new_name.description.notes)\n end" ]
[ "0.8228131", "0.7070411", "0.6932775", "0.60628676", "0.59932244", "0.5953828", "0.5859783", "0.5825521", "0.5762382", "0.57510424", "0.57493937", "0.57026863", "0.566392", "0.5652546", "0.56464803", "0.5595954", "0.5570968", "0.55679035", "0.5567318", "0.55651224", "0.55166775", "0.55117774", "0.5511601", "0.54833925", "0.5458334", "0.54547346", "0.5449481", "0.5448781", "0.5436386", "0.5433688", "0.54301363", "0.5418383", "0.5416114", "0.5407933", "0.5400458", "0.53949344", "0.53859055", "0.5380408", "0.5376978", "0.5376978", "0.53677475", "0.5362296", "0.5355459", "0.5349407", "0.5344071", "0.533865", "0.5333519", "0.53187716", "0.5312342", "0.5312139", "0.5307502", "0.530569", "0.5297478", "0.52866757", "0.52866757", "0.5281037", "0.52774465", "0.5275082", "0.52680844", "0.5260141", "0.5257514", "0.52550286", "0.52519834", "0.5247421", "0.52452236", "0.5244831", "0.52442616", "0.52426314", "0.5238185", "0.5236925", "0.5236793", "0.523378", "0.522648", "0.52242124", "0.5212705", "0.51940376", "0.5192577", "0.51891935", "0.51888174", "0.518621", "0.5186014", "0.5181649", "0.5180581", "0.517955", "0.51786226", "0.5173762", "0.517167", "0.5167208", "0.5165181", "0.5164812", "0.51636577", "0.51620686", "0.5155095", "0.51525265", "0.51513284", "0.51488686", "0.5148321", "0.51476103", "0.5143412", "0.5141622" ]
0.823546
0
PROVISOS Enters or removes provisos per a given set of test data
def enter_provisos(test_data) hide_notifications_bar logger.info "Entering provisos '#{test_data[CoreUseOfCollectionsData::PROVISOS.name]}'" wait_for_element_and_type(provisos_text_area, test_data[CoreUseOfCollectionsData::PROVISOS.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_002\n # delete all existed projects\n delete_all_pus\n begin\n # there is no project\n open_pu_management_page\n assert is_element_not_present(xpath[\"pu_management\"][\"search_box\"])\n assert is_element_not_present(xpath[\"pu_management\"][\"pu_table\"])\n logout\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n # return the original data (2 pus)\n make_original_pus\n end", "def test_001\n # delete all existed projects\n delete_all_pus\n begin\n # there is no project\n open_pu_management_page\n wait_for_text_present(_(\"No PU has been registered\"))\n logout\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n # return the original data (2 pus)\n make_original_pus\n end", "def verify_provisos(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::PROVISOS.name], element_value(provisos_text_area))\n end", "def verify_provisos(test_data)\n verify_values_match(test_data[UseOfCollections::PROVISOS.name], element_value(provisos_text_area))\n end", "def enter_provisos(test_data)\n hide_notifications_bar\n wait_for_element_and_type(provisos_text_area, test_data[UseOfCollections::PROVISOS.name])\n end", "def test_036\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n filtering('1')\n assert is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def test_039\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n #Open PU management page\n open_pu_management_page_1\n\n filtering(\"\")\n assert is_text_present('sample_pu1')\n assert is_text_present('sample_pu2')\n\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def test_037\n\n login\n\n #Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to PU name.\n assert_equal _(\"PU name\"), get_selected_label(\"find_box\")\n\n\n # you have no relevance\n filtering('3')\n assert !is_text_present('sample_pu1')\n assert !is_text_present('sample_pu2')\n assert is_text_present(_('A PU does not exist.'))\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def test_031\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n pu_name_a = 'puA'\n pu_name_b = 'puB'\n create_pu(pu_name_a)\n create_pu(pu_name_b)\n\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # firtly, sort by ID\n pus = Pu.find(:all,:order => 'id')\n\n # click ID link\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'id')\n pus_second = Pu.find(:all,:order => 'id DESC')\n else\n pus = Pu.find(:all,:order => 'id DESC')\n pus_second = Pu.find(:all,:order => 'id')\n end\n for j in 1..@@no_pu\n assert_equal pus[j-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{j}.1\")\n end\n # Click PU ID\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n for k in 1..@@no_pu\n assert_equal pus_second[k-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{k}.1\")\n end\n\n # Delete created data\n\n @@pu= Pu.find_by_name('puA')\n @@pu2= Pu.find_by_name('puB')\n @@pu.destroy\n @@pu2.destroy\n\n\n # Logout\n logout\n make_original_pus\n end", "def delete_testds(testds)\n not_found = []\n testds.each do |testd_td|\n descriptor = Testd.where({ 'testd.name' => testd_td['name'],\n 'testd.vendor' => testd_td['vendor'],\n 'testd.version' => testd_td['version'] }).first\n if descriptor.nil?\n logger.error 'Test Descriptor not found ' + testd_td.to_s\n not_found << testd_td\n else\n if descriptor['pkg_ref'] == 1\n descriptor.destroy\n del_ent_dict(descriptor, :testd)\n else descriptor.update_attributes(pkg_ref: descriptor['pkg_ref'] - 1)\n end\n end\n end\n not_found\n end", "def test_032\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # Sort by name\n pus = Pu.find(:all,:order => 'name')\n\n # Click PU name\n\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'name')\n pus_second = Pu.find(:all,:order => 'name DESC')\n else\n pus = Pu.find(:all,:order => 'name DESC')\n pus_second = Pu.find(:all,:order => 'name')\n end\n\n for l in 1..@@no_pu\n assert_equal pus[l-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{l}.1\")\n end\n # secondly, sort by PU's name\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n for m in 1..@@no_pu\n assert_equal pus_second[m-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{m}.1\")\n end\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu.destroy\n @@pu2.destroy\n\n # Logout\n logout\n make_original_pus\n end", "def test_export_to_pstore\r\n model=Model.new(2, 'pstore persistance')\r\n model.description = 'will be deleted between tests'\r\n model.commentary = 'and they are off'\r\n \r\n proc1 = model.node_list.add_node(1, 'process one', PROCESS)\r\n proc2 = model.node_list.add_node(2, 'process two', PROCESS)\r\n proc1.evidence = [0.2, 0.3]\r\n model.link_list.add_link(proc1, proc2)\r\n \r\n Persist.export_to_pstore(model, 'models/unittest1')\r\n end", "def test_033\n # login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n #Open PU management page\n open_pu_management_page_1\n\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n\n # firtly, sort by PU's registration date\n pus = Pu.find(:all,:order => 'created_at')\n\n #Click registration date link\n click $xpath[\"misc\"][\"registration_link\"]\n\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'created_at')\n pus_second = Pu.find(:all,:order => 'created_at DESC')\n else\n pus = Pu.find(:all,:order => 'created_at DESC')\n pus_second = Pu.find(:all,:order => 'created_at')\n end\n\n for n in 1..@@no_pu\n assert_equal pus[n-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{n}.1\")\n end\n\n # secondly, sort by PU's registration date\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n for p in 1..@@no_pu\n assert_equal pus_second[p-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{p}.1\")\n end\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu.destroy\n @@pu2.destroy\n\n # Logout\n logout\n make_original_pus\n end", "def test_035\n\n login\n\n # Create some PUs\n\n for i in 0..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Selection for filtering\n assert_equal [_(\"PU name\"), _(\"Registration date\")], get_select_options(\"find_box\")\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n\n end", "def proppatch(nodes)\n init_pstore unless exists?\n\n actions = { set: [], remove: [] }\n\n @store.transaction do\n @store[:properties] = {} unless @store[:properties].is_a? Hash\n\n add_remove_properties nodes, actions\n end\n\n get_custom_property nil\n actions\n end", "def test_remove_promotion_multiple_items\n setup_new_order_with_items()\n editable_order_codes = (1..5)\n editable_order_codes.each do |status_id|\n o_status = OrderStatusCode.find(status_id)\n assert_kind_of OrderStatusCode, o_status\n\n @o.order_status_code = o_status\n assert @o.is_editable?\n \n promo = promotions(:fixed_rebate)\n @o.promotion_code = promo.code\n assert @o.save\n assert_kind_of OrderLineItem, @o.promotion_line_item\n # Add dupe line item.\n dupe_item = @o.promotion_line_item.clone\n @o.order_line_items << dupe_item\n assert_equal 2, @o.order_line_items.count(\n :conditions => [\"name = ?\", @o.promotion.description]\n )\n # Remove\n @o.remove_promotion()\n assert_nil @o.promotion_line_item\n end\n end", "def test_038\n\n login\n\n # Create some PUs\n\n for i in 1..2\n create_pu('sample_pu'+i.to_s)\n end\n\n pus = Pu.find_all_by_name('sample_pu1')\n pu = pus.last\n pu.created_at =\"2009-05-08 11:30:50\"\n pu.save\n pus = Pu.find_all_by_name('sample_pu2')\n pu = pus.last\n pu.created_at =\"2008-05-08 14:30:50\"\n pu.save\n @@year = \"2009\"\n @@hour = \"14\"\n\n # Open PU management page\n open_pu_management_page_1\n\n # Arbitrary filtering is performed to date.\n select \"find_box\", \"label=#{_('Registration date')}\"\n assert_equal _(\"Registration date\"), get_selected_label(\"find_box\")\n\n # filtering\n filtering(@@year)\n assert is_text_present(\"2009-05-08\")\n assert !is_text_present(\"2008-05-08\")\n # you have no relevance\n filtering(@@year+'a')\n assert !is_text_present(\"2009-05-08\")\n assert !is_text_present(\"2008-05-08\")\n filtering(@@hour)\n assert is_text_present(\"2008-05-08\")\n sleep 2\n\n # Delete created data\n @@pu= Pu.find_by_name('sample_pu1')\n @@pu2= Pu.find_by_name('sample_pu2')\n @@pu.destroy\n @@pu2.destroy\n logout\n end", "def update_with_measure_tests(product_params)\n add_measure_tests(product_params)\n save!\n add_filtering_tests if c4_test\n add_checklist_test if c1_test\n end", "def update_test_cases\n unless test_case_ids.nil?\n self.plan_cases.each do |p|\n p.destroy unless test_case_ids.include?(p.test_case_id.to_s)\n test_case_ids.delete(p.test_case_id.to_s)\n end \n test_case_ids.each do |c|\n self.plan_cases.create(:test_case_id => c) unless c.blank?\n end\n reload\n self.test_case_ids = nil\n end\n end", "def clean_test\n video=Video.find(self.id)\n video.attach_file_name = nil\n video.attach_content_type = nil\n video.attach_file_size = nil\n video.attach_updated_at = nil\n video.video_estado_id = nil\n video.transcoder_job_id = nil\n video.conversion_status = nil\n video.revisado = false\n video.identidad_verificada = nil\n video.intentos = 0\n video.save(validate:false)\n ##self.save(validate:false)\n Evaluacion.where(video_id: self.id).map{|x|x.delete}\n Reporte.where(video_id: self.id).map{|x|x.delete}\n end", "def test_029\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n #Register a new PU\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n\n # Get total rows in PU table\n total_rows = get_xpath_count($xpath[\"misc\"][\"result_list_PU_row\"])\n\n # for all table...\n (1..total_rows).each do |row_index|\n row_xpath = $xpath[\"misc\"][\"result_list_PU_row\"] + \"[#{row_index}]\"\n result_link_xpath = row_xpath + \"/td[5]/a[2]\"\n result_name_xpath = row_xpath + \"/td[2]\"\n get_text(result_name_xpath)\n\n if row_index == 1\n choose_cancel_on_next_confirmation()\n else\n # PU name is deleted.\n choose_ok_on_next_confirmation()\n end\n\n # clicks on link to delete PU\n click(result_link_xpath)\n\n pj_name = get_text(result_name_xpath)\n strmsg1 = _(\"All information of \")\n strmsg2 = _(\" will be deleted.\\n<PJ,master, analysis task, analysis result, analysis log>\\n\")\n strmsg3 = _(\"Really\")\n strmsg4 = _(\"Are you sure you want to delete\")\n strmsg = ''\n if $lang == 'ja'\n strmsg = \"#{pj_name}\" +strmsg1 + strmsg2 + strmsg3 + \"#{pj_name}\" + strmsg4 +\"?\"\n else\n strmsg = strmsg1 + \"#{pj_name}\" + strmsg2 + strmsg4 + \" #{pj_name}\" +\"?\"\n end\n\n # The dialog which checks deletion comes out.\n assert_equal( strmsg,get_confirmation)\n\n @@pu.destroy\n\n end\n # logout\n logout\n make_original_pus\n end", "def run_test_and_real(ops, program, stamp_columns=nil)\n run_qpcr(FRAGMENT, ops, program, TEST, stamp_columns)\n csv_upload = upload_data(FRAGMENT, ops, program, TEST)\n find_stop_cycles(FRAGMENT, ops, csv_upload)\n separate_tubes(FRAGMENT, ops, REAL, stamp_columns)\n run_qpcr(FRAGMENT, ops, program, REAL, stamp_columns)\n upload_data(FRAGMENT, ops, program, REAL)\n end", "def build_provisions(run_directory, data_directory, whitelist, blacklist)\n \n Scarcity::Submission.new do\n \n # declare where runs happen and where data comes from\n # and indicate that we gather default provisions accordingly \n # This will not need to change in almost all cases.\n runs_in run_directory\n pulls_from data_directory, :only => whitelist, :except => blacklist\n gathers_provisions :zip_data => true\n \n # Declare other goods that will be provided to each dataset at run time.\n provides :from => 'app/executables', :to => :each_dataset do\n file '<%= base_name %>.py', :chmod => 0755\n end\n \n provides :from => 'app/scripts', :to => :each_dataset do\n file 'prejob.py', :chmod => 0755\n file 'postjob.py', :chmod => 0755\n end\n \n provides :from => 'app/submits', :to => :each_dataset do\n file '<%= base_name %>.submit'\n end\n \n provides :from => 'lib/submits', :to => :each_dataset do\n file 'null.submit'\n end\n \n # You might also declare goods to be provided to the segment as a whole\n # provides :from => 'lib/submits', :to => :segment do\n # file 'null.submit'\n # end\n \n end\n \nend", "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def test_product_status\n product = Product.new(vendor: @vendor, name: 'my product', c1_test: true, measure_ids: ['BE65090C-EB1F-11E7-8C3F-9A214CF093AE'], bundle_id: @bundle.id)\n product.save!\n product_test = product.product_tests.build({ name: 'my product test 1', measure_ids: ['BE65090C-EB1F-11E7-8C3F-9A214CF093AE'] }, MeasureTest)\n product_test.save!\n # status should be incomplete if all product tests passing but no checklist test exists\n product_test.tasks.first.test_executions.create!(state: :passed, user: @vendor_user)\n assert_equal 'incomplete', product.status\n\n # if product does not need to certify for c1, than product should pass\n product.update(c1_test: nil, c2_test: true)\n assert_equal 'passing', product.status\n product.update(c1_test: true, c2_test: nil)\n\n # adding a complete checklist test will make product pass\n create_complete_checklist_test_for_product(product, product.measure_ids.first)\n assert_equal 'passing', product.status\n\n # one failing product test will fail the product\n product_test = product.product_tests.build({ name: 'my product test 2', measure_ids: ['BE65090C-EB1F-11E7-8C3F-9A214CF093AE'] }, MeasureTest)\n product_test.save!\n te = product_test.tasks.first.test_executions.build(state: :failed)\n @vendor_user.test_executions << te\n te.save!\n assert_equal 'failing', product.status\n end", "def test_scenario2\n data = [{'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'measure' => 'average_phi',\n 'value' => '0.98029',\n 'params' => {\"combiner\" => 0},\n 'tlp' => 1},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'measure' => 'average_phi',\n 'value' => '0.95061',\n 'params' => {\"combiner\" => 1},\n 'tlp' => 1},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'measure' => 'average_phi',\n 'value' => '0.98029',\n 'params' => {\"combiner\" => 2},\n 'tlp' => 1},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'measure' => 'average_phi',\n 'value' => '0.98029',\n 'params' => {\"operating_kind\" => \"votes\"},\n 'tlp' => 1},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'measure' => 'average_phi',\n 'value' => '0.97064',\n 'params' => {\"operating_kind\" => \"probability\"},\n 'tlp' => 1}, \n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'measure' => 'average_phi',\n 'value' => '0.95061',\n 'params' => {\"operating_kind\" => \"confidence\"},\n 'tlp' => 1},\n ]\n \n puts\n puts \"Scenario: Successfully creating an evaluation for an ensemble\" \n\n data.each do |item|\n puts\n puts \"Given I create a data source uploading a \" + item[\"filename\"] + \" file\"\n source = @api.create_source(item[\"filename\"], {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I create dataset with local source\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n\n puts \"And I create an ensemble of #{item['number_of_models']} models and #{item['tlp']} tlp\"\n \n ensemble = @api.create_ensemble(dataset, {\"number_of_models\"=> item[\"number_of_models\"], \n \"seed\" => 'BigML', \n 'ensemble_sample'=>{'rate' => 0.7, \n 'seed' => 'BigML'}, \n 'missing_splits' => false})\n \n\n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(@api.ok(ensemble), true)\n\n puts \"When I create an evaluation for the ensemble with the dataset\"\n evaluation = @api.create_evaluation(ensemble, dataset, item[\"params\"])\n\n puts \"And I wait until the evaluation is ready\"\n assert_equal(BigML::HTTP_CREATED, evaluation[\"code\"])\n assert_equal(@api.ok(evaluation), true)\n\n puts \"Then the measured #{item['measure']} is #{item['value']}\"\n evaluation = @api.get_evaluation(evaluation)\n assert_equal(item[\"value\"].to_f, evaluation[\"object\"][\"result\"][\"model\"][item[\"measure\"]].to_f) \n\n end\n\n end", "def _setup_pcrs_and_seq_file_for_batch_tests\n @proj = Proj.find($proj_id) \n \n @proj.pcrs.destroy_all\n\n (0..4).each do |i|\n Pcr.create!(:fwd_primer => @primer1, :rev_primer => @primer2, :extract => @extract)\n end\n\n @proj.reload\n\n foo = File.new((File.dirname(__FILE__) + '/../fixtures/test_files/seqs.fasta'), \"w+\")\n foo.puts @proj.pcrs.collect{|p| \">seq_#{p.id}\\nACGTCGT\"}.join(\"\\n\\n\")\n foo.close\n\n @fasta_file = File.open((File.dirname(__FILE__) + '/../fixtures/test_files/seqs.fasta'), \"r\") \n end", "def compare_product_tests(test1, test2)\n # compare relevant details\n test1.save\n test2.save\n assert_performed_jobs 2\n\n test1.reload\n test2.reload\n compare_results(test1, test2)\n\n # compare records\n test1.patients.each_index do |x|\n patient1 = test1.patients.fetch(x)\n patient2 = test2.patients.fetch(x)\n compare_records(patient1, patient2)\n end\n end", "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "def test_028\n\n # login\n login\n # Open PU management page\n open_pu_management_page\n # Get total rows in PU table\n total_rows = get_xpath_count($xpath[\"pu\"][\"pu_list_row\"])\n # delete pu\n row_xpath = $xpath[\"pu\"][\"pu_list_row\"] + \"[#{total_rows}]\"\n result_link_xpath = row_xpath + \"/td[5]/a[2]\"\n result_name_xpath = row_xpath + \"/td[2]\"\n # clicks on link to delete PU\n click(result_link_xpath)\n # The dialog which checks deletion comes out.\n pj_name = get_text(result_name_xpath)\n strmsg1 = _(\"All information of \")\n strmsg2 = _(\" will be deleted.\\n<PJ,master, analysis task, analysis result, analysis log>\\n\")\n strmsg3 = _(\"Really\")\n strmsg4 = _(\"Are you sure you want to delete\")\n strmsg = ''\n if $lang == 'ja'\n strmsg = \"#{pj_name}\" +strmsg1 + strmsg2 + strmsg3 + \"#{pj_name}\" + strmsg4 +\"?\"\n else\n strmsg = strmsg1 + \"#{pj_name}\" + strmsg2 + strmsg4 + \" #{pj_name}\" +\"?\"\n end\n assert_equal(strmsg , get_confirmation)\n # logout\n logout\n make_original_pus\n end", "def setup_for_etc_test_by_diff_client\n client1 = clients(:Triad)\n facility1 = Facility.create!(:name => \"Test facility1\",:sitecode => 8234,:client => client1)\n\t\t@batch_for_triad_client = Batch.create!(:batchid => 31120601,\n :facility => facility1,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now.tomorrow - 64.minutes}\",\n :status => \"New\",\n :manual_override\t=> false)\n\n\t\tclient2 = clients(:Apria)\n facility2 = Facility.create(:name => \"Test facility2\",:sitecode => 8294,:client => client2)\n\t\t@batch_for_other_client = Batch.create!(:batchid => 31120602,\n :facility => facility2,\n :date => Date.today.strftime(\"%m/%d/%Y\"),\n :arrival_time => \"#{Time.now}\",\n :target_time => \"#{Time.now.tomorrow - 64.minutes}\",\n :status => \"New\",\n :manual_override\t=> false)\n\n\t\t@processor1 = User.create!(:name => 'pro', :userid => 'pro_one', :password => 'pro', :role => 'Processor',\n :processing_rate_triad => 20, :processing_rate_others => 30)\n\t\t@processor2 = User.create!(:name => 'anu', :userid => 'anu_one', :password => 'anu', :role => 'Processor',\n :processing_rate_triad => 10, :processing_rate_others => 20)\n\t\t@qa = User.create!(:name => 'anu2', :userid => 'anu2_one', :password => 'anu2', :role => 'QA')\n\n end", "def test_del_multiple_non_profile_nodes\r\n\r\n @place_holder.login_goto_profile(@provider_url)\r\n\r\n # Switch the perspective to 'Graph'\r\n @place_holder.add_to_or_view_on_graph('initially form the profile view when the nodes are not yet added to the graph')\r\n\r\n # Delete multiple nodes\r\n begin\r\n\r\n # Delete NPI node\r\n npi_node_vertex_id = PropertiesReader.get_npi_node_vertex_id\r\n npi_node_message = PropertiesReader.get_npi_node_message\r\n @place_holder.delete_node(npi_node_vertex_id, npi_node_message, true)\r\n\r\n # Delete location node\r\n location1_node_vertex_id = PropertiesReader.get_location1_node_vertex_id\r\n location1_node_message = PropertiesReader.get_location1_node_message\r\n @place_holder.delete_node(location1_node_vertex_id, location1_node_message, true)\r\n\r\n # Until dependency on uids is reduced, these two nodes are excluded\r\n begin\r\n ## Delete phone node\r\n #phone_node_vertex_id = PropertiesReader.get_phone_node_vertex_id\r\n #phone_node_message = PropertiesReader.get_phone_node_message\r\n #@place_holder.delete_node(phone_node_vertex_id, phone_node_message, true)\r\n #\r\n ## Delete tax_id node\r\n #tax_id_node_vertex_id = PropertiesReader.get_tax_id_node_vertex_id\r\n #tax_id_node_message = PropertiesReader.get_tax_id_node_message\r\n #@place_holder.delete_node(tax_id_node_vertex_id, tax_id_node_message, true)\r\n\r\n end\r\n end\r\n\r\n # Switch the perspective to 'Profiles'\r\n @place_holder.go_to_profiles_view\r\n\r\n # Switch back to the graph view\r\n @place_holder.add_to_or_view_on_graph(\"after switching back to 'Profiles' view after the nodes are deleted from the graph\")\r\n\r\n # Verify that all the deleted nodes stay deleted\r\n begin\r\n\r\n # Verify that the NPI node stays deleted (i.e. doesn't appear back on the graph) after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n assert_message = \"The existence/persistence of the deleted (non-profile) node <#{npi_node_message}> after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n @place_holder.assert_node_existence_on_graph(npi_node_vertex_id, false, assert_message)\r\n\r\n # Verify that the location node stays deleted (i.e. doesn't appear back on the graph) after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n assert_message = \"The existence/persistence of the deleted (non-profile) node <#{location1_node_message}> after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n @place_holder.assert_node_existence_on_graph(location1_node_vertex_id, false, assert_message)\r\n\r\n # Until dependency on uids is reduced, these two nodes are excluded\r\n begin\r\n ## Verify that the tax_id node stays deleted (i.e. doesn't appear back on the graph) after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n #assert_message = \"The existence/persistence of the deleted (non-profile) node <#{tax_id_node_message}> after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n #@place_holder.assert_node_existence_on_graph(tax_id_node_vertex_id, false, assert_message)\r\n #\r\n ## Verify that the phone node stays deleted (i.e. doesn't appear back on the graph) after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n #assert_message = \"The existence/persistence of the deleted (non-profile) node <#{phone_node_message}> after it was deleted and the view is switched to 'Profiles' view and then back to the graph view\"\r\n #@place_holder.assert_node_existence_on_graph(phone_node_vertex_id, false, assert_message)\r\n end\r\n\r\n end\r\n\r\n end", "def vs_spec_save\n event_id = params[\"event_id\"]\n products = Product.joins(:designed_products).where(\"designed_products.florist_id\" => session[\"found_florist_id\"]).where(\"designed_products.event_id\" => event_id).uniq.order(\"name\")\n for product in products \n designed_product = DesignedProduct.where(product_id: product.id).where(specification_id: params[\"spec_id\"]).first\n if designed_product != nil && params[\"stemcount_#{product.id}\"].to_f > 0\n if params[\"stemcount_#{product.id}\"].to_f * 100 != designed_product.product_qty\n designed_product.product_qty = params[\"stemcount_#{product.id}\"].to_f * 100.round(2)\n designed_product.save!\n else # don't save\n end\n elsif designed_product != nil && params[\"stemcount_#{product.id}\"].to_f <= 0\n designed_product.destroy\n elsif designed_product == nil && params[\"stemcount_#{product.id}\"].to_f > 0\n new_dp = DesignedProduct.new\n new_dp.specification_id = params[\"spec_id\"]\n new_dp.product_id = product.id\n new_dp.event_id = event_id\n new_dp.product_qty = params[\"stemcount_#{product.id}\"].to_f * 100.round(2)\n new_dp.florist_id = session[\"found_florist_id\"]\n new_dp.image_in_quote = 1\n new_dp.save!\n end\n end\n \n # Create a DP for the product assigned to the placeholder specification.\n if params[\"add\"]\n new_item = params[\"new_item\"]\n specification = Specification.where(event_id: event_id).where(item_name: \"X1Z2-PlaCeHoldEr\").first\n new_dp = DesignedProduct.new\n new_dp.specification_id = specification.id\n new_dp.product_qty = 0\n new_dp.florist_id = session[\"found_florist_id\"]\n new_dp.product_id = Product.where(name: new_item).where(florist_id: session[\"found_florist_id\"]).first.id\n new_dp.event_id = event_id\n new_dp.image_in_quote = 1\n new_dp.save! \n redirect_to \"/virtual_studio/#{params[\"spec_id\"]}\" and return\n end\n \n \n if params[\"save\"]\n redirect_to \"/virtual_studio/#{params[\"spec_id\"]}\" and return\n end\n specifications = Specification.where(florist_id: session[\"found_florist_id\"]).where(event_id: params[\"event_id\"]).where(\"item_name not like 'X1Z2-PlaCeHoldEr'\").order(\"id\")\n spec_list = []\n for specification in specifications\n spec_list << specification.id\n end\n last_items_index = spec_list.index(Specification.where(id: params[\"spec_id\"]).first.id)\n if params[\"save_previous\"]\n if last_items_index - 1 >= 0 \n @spec = Specification.where(id: spec_list[last_items_index - 1]).first\n redirect_to \"/virtual_studio/#{@spec.id}\" and return\n else\n redirect_to \"/stem_count/#{event_id}\" and return\n end\n elsif params[\"save_next\"]\n if last_items_index + 1 < spec_list.size\n @spec = Specification.where(id: spec_list[last_items_index + 1]).first\n \n redirect_to \"/virtual_studio/#{@spec.id}\" and return\n else\n redirect_to \"/stem_count/#{event_id}\" and return\n end \n end\n end", "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "def clean_up\n show do\n title 'Store pellets on ice'\n note temp_instructions(ON_ICE)\n\n note 'Keep the labeled cell pellets, in the 24-well aluminum block, on ice until you are ready for FACS.'\n end\n\n buffers = operations.map { |op| op.inputs.select { |i| ALL_BUFFERS.include?(i.name) } }.flatten\n buffers.map! { |b| b.child_item }.uniq!\n\n release(buffers, interactive: true)\n\n show do\n title 'Clean up'\n\n check 'Any items that remain on the bench (other than the labeled cell pellets) can be discarded.'\n check \"Set the refigerated centrifuge back to 25 #{DEGREES_C}.\"\n end\n end", "def test_034\n #login\n login\n\n # Two PUs are created\n Pu.destroy_all\n create_pu('SampleA')\n create_pu('SampleB')\n\n # Count all records\n pus = Pu.find(:all)\n @@no_pu = pus.length\n\n # Open PU management page\n open_pu_management_page_1\n\n for i in 1..@@no_pu\n assert_equal pus[i-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{i}.1\")\n end\n sleep 2\n\n # register a pu\n create_pu('SampleC')\n\n sleep 2\n\n #Sort by ID\n pus = Pu.find(:all)\n\n click $xpath[\"misc\"][\"PU_link\"]\n sleep 2\n\n #Click ID link\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'id')\n pus_second = Pu.find(:all,:order => 'id DESC')\n else\n pus = Pu.find(:all,:order => 'id DESC')\n pus_second = Pu.find(:all,:order => 'id')\n end\n\n for j in 1..@@no_pu\n assert_equal pus[j-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{j}.1\")\n end\n\n # secondly, sort by ID\n click $xpath[\"misc\"][\"id_link\"]\n sleep 2\n for k in 1..@@no_pu\n assert_equal pus_second[k-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{k}.1\")\n end\n\n # Sort by name\n pus = Pu.find(:all,:order => 'name')\n\n # Click PU name link\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'name')\n pus_second = Pu.find(:all,:order => 'name DESC')\n else\n pus = Pu.find(:all,:order => 'name DESC')\n pus_second = Pu.find(:all,:order => 'name')\n end\n\n for l in 1..@@no_pu\n assert_equal pus[l-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{l}.1\")\n end\n sleep 2\n # secondly, sort by PU's name\n click $xpath[\"misc\"][\"name_link\"]\n sleep 2\n for m in 1..@@no_pu\n assert_equal pus_second[m-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{m}.1\")\n end\n\n # firtly, sort by PU's registration date\n pus = Pu.find(:all,:order => 'created_at')\n\n #Click registration date link\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n if pus[0].id.to_s == get_table(\"//div[@id='right_contents']/div[1]/table[2].1.0\")\n pus = Pu.find(:all,:order => 'created_at')\n pus_second = Pu.find(:all,:order => 'created_at DESC')\n else\n pus = Pu.find(:all,:order => 'created_at DESC')\n pus_second = Pu.find(:all,:order => 'created_at')\n end\n for n in 1..@@no_pu\n assert_equal pus[n-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{n}.1\")\n end\n\n # secondly, sort by PU's registration date\n click $xpath[\"misc\"][\"registration_link\"]\n sleep 2\n for p in 1..@@no_pu\n assert_equal pus_second[p-1].name, get_table(\"//div[@id='right_contents']/div[1]/table[2].#{p}.1\")\n end\n\n\n # Delete created data\n @@pu= Pu.find_by_name('SampleA')\n @@pu2= Pu.find_by_name('SampleB')\n @@pu3=Pu.find_by_name('SampleC')\n @@pu.destroy\n @@pu2.destroy\n @@pu3.destroy\n\n # Logout\n logout\n make_original_pus \n end", "def pending_test_prod_tr_ids\r\n prods = Product.find(1, 2)\r\n assert_equal 2, prods.length\r\n assert_equal \"first-product\", prods[0].code\r\n assert_equal \"second-product\", prods[1].code\r\n assert_equal \"these are the specs for the first product\",\r\n prods[0].specs \r\n assert_equal \"This is a description of the first product\",\r\n prods[0].description \r\n assert_equal \"these are the specs for the second product\",\r\n prods[1].specs\r\n end", "def test_orchio_delete\n\n output_message(@test_root_name)\n\n ref_value_1a = ref_value_1b = ref_value_1c = nil\n ref_value_4a = ref_value_4b = ref_value_4c = nil\n\n # setup\n VCR.use_cassette(\"#{@test_root_name}/setup\") do\n\n test_instance = TestModel.create!(id: 'instance_1', name: 'test_1a', desc: 'desc_1a')\n assert test_instance != false\n ref_value_1a = test_instance.orchestrate_ref_value\n\n status = test_instance.update_attributes!(name: 'test_1b', desc: 'desc_1b')\n assert status != false\n ref_value_1b = test_instance.orchestrate_ref_value\n assert ref_value_1b != ref_value_1a\n\n status = test_instance.update_attributes!(name: 'test_1c', desc: 'desc_1c')\n assert status != false\n ref_value_1c = test_instance.orchestrate_ref_value\n assert ref_value_1c != ref_value_1a\n assert ref_value_1c != ref_value_1b\n\n test_instance = TestModel.create!(id: 'instance_2', name: 'test_2a', desc: 'desc_2a')\n assert test_instance != false\n\n test_instance = TestModel.create!(id: 'instance_3', name: 'test_3a', desc: 'desc_3a')\n assert test_instance != false\n\n test_instance = TestModel.create!(id: 'instance_4', name: 'test_4a', desc: 'desc_4a')\n assert test_instance != false\n ref_value_4a = test_instance.orchestrate_ref_value\n\n status = test_instance.update_attributes!(name: 'test_4b', desc: 'desc_4b')\n assert status != false\n ref_value_4b = test_instance.orchestrate_ref_value\n assert ref_value_4b != ref_value_4a\n\n status = test_instance.update_attributes!(name: 'test_4c', desc: 'desc_4c')\n assert status != false\n ref_value_4c = test_instance.orchestrate_ref_value\n assert ref_value_4c != ref_value_4a\n assert ref_value_4c != ref_value_4b\n\n assert TestModel.all.length == 4\n end\n\n # test\n output_message(@test_root_name, \"TEST START\")\n\n VCR.use_cassette(\"#{@test_root_name}/synopsis\") do\n\n status = TestModel.orchio_delete_key('test_models', 'instance_4')\n assert status == true\n assert TestModel.all.length == 3\n\n test_instance = TestModel.new(id: 'instance_4')\n result = test_instance.orchio_get\n assert result.success? == false\n\n ref_instance = test_instance.get_by_ref(ref_value_4a)\n assert ref_instance != false\n assert ref_instance.id == 'instance_4'\n assert ref_instance.name == 'test_4a'\n\n status = test_instance.orchio_purge\n assert status == true\n\n ref_instance = TestModel.new(id: 'instance_4').get_by_ref(ref_value_4a)\n assert ref_instance == false\n\n test_instance = TestModel.new(id: 'instance_1')\n status = test_instance.orchio_delete\n assert status == true\n assert TestModel.all.length == 2\n\n result = test_instance.orchio_get\n assert result.success? == false\n\n ref_instance = test_instance.get_by_ref(ref_value_1a)\n assert ref_instance != nil\n assert ref_instance.id == 'instance_1'\n assert ref_instance.name == 'test_1a'\n\n ref_instance = test_instance.get_by_ref(ref_value_1b)\n assert ref_instance != nil\n assert ref_instance.id == 'instance_1'\n assert ref_instance.desc == 'desc_1b'\n\n ref_instance = test_instance.get_by_ref(ref_value_1c)\n assert ref_instance != false\n assert ref_instance.id == 'instance_1'\n assert ref_instance.name == 'test_1c'\n\n status = test_instance.orchio_purge\n assert status == true\n\n ref_instance = test_instance.get_by_ref(ref_value_1a)\n assert ref_instance == false\n\n ref_instance = test_instance.get_by_ref(ref_value_1b)\n assert ref_instance == false\n\n ref_instance = test_instance.get_by_ref(ref_value_1c)\n assert ref_instance == false\n\n status = TestModel.orchio_delete 'test_models'\n assert status == true\n sleep 1\n assert TestModel.all.length == 0\n end\n\n # cleanup\n output_message(@test_root_name, \"Test cleanup\")\n\n VCR.use_cassette(\"#{@test_root_name}/cleanup\") do\n status = TestModel.destroy!('instance_1')\n assert status == true\n status = TestModel.destroy!('instance_2')\n assert status == true\n status = TestModel.destroy!('instance_3')\n assert status == true\n status = TestModel.destroy!('instance_4')\n assert status == true\n end\n end", "def test_ut_t5_sef_pj_009\n current_user = User.find(PJ_ADMIN_ID)\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n # Create PJ admin right\n PrivilegesUsers.create(:user_id => PJ_ADMIN_ID,\n :privilege_id => 3,\n :pu_id => PU_ID,\n :pj_id => new_pj.id)\n #\n EVENT_IDS.each do |event_id|\n un_users = new_pj.users_not_in_mailing_list(event_id,current_user)\n un_users.each do |user_id|\n user = User.find(user_id[1])\n assert !user.pu_admin?(PU_ID)\n assert !user.toscana_admin?\n end\n end\n end", "def setup_test(operations, ot_type_name)\n operations.make\n operations.each do |op|\n output_collection = op.output('PCR Plate').collection\n rows = output_collection.dimensions[0]\n sample_names = ['RP', '2019-nCoVPC_N1', '2019-nCoVPC_N2']\n (rows/(sample_names.length)).times do\n sample_names.each do |name|\n collection = Collection.new_collection(ot_type_name)\n samples = Array.new(collection.dimensions[0], Sample.find_by_name(name))\n collection.add_samples(samples)\n end\n end\n end\n end", "def pending_test_prod_tr_ids\n prods = Product.find(1, 2)\n assert_equal 2, prods.length\n assert_equal \"first-product\", prods[0].code\n assert_equal \"second-product\", prods[1].code\n assert_equal \"these are the specs for the first product\",\n prods[0].specs\n assert_equal \"This is a description of the first product\",\n prods[0].description\n assert_equal \"these are the specs for the second product\",\n prods[1].specs\n end", "def testNominalWithSeveralDeliverables\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_2DummyGems ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem1.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem2.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def test_get_etc_by_processor\n\t\tclient = Client.create!(:name => 'New Client', :contracted_tat => 12, :tat => 30)\n\t\tfacility = Facility.create!(:name => 'New Facility', :client => client, :sitecode => '00902')\n\t\tprocessor = User.new(:name => 'gg', :userid => 'gg', :password => 'gg',\n :processing_rate_triad => 10, :processing_rate_others => 15)\n\t\tbatch = Batch.create!(:batchid \t\t\t\t\t=> 14567,\n :facility \t\t\t\t=> facility,\n :date \t\t\t\t\t\t=> Date.today.strftime(\"%m/%d/%Y\"),\n :arrival_time \t\t=> \"#{Time.now}\",\n :target_time \t\t=> \"#{Time.now.tomorrow - 64.minutes}\",\n :status \t\t=> \"New\",\n :manual_override \t=> false)\n\n\t\tjob_new = Job.create!(:batch=>batch,:tiff_number=>1234,\n :check_number=>12131,:count=>12,\n :estimated_eob => 50, :processor => processor,\n :processor_status => 'Processor Allocated',:job_status => 'Processing')\n\t\tbatch.reload\n batch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_with_one_job = batch.expected_completion_time\n\n job_one_more = Job.new(:batch=>batch,:tiff_number=>1231,\n :check_number=>12135,:count=>12,\n :estimated_eob => 50,:processor => processor,\n :processor_status => 'Processor Allocated',:job_status => 'Processing')\n\t\tjob_one_more.save\n\t\tbatch.reload\n\t\tbatch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_with_two_jobs = batch.expected_completion_time\n\n\t\tassert_not_equal(etc_with_one_job, etc_with_two_jobs)\n\n\t\tjob_one_more.processor = nil\n\t\tjob_one_more.job_status = ''\n\t\tjob_one_more.update\n\t\tbatch.reload\n\t\tbatch.expected_completion_time = batch.expected_time\n batch.save\n\t\tetc_after_deallocation = batch.expected_completion_time\n assert_in_delta(etc_after_deallocation, etc_with_one_job, 1, \"ETC after deallocation varys by more than 1 second.\")\n end", "def destroy\n product_tests = ProductTest.where(:product_id.in => product_ids)\n product_test_ids = product_tests.pluck(:_id)\n ProductTest.destroy_by_ids(product_test_ids)\n\n Product.in(id: product_ids).delete\n\n super\n end", "def update_hits(peptide_hits, final_peps_to_prots)\n peptide_hits.each do |pep|\n pep.prots = pep.prots.select do |prot| \n prot.peps = [] # clear the peptides\n #final_peps_to_prots.each {|k,v| puts \"K: #{k} V: #{v}\"; break }\n final_peps_to_prots[pep.aaseq].include?(prot.id) \n end\n end\n \n peptide_hits.each do |pep_hit|\n pep_hit.prots.each do |prot|\n prot.peps.push(pep_hit)\n end\n end\n \n peptide_hits\n end", "def destroy\n ProductTest.destroy_by_ids(product_test_ids)\n\n super\n end", "def add_specimen_provenance(operations:)\n operations.each do |op|\n add_one_to_one_provenance(\n from_item: op.input(SPECIMEN).item,\n to_item: op.output(SPECIMEN).item\n )\n end\n return unless debug\n\n inspect(operations.last.input(SPECIMEN).item.associations, 'input')\n inspect(operations.last.output(SPECIMEN).item.associations, 'output')\n end", "def test_scenario2\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-setosa', {\"kind\" => \"probability\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-versicolor', {\"kind\" => \"probability\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\" => 2.4}, 'Iris-setosa', {\"kind\" => \"confidence\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\" => 2.4}, 'Iris-versicolor', {\"kind\" => \"confidence\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"]\n ]\n puts\n puts \"Scenario : Successfully comparing predictions in operating points for models\"\n\n data.each do |filename, data_input, prediction_result, operating_point, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create model\"\n model=@api.create_model(dataset)\n \n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true)\n \n puts \"And I create a local model\"\n local_model = BigML::Model.new(model, @api)\n\n puts \"When I create a prediction for %s in %s \" % [JSON.generate(data_input), JSON.generate(operating_point)]\n prediction = @api.create_prediction(model, data_input, {\"operating_point\" => operating_point})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n\n puts \"Then the prediction for '<%s>' is '<%s>'\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end\n\n puts \"And I create a local prediction for <%s> in <%s>\" % [JSON.generate(data_input), JSON.generate(operating_point)]\n local_prediction = local_model.predict(data_input, {\"operating_point\" => operating_point})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n \n if (local_model.regression) or \n (local_model.is_a?(BigML::MultiModel) and local_model.models[0].regression)\n assert_equal(local_prediction.to_f.round(4), prediction_result.to_f.round(4))\n else\n assert_equal(local_prediction, prediction_result)\n end \n \n end\n \n end", "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_ut_t5_sef_pj_005\n current_user = User.find(PU_ADMIN_ID)\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n # Create PJ admin right\n PrivilegesUsers.create(:user_id => PJ_ADMIN_ID,\n :privilege_id => 3,\n :pu_id => PU_ID,\n :pj_id => new_pj.id)\n # Create PJ member right\n PjsUsers.create(:pj_id => new_pj.id,\n :user_id => PJ_MEMBER_ID)\n #\n EVENT_IDS.each do |event_id|\n email_setting = EmailSetting.find(:first,\n :conditions => {\n :pj_id => new_pj.id,\n :analyze_process_event_id => event_id})\n email_setting.user_ids = \"#{TCANA_ADMIN_ID},#{PU_ADMIN_ID},#{PJ_ADMIN_ID},#{PJ_MEMBER_ID}\"\n email_setting.save\n\n users = new_pj.users_in_mailing_list(event_id,current_user)\n assert_equal 3,users.size\n end\n end", "def testNominalWithSeveralRN\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_SingleDummyGemWithSeveralRN ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ],\n Actions::File_UploadReleaseNote => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.html\"), 'html', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/ReleaseNotes/DummyGemReleaseNote.txt\"), 'txt', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def test_without_vm\n prep\n test_services\n end", "def test_ut_t5_sef_pj_006\n current_user = User.find(PJ_ADMIN_ID)\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n # Create PJ admin right\n PrivilegesUsers.create(:user_id => PJ_ADMIN_ID,\n :privilege_id => 3,\n :pu_id => PU_ID,\n :pj_id => new_pj.id)\n # Create PJ member right\n PjsUsers.create(:pj_id => new_pj.id,\n :user_id => PJ_MEMBER_ID)\n #\n EVENT_IDS.each do |event_id|\n email_setting = EmailSetting.find(:first,\n :conditions => {\n :pj_id => new_pj.id,\n :analyze_process_event_id => event_id})\n email_setting.user_ids = \"#{TCANA_ADMIN_ID},#{PU_ADMIN_ID},#{PJ_ADMIN_ID},#{PJ_MEMBER_ID}\"\n email_setting.save\n\n users = new_pj.users_in_mailing_list(event_id,current_user)\n assert_equal 2,users.size\n end\n end", "def test_scenario4\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-setosa', {\"kind\" => \"probability\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 4}, 'Iris-virginica', {\"kind\" => \"probability\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\"=> 2.4}, 'Iris-setosa', {\"kind\" => \"confidence\", \"threshold\" => 0.1, \"positive_class\" => \"Iris-setosa\"}, \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"sepal length\" => 4.1, \"sepal width\"=> 2.4}, 'Iris-versicolor', {\"kind\" => \"confidence\", \"threshold\" => 0.9, \"positive_class\" => \"Iris-setosa\"}, \"000004\"]\n ]\n puts\n puts \"Successfully comparing predictions in operating points for ensembles\"\n\n data.each do |filename, data_input, prediction_result, operating_point, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create an ensemble\"\n ensemble = @api.create_ensemble(dataset, {\"number_of_models\"=> 2, \"seed\" => 'BigML', 'ensemble_sample'=>{'rate' => 0.7, 'seed' => 'BigML'}, 'missing_splits' => false})\n \n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(1, ensemble[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(ensemble), true)\n \n puts \"And I create a local ensemble\"\n local_ensemble = BigML::Ensemble.new(ensemble, @api)\n local_model = BigML::Model.new(local_ensemble.model_ids[0], @api)\n \n puts \" When I create a prediction for <%s>\" % [JSON.generate(data_input)]\n prediction = @api.create_prediction(ensemble['resource'], data_input, {\"operating_point\" => operating_point})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n \n \n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end \n \n puts \"And I create a local prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = local_ensemble.predict(data_input, {\"operating_point\" => operating_point})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n \n if (local_ensemble.regression) or \n (local_ensemble.is_a?(BigML::MultiModel) and local_ensemble.models[0].regression)\n assert_equal(local_prediction.to_f.round(4), prediction_result.to_f.round(4))\n else\n assert_equal(local_prediction, prediction_result)\n end \n \n end\n end", "def clean_up\n puts \"Run the following commands to clean up your test data:\"\n puts \"oc delete pv --all\"\n puts \"oc delete pvc --all\"\n puts \"Deleting temporary test files\"\n `rm -rf #{$templates_path}/*`\nend", "def test_011\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def update_test_suites_data(test_suite_data)\n return if $debug\n\n test_suite_data.each do |test_data|\n saved_test_suite = get_test_suite_from_test_data(test_data)\n suite_id = get_suite_id_from_saved_test_suite(saved_test_suite, test_data)\n test_data[:suite][:cases].each do |test_case|\n labels = get_labels_from_suite_and_case(test_data[:suite][:labels], test_case[:labels])\n label_ids = insert_and_return_label_ids(labels)\n update_test_case_and_test_case_label(suite_id, test_case, label_ids)\n end\n end\n @connector.disconnect\n end", "def asociarContenidoAPerfiles\n \n # Se borran asociaciones previas al contenido\n @contenidos_profiles = ContenidoProfile.find(:all, :conditions => \"contenido_id = #{params[:contenido][:id]}\")\n \n for contenido_profile in @contenidos_profiles\n contenido_profile.destroy\n end\n \n\n @profiles = params[:profiles]\n \n logger.debug(\"#################### CANTIDAD DE PROFILES A ASOCIAR: #{@profiles.size}\")\n if (!@profiles.nil? && @profiles.size() > 0 )\n \n # Guardando las nuevas asociaciones\n for profile in @profiles\n logger.debug(\"Contenido del profile: #{profile}\")\n \n contenido_profile = ContenidoProfile.new()\n contenido_profile.profile_id = profile\n contenido_profile.contenido_id = params[:contenido][:id]\n contenido_profile.save!\n \n end\n end \n end", "def process_acquisitions\n if @entity_data['acquisitions'].present?\n @company.acquisitions.destroy_all\n @entity_data['acquisitions'].each do |acquisition|\n create_acquisition(acquisition, @company)\n end\n end\n end", "def test_scenario2\n data = [{'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'tlp' => 1,\n 'local_file' => File.dirname(__FILE__)+'/tmp/batch_predictions.csv',\n 'predictions_file' => File.dirname(__FILE__)+'/data/batch_predictions_e.csv',\n 'params' => {\"combiner\" => 0}},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'tlp' => 1,\n 'local_file' => File.dirname(__FILE__)+'/tmp/batch_predictions.csv',\n 'predictions_file' => File.dirname(__FILE__)+'/data/batch_predictions_e_c1.csv',\n 'params' => {\"combiner\" => 1, \"confidence\" => true}},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'tlp' => 1,\n 'local_file' => File.dirname(__FILE__)+'/tmp/batch_predictions.csv',\n 'predictions_file' => File.dirname(__FILE__)+'/data/batch_predictions_e_c2.csv',\n 'params' => {\"combiner\" => 2, \"confidence\" => true}},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'tlp' => 1,\n 'local_file' => File.dirname(__FILE__)+'/tmp/batch_predictions.csv',\n 'predictions_file' => File.dirname(__FILE__)+'/data/batch_predictions_e_o_k_v.csv',\n 'params' => {\"operating_kind\" => \"votes\", \"confidence\" => true}},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'tlp' => 1,\n 'local_file' => File.dirname(__FILE__)+'/tmp/batch_predictions.csv',\n 'predictions_file' => File.dirname(__FILE__)+'/data/batch_predictions_e_o_k_p.csv',\n 'params' => {\"operating_kind\" => \"probability\", \"probability\" => true}},\n {'filename' => File.dirname(__FILE__)+'/data/iris.csv',\n 'number_of_models' => 5,\n 'tlp' => 1,\n 'local_file' => File.dirname(__FILE__)+'/tmp/batch_predictions.csv',\n 'predictions_file' => File.dirname(__FILE__)+'/data/batch_predictions_e_o_k_c.csv',\n 'params' => {\"operating_kind\" => \"confidence\", \"confidence\" => true}}\n ]\n\n puts\n puts \"Scenario: Successfully creating a batch prediction for an ensemble\"\n\n data.each do |item|\n puts\n puts \"Given I create a data source uploading a #{item['filename']} file\"\n source = @api.create_source(item[\"filename\"], {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I create dataset with local source\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n\n puts \"And I create an ensemble of #{item['number_of_models']} models and #{item['tlp']} tlp\"\n # \"tlp\"=> item[\"tlp\"]\n ensemble = @api.create_ensemble(dataset, {\"number_of_models\"=> item[\"number_of_models\"], \"seed\" => 'BigML', 'ensemble_sample'=>{'rate' => 0.7, 'seed' => 'BigML'}, 'missing_splits' => false})\n\n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(@api.ok(ensemble), true)\n\n puts \"When I create a batch prediction for the dataset with the ensemble and params <%s>\" % JSON.generate(item['params'])\n batch_prediction = @api.create_batch_prediction(ensemble, dataset, item['params'])\n\n puts \"And I wait until the batch prediction is ready\"\n assert_equal(BigML::HTTP_CREATED, batch_prediction[\"code\"])\n assert_equal(@api.ok(batch_prediction), true) \n\n puts \"And I download the created predictions file to #{item['local_file']}\"\n filename = @api.download_batch_prediction(batch_prediction, item[\"local_file\"])\n assert_not_nil(filename)\n\n puts \"Then the batch prediction file is like #{item['predictions_file']}\"\n assert_equal(FileUtils.compare_file(item[\"local_file\"], item[\"predictions_file\"]), true)\n\n\n end\n\n end", "def preencher\n cliente.set CONFIG['cliente']\n seleciona_Cliente.set CONFIG['idcliente']\n tipo_de_operacao.set CONFIG['tipooperacao'] \n cond_pagamento.set CONFIG['condpagamento']\n topico.set CONFIG['topico']\n tipo_venda.set CONFIG['tipovenda'] \n condicoes_de_frete.set CONFIG['condiFrete'] \n apelido.set CONFIG['apelido'] \n botaopesquisar.click\n\n end", "def delete_data\n Report.plugin_matrix.each do |resource_name, measurements|\n model = Object.const_get((resource_name + 'Resource').camelcase(:upper))\n model.dataset.all.each(&:delete)\n\n measurements.each do |measurement_name|\n table = Plugin.where(name: measurement_name).first.storage_table\n Iam.settings.DB[table.to_sym].delete\n end\n end\n Iam.settings.DB[:projects].delete\n Iam.settings.DB[:clients].delete\n end", "def seo(testrun)\n # get test suite\n suite = TestSuites.find(testrun.test_suites_id)\n # pull the seo suite data\n test_obj = GRTesting::SeoTest.new(title: testrun['test name'], browser: testrun['driver'], validations: testrun.test_steps, id: testrun.id)\n # Add platform as a part of the campaign Hash object\n if(!suite.email_random)\n if(suite.emailnotification.include?(';'))\n conf_email_to_use = suite.emailnotification.split(';')[0].strip() \n else\n conf_email_to_use = suite.emailnotification\n end\n else\n conf_email_to_use = Time.now.to_i.to_s + \".d7f2d322@mailosaur.in\"\n end\n\n test_obj.email = conf_email_to_use\n\n # Add Metadata to report object\n test_obj.report.author = \"Automation\"\n test_obj.report.environment = testrun['Env']\n\n # Add the test settings to the test object\n test_obj.testtype = testrun['testtype']\n test_obj.platform = testrun['driverplatform']\n test_obj.browsertype = testrun['driver']\n \n begin\n test_obj.custom_settings = YAML.load(testrun['custom_settings'])\n rescue => e\n\n end\n\n # get the testrun url\n target = testrun.url\n\n \n\n # update its status for running suite\n suite.Status = \"Running\"\n\n # save the record\n suite.save!\n\n\n # if the target url is not properly formatted with protocol for testing\n if(!target.include?(\"http\"))\n\n # prepend the default protocol and resume test\n url = \"http://#{target}\"\n\n else\n\n # set to url if correctly formatted\n url = target\n\n end\n\n # load the url into the test object\n test_obj.url = url\n\n # run the test case\n test_obj.run()\n\n # check for needed updates to suite\n update_suite(suite)\n\n # return completed object for debugging or testing\n return test_obj\n end", "def skip_test_inmutable\n #they come fully loaded\n Status.load_inmutable_instances\n status1 = Status.where.all.sort_by { |s| s.code }\n status2 = Status.where.all.sort_by { |s| s.code }\n assert status1.length == 4\n assert status2.length == 4\n #same referencs\n status1.each_index do |i|\n assert status1[i].object_id==status2[i].object_id \n end\n\n #create a new object\n stt = Status.new(code: \"xx\", description: (\"xx\" + \" some desc\"))\n stt.save\n\n status1 = Status.where.all.sort_by { |s| s.code }\n status2 = Status.where.all.sort_by { |s| s.code }\n assert status1.length == 5\n assert status2.length == 5\n #same referencs\n status1.each_index do |i|\n assert status1[i].object_id==status2[i].object_id \n end \n\n status1.each do |st|\n assert st.code\n assert st.description\n end\n\n marr = Status.find(\"divorced\").first\n assert marr.code == \"divorced\"\n assert marr.description\n assert marr.object_id == status1.first.object_id\n\n people = Person.where.include(:name, status: [ :code, :description ]).all\n people.each do |p|\n assert p.status.object_id == status1.select { |st| st.id == p.status.id }.first.object_id\n assert p.status.code\n assert p.status.description\n end\n end", "def protestors(basepath=nil)\n # return @protestors unless @protestors.nil? # memoized\n\n # users = User.all(:id => protestor_user_ids)\n users = self.visits.map(&:user)\n\n # Expand avatars to full paths, FIXME h8 basepath\n users.each{|u| u.avatar = User.fix_avatar(u.avatar, basepath) unless u.blank? }\n\n # Strip bad elements... TODO where are these being made?!\n users.reject!{|u| u.uuid.nil? }\n\n @protestors = users\n end", "def test_for_code_coverage\n \n u = users(:basic_user)\n p = u.profile\n assert_equal 'BI', p.country\n \n # discount_before_tax\n assert p.discount_before_tax\n p.discount_before_tax = false \n\n p.reload\n\n assert p.discount_before_tax\n\n p.discount_before_tax = false \n p.save!\n p.reload \n assert !p.discount_before_tax\n\n p.discount_before_tax = true\n p.save!; p.reload\n assert p.discount_before_tax\n \n # tax_enabled\n assert !p.tax_enabled\n p.tax_enabled = true\n p.save!; p.reload\n assert p.tax_enabled\n p.tax_enabled = false\n p.save!; p.reload\n assert !p.tax_enabled\n\n p.logo\n p.web_invoice_css\n end", "def setup_broker_requests(broker)\n broker.license_type.each_with_index do |l,index| \n license=broker.licenses.create(license_type:l,license_number:\"test#{index}\")\n license.license_image=(Rails.root+\"spec/fixtures/test_files/example_license.pdf\").open\n license.save\n end\n \n @license1=License.all.first\n @license2=License.all.second\n broker.broker_requests.create(request_type:\"create account\",complement:false) \n broker.reload\n broker.licenses.each do |l|\n broker.broker_requests.create(request_type:\"create license\", license_id:l.id,complement:true,admin_reply:nil)\n end\n\nend", "def test_006\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #A task type is changed into \"individual analysis\"\n # with a \"general control\" tab.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析 (Individual Analysis)\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n #An option setup of \"master: A qac\" subwindow is displayed.\n click $xpath[\"task\"][\"option_setup_link\"]\n # click \"link=設定する\"\n sleep 3\n # #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n assert !60.times{ break if (@selenium.is_text_present(_(\"Optional setting\")+\":qac\") rescue false); sleep 2 }\n sleep 2\n\n # logout\n logout\n\n end", "def cleanup(args = nil)\n opts = args ? @options.merge(args) : @options\n\n print \"Cleaning database...\"\n\n ProductTest.where({name: \"measureEvaluationTest\"}).each do |test|\n Result.where({\"value.test_id\" => test.id}).destroy_all\n QME::QualityReport.where({\"test_id\" => test.id}).destroy_all\n HealthDataStandards::CQM::QueryCache.where({\"test_id\" => test.id}).destroy_all\n test.destroy\n end\n\n p = Product.where({name: \"MeasureEvaluationProduct\"}).first\n ProductTest.where({_type: \"QRDAProductTest\", product: p}).destroy_all\n\n Vendor.where({name: \"MeasureEvaluationVendor\"}).destroy_all\n Product.where({name: \"MeasureEvaluationProduct\"}).destroy_all\n\n puts \"done\"\n end", "def perform_changes\n Token.where(stake_currency_id: @pax_stake_currency_id).find_in_batches(batch_size: 100) do |token_batches|\n @client_ids_array = []\n token_batches.each do |token|\n unless token['client_id'].present?\n fail 'invalid client id'\n end\n current_client_id = token['client_id']\n @client_ids_array.push(current_client_id)\n debug_data = {\"disassociation_reason\": \"Removing all economies whose stake currency is PAX\"}\n Token.where(client_id: current_client_id).update_all(client_id_was: current_client_id, client_id: nil, debug: debug_data.to_json)\n Workflow.where(client_id: current_client_id, kind: GlobalConstant::Workflow.token_deploy).update_all(unique_hash: nil)\n end\n\n change_client_related_flags\n KitSaasSharedCacheManagement::TokenDetails.new(@client_ids_array).clear\n CacheManagement::WorkflowByClient.new(@client_ids_array).clear\n end\n end", "def seed_data_for_preference(prof, student)\n course = Course.create!(name: \"Computer Networks (Preference Voting)\",\n pin: Faker::Number.number(digits: 6),\n professor_id: prof.id,\n minimum_group_member: 2,\n maximum_group_member: 5,\n has_group: false,\n is_voting: false,\n state: \"choose_algo\",\n withProject: true)\n students = []\n 31.times do\n first = Faker::Name.first_name\n last = Faker::Name.last_name\n s = User.create!(firstname: first,\n lastname: last,\n email: last + Faker::Number.number(digits: 6).to_s + \"@brandeis.edu\",\n password: \"password\", type: \"Student\", time_zone: seed_time_zone)\n students << s\n Taking.create!(student_id: s.id, course_id: course.id, state: \"created\")\n end\n Taking.create!(student_id: student.id, course_id: course.id, state: \"created\")\n students << student\n projects = []\n 7.times do\n active_project = Project.create!(project_name: Faker::Team.name, course_id: course.id, description: Faker::Game.genre,\n is_active: true, number_of_likes: 0, added_by: students.sample)\n projects << active_project.id\n end\n 2.times do\n inactive_project = Project.create!(project_name: Faker::Team.name, course_id: course.id, description: Faker::Game.genre,\n is_active: false, number_of_likes: 0, added_by: students.sample)\n end\n seed_preference(course, students)\n puts \"seed preference\"\nend", "def assign_prisoners\n if @prisoner_ids\n\n new_ids = @prisoner_ids\n old_ids = prisoners.collect{|p| p.id}\n ids_to_delete = old_ids - (old_ids & new_ids)\n ids_to_add = new_ids - (old_ids & new_ids)\n\n game_id = id\n \n ids_to_delete.each do |prisoner_id|\n GamePrisoner.destroy_all(:game_id => game_id, :prisoner_id => prisoner_id)\n end\n\n ids_to_add.each do |prisoner_id|\n GamePrisoner.create(:game_id => game_id, :prisoner_id => prisoner_id)\n end\n end\n end", "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def test_ut_da10b_t1_16\n p \"Test 16\"\n pu =Pu.new( :name => \"SamplePU3\" )\n # gets a list of pjs belong to selected pu\n pjs = pu.get_pjs_belong_to_pu\n assert_equal [], pjs\n end", "def teardown_test_chamber\n if TestChamber::Config[:tc_partner_delete]\n TestChamber::Models::Partner.destroy_all(id: Array(TestChamber.created_partners))\n end\nend", "def delete_test\n @project = Project.find(params[:id])\n @testk= @project.testxes.find(params[:test_id])\n if @testk\n @project.testxes.delete(@testk)\n end\n redirect_to :action => 'analyses'\n end", "def test_scenario7\n\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2.46}, 'Iris-versicolor', \"probability\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2}, 'Iris-setosa', \"probability\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2.46}, 'Iris-versicolor', \"confidence\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2}, 'Iris-setosa', \"confidence\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 2.46}, 'Iris-versicolor', \"votes\", \"000004\"],\n [File.dirname(__FILE__)+'/data/iris.csv', {\"petal length\" => 1}, 'Iris-setosa', \"votes\", \"000004\"]\n ]\n puts\n puts \"Successfully comparing predictions in operating points for ensembles\"\n\n data.each do |filename, data_input, prediction_result, operating_kind, objective|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create an ensemble\"\n ensemble = @api.create_ensemble(dataset, {\"number_of_models\"=> 2, \"seed\" => 'BigML', 'ensemble_sample'=>{'rate' => 0.7, 'seed' => 'BigML'}, 'missing_splits' => false})\n \n puts \"And I wait until the ensemble is ready\"\n assert_equal(BigML::HTTP_CREATED, ensemble[\"code\"])\n assert_equal(1, ensemble[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(ensemble), true)\n \n puts \"And I create a local ensemble\"\n local_ensemble = BigML::Ensemble.new(ensemble, @api)\n local_model = BigML::Model.new(local_ensemble.model_ids[0], @api)\n \n puts \"When I create a prediction for <%s>\" % [JSON.generate(data_input)]\n prediction = @api.create_prediction(ensemble['resource'], data_input, {\"operating_kind\" => operating_kind})\n \n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n assert_equal(@api.ok(prediction), true)\n\n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n \n if !prediction['object']['prediction'][objective].is_a?(String)\n assert_equal(prediction['object']['prediction'][objective].to_f.round(5), prediction_result.to_f.round(5))\n else\n assert_equal(prediction['object']['prediction'][objective], prediction_result)\n end \n \n puts \"And I create a local prediction for <%s>\" % JSON.generate(data_input)\n local_prediction = local_ensemble.predict(data_input, {\"operating_kind\" => operating_kind})\n \n puts \"Then the local prediction is <%s>\" % prediction_result\n \n if local_prediction.is_a?(Array)\n local_prediction = local_prediction[0]\n elsif local_prediction.is_a?(Hash)\n local_prediction = local_prediction['prediction']\n else\n local_prediction = local_prediction\n end \n \n if (local_ensemble.regression) or \n (local_ensemble.is_a?(BigML::MultiModel) and local_ensemble.models[0].regression)\n assert_equal(local_prediction.to_f.round(4), prediction_result.to_f.round(4))\n else\n assert_equal(local_prediction, prediction_result)\n end \n \n end\n end", "def remove_dependent_entries\n product = self.product\n variants = (product.variants.present? ? product.variants : product.master)\n product.stock_products.where(:sellers_market_places_product_id=>self.id).destroy_all\n #product.title_managements.where(:market_place_id=>self.market_place_id).destroy_all\n #product.description_managements.where(:market_place_id=>self.market_place_id).destroy_all\n #variants.each do |variant|\n # variant.price_managements.where(:market_place_id=>self.market_place_id).destroy_all\n #end\n end", "def run_tests()\n Signal.trap(\"CLD\") {@process_counter += 1}\n for setting in @settings\n Process.wait if @process_counter <= 0\n @process_counter -= 1\n fork do\n temp_name, log = copy_and_edit(setting)\n puts \"Running: \" + setting[:material] + \" \" + setting[:length] + \"cm \" + setting[:energy] + \"MeV\"\n system(@output_dir + \"Hadr06 \" + temp_name + \" > \" + log)\n relocate(setting)\n clean()\n end\n end\nend", "def stop(_examples_notification)\n if @testrail_plan_id\n # Need to prune un-executed tests from the test run on testrail\n if is_for_test_rail_plan # run on jenkins, multiple threads doing this\n # Need to dump a list of executed tests so unexecuted tests can be pruned later (on testrail)\n # after all the rspec tests are done.\n File.open(\"executed_tests_#{Process.pid}.json\", 'w') do |f|\n f.puts @executed_test_ids.to_json\n end\n # Another process will take the json file and use it to prune the test run.\n else # run locally, and only one thread\n # prune the test cases to only what was run\n response = TestRailOperations.keep_only(@testrail_plan_id, @testrail_entry_id, @executed_test_ids)\n end\n elsif !ENV[\"TESTRAIL_RUN_ID\"].nil?\n # Results were already pushed to an existing testrail run. Nothing more to do here, we are done! :)\n else\n puts \"Unknown condition\"\n end\n end", "def seed_data_for_no_project_preference_match(prof, student)\n course = Course.create!(name: \"Computer Architecture\",\n pin: Faker::Number.number(digits: 6),\n professor_id: prof.id,\n minimum_group_member: 2,\n maximum_group_member: 3,\n has_group: false,\n is_voting: false,\n state: \"choose_algo\",\n withProject: false)\n students = []\n 12.times do\n first = Faker::Name.first_name\n last = Faker::Name.last_name\n s = User.create!(firstname: first,\n lastname: last,\n email: last + Faker::Number.number(digits: 6).to_s + \"@brandeis.edu\",\n password: \"password\", type: \"Student\", time_zone: seed_time_zone)\n students << s\n Taking.create!(student_id: s.id, course_id: course.id, state: \"created\")\n end\n Taking.create!(student_id: student.id, course_id: course.id, state: \"created\")\n students << student\n PreferenceWeight.create!(course_id: course.id, subject_proficiency: rand(5), dream_partner: rand(5), time_zone: rand(5), schedule: rand(5), project_voting: rand(5))\n students.each do |s|\n dream_partner = seed_partner(students, course.maximum_group_member)\n schedule = seed_schedule\n time_zone = s.time_zone\n Preference.create!(student_id: s.id, course_id: course.id, subject_matter_proficiency: (1..5).to_a.sample, time_zone: time_zone, dream_partner: dream_partner, schedule: schedule)\n end\n puts \"seed project preference\"\nend", "def test_communication_priorities\n [-1, 5, 6].each do |i|\n @communication.priority = i\n assert !@communication.save\n end\n \n [0, 4].each do |i|\n @communication.priority = i\n assert @communication.save\n end\n end", "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "def test_save\n @pmi.medical_record_number = Jinx::UID.generate.to_s\n @pmi.site = defaults.tissue_bank\n @pmi.participant = CaTissue::Participant.new(:name => Jinx::StringUniquifier.uniquify('Test Participant'))\n verify_save(@pmi)\n # update the PMI\n @pmi.medical_record_number = Jinx::UID.generate.to_s\n verify_save(@pmi)\n end", "def test_009\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qac)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"analyze_allow_file_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(\"analyze_allow_files(qacpp)\") rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "def test_ut_t5_sef_pj_003\n current_user = User.find(PJ_ADMIN_ID)\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n # Create PJ admin right\n PrivilegesUsers.create(:user_id => PJ_ADMIN_ID,\n :privilege_id => 3,\n :pu_id => PU_ID,\n :pj_id => new_pj.id)\n #\n EVENT_IDS.each do |event_id|\n users = new_pj.users_in_mailing_list(event_id,current_user)\n assert users.blank?\n end\n end", "def test_025\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #Move to general control tab\n click $xpath[\"task\"][\"general_control_tab\"]\n\n #The information set does not disappear and remains.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n # logout\n logout\n\n end", "def load_previous_provisions\n @ciservice.provisionings = @data_store.transaction { @data_store.fetch(:provisionings, @ciservice.provisionings) }\n end", "def add_commands_for_products_to_be_removed!\n current_state.each do |profile|\n\n # We need to issue refunds before cancelling profiles\n refund_options = issue_refunds_if_necessary(profile)\n remaining_products = remove_products_from_profile(profile)\n\n if remaining_products.empty? # all products in payment profile needs to be removed\n\n @command_list << cancel_recurring_payment_command(profile, refund_options)\n\n elsif remaining_products.size == profile.products.size # nothing has changed\n #\n # do nothing\n #\n else # only some products are being removed and the profile needs to be updated\n\n if remaining_products.size >= 1\n\n @command_list << remove_product_from_payment_profile(profile.identifier,\n removed_products_from_profile(profile),\n refund_options)\n else\n\n @command_list << cancel_recurring_payment_command(profile, refund_options)\n @command_list << create_recurring_payment_command(remaining_products, \n :paid_until_date => profile.paid_until_date,\n :period => extract_period_from_product_list(remaining_products))\n end\n end\n end\n end", "def run_tests()\r\n Signal.trap(\"CLD\") {@process_counter += 1}\r\n for setting in @settings\r\n Process.wait if @process_counter <= 0\r\n @process_counter -= 1\r\n fork do\r\n temp_name, log = copy_and_edit(setting)\r\n puts \"Running: \" + String(setting[0][:materials]) + \" \" + String(setting[0][:lengths]) + \"cm \" + String(setting[0][:energy]) + \"MeV\"\r\n cmd = String(@output_dir) + \"Hadr06 \" + String(temp_name) + \" > \" + String(log)\r\n system(@output_dir + \"Hadr06 \" + temp_name + \" > \" + log)\r\n relocate(setting)\r\n clean()\r\n end\r\n end\r\nend", "def test_delete_previous_promotion_line_item\n setup_new_order_with_items()\n \n a_fixed_rebate = promotions(:fixed_rebate)\n @o.promotion_code = a_fixed_rebate.code\n # Saving it, sets the promo code and product cost.\n assert @o.save\n # Assert the promotion is there.\n assert_equal @o.order_line_items.find_by_name(a_fixed_rebate.description).name, a_fixed_rebate.description, \"The fixed rebate wasn't added properly.\"\n\n # Test a percent rebate.\n a_percent_rebate = promotions(:percent_rebate)\n @o.promotion_code = a_percent_rebate.code\n # Saving it, sets the promo code and product cost.\n assert @o.save\n # Assert the promotion is there.\n assert_equal @o.order_line_items.find_by_name(a_percent_rebate.description).name, a_percent_rebate.description, \"The percent rebate wasn't added properly.\"\n\n # Assert the previous promotion is NOT there.\n assert_equal @o.order_line_items.find_by_name(a_fixed_rebate.description), nil, \"The fixed rebate is still there.\"\n end", "def test_024\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n #The Make root directory set as the make_root field enters.\n assert_equal \"public/\", get_value($xpath[\"task\"][\"make_root_main_link\"])\n\n #The directory/file names which were being changed into the state\n #where it does not check at the information dialog\n #which clicks analyze_deny_files and comes out are enumerated.\n\n click $xpath[\"task\"][\"analyze_deny_files\"]\n sleep 3\n\n assert is_text_present(\"sample_c/Makefile\")\n\n\n # logout\n logout\n\n end", "def testNominalWithSeveralPlatforms\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_DummyGemAndWindows ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/Windows/Inst/Install.exe\"), 'Windows', 'Inst', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def test_ut_t5_sef_pj_008\n current_user = User.find(PU_ADMIN_ID)\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n #\n EVENT_IDS.each do |event_id|\n un_users = new_pj.users_not_in_mailing_list(event_id,current_user)\n un_users.each do |user_id|\n user = User.find(user_id[1])\n assert !user.toscana_admin?\n end\n end\n end", "def test_043\n test_000\n login(\"root\",\"root\")\n register_master(\"normal\", MASTER_FILES[\"normal\"])\n master_chosen = Master.find(:last)\n all_segments_of_master = Segment.find_all_by_fk_id(master_chosen)\n assert_not_equal all_segments_of_master, []\n delete_master\n wait_for_text_present(_(\" deleted successfully!\"))\n all_segments_of_master = Segment.find_all_by_fk_id(master_chosen)\n assert_equal all_segments_of_master, []\n logout\n end", "def test_destroy_list\n\n subsection_01_1_1 = subsections(:subsection_01_1_1)\n total_checks = Check.count\n \n put(:destroy_list, {:id => subsection_01_1_1.id}, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n admin_session = cathy_admin_session\n subsection_01_1_1.reload\n assert_equal(3, subsection_01_1_1.checks.size)\n assert_equal(total_checks, Check.count)\n\n put(:destroy_list, { :id => subsection_01_1_1.id }, admin_session)\n #assert_equal('All checks deleted successfully', flash['notice'])\n assert_redirected_to(:controller => 'checklist',\n :action => 'edit',\n :id => subsection_01_1_1.checklist.id)\n\n total_checks -= 3\n subsection_01_1_1.reload\n subsection_01_1_2 = subsections(:subsection_01_1_2)\n assert_equal(0, subsection_01_1_1.checks.size)\n assert_equal(3, subsection_01_1_2.checks.size)\n assert_equal(total_checks, Check.count)\n\n checklist = Checklist.find(subsection_01_1_1.checklist.id)\n assert_equal(6, checklist.designer_only_count)\n assert_equal(3, checklist.designer_auditor_count)\n assert_equal(0, checklist.dc_designer_only_count)\n assert_equal(0, checklist.dc_designer_auditor_count)\n assert_equal(0, checklist.dr_designer_only_count)\n assert_equal(0, checklist.dr_designer_auditor_count)\n\n put(:destroy_list, {:id => subsection_01_1_2.id}, admin_session)\n total_checks -= 3\n subsection_01_1_2.reload\n assert_equal(0, subsection_01_1_2.checks.size)\n assert_equal(total_checks, Check.count)\n\n checklist = Checklist.find(subsection_01_1_1.checklist.id)\n assert_equal(3, checklist.designer_only_count)\n assert_equal(3, checklist.designer_auditor_count)\n assert_equal(0, checklist.dc_designer_only_count)\n assert_equal(0, checklist.dc_designer_auditor_count)\n assert_equal(0, checklist.dr_designer_only_count)\n assert_equal(0, checklist.dr_designer_auditor_count)\n\n subsection_01_2_1 = subsections(:subsection_01_2_1)\n assert_equal(3, subsection_01_2_1.checks.size)\n \n put(:destroy_list, { :id => subsection_01_2_1.id }, admin_session)\n total_checks -= 3\n subsection_01_2_1.reload\n assert_equal(0, subsection_01_2_1.checks.size)\n assert_equal(total_checks, Check.count)\n\n checklist = Checklist.find(subsection_01_2_1.checklist.id)\n assert_equal(0, checklist.designer_only_count)\n assert_equal(3, checklist.designer_auditor_count)\n assert_equal(0, checklist.dc_designer_only_count)\n assert_equal(0, checklist.dc_designer_auditor_count)\n assert_equal(0, checklist.dr_designer_only_count)\n assert_equal(0, checklist.dr_designer_auditor_count)\n\n subsection_01_2_2 = subsections(:subsection_01_2_2)\n assert_equal(3, subsection_01_2_2.checks.size)\n \n put(:destroy_list, { :id => subsection_01_2_2.id }, admin_session)\n total_checks -= 3\n subsection_01_2_2.reload\n assert_equal(0, subsection_01_2_2.checks.size)\n assert_equal(total_checks, Check.count)\n\n checklist = Checklist.find(subsection_01_2_1.checklist.id)\n assert_equal(0, checklist.designer_only_count)\n assert_equal(0, checklist.designer_auditor_count)\n assert_equal(0, checklist.dc_designer_only_count)\n assert_equal(0, checklist.dc_designer_auditor_count)\n assert_equal(0, checklist.dr_designer_only_count)\n assert_equal(0, checklist.dr_designer_auditor_count)\n\n subsection_10_1_1 = subsections(:subsection_10_1_1)\n put(:destroy_list, { :id => subsection_10_1_1.id }, admin_session)\n #assert_equal('This is a released checklist. No checks were deleted.', flash['notice'])\n assert_redirected_to(:controller => 'checklist',\n :action => 'edit',\n :id => subsection_10_1_1.checklist.id)\n\n end", "def testNominalWithSeveralTypes\n setupTest do |iTasksFileName, iTicketsFileName|\n $Context[:OS_ExecAnswers] = [\n # svn co => success\n [ 0, '' ],\n # deliver => success, generating files\n [ 0, '', @@Generator_DummyGemAndOther ]\n ]\n executeProcess(\n [\n '--user', 'ReleaseUser',\n '--branch', 'BranchName',\n '--comment', 'ReleaseComment',\n '--version', '0.0.1.20100317',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--svnco', 'MySVNRep',\n '--deliver', 'deliver %{DeliverablesDir}'\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn co MySVNRep' ],\n [ 'query', /^deliver .*$/ ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal( @@CommonSlaveActions.merge(\n {\n Tools::FilesManager => {\n Actions::File_Upload => [\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Gem/DummyGem.gem\"), 'All', 'Gem', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ],\n [ WEACE::Master::TransferFile.new(\"#{$Variables[:DeliverableDir]}/Releases/All/Other/DummyOtherFile\"), 'All', 'Other', 'BranchName', '0.0.1.20100317', 'ReleaseUser', 'ReleaseComment' ]\n ]\n }\n } ),\n iSlaveActions\n )\n end\n end\n end", "def mark_progresses_for_removal\n self.progresses.each do |p|\n if p.due_date.blank? && p.accuracy.to_i <= 0\n p.mark_for_destruction\n end\n end\n end", "def update\n @smoke_test = SmokeTest.find(params[:id])\n\n if not params[:smoke_test][:test_suite_ids] and not params[:smoke_test][:config_templates]\n @smoke_test.config_templates.clear\n @smoke_test.test_suites.clear\n end\n respond_to do |format|\n if @smoke_test.update_attributes(params[:smoke_test])\n\n @smoke_test.test_suites.clear if @smoke_test.test_suites.size == 0\n format.html { redirect_to(@smoke_test, :notice => 'Smoke test was successfully updated.') }\n format.json { render :json => @smoke_test, :status => :ok }\n format.xml { render :xml => @smoke_test, :status => :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @smoke_test.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @smoke_test.errors, :status => :unprocessable_entity }\n end\n end\n end", "def test_ut_t5_sef_pj_004\n current_user = User.find(TCANA_ADMIN_ID)\n new_pj = Pj.create(:name => \"test_pj\",\n :pu_id => PU_ID)\n #\n EVENT_IDS.each do |event_id|\n email_setting = EmailSetting.find(:first,\n :conditions => {\n :pj_id => new_pj.id,\n :analyze_process_event_id => event_id})\n email_setting.user_ids = \"#{TCANA_ADMIN_ID},#{PU_ADMIN_ID},#{PJ_ADMIN_ID},#{PJ_MEMBER_ID}\"\n email_setting.save\n\n users = new_pj.users_in_mailing_list(event_id,current_user)\n assert_equal 4,users.size\n end\n end" ]
[ "0.6101667", "0.5871965", "0.5866242", "0.5758524", "0.5736607", "0.5681461", "0.56410456", "0.5619978", "0.55291146", "0.5479975", "0.5469446", "0.54309833", "0.5392201", "0.538284", "0.5313692", "0.5274072", "0.52509636", "0.5216407", "0.5213342", "0.52042246", "0.51963884", "0.516554", "0.51610655", "0.5156637", "0.5136233", "0.5123212", "0.511279", "0.5105272", "0.5102811", "0.5088117", "0.5085707", "0.507417", "0.5055396", "0.50104964", "0.49900135", "0.4980912", "0.49690658", "0.49677077", "0.4967194", "0.49553713", "0.49496734", "0.4933807", "0.49278793", "0.49159586", "0.48849848", "0.4880812", "0.48725826", "0.48657534", "0.4863585", "0.48553026", "0.48391852", "0.48386222", "0.48357767", "0.48321235", "0.48255235", "0.48179615", "0.48156378", "0.48131463", "0.48027515", "0.4802749", "0.47902352", "0.4788732", "0.47886005", "0.47810325", "0.47780484", "0.47697273", "0.47669294", "0.47635242", "0.47605506", "0.4759953", "0.475927", "0.47532833", "0.47427434", "0.47405493", "0.47375467", "0.47339112", "0.47315848", "0.47304413", "0.47282445", "0.47269365", "0.47261", "0.47228917", "0.47226325", "0.4719031", "0.47177884", "0.47080857", "0.47074887", "0.47064558", "0.46994954", "0.4696696", "0.46934366", "0.46878174", "0.46851206", "0.46845207", "0.46774358", "0.46773976", "0.46735814", "0.46732676", "0.4672495", "0.46714976" ]
0.5955965
1
Verifies that the provisos match test data
def verify_provisos(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::PROVISOS.name], element_value(provisos_text_area)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_provisos(test_data)\n verify_values_match(test_data[UseOfCollections::PROVISOS.name], element_value(provisos_text_area))\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def verify\n end", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def verify()\n # TODO\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def verify\n\t\t#puts \"INSIDE DEF: vERIFY IN ORDER CONCERN.\"\n\t\tself.reports.each do |report|\n\t\t\treport.a_test_was_verified = false\n\t\t\tif report.consider_for_processing?(self.history_tags)\n\t\t\t#puts \"checking report: #{report.name}\"\n\t\t\t#puts \"report verify all is: #{report.verify_all},,, #{Diagnostics::Report::VERIFY_ALL}\"\n\t\t\t\tif report.verify_all == Diagnostics::Report::VERIFY_ALL\n\t\t\t\t\t#puts \"reprot verify all is true\"\n\t\t\t\t\tif report.impression.blank?\n\t\t\t\t\t\t#puts \"impression is balnk\"\n\t\t\t\t\t\treport.tests.each do |test|\n\t\t\t\t\t\t\t#puts \"Calling verify if normal on test: #{test.name}\"\n\t\t\t\t\t\t\tunless test.verify_if_normal(self.current_user).blank?\n\t\t\t\t\t\t\t\treport.a_test_was_verified = true\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\treport.tests.each do |test|\n\t\t\t\t\t\t\tunless test.verify.blank?\n\t\t\t\t\t\t\t\treport.a_test_was_verified = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def verify\n\n end", "def verify\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def verifierCorrect()\n return @solution.equals(@partie.getCurrentGrid())\n end", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def compare_profile_data\n puts \"Step 11: Comparing Freelancer Profile data\"\n parent = $freelancers_card_data[@index]\n child = @profile_data\n puts \"for freelancer #{parent[:name]}, comparing results page fields with internal page fields:\"\n [:description, :title, :skills].each do |field|\n verify_details(parent, child, field, parent[:name])\n end\n puts \"All results are printed successfully\"\n\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def consistency_checks\n unless certificate_serial_number == voucher_serial_number\n error_report << \"serial number mismatch certificate '#{certificate_serial_number}' vs '#{voucher_serial_number}'\"\n return false\n end\n # other tests here.\n return true\n end", "def compare_product_tests(test1, test2)\n # compare relevant details\n test1.save\n test2.save\n assert_performed_jobs 2\n\n test1.reload\n test2.reload\n compare_results(test1, test2)\n\n # compare records\n test1.patients.each_index do |x|\n patient1 = test1.patients.fetch(x)\n patient2 = test2.patients.fetch(x)\n compare_records(patient1, patient2)\n end\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def testa_comparacao_entre_dinheiro\n COMPARACAO.each { |comparacao| assert comparacao }\n end", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end", "def test_exercise_1111\n verify_method :exercise_1111,\n :with => [{param: [[true]], expect: \" 1\\n1*\\n\"},\n {param: [[false]], expect: \" 1\\n1 \\n\"},\n {param: [[true, false]], expect: \" 12\\n1* \\n\"},\n {param: [[true, false], [true, false]], expect: \" 12\\n1* \\n2* \\n\"}]\n end", "def verify\n recipes.each { |rcp| rcp.verify }\n end", "def matches_expected? pi\n pi.patient_identifier == expected.patient_identifier &&\n pi.affinity_domain == expected.affinity_domain\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def test_truth\n end", "def test_existing_file\n assert verify_parameters(['verifier_tests.rb'])\n end", "def test_validation\n \n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-')\n pcba_pn = '500-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No - PCB, PCBA part numbers are not unique.\n pcba_pn = '600-123-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n \n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert( pn.error_message)\n assert_equal('The PCB part number (600-123-a0 a) and the PCBA part number ' +\n \"(600-123-00 b) must be unique - YOUR PART NUMBER WAS NOT CREATED\",\n pn.error_message)\n \n\n # Valid? - No - Format bad, short prefix\n pcb_pn = '12-123-a0'.split('-')\n pcba_pn = '34-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No - Format bad, illegal characters in the prefix\n pcb_pn = '12e-123-a0'.split('-')\n pcba_pn = 'pcb-120-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert(!pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, wrong number of characters in the number\n pcb_pn = '127-3-a0'.split('-')\n pcba_pn = '128-21-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the number\n pcb_pn = '127-###-a0'.split('-')\n pcba_pn = '128-JPA-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No - Format bad, illegal characters in the dash number\n pcb_pn = '127-714-*'.split('-')\n pcba_pn = '128-755-!&'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcba_number = pcba_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert(!pn.valid_pcba_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_pcba_part_number?)\n assert(!pn.valid_components?('new'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes\n pcb_pn = '127-714-01'.split('-')\n pcba_pn = '128-755-a0'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_dash_number = pcba_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcba_number?)\n assert( pn.valid_pcba_prefix?)\n assert( pn.valid_pcba_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_pcba_part_number?)\n assert( pn.valid_components?('new'=='new'))\n assert(!pn.error_message)\n\n # Valid? - Yes\n pn = PartNumber.initial_part_number\n pcb_pn = '600-123-a0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n # Valid? - No, pcb pn exists.\n pcb_pn = '252-700-b0'.split('-') \n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'a'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n \n # Valid? - No, pcb pn duplicates pcba pn \n pcb_pn = '259-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcb_revision = 'b'\n\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n # Valid? - No, pcb pn prefix contains the wrong number of characters \n pcb_pn = '12-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - No, pcb pn prefix contains illegal characters \n pcb_pn = '12e-700-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n assert( pn.valid_pcb_number?)\n assert(!pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains wrong number of characters \n pcb_pn = '127-3-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n #assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn number contains illegal characters \n pcb_pn = '127-#*@-00'.split('-')\n pn.pcb_number = pcb_pn[1]\n assert(!pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n\n # Valid? - No, pcb pn dash number contains wrong number of, and illegal, characters \n pcb_pn = '127-714-@'.split('-')\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert(!pn.valid_pcb_dash_number?)\n assert(!pn.valid_pcb_part_number?)\n assert(!pn.valid_components?('not'=='new'))\n assert_equal(@msg_format_error, pn.error_message)\n\n # Valid? - Yes \n pcb_pn = '127-714-01'.split('-')\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_pcb_number?)\n assert( pn.valid_pcb_prefix?)\n assert( pn.valid_pcb_dash_number?)\n assert( pn.valid_pcb_part_number?)\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n \n \n assert(!pn.exists?)\n assert_nil(pn.error_message)\n pn.save\n assert(pn.exists?)\n assert_equal(@msg_pcb_exists_pcb, pn.error_message)\n\n assert(PartNumber.valid_prefix?('100'))\n assert(!PartNumber.valid_prefix?('1'))\n assert(!PartNumber.valid_prefix?('a'))\n assert(!PartNumber.valid_prefix?('10'))\n assert(!PartNumber.valid_prefix?('a7'))\n assert(!PartNumber.valid_prefix?('1aa'))\n assert(!PartNumber.valid_prefix?('a00'))\n assert(!PartNumber.valid_prefix?('1776'))\n assert(!PartNumber.valid_prefix?('a345'))\n \n assert(PartNumber.valid_number?('100'))\n assert(!PartNumber.valid_number?('1'))\n assert(!PartNumber.valid_number?('a'))\n assert(!PartNumber.valid_number?('10'))\n assert(!PartNumber.valid_number?('a7'))\n assert(!PartNumber.valid_number?('1aa'))\n assert(!PartNumber.valid_number?('a00'))\n assert(!PartNumber.valid_number?('1776'))\n assert(!PartNumber.valid_number?('a345'))\n \n assert(PartNumber.valid_dash_number?('a0'))\n assert(PartNumber.valid_dash_number?('0a'))\n assert(!PartNumber.valid_dash_number?('a'))\n assert(!PartNumber.valid_dash_number?('4'))\n assert(!PartNumber.valid_dash_number?('aa33'))\n assert(!PartNumber.valid_dash_number?('333'))\n \n # Create known part numbers for testing.\n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-802-00'.split('-')\n pcba_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.save\n \n pn = PartNumber.initial_part_number\n pcb_pn = '700-801-01'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert( pn.valid_components?('not'=='new'))\n assert(!pn.error_message)\n\n pn = PartNumber.initial_part_number\n pcb_pn = '700-804-00'.split('-')\n pn.pcb_prefix = pcb_pn[0]\n pn.pcb_number = pcb_pn[1]\n pn.pcb_dash_number = pcb_pn[2]\n assert(!pn.valid_components?('not'=='new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n pcba_pn = '700-900-90'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'b'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n \n pcba_pn = '000-000-00'.split('-')\n pn.pcba_prefix = pcba_pn[0]\n pn.pcba_number = pcba_pn[1]\n pn.pcba_dash_number = pcba_pn[2]\n pn.pcba_revision = 'a'\n assert(!pn.valid_components?('new'))\n assert( pn.error_message)\n assert_equal(@msg_pcb_exists_pcba, pn.error_message)\n \n end", "def verify\n # nothing to do here, so just return\n end", "def validate(parsed_data)\n graph_name = load_data parsed_data\n \n begin \n results = @tests.map do |test|\n run_test(test, graph_name)\n end\n ensure\n clear_graph graph_name\n end\n\n # Remove empty results\n results.flatten.reject(&:empty?)\n end", "def verify_occasions(test_data)\n occasions = test_data[UseOfCollections::OCCASION_LIST.name] || [{ UseOfCollections::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[UseOfCollections::OCCASION.name], element_value(occasion_input index)) }\n end", "def audit_data_verify(a_data, v_data)\n found = nil\n a_data.each do |entry|\n if entry.text.match(v_data)\n found = true\n print_to_output(\"VERIFIED: Expected Audit data: '#{v_data}' is displayed.\")\n break\n end\n end\n raise \"Audit data #{v_data} was not found!\" unless found\n end", "def verify_occasions(test_data)\n occasions = test_data[CoreUseOfCollectionsData::OCCASION_LIST.name] || [{CoreUseOfCollectionsData::OCCASION.name => ''}]\n occasions.each_with_index { |occasion, index| verify_values_match(occasion[CoreUseOfCollectionsData::OCCASION.name], element_value(occasion_input index)) }\n end", "def test_check_invalid_prospectors\n assert_equal check_valid([2, 0, 1]), [1, nil, nil, nil]\n end", "def test_exercise_1115\n verify_method :exercise_1115,\n :with => [{params: [[0], 1], expect: [1]},\n {params: [[0], 2], expect: [1, 0]},\n {params: [[1, 1], 2], expect: [0, 2]},\n {params: [[1, 2, 3, 3, 3, 4], 5], expect: [0, 1, 1, 3, 1]}]\n end", "def verify_fees(test_data)\n fees = test_data[UseOfCollections::FEE_GRP.name] || [UseOfCollections.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[UseOfCollections::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[UseOfCollections::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[UseOfCollections::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def verify\n head :ok\n end", "def assert_valid\n @validator = validator\n assert @validator.validate(data_sample, fail_fast: true)\n assert @validator.validate(data_sample, fail_fast: false)\n end", "def validate_release\n if !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end", "def validate_release\n if !system(\"origen specs\") || !system(\"origen examples\")\n puts \"Sorry but you can't release with failing tests, please fix them and try again.\"\n exit 1\n else\n puts \"All tests passing, proceeding with release process!\"\n end\n end", "def verify_note(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::NOTE.name], element_value(note_text_area))\n end", "def test_save\n verify_save(@pnt)\n end", "def validate_same_number_of_sts_in_p_and_f(asp_w_f_sts)\n p_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[0].count('@') }\n f_st_count = asp_w_f_sts.inject(0) { |m,e| m += e[1].count('@') }\n if p_st_count != f_st_count\n if debug\n puts asp_w_f_sts.ai(indent: -2)\n puts \"\\n\\n\\n\\n\"\n puts \"mismatches:\".color(:red)\n asp_w_f_sts.each { |(primary,foreign,conf)|\n pr_st_count = primary.count('@')\n fo_st_count = foreign.count('@')\n if pr_st_count != fo_st_count\n puts '-' * 10\n p primary\n puts \"pr_st_count: #{ pr_st_count }\"\n p foreign\n puts \"fo_st_count: #{ fo_st_count }\"\n puts \"conf: #{ conf.inspect }\"\n end\n }\n end\n raise \"Mismatch in subtitle counts: primary has #{ p_st_count } and foreign has #{ f_st_count }\"\n end\n true\n end", "def test_idempotency_validation\n FootballData::Scrape.get_team_year(1, '1999-2000')\n assert_equal FootballData::RawGame.count, @count\n end", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def verify_fees(test_data)\n fees = test_data[CoreUseOfCollectionsData::FEE_GRP.name] || [CoreUseOfCollectionsData.empty_fee]\n fees.each_with_index do |fee, index|\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_CURRENCY.name], element_value(fee_currency_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_VALUE.name], element_value(fee_value_input index))\n verify_values_match(fee[CoreUseOfCollectionsData::FEE_NOTE.name], element_value(fee_note_input index))\n end\n end", "def testNominal\n executeProcess(\n [\n '--masterticket', '123',\n '--slaveticket', '456'\n ]\n ) do |iError, iSlaveActions|\n assert_equal(\n {\n Tools::TicketTracker => {\n Actions::Ticket_RejectDuplicate => [\n [ '123', '456' ]\n ]\n }\n },\n iSlaveActions\n )\n end\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def valid?\n verify\n end", "def test_num_transactions_correct_0_true\n assert_equal(false, @bv.num_transactions_correct?(0, [0,1]))\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def test_arg_check_prospectors_valid\n ret = arg_check_prospectors '1'\n assert_equal ret, 0\n end", "def passing?\n return true if self.product_tests.empty?\n\n passing = self.product_tests.includes(:test_executions).select do |p|\n p.execution_state == :passed\n end\n passing.length == product_tests.length\n end", "def compare_tests(test_a, test_b); end", "def compare_tests(test_a, test_b); end", "def pass?\n expected_array.size == actual_array.size &&\n [expected_array, actual_array].transpose.all? do |expected_element, actual_value|\n expected_element.match_against_actual_value(actual_value)\n end\n end", "def verify_authorizations(test_data)\n authorizations = test_data[UseOfCollections::AUTHORIZATION_GRP.name] || [UseOfCollections.empty_authorization]\n authorizations.each_with_index do |auth, index|\n verify_values_match(auth[UseOfCollections::AUTHORIZED_BY.name], element_value(authorized_by_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_DATE.name], element_value(authorization_date_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_NOTE.name], element_value(authorization_note_input index))\n verify_values_match(auth[UseOfCollections::AUTHORIZATION_STATUS.name], element_value(authorization_status_input index))\n end\n end", "def verify_note(test_data)\n verify_values_match(test_data[UseOfCollections::NOTE.name], element_value(note_text_area))\n end", "def check_against(unit_test)\n grade_sheet = unit_test.execute(src_code) \n Feedback.on(grade_sheet)\n end", "def validate_release \n if !system(\"origen examples\") #|| !system(\"origen specs\") \n puts \"Sorry but you can't release with failing tests, please fix them and try again.\" \n exit 1 \n else \n puts \"All tests passing, proceeding with release process!\" \n end \n end", "def verify_history_notes(test_data)\n test_histories = test_data[Org::HISTORY_NOTES.name]\n errors = []\n test_histories = [{ Org::HISTORY_NOTE.name => ''}] unless test_histories\n test_histories.each_with_index do |test_history, index|\n text_values_match?(test_history[Org::HISTORY_NOTE.name], element_value(history_input(index)), errors)\n end\n errors\n end", "def verify(event_data)\n true\n end", "def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end", "def verify_groups(test_data)\n test_groups = test_data[Org::GROUPS.name]\n errors = []\n test_groups = [{ Org::GROUP.name => ''}] unless test_groups\n test_groups.each_with_index do |test_grp, index|\n text_values_match?(test_grp[Org::GROUP.name], element_value(group_input(index)), errors)\n end\n errors\n end", "def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data record! -- sample #{id}\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[0]} --\", \"#{dose_unit_text(values[values.keys[0]])}/day,\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[1]} --\", \"#{dose_unit_text(values[values.keys[1]])}/day.\", \"|\"]\n puts \"%s%7s\" % [\"| Sample #{id} will not include in the analysis!\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n data.delete(id)\n end\n end\n data\n end" ]
[ "0.74271333", "0.6471244", "0.643594", "0.6350065", "0.6345271", "0.6323167", "0.6268271", "0.6247416", "0.62469137", "0.62074935", "0.6188318", "0.61853796", "0.6042191", "0.60177153", "0.60109514", "0.59783953", "0.5936607", "0.5891009", "0.58907545", "0.58778477", "0.58754194", "0.5873278", "0.5850755", "0.5839259", "0.58184457", "0.57733464", "0.5772223", "0.5772029", "0.5769782", "0.57693416", "0.575791", "0.575791", "0.57491577", "0.57400113", "0.57377636", "0.5725064", "0.5724635", "0.5714037", "0.5710693", "0.5694456", "0.56835973", "0.56685567", "0.5661089", "0.5648479", "0.56361234", "0.5632381", "0.5628145", "0.5619241", "0.5618222", "0.5614334", "0.56115186", "0.5603266", "0.5594995", "0.5583287", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.55673313", "0.5563204", "0.5558559", "0.5521371", "0.5518533", "0.55166286", "0.55166286", "0.551524", "0.55141705", "0.55124027", "0.5508251", "0.55068636", "0.5496353", "0.54749477", "0.54737175", "0.54638755", "0.5460814" ]
0.74541885
0
RESULT Enters or removes a result per a given set of test data
def enter_result(test_data) hide_notifications_bar logger.info "Entering result '#{test_data[CoreUseOfCollectionsData::RESULT.name]}'" wait_for_element_and_type(result_text_area, test_data[CoreUseOfCollectionsData::RESULT.name]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_users_should_update_test_result_under_c1_0\n test_target_instance = get_new_test_target_instance(\"example5\", \"2012112805\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_PASS, 'test_case_1')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b01, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b10, 0b11, 2)\n end", "def test_single_user_should_keep_test_results_under_c1\n test_target_instance = get_new_test_target_instance(\"example4\", \"2012112804\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 1, 1, 2)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_2', 1, 1, 2)\n #TODO assert view\n end", "def test_multiple_users_should_update_test_result_under_c1_1\n test_target_instance = get_new_test_target_instance(\"example6\", \"2012112806\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b10, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b10, 0b11, 2)\n end", "def clear_result; end", "def test_multiple_users_should_keep_test_results_under_c2\n test_target_instance = get_new_test_target_instance(\"example8\", \"2012112808\")\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_PASS, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 1)\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 1)\n end", "def test_single_user_should_update_test_results_under_c1\n test_target_instance = get_new_test_target_instance(\"example3\", \"2012112803\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1', 'test_case_2')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 2, 3, 2)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_2', 2, 3, 2)\n end", "def compare_result(test, result)\n if @per_test_insert\n expected = translate_column_names(test['expected'])\n else\n expected = test['expected']\n end\n expected.each do |key, value|\n if value == 'ignore'\n next\n end\n\n if !compare_values(value, result[key])\n @num_fails += 1\n @failed_tests.push(test['name'])\n\n puts \" Expected: \\\"#{key}\\\": #{value}\"\n puts \" Result: \\\"#{key}\\\": #{result[key]}\"\n puts \" Status: Failed\"\n return\n end\n end\n\n @num_successes += 1\n puts \" Status: Passed\"\n end", "def discard_results; end", "def test_multiple_users_should_update_test_results_under_c2\n test_target_instance = get_new_test_target_instance(\"example7\", \"2012112807\")\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_FAIL, 'test_case_1')\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b10, 0b11)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 0b01, 0b11)\n end", "def test_result_changes(test_result)\n test_changes(test_result.run_result, test_result.test)\n end", "def set_test_and_result\n @test = set_test\n @result = @test.results.find(params[:id])\n end", "def populate_results(test_result)\n # Note: id is not an XCCDF 1.2 compliant identifier and will need to be updated when that support is added.\n test_result.id = 'result_1'\n test_result.starttime = run_start_time\n test_result.endtime = run_end_time\n\n # Build out individual results\n all_rule_result = []\n\n @data['controls'].each do |control|\n next if control['results'].empty?\n\n control_results =\n control['results'].map do |result|\n populate_rule_result(control, result, xccdf_status(result['status'], control['impact']))\n end\n\n # Consolidate results into single rule result do to lack of multiple=true attribute on Rule.\n # 1. Select the unified result status\n selected_status = control_results.reduce(control_results.first.result) { |f_status, rule_result| xccdf_and_result(f_status, rule_result.result) }\n\n # 2. Only choose results with that status\n # 3. Combine those results\n all_rule_result << combine_results(control_results.select { |r| r.result == selected_status })\n end\n\n test_result.rule_result = all_rule_result\n test_result\n end", "def test_multi_user_delete_test_results_with_weighted_values_checked_fail\n test_target_instance = get_new_test_target_instance(\"example15\", \"2012112815\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_FAIL, 'test_case_1', 'test_case_2')\n batch_edit_test_results(test_target_instance, members(:two), TestResult::TEST_TARGET_FAIL, 'test_case_1', 'test_case_2')\n\n batch_delete_test_results(test_target_instance, members(:one), 'test_case_2')\n\n batch_delete_test_results(test_target_instance, members(:two), 'test_case_1')\n\n assert_test_result_valid(test_target_instance, members(:two), 'test_case_2', 2)\n assert_delete_test_result_valid(test_target_instance, members(:one), 'test_case_2', 0b10)\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 2)\n assert_delete_test_result_valid(test_target_instance, members(:two), 'test_case_1', 0b10)\n end", "def store_result()\n #This is a stub, used for indexing\n end", "def test_should_create_test_results\n test_target_instance = get_new_test_target_instance(\"example2\", \"2012112802\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1', 'test_case_2')\n assert_response :success\n\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 1)\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_2', 1)\n end", "def clearResult\n @mResult.clear\n end", "def run_additional_operations(query_type, test)\n query_data = translate_column_names(test['additional_operation'])\n if query_type == 'delete'\n puts \" Deleting\"\n else\n puts \" Updating\"\n end \n\n if @verbose\n puts \" - #{query_data}\"\n end\n \n result = nil\n\n if query_type == 'delete'\n result = @client.delete(query_data)\n elsif query_type == 'update'\n result = @client.update(query_data)\n end\n\n expected = translate_column_names(test['result_additional'])\n expected.each do |key, value|\n if value == 'ignore'\n next\n end\n\n if !compare_values(value, result[key])\n @num_fails += 1\n @failed_tests.push(test['name'])\n\n puts \" Expected: \\\"#{key}\\\": #{value}\"\n puts \" Result: \\\"#{key}\\\": #{result[key]}\"\n puts \" Status: Failed\"\n return false\n end\n end\n \n self.num_successes += 1\n print(' Status: Passed')\n return true\n end", "def update_results\n Rails.logger.debug \"GroupRuleResultSet #{id}: Updating results for group rule set ##{id}\"\n\n p = GroupRule.find_matches(column, value)\n\n # Compare new and existing results to selectively destroy/create GroupRuleResult records as needed\n existing_results = results.to_a\n new_results = p.uniq.map { |e| GroupRuleResult.new(entity_id: e.id, group_rule_result_set_id: id) }\n\n outdated_results = existing_results.reject do |er|\n new_results.reject! { |nr| (nr.entity_id == er.entity_id) && (nr.group_rule_result_set_id == er.group_rule_result_set_id) } != nil\n end\n\n outdated_results.each(&:destroy)\n new_results.each do |nr|\n results << nr\n end\n\n update_occurred = !(outdated_results.empty? && new_results.empty?)\n\n if update_occurred\n self.touch # rubocop:disable Style/RedundantSelf\n Rails.logger.debug \"GroupRuleResultSet #{id}: Updated group rule set ##{id} to have #{results.length} result(s)\"\n else\n Rails.logger.debug \"GroupRuleResultSet #{id}: No update necessary for group rule set ##{id} (has #{results.length} result(s))\"\n end\n end", "def test_should_create_test_result\n test_target_instance = get_new_test_target_instance(\"example1\", \"2012112801\")\n batch_edit_test_results(test_target_instance, members(:one), TestResult::TEST_TARGET_PASS, 'test_case_1')\n assert_response :success\n assert_test_result_valid(test_target_instance, members(:one), 'test_case_1', 1)\n end", "def abandon_results!()\n #This is a stub, used for indexing\n end", "def store_result(result); end", "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def add_result name, res\n \n end", "def update_result_in_test_rail(test_rail_url, user_name, access_key, run_id, hash_case_id)\n\n begin\n # hash of mapping case id to id as per the test rail\n hash_test_mapping = Hash.new\n b_flag = true\n\n if test_rail_url.to_s.strip.empty? or user_name.to_s.strip.empty? or access_key.to_s.strip.empty? or run_id.to_s.strip.empty?\n puts 'Specified parameters is not correct, please re-check !'\n puts 'Specified Test Rail URL : ' + test_rail_url\n puts 'Specified Test Rail User Name : ' + user_name\n puts 'Specified Test Rail Access Key : ' + access_key\n puts 'Specified Test Rail Run Id : ' + run_id\n else\n # creating connection with test rail api\n obj_test_rail = TestRail::APIClient.new(test_rail_url)\n obj_test_rail.user = user_name\n obj_test_rail.password = access_key\n get_tests_uri = 'get_tests/' + run_id.to_s\n\n get_response = obj_test_rail.send_get(get_tests_uri)\n response_size = get_response.size\n i_count = 0\n\n while i_count < response_size do\n case_id = get_response[i_count.to_i]['case_id']\n id = get_response[i_count.to_i]['id']\n hash_test_mapping[case_id] = id\n i_count = i_count + 1\n end\n\n if hash_test_mapping.empty?\n puts 'No entry retrieved from Test Rail for Test Rail Run ID : ' + run_id.to_s\n else\n # specify the result array\n result = []\n\n hash_test_mapping.each do |key,value|\n case_id = 'C' + key.to_s\n if hash_case_id.has_key?case_id\n status = hash_case_id[case_id]\n if status.downcase == 'pass'\n result << {\"test_id\": \"#{hash_test_mapping[key]}\", \"status_id\": 1}\n elsif status.downcase == 'fail'\n result << {\"test_id\": \"#{hash_test_mapping[key]}\", \"status_id\": 5}\n end\n end\n end\n\n result_string = {\"results\": JSON.parse(result.to_json)}\n result_string = JSON.parse(result_string.to_json)\n\n if result_string['results'].size > 0\n add_results_uri = 'add_results/' + run_id.to_s\n obj_test_rail.send_post(add_results_uri, result_string)\n else\n puts 'No result found to upload in Test Rail'\n end\n end\n end\n rescue Exception => e\n b_flag = false\n puts 'Error Occured In Uploading The results in Test Rail, Error is : ' + e.message\n ensure\n return b_flag\n end\nend", "def verify_result(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area))\n end", "def set_result\n results = result_params\n unless results.nil?\n if results.is_a?(String)\n parts = results.split(\"#\")\n @result = @measurement.results.find(parts[0].to_i)\n end\n end\n end", "def add_result(result_tuple)\n @test_results << result_tuple\n end", "def process_result res\n call = res[-1]\n\n check = check_call call\n\n if check and not @results.include? call\n @results << call\n\n if include_user_input? call[3]\n confidence = CONFIDENCE[:high]\n else\n confidence = CONFIDENCE[:med]\n end\n \n warn :result => res, \n :warning_type => \"Mass Assignment\", \n :message => \"Unprotected mass assignment\",\n :line => call.line,\n :code => call, \n :confidence => confidence\n end\n res\n end", "def process_result(new_result)\n self.result = new_result\n calculate\n end", "def use_result\n store_result\n end", "def process_result\n end", "def get_results(test_id)\n if !(/\\A\\d+\\z/ === test_id.to_s)\n print \"ERROR: get_results called with non-numeric :test_id = '#{test_id}'\\n\"\n exit -1\n end\n uri = \"get_results/#{test_id}\"\n begin\n @all_results = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"EXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to retrieve list of results; exiting\\n\"\n exit -1\n end\n @all_results.each_with_index do |next_result,ndx_result|\n print ' '*14\n print \" result-%02d:\" % [ndx_result+1]\n print \" id=%-3d\" % [next_result['id']]\n print \" test_id=%d\" % [next_result['test_id']]\n print \" comment=%s\" % [next_result['comment']]\n print \" defects=%s\" % [next_result['defects']]\n print \"\\n\"\n end\n return\nend", "def merged_result; end", "def update_result(new_result)\n @result = new_result if new_result > @result\n end", "def get_result(result_type) ; add_result(result_type, false) ; end", "def process_result(body)\n if body =~ RESULT_TITLE\n # this is a result\n units, place = $1, $2\n if body =~ EX_TEMP\n temp = $1\n out = if EXTMODE\n overview = ((m = EX_OVERVIEW.match(body)) ? m[1] : '?')\n wind_dir, wind_speed = ((m = EX_WIND.match(body)) ? m[1,2] : ['?','?'])\n humidity = ((m = EX_HUMIDITY.match(body)) ? m[1] : '?')\n pressure = ((m = EX_PRESSURE.match(body)) ? m[1] : '?')\n visibility = ((m = EX_VISIBILITY.match(body)) ? m[1] : '?')\n\n \"\\n#{place}\\n\" +\n \" Temp : #{temp} degrees #{units}\\n\" +\n \" Wind : #{wind_dir} (#{wind_speed} mph)\\n\" +\n \" Humidity (%) : #{humidity}\\n\" +\n \" Pressure (mB): #{pressure.chop}\\n\" +\n \" Visibility : #{visibility}\"\n else\n \"#{place} - #{temp} degrees #{units}\"\n end\n\n puts out\n else\n puts \"No data for #{place}\"\n end\n elsif body =~ MULTI_RESULT_TITLE \n # multiple or no result\n if body =~ NO_LOCS \n puts \"No locations matched '#{$1}'\"\n else\n a = collect_results(body) \n\n if a.length > 0\n unless n = AUTOSELECT\n puts \"Multiple results:\\n\"\n puts \" [0]\\tCancel\"\n a.each_with_index do |e,i|\n puts \" [#{i+1}]\\t#{e.first}\"\n end\n\n puts \" [A]\\tAll\\n\\n\"\n\n begin\n print \"Select (separate with spaces): \"\n n = STDIN.gets.chomp \n end until n =~ SELECT_INPUT \n end\n\n if n != '0' # 0 is cancel\n n.split(' ').inject([]) do |ary,i|\n if i.upcase == 'A'\n ary + a.map { |e| e.last }\n else\n ary << a[i.to_i - 1].last\n end\n end.each do |id|\n fetch_process(\"http://www.bbc.co.uk/weather/5day.shtml?#{id}\")\n end\n end\n else\n puts \"No usable results found\"\n end\n end\n else\n puts \"Unknown location\"\n end\nend", "def clear_results\n @derived_values = []\n end", "def generate_results\n Result.destroy_all\n\n puts 'Generating results'\n\n (MULTIPLIER * 3).times do\n user_id = User.all.sample.id\n question_id = Question.all.sample.id\n result = ['true', 'false'].sample\n Result.create(user_id: user_id, question_id: question_id, result: result)\n end\nend", "def apply_test_result_filters(result,\n test,\n target,\n project,\n machine,\n pool)\n handle_action_exceptions(__method__) do\n cmd_line = [\n \"applytestresultfilters '#{result}' '#{test}' '#{target}' \"\\\n \"'#{project}' '#{machine}' '#{pool}'\"\n ]\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end", "def addResult(result, usableItems)\n r = (@results ||= []).find { |x| x.result == result.to_sym }\n if r.nil?\n r = Result.new(result.to_sym)\n @results << r\n @results.sort!\n end\n\n newItems = usableItems.to_a # guarantee array form\n newItems.each do |x|\n if !(@items ||= []).find { |y| x == y }\n @items << x\n @items = @items.sort_by { |z| z.to_s }\n r << x\n end\n end\n end", "def reset\n @results = {}\n @success = false\n end", "def merge_resultsets(result1, result2); end", "def merge_resultsets(result1, result2); end", "def process_test_results(force: false, xunit_viewer: \"xunit-viewer\")\n process_test_results_xunit(force: force, xunit_viewer: xunit_viewer)\n end", "def reset()\n @result = false\n @tests = 0\n end", "def exec\n question = Question.find(self.question_id)\n tmp = Time.now.to_i\n\n\t\t# Compila a resposta\n compile_result = Judge::compile(self.lang,self.response,tmp)\n\n\t\t# Verifica se houve erro de compilacao\n if compile_result[0] != 0\n self.compile_errors = compile_result[1]\n self.correct = false\n else\n\n\t\t\t# Se compilou, executa os casos de teste.\n correct = Judge::test(lang,compile_result[1],question.test_cases,tmp)\n\n self.results = Hash.new\n self.correct = true\n\t\t\t# para cada caso de teste salva os dados retornados\n\t\t\t# os dados retornados estarao na variavel 'r'\n\t\t\t# cada caso de teste tem seus dados armazenados no hash 'results'\n correct.each do |id,r|\n\n self.results[id] = Hash.new\n self.results[id][:error] = false\n self.results[id][:diff_error] = false\n self.results[id][:time_error] = false\n self.results[id][:exec_error] = false\n self.results[id][:presentation_error] = false\n self.results[id][:content] = question.test_cases.find(id).content\n\n self.results[id][:title] = question.test_cases.find(id).title\n self.results[id][:show_input_output] = question.test_cases.find(id).show_input_output\n\n if question.test_cases.find(id).show_input_output\n self.results[id][:input] = r[1][0]\n self.results[id][:output_expected] = r[1][1]\n end\n\n self.results[id][:output] = r[1][2]\n self.results[id][:id] = id\n\n\t\t\t\t# cada erro possui um numero de identificacao\n if r[0] == 3\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:diff_error] = true\n elsif r[0] == 2\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:presentation_error] = true\n elsif r[0] == 143 || r[0] == 141\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:time_error] = true\n elsif r[0] != 0\n self.correct = false\n self.results[id][:error] = true\n self.results[id][:exec_error] = true\n end\n\n\t\t\t\t# se o numero de tentativas for suficiente para mostrar dicas, salva a dica na resposta do caso de teste.\n if Answer.where(user_id: self.user_id, question_id: self.question_id, correct: false, compile_errors: nil).count >= question.test_cases.find(id).tip_limit-1 || self.correct\n self.results[id][:tip] = question.test_cases.find(id).tip\n end\n\n #self.results[id][:output2] = simple_format r[1][0]\n end\n end\n true\n end", "def on_test_result(node)\n id, passed, *nodes = *node\n if (passed && !failed_test_ids.include?(id)) ||\n (!passed && failed_test_ids.include?(id))\n process_all(nodes)\n end\n end", "def process_run_results(test_objects, run_type, start_time, run_id)\n @event_emitter.emit_event :info => 'Processing results. This may take a minute...'\n\n primary = []\n rerun = []\n @event_emitter.emit_event :update_stats => '' #this needs to be an object not a string. will implement later\n test_objects.each do |test|\n\n if run_type == :primary\n if test.results[:primary].nil?\n puts \"There was a test scheduled to run that didnt: #{test.id}\"\n end\n primary << test.results[:primary] unless test.results[:primary].nil?\n primary.flatten!\n elsif run_type == :rerun\n unless test.results[:rerun].nil?\n rerun << test.results[:rerun]\n rerun.flatten!\n end\n end\n\n end\n if run_type == :primary\n @results[:primary] = DATSauce::TestRunResult.new primary, start_time, run_id, 'primary'\n elsif run_type == :rerun\n @results[:rerun] = DATSauce::TestRunResult.new rerun, start_time, run_id, 'rerun'\n end\n end", "def normalize_result(result)\n end", "def remove_result(round)\n result = find_result(round)\n return unless result\n @results.delete(result)\n result\n end", "def update_test_link_with_result\n parse_test_plan #get the test plan name, if provided\n\n # Update result if all needed data exists\n if updateable?\n tl=TestLinkAPI.new\n # initialize cache, if it's not already\n unless defined?(@@id_cache)\n @@id_cache = Hash.new unless defined?(@@id_cache)\n #populate all test cases into cache\n test_cases = tl.get_test_case_ids_from_path(tst_project_name, (tst_folder_path + [tst_suite_name]))\n test_cases.each {|name, id| @@id_cache[name] = id}\n tcid = @@id_cache[tst_case_name]\n # cache the plan ID and build ID\n tpid = @@id_cache[tst_plan_name] = tl.getTestPlanIDByName(tst_plan_name, tst_project_name)\n @@id_cache[tst_plan_name + \":build\"] = tl.getLatestBuildIDForTestPlan(tpid) unless tpid.nil?\n end\n tcid = @@id_cache[tst_case_name]\n tpid = @@id_cache[tst_plan_name]\n bid = @@id_cache[tst_plan_name + \":build\"]\n tl.reportTCResult(tcid, tpid, tst_result, bid, run_notes) unless tcid.nil? || tpid.nil? || bid.nil?\n end\n end", "def manage_record_result(id, result)\n separator = @global_opts[:csv] ? \",\" : \": \"\n if @client.is_success?\n @response_data.root << result.at_xpath(RECORD_XPATH,\n \"marc\" => XMLNS_MARC\n )\n @response_status << id + separator + PAST_TENSE[@cmd] + \"\\n\"\n puts id + separator + PAST_TENSE[@cmd] if @global_opts[:verbose]\n @successes += 1\n else\n if @global_opts[:csv]\n @response_status << [id, \"failed\", result.to_s].to_csv\n else\n @response_status << id + separator + \"failed\\n\"\n @response_status << result.to_s\n end\n puts id + separator + \"failed\" if @global_opts[:verbose]\n @failures += 1\n end\n end", "def cleanup_with_test_runner\n cleanup_without_test_runner\n\n if defined? @run_result\n # Any tests that are still \"running\" are marked as complete.\n # Their results are set to \"unknown\" too.\n test_results = @test_database.get_running_test_results(@run_result)\n test_results.each do |test_result|\n test_result.status = Status::Complete\n test_result.result = Result::Unknown\n test_result.save\n end\n end\n end", "def run(result)\t\t\n\t\tcolumn_names = result.fields #store the column names\n\t\trow_count = result.num_tuples #get the number of rows in the result\n\t\tinitial_data = Array.new #payload holder\n result.each do |item|\n intial_data << item.to_ary\n end\t\t\n\t\tasrecordset = ASRecordset.new(row_count,column_names,initial_data)\n\t\tresult = asrecordset\n\t\tresults\n\tend", "def report_test_results(test_name, results)\n status = true\n message = \"\"\n for result in results\n # print (\"Status: \"+result[0].to_s+\"\\n\")\n status = (status && result[0])\n if (result[1].is_a?(Array))\n for m in result[1]\n message += m.to_s + \"\\n\\t\"\n end\n else\n message += result[1] + \"; \"\n end\n end\n\n report_test_result(test_name, status, message)\nend", "def store_result(result)\n synchronize_resultset do\n # Ensure we have the latest, in case it was already cached\n new_resultset = read_resultset\n\n # A single result only ever has one command_name, see `SimpleCov::Result#to_hash`\n command_name, data = result.to_hash.first\n new_resultset[command_name] = data\n File.open(resultset_path, \"w+\") do |f_|\n f_.puts JSON.pretty_generate(new_resultset)\n end\n end\n true\n end", "def prepare_result; end", "def set_result\n @result = Result.new\n end", "def test_results_filter(test_results)\n test_results.select do |tr|\n # Non TestResult items are never filtered.\n next true unless tr.kind_of?(Automation::TestDatabase::TestResult)\n entity_result(tr) != Automation::Result::Pass\n end\n end", "def prune_results(round_id)\n results = Round.find(round_id).results\n # Every Result must have at least 1 corr/skip/incorr\n rt = results.select{|t| t.num_correct+t.num_skipped+t.num_incorrect == 0}\n if rt.length > 0\n puts 'Destroying ' + rt.length.to_s + ' Result records without answers'\n rt.each{|t| t.destroy}\n end\n end", "def merged_result\n # conceptually this is just doing `merge_results(resultset_path)`\n # it's more involved to make syre `synchronize_resultset` is only used around reading\n resultset_hash = read_resultset\n command_names, coverage = merge_valid_results(resultset_hash)\n\n create_result(command_names, coverage)\n end", "def merge_results(*results); end", "def merge_results(*results); end", "def merge_results(*results); end", "def classificateResult(label, sampleMap, foundAllArr)\n puts \"[classificateResult] started label #{label}\"\n foundArr = foundAllArr.select{|found| matchLabels?(found.label, label)}\n expRecognitionResult = Spnt::Exp::Data::ExpRecognitionResult.new()\n expRecognitionResult.falseNegative = []\n expRecognitionResult.falsePostive = []\n #missed = sampleArr - foundArr\n #1 step. filter that was found and transform to array\n substituted = sampleMap.select{|ekey, sample|\n if(matchLabels?( label, sample.label))\n nil == foundArr.detect{|found| sample.ekey == found.ekey && found.shouldStart != @@UNDEFINED_CELL} \n end\n }.collect { |k, v| v }\n deleted =foundArr.select{|found|\n found.foundStart == nil || found.foundStart == @@UNDEFINED_CELL \n }\n inserted =foundArr.select{|found|\n found.shouldStart == nil || found.shouldStart == @@UNDEFINED_CELL \n }\n \n puts \"[classificateResult] %s substituted: %i\" % [label, substituted.length]\n puts \"[classificateResult] %s deleted: %i\" % [label, deleted.length]\n puts \"[classificateResult] %s inserted: %i\" % [label, inserted.length]\n\n expRecognitionResult.falseNegative = (expRecognitionResult.falseNegative << substituted).flatten\n expRecognitionResult.falseNegative = (expRecognitionResult.falseNegative << deleted).flatten\n expRecognitionResult.falsePostive = (expRecognitionResult.falsePostive << inserted).flatten\n \n puts \"[classificateResult] %s falseNegative: %i\" % [label, expRecognitionResult.falseNegative.length]\n puts \"[classificateResult] %s falsePostive: %i\" % [label, expRecognitionResult.falsePostive.length]\n\n\n puts \"[classificateResult]substituted: \" + substituted.collect{|v| \" %i => %s[%s]\" % [v.id, v.ekey, v.foundStart]}.join(\"; \")\n\n# foundDuplicates = {}\n# expRecognitionResult.correct = foundArr.select{|found|\n# sample = sampleMap[found.ekey]\n# if(sample != nil && matchLabels?( label, found.label))\n# if(found.foundStart == nil)\n# #puts \"[classificateResult]falseNegative [#{found.ekey}] no start: #{sample.shouldStart} #{found.foundStart}\"\n# expRecognitionResult.falseNegative << sample\n# false\n# else\n# absStartDelta = (sample.shouldStart - found.foundStart).abs\n# absEndDelta = (sample.shouldEnd - found.foundEnd).abs\n# matched = sample.ekey == found.ekey && absStartDelta <= @@thresholdStart && absEndDelta <= @@thresholdEnd\n# if matched == true\n# foundDuplicateElement = foundDuplicates[found.ekey]\n# if foundDuplicateElement == nil\n# foundDuplicateElement = []\n# foundDuplicates[found.ekey] = foundDuplicateElement\n# end\n# foundDuplicateElement << found\n# #puts \"foundDuplicates[#{sample.ekey}] #{foundDuplicates[sample.ekey].length} #{matched && foundDuplicates[sample.ekey].length == 1}\"\n# end\n# matched && foundDuplicates[sample.ekey].length == 1\n# end\n# else\n# false\n# end\n# }\n #expRecognitionResult.falsePostive = foundArr.select{|found| !expRecognitionResult.correct.include?(found) && !expRecognitionResult.falseNegative.include?(found)}\n# expRecognitionResult.correct = foundArr.select{|found|\n# expRecognitionResult.falsePostive.include?(found) && expRecognitionResult.falseNegative.include?(found)\n# }\n expRecognitionResult.correct = foundArr.to_set - expRecognitionResult.falsePostive.to_set - expRecognitionResult.falseNegative.to_set;\n puts \"falsePostive[#{expRecognitionResult.falsePostive.length}] + falseNegative[#{expRecognitionResult.falseNegative.length}]+correct[#{expRecognitionResult.correct.length}] = foundArr[#{foundArr.length}]\"\n expRecognitionResult\n end", "def generate_results!(key)\n generate_results(key, true)\n end", "def add_unranked_query_result\n \n @query_result = Retreval::UnrankedQueryResult.new :query => \"query1\", :gold_standard => @gold_standard\n \n for i in (1..4) do\n @query_result.add_document :id => \"doc#{i}\"\n end\n \n for i in (5..10) do\n @query_result.add_document :id => \"doc#{i}\"\n end\n \n end", "def create_result\n TestResult.new\n end", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def enter_result(test_data)\n hide_notifications_bar\n wait_for_element_and_type(result_text_area, test_data[UseOfCollections::RESULT.name])\n end", "def results; end", "def results; end", "def results; end", "def set_testrail_results(results, junit_file, testrun_id, dry_run = false)\n if not dry_run\n credentials = load_credentials(CREDENTIALS_FILE)\n api = get_testrail_api(credentials)\n else\n api = get_testrail_api( { \"testrail_username\" => 'name', \"testrail_password\" => 'pass' } )\n end\n\n\n # Results that couldn't be set in testrail for some reason\n bad_results = {}\n\n # passes\n results[:passes].each do |junit_result|\n begin\n submit_result(api, PASSED, junit_result, junit_file, testrun_id, dry_run)\n rescue MissingTestRailId, TestRail::APIError => e\n bad_results[junit_result[:name]] = e.message\n end\n end\n\n # Failures\n results[:failures].each do |junit_result|\n begin\n submit_result(api, FAILED, junit_result, junit_file, testrun_id, dry_run)\n rescue MissingTestRailId, TestRail::APIError => e\n bad_results[junit_result[:name]] = e.message\n end\n end\n\n # Skips\n results[:skips].each do |junit_result|\n begin\n submit_result(api, BLOCKED, junit_result, junit_file, testrun_id, dry_run)\n rescue MissingTestRailId, TestRail::APIError => e\n bad_results[junit_result[:name]] = e.message\n end\n end\n\n return bad_results\n end", "def set_test_result\n @test_result = TestResult.find(params[:id])\n end", "def set_test_result\n @test_result = TestResult.find(params[:id])\n end", "def set_last_result(result, code = \"\")\n @last_result_is_exception = false\n @output_ring << result\n\n self.last_result = result unless code =~ /\\A\\s*\\z/\n end", "def build_results\n # Which files can we ignore?\n @files_to_ignore = Set.new\n @diffs.each do |diff|\n next unless diff.change? && diff.type == 'File' && diff.structure == %w(parameters ensure)\n next unless ['absent', 'false', false].include?(diff.new_value)\n @files_to_ignore.add diff.title\n end\n\n # Based on that, which diffs can we ignore?\n @results = Set.new @diffs.reject { |diff| keep_diff?(diff) }\n end", "def synchronize_resultset; end", "def test_2022_batch_values\n hash = extract_result\n\n assert_includes hash[2][6], \"Daris\"\n assert_includes hash[3][5], \"Aurika\"\n assert_includes hash[3][17], \"Gerhards\"\n assert_includes hash[4][6], \"Dzintis\"\n assert_includes hash[4][20], \"Meija\"\n assert_includes hash[4][23], \"Jurgita\"\n assert_includes hash[9][17], \"Vaiva\"\n assert_includes hash[9][29], \"Jumis\"\n assert_includes hash[11][7], \"Pērle\"\n assert_includes hash[12][3], \"Ako\"\n end", "def run(results)\n if(use_multiple?(results))\n results = run_multiple(results)\n else\n results = run_single(results)\n end\n return results\n end", "def process(result)\n # :nocov:\n raise NotImplementedError\n # :nocov:\n end", "def post_process_results(original_results_directory = nil)\n puts ' ========================= Starting Results Post Process ================================'\n puts \"Current directory: #{@base_dir}\"\n puts \"Test results will be stored in: #{test_results_dir}\"\n\n results = OpenStudioMeasureTester::OpenStudioTestingResult.new(@base_dir, test_results_dir, original_results_directory)\n results.save_results # one single file for dashboard\n\n # call the create dashboard command now that we have results\n dashboard\n\n # return the results exit code\n return results.exit_code\n end", "def destroy\n submission = Submission.get_submission_by_grouping_id_and_assignment_id(\n params[:group_id], params[:assignment_id])\n\n test_result = submission.test_group_results\n .includes(:test_results)\n .find(params[:test_group_result_id])\n .test_results.find(params[:id])\n\n if test_result.destroy\n # Successfully deleted the TestResult; render success\n render 'shared/http_status', locals: { code: '200', message:\n HttpStatusHelper::ERROR_CODE['message']['200']}, status: 200\n else\n # Some other error occurred\n render 'shared/http_status', locals: { code: '500', message:\n HttpStatusHelper::ERROR_CODE['message']['500'] }, status: 500\n end\n rescue ActiveRecord::RecordNotFound => e\n # Could not find submission or test script result or test result\n render 'shared/http_status', locals: {code: '404', message:\n e}, status: 404\n end", "def next_result()\n #This is a stub, used for indexing\n end", "def parse_tests(records, expected_result)\n comment = nil\n records.each do |test|\n if test[0].is_a?(Array)\n if test.size != 3 || !test[1].is_a?(String) || !test[2].is_a?(String)\n raise \"Bad test: #{test.inspect} (#{test.size} #{test[1].class} #{test[2].class})\"\n end\n mapprevOutScriptPubKeys = {} # Outpoint => Script\n inputs = test[0]\n inputs.each do |input|\n raise \"Bad test: input is not an array: #{test.inspect}\" if !input.is_a?(Array)\n raise \"Bad test: input is an array of 3 items: #{test.inspect}\" if input.size != 3\n previd, previndex, scriptstring = input\n \n outpoint = BTC::Outpoint.new(transaction_id: previd, index: previndex)\n \n mapprevOutScriptPubKeys[outpoint] = parse_script(scriptstring)\n end\n \n tx = BTC::Transaction.new(hex: test[1])\n flags = parse_flags(test[2])\n \n if debug_filter(test)\n validation_proc = lambda do\n validation_passed = BTC::Validation.new.check_transaction(tx, BTC::ValidationState.new)\n if expected_result\n validation_passed.must_equal expected_result\n end\n script_passed = false\n \n if validation_passed\n tx.inputs.each do |txin|\n output_script = mapprevOutScriptPubKeys[txin.outpoint]\n raise \"Bad test: output script not found: #{test.inspect}\" if !output_script\n sig_script = txin.signature_script\n if !sig_script\n sig_script = BTC::Script.new(data: txin.coinbase_data)\n end\n \n checker = BTC::TransactionSignatureChecker.new(transaction: tx, input_index: txin.index)\n extensions = []\n extensions << BTC::P2SHExtension.new if (flags & BTC::ScriptFlags::SCRIPT_VERIFY_P2SH) != 0\n extensions << BTC::CLTVExtension.new if (flags & BTC::ScriptFlags::SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY) != 0\n interpreter = BTC::ScriptInterpreter.new(\n flags: flags,\n extensions: extensions,\n signature_checker: checker,\n raise_on_failure: expected_result,\n )\n #Diagnostics.current.trace do\n script_passed = interpreter.verify_script(signature_script: sig_script, output_script: output_script)\n if !script_passed\n break\n end\n #end\n end\n end\n (script_passed && validation_passed).must_equal expected_result\n end # proc\n \n yield(comment || test.inspect, validation_proc)\n end # if not filtered\n \n comment = nil\n else\n comment ||= \"\"\n comment += test[0].gsub(/\\.$/,\"\") + \". \"\n comment.gsub!(/\\. $/, \"\")\n end\n end\n end", "def process_results (results)\n\t\t\tresults.each do |result|\n\t\t\t\tresult = process_result(result)\n\t\t\tend\n\t\t\treturn results\n\t\tend", "def resultset; end", "def run_tests(query_type)\n test_data = load_test_data(query_type)\n num_tests = test_data.length\n\n @per_test_insert = test_data[0].key?(\"insert\")\n \n if !@per_test_insert and @insert_sql_data\n insertion_data = load_test_data(query_type, suffix=\"_insert\")\n insertion_data.each do |insert_command|\n @client.insert(insert_command)\n end\n\n sleep @sleep_time\n end\n\n test_data.each_with_index do |test, i|\n _query_type = query_type\n empty_column_translation\n\n puts \"(#{i + 1}/#{num_tests}) Executing test \\\"#{test['name']}\\\"\"\n\n if test.include? 'description'\n puts \" Description: #{test['description']}\"\n end\n puts \" Query type: #{query_type}\"\n\n begin\n if @per_test_insert\n create_columns test\n insert_data test\n sleep @sleep_time\n end\n if query_type == \"update\" or query_type == \"delete\"\n result_additional = run_additional_operations(query_type, test)\n if !result_additional\n next\n end\n _query_type = \"count_entity\"\n end\n\n result = execute_query(_query_type, test)\n rescue StandardError => e\n result = {\"result\" => {\"error\" => e.to_s}}\n if query_type == \"update\" or query_type == \"delete\"\n @num_fails += 1\n @failed_tests.push(test['name'])\n\n puts \" Result: #{result}\"\n puts \" Status: Failed\"\n end\n end\n\n compare_result(test, result)\n puts\n end\n end", "def execute_internal(_result)\n \n # use the testing keyword\n testing do |r|\n r.expect(1).to r.eq(2)\n end\n end", "def update!(**args)\n @results = args[:results] if args.key?(:results)\n end", "def update!(**args)\n @results = args[:results] if args.key?(:results)\n end", "def test_results\n test_result_string = ''\n test_result_string += \"Marquis test: #{marquis_test}. \" if marquis_test\n test_result_string += \"Mandelin test: #{mandelin_test}. \" if mandelin_test\n test_result_string += \"Mecke test: #{mecke_test}. \" if mecke_test\n test_result_string += \"Liebermann Test: #{liebermann_test}. \" if liebermann_test\n test_result_string += \"Froehde Test: #{froehde_test}. \" if froehde_test\n test_result_string += \"Gallic Acid Test: #{gallic_acid_test}. \" if gallic_acid_test\n test_result_string += \"Ehrlic Test: #{ehrlic_test}. \" if ehrlic_test\n test_result_string += \"Folin Test: #{folin_test}. \" if folin_test\n test_result_string += \"Robadope Test: #{robadope_test}. \" if robadope_test\n test_result_string += \"Simon's Test: #{simons_test}. \" if simons_test\n test_result_string += \"Scott Test: #{scott_test}. \" if scott_test\n test_result_string.strip\n end", "def process_unexpected_transactions()\t\t\n\t\tunexpected_uuids=[]\t\n\t\tparams=prepare_base_params()\t\n\t\tresult=server_rest_api(@transaction_restapi,params)\t\n\t\tresult.each do |res|\t\n\t\t\tif ! @output[:transactionInstances][:data][:expected_results].any?{ |h| ! h.nil? && ! h[:uuid].nil? && h[:uuid] == res[:uuid]} && ! @optional.any?{ |h| ! h.nil? && h[:name] == res[:name]}\n\t\t\t\t@output[:transactionInstances][:data][:not_expected_results].push({:name => res[:name], :uuid=> res[:uuid], :tr_exist => true, :tr_status => false})\t\t\n\t\t\t\t@output[:transactionInstances][:failed_count]+=1\t\t\n\t\t\tend\t\t\t\n\t\tend\tunless result.nil?\n\t\t@output[:transactionInstances][:total_count]=@output[:transactionInstances][:failed_count] + @output[:transactionInstances][:success_count]\n\t\t@output[:transactionInstances][:success_rate]=(@output[:transactionInstances][:total_count] == 0) ? 0 : ( ( @output[:transactionInstances][:success_count].to_f / @output[:transactionInstances][:total_count] ) * 100).round(2)\n\t\t@output[:workUnits][:total_count]=@output[:workUnits][:failed_count] + @output[:workUnits][:success_count]\n\t\t@output[:workUnits][:success_rate]=(@output[:workUnits][:total_count] == 0) ? 0 : ( ( @output[:workUnits][:success_count].to_f / @output[:workUnits][:total_count] ) * 100).round(2)\t\t\n\t\t@output[:workUnitAttributes][:total_count]=@output[:workUnitAttributes][:failed_count] + @output[:workUnitAttributes][:success_count]\n\t\t@output[:workUnitAttributes][:success_rate]=(@output[:workUnitAttributes][:total_count] == 0) ? 0 : ( ( @output[:workUnitAttributes][:success_count].to_f / @output[:workUnitAttributes][:total_count] ) * 100).round(2)\t\t\n\tend", "def process_result(player, result)\n result_object = nil\n self.results.to_a.each do |result|\n if result.player == player\n result_object = result\n end\n end\n result_object.value = result\n result_object.save!\n calculate\n end", "def run( result )\n\t\tprint_test_header self.name\n\t\tsuper\n\tend", "def reconstruct_xml_results\n ReportLog.entering(@@class_name, __method__.to_s)\n Dir.mkdir @output_xml_dir unless Dir.exist? @output_xml_dir\n get_test_xml_files.each do |xml_path|\n xml_input_file = File.new(xml_path)\n ReportLog.info(\"Writing additional info (test suite owner and RTC defect etc.) into new test result XML file in directory #{@output_xml_dir}...\")\n # using File.open block pattern to ensure the file is closed afterwards\n File.open(@output_xml_dir + '/' + File.basename(xml_path), 'w') do |xml_output_file|\n write_to_xml(xml_input_file, xml_output_file)\n end\n end\n ReportLog.exiting(@@class_name, __method__.to_s)\n end", "def context_return_value(desired_test_result)\n raise 'desired_test_result value must be either \"pass\" or \"fail\"' unless\n %w[pass fail].include?(desired_test_result)\n\n if desired_test_result == 'fail'\n 'returns offending logical resource id'\n else\n 'returns empty list'\n end\nend", "def test_print_results\n @d.add_book\n @d.add_book\n @d.add_book\n @d.add_book\n @d.add_dino\n @d.add_dino\n @d.add_dino\n @d.add_class\n @d.add_class\n assert_output(\"Driver 1 obtained 4 books!\\nDriver 1 obtained 3 dinosaur toys!\\nDriver 1 attended 4 classes!\\n\") { @d.print_results }\n end", "def finish\n @test_output = @test_output.join.split(\"\\n\")\n @test_description = @test_output.shift\n end" ]
[ "0.6645193", "0.66376686", "0.6630972", "0.65602446", "0.650284", "0.64844567", "0.64429146", "0.64163446", "0.63618034", "0.63436174", "0.63162977", "0.6291909", "0.6253884", "0.6211486", "0.61765534", "0.61069846", "0.61049044", "0.60897076", "0.607499", "0.6031293", "0.59827346", "0.5967522", "0.59314215", "0.5919919", "0.5909773", "0.5869041", "0.58633435", "0.585326", "0.5849463", "0.582801", "0.5819019", "0.58005065", "0.57802874", "0.5755164", "0.57540435", "0.5732563", "0.57287705", "0.5716112", "0.56846124", "0.5678042", "0.5668488", "0.56545943", "0.56545645", "0.56470877", "0.56382316", "0.5627324", "0.5623236", "0.562227", "0.56195444", "0.56054986", "0.56033486", "0.56023455", "0.5597909", "0.5595323", "0.55908537", "0.558912", "0.5585305", "0.5585296", "0.5577638", "0.5569277", "0.55637217", "0.5540405", "0.5540405", "0.55403614", "0.55346566", "0.5520469", "0.55121636", "0.5499703", "0.54909134", "0.5490216", "0.5488692", "0.5488692", "0.5488692", "0.5470438", "0.54671377", "0.54671377", "0.54638773", "0.54632056", "0.5462279", "0.5459521", "0.54586774", "0.54532504", "0.54521203", "0.5448797", "0.5445141", "0.54333967", "0.54205704", "0.5416609", "0.54130113", "0.5408804", "0.54029614", "0.54029614", "0.5396569", "0.5390249", "0.5389181", "0.53855485", "0.53830063", "0.53798866", "0.53788215", "0.5374619" ]
0.56286865
45
Verifies that the result matches test data
def verify_result(test_data) verify_values_match(test_data[CoreUseOfCollectionsData::RESULT.name], element_value(result_text_area)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify_result(test_data)\n verify_values_match(test_data[UseOfCollections::RESULT.name], element_value(result_text_area))\n end", "def verify_result(expect, model)\n puts \"running query: #{build_query(model)}\"\n result = search(build_query(model))\n assert_equal(expect.size, result.hit.size)\n expect.each_with_index do |expected_sub_scores,i|\n jsf = result.hit[i].field['summaryfeatures']\n sub_scores = extract_subscores(jsf, model.size)\n assert_equal(expected_sub_scores, sub_scores,\n \"subscores differ for hit #{i}: #{expected_sub_scores} != #{sub_scores}\")\n end\n end", "def compare_result(test, result)\n if @per_test_insert\n expected = translate_column_names(test['expected'])\n else\n expected = test['expected']\n end\n expected.each do |key, value|\n if value == 'ignore'\n next\n end\n\n if !compare_values(value, result[key])\n @num_fails += 1\n @failed_tests.push(test['name'])\n\n puts \" Expected: \\\"#{key}\\\": #{value}\"\n puts \" Result: \\\"#{key}\\\": #{result[key]}\"\n puts \" Status: Failed\"\n return\n end\n end\n\n @num_successes += 1\n puts \" Status: Passed\"\n end", "def test_verify_data_positions\n result = verify_data_positions(@warehouse_data)\n assert_equal(true,result)\nend", "def verify_operation_result(actual)\n expected = test_instance.expected_outcome.result\n if expected.is_a?(Array)\n if expected.empty?\n expect(actual).to be_empty\n else\n expected.each_with_index do |expected_elt, i|\n verify_result(expected_elt, actual[i])\n end\n end\n else\n verify_result(expected, actual)\n end\n end", "def verify_result()\n #puts \"{#@recode}\" \"return code\"\n #puts \"{#@expect_code}\" \"expect code\"\n # method to show object's type, include both basic type and class type.\n #puts @recode.class\n #puts @expect_code.class\n # to_i to interger\n # to_f to float\n # to_s to string\n \n if @recode == @expect_code.to_s\n @output.puts \"Verification Success\"\n puts \"Verification Success\"\n\n else\n @output.puts \"ERROR: Verification Failiure errorcode:\" + @recode + \" errormsg:\" + @remsg\n puts \"ERROR: Verification Failiure error code:\" + @recode + \" errormsg:\" + @remsg\n end\n\n end", "def test_exercise_113\n verify_method :exercise_113,\n :with => [{param: '1 2 3', expect: false},\n {param: '1 1 1', expect: true}]\n end", "def dataTest data\n failure = RubyUnit::AssertionFailure.new(data)\n assertEqual data, failure.data, 'Assertion data Hash is incorrect'\n end", "def check_solution(test_number, argument, expected)\n actual = fields(argument)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test\n false_good, true_bad = get_counts(@testing_bad)\n true_good, false_bad = get_counts(@testing_good)\n\n correct = true_good.length + true_bad.length\n total = correct + false_bad.length + false_good.length\n ratio = format_ratio(1.0 * correct / total)\n\n bad_total = false_good.length + true_bad.length\n bad_ratio = format_ratio(1.0 * true_bad.length / bad_total)\n\n good_total = true_good.length + false_bad.length\n good_ratio = format_ratio(1.0 * true_good.length / good_total)\n\n puts \"Accuracy: #{ratio} (#{correct} of #{total})\"\n\n puts \"Bad commit accuracy: #{bad_ratio} (#{true_bad.length} of #{bad_total})\"\n print_failures(true_bad)\n\n puts \"Good commit accuracy: #{good_ratio} (#{true_good.length} of #{good_total})\"\n print_failures(true_good)\n end", "def verify_operation_result(expected, actual)\n if expected.is_a?(Array)\n if expected.empty?\n expect(actual).to be_empty\n else\n expected.each_with_index do |expected_elt, i|\n # If the YAML spec test does not define a result,\n # do not assert the operation's result - the operation may\n # have produced a result, the test just does not care what it is\n if expected_elt\n verify_result(expected_elt, actual[i])\n end\n end\n end\n else\n verify_result(expected, actual)\n end\n end", "def dataset_data_match?(domo_client, dataset_id, expected_data, should_fail=false)\n data = export_dataset(domo_client, dataset_id)\n\n if data.nil?\n unless expected_data.nil?\n puts \"Got no data back from Domo.\"\n puts \"Expected data: #{expected_data}\"\n return false\n end\n return true\n end\n\n if expected_data.is_a? Hash\n return false unless data.size == 1\n data = data[0]\n end\n\n # Sort the expected and actual data so we don't go chasing down row order differences.\n unless data.is_a? Hash\n data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n unless expected_data.is_a? Hash\n expected_data.sort! { |a,b| b[\"Event Name\"] <=> a[\"Event Name\"] }\n end\n\n unless data == expected_data\n missing_data = Array.new\n expected_data.each do |d|\n unless data.include? d\n missing_data << d\n end\n end\n unless should_fail\n puts \"-----\"\n puts \"Actual data length: #{data.length}\"\n puts \"Expected data length: #{expected_data.length}\"\n puts \"-----\"\n puts \"Missing Data\"\n puts missing_data\n puts \"-----\"\n puts \"Actual Data\"\n puts data\n puts \"-----\"\n end\n return false\n end\n true\n end", "def test_exercise_115\n verify_method :exercise_115,\n :with => [{param: [0.8, 0.8], expect: true},\n {param: [0.1, 0.1], expect: true},\n {param: [0.9, 0.9], expect: true},\n {param: [1, 1], expect: false},\n {param: [0, 0], expect: false}]\n end", "def pass?\n expected_array.size == actual_array.size &&\n [expected_array, actual_array].transpose.all? do |expected_element, actual_value|\n expected_element.match_against_actual_value(actual_value)\n end\n end", "def assert_results(expected, actual, message = nil)\n assert_equal(expected.size, actual.size, \"Size of results. #{message}\")\n expected.each_with_index {|result, index|\n assert_equal((index + 1).to_s, actual[index].place.to_s, \"place for #{result}. #{message}\")\n assert_equal(result.person, actual[index].person, \"person for #{result}. #{message}\")\n assert_equal(result.time, actual[index].time, \"time for #{result}. #{message}\")\n }\n end", "def assert_results(expected, actual, message = nil)\n assert_equal(expected.size, actual.size, \"Size of results. #{message}\")\n expected.each_with_index {|result, index|\n assert_equal((index + 1).to_s, actual[index].place.to_s, \"place for #{result}. #{message}\")\n assert_equal(result.person, actual[index].person, \"person for #{result}. #{message}\")\n assert_equal(result.time, actual[index].time, \"time for #{result}. #{message}\")\n }\n end", "def test_hash_mismatch\n v = Verify.new\n return_code = v.verify_second_pipeset('1as3', '2as3')\n assert_equal 2, return_code\n end", "def valid?\n expected = {}\n\n count = 0\n self.each_unsafe do |k,v|\n return false if @data[k][2] != v\n count += 1\n end\n count == @data.count\n end", "def test_exercise_1124\n verify_method :exercise_1124,\n :with => [{params: [1111111, 1234567], expect: 1},\n {params: [33 * 7, 33 * 23], expect: 33},\n {params: [41 * 13, 41 * 29], expect: 41}]\n\n end", "def test_exercise_1128\n verify_method :exercise_1128,\n :with => [{param: [0, 0, 1, 2, 3, 3], expect: [0, 1, 2, 3]},\n {param: [0, 1, 2, 3], expect: [0, 1, 2, 3]},\n {param: [0, 0], expect: [0]},\n {param: [0], expect: [0]}]\n end", "def test_csv_table_match(subject)\n # Compare the fields\n if !subject.empty?\n subject_fields = subject[0].keys\n master_fields = @golden_master.headers\n\n if subject_fields.count != master_fields.count\n throw_no_match \"Expected #{master_fields.count} field(s), got #{subject_fields.count}\"\n end\n\n master_fields.each_with_index do |column, index|\n if column != subject_fields[index]\n throw_no_match \"Expected field \\\"#{column}\\\", got field \\\"#{subject_fields[index]}\\\"\"\n end\n end\n end\n\n # Compare the number of records\n subject_record_count = subject.count\n master_record_count = @golden_master.inject(0){|count| count += 1}\n if subject_record_count != master_record_count\n throw_no_match \"Expected #{master_record_count} record(s), got #{subject_record_count}\"\n end\n\n # Compare the values of the golden master with the subject\n current_row = 0\n @golden_master.each do |row|\n row.each do |field, master_string|\n subject_value = subject[current_row][field]\n if !match_values?(master_string, subject_value)\n throw_no_match \"Field \\\"#{field}\\\", Record #{current_row + 1}: Expected value #{master_string.nil? ? '<NULL>' : \"\\\"#{master_string}\\\"\"}, got #{subject_value.nil? ? '<NULL>' : \"\\\"#{subject_value}\\\"\"}\"\n end\n end\n current_row += 1\n end\n end", "def assertEquals(results, expected, msg)\n puts \"#{calling_method}: #{msg}\\n\"\n if(results != expected)\n puts \"Expected #{expected} not #{results}\\n\"\n return false\n end\n \n return true\n end", "def verifyEqual(exp_val,act_val)\n assert_equal(exp_val, act_val,\"Wrong value Expected #{exp_val} Actual #{act_val}\")\n end", "def is_correct?\n self.match.final_result == selected_result\n end", "def test_truth\n end", "def test_check_hash_equal\r\n assert_equal true, @g.check_hash(1, 1)\r\n end", "def check_solution(test_number, array, expected)\n actual = is_sorted?(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def check_solution(test_number, array, expected)\n actual = is_sorted?(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def validate_answer(answer)\n answer == @result\n end", "def assert_valid\n @validator = validator\n assert @validator.validate(data_sample, fail_fast: true)\n assert @validator.validate(data_sample, fail_fast: false)\n end", "def test_exercise_119\n verify_method :exercise_119,\n :with => [{param: 1, expect: '1'},\n {param: 2, expect: '10'},\n {param: 3, expect: '11'},\n {param: 8, expect: '1000'},\n {param: 11, expect: '1011'}]\n end", "def test_prev_hash_correct_true\n assert @bv.prev_hash_correct?(0, \"abcd\", \"abcd\")\n end", "def check_solution(test_number, array, expected)\n actual = find_peaks(array)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_not_same_value_as\n #G\n white_pair = PAIR_OF_4\n black_value = VALUE_2\n\n #W\n result = white_pair.same_value? black_value\n\n #T\n assert_false result\n end", "def assert_equal_station station, sample_station\n if station.instance_of?(Station) && sample_station.instance_of?(Station)\n return assert(station.abbreviation == sample_station.abbreviation && station.est.include_all?(sample_station.est), \"Estimates should be equal\")\n end\n false\n end", "def test_exercise_1122\n verify_method :exercise_1122,\n :with => [{\n params: [0, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 0, hi: 1\\n\"\n },\n {\n params: [5, [0, 1, 2, 3, 4, 5]],\n expect: \"lo: 0, hi: 5\\n\\tlo: 3, hi: 5\\n\\t\\tlo: 5, hi: 5\\n\"\n }]\n end", "def test_appellation_validity\n assert @valid_appellation_1.valid?\n assert @valid_appellation_2.valid?\n end", "def verify_collection_data(actual_collection_data)\n expected_collection_data = test_instance.outcome_collection_data\n if expected_collection_data.nil?\n expect(actual_collection_data).to be nil\n elsif expected_collection_data.empty?\n expect(actual_collection_data).to be_empty\n else\n expect(actual_collection_data).not_to be nil\n expected_collection_data.each do |doc|\n expect(actual_collection_data).to include(doc)\n end\n actual_collection_data.each do |doc|\n expect(expected_collection_data).to include(doc)\n end\n end\n end", "def test_same_tv_show\n result = same_tv_show(@people)\n assert_equal({\"Pokemon\" => [\"Keith\", \"Val\"]}, result)\nend", "def verify_object_info_data(data_set)\n logger.debug \"Checking object number #{data_set[CoreObjectData::OBJECT_NUM.name]}\"\n object_data_errors = []\n text_values_match?(data_set[CoreObjectData::OBJECT_NUM.name], element_value(object_num_input), object_data_errors)\n\n other_nums = data_set[CoreObjectData::OTHER_NUM.name]\n other_nums && other_nums.each do |num|\n index = other_nums.index num\n text_values_match?(num[CoreObjectData::NUM_VALUE.name], element_value(other_num_num_input index), object_data_errors)\n text_values_match?(num[CoreObjectData::NUM_TYPE.name], element_value(other_num_type_input index), object_data_errors)\n end\n\n num_objects = data_set[CoreObjectData::NUM_OBJECTS.name]\n num_objects && text_values_match?(num_objects.to_s, element_value(num_objects_input), object_data_errors)\n\n collection = data_set[CoreObjectData::COLLECTION.name]\n collection && text_values_match?(collection, element_value(collection_input), object_data_errors)\n\n resp_depts = data_set[CoreObjectData::RESPONSIBLE_DEPTS.name]\n resp_depts && resp_depts.each { |dept| text_values_match?(dept[CoreObjectData::RESPONSIBLE_DEPT.name], element_value(resp_dept_input resp_depts.index(dept)), object_data_errors) }\n\n pub_to_list = data_set[CoreObjectData::PUBLISH_TO_LIST.name]\n pub_to_list && pub_to_list.each { |pub| text_values_match?(pub[CoreObjectData::PUBLISH_TO.name], element_value(publish_to_input pub_to_list.index(pub)), object_data_errors) }\n\n status = data_set[CoreObjectData::RECORD_STATUS.name]\n status && text_values_match?(status, element_value(record_status_input), object_data_errors)\n\n inv_statuses = data_set[CoreObjectData::INVENTORY_STATUS_LIST.name]\n inv_statuses && inv_statuses.each { |stat| text_values_match?(stat[CoreObjectData::INVENTORY_STATUS.name], element_value(inventory_status_input inv_statuses.index(stat)), object_data_errors) }\n\n brief_descrips = data_set[CoreObjectData::BRIEF_DESCRIPS.name]\n brief_descrips && brief_descrips.each { |descrip| text_values_match?(descrip[CoreObjectData::BRIEF_DESCRIP.name], element_value(brief_desc_text_area brief_descrips.index(descrip)), object_data_errors) }\n\n dist_feat = data_set[CoreObjectData::DISTINGUISHING_FEATURES.name]\n dist_feat && text_values_match?(dist_feat, element_value(dist_features_text_area), object_data_errors)\n\n comments = data_set[CoreObjectData::COMMENTS.name]\n comments && comments.each { |comment| text_values_match?(comment[CoreObjectData::COMMENT.name], element_value(comment_text_area comments.index(comment)), object_data_errors) }\n\n titles = data_set[CoreObjectData::TITLE_GRP.name]\n titles && titles.each do |title|\n index = titles.index title\n text_values_match?(title[CoreObjectData::TITLE.name], element_value(title_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_TYPE.name], element_value(title_type_input index), object_data_errors)\n text_values_match?(title[CoreObjectData::TITLE_LANG.name], element_value(title_lang_input index), object_data_errors)\n\n translations = title[CoreObjectData::TITLE_TRANSLATION_SUB_GRP.name]\n translations && translations.each do |trans|\n sub_index = translations.index trans\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION.name], element_value(title_translation_input [index, sub_index]), object_data_errors)\n text_values_match?(trans[CoreObjectData::TITLE_TRANSLATION_LANG.name], element_value(title_translation_lang_input [index, sub_index]), object_data_errors)\n end\n end\n\n obj_names = data_set[CoreObjectData::OBJ_NAME_GRP.name]\n obj_names && obj_names.each do |name|\n index = obj_names.index name\n text_values_match?(name[CoreObjectData::OBJ_NAME_NAME.name], element_value(object_name_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_CURRENCY.name], element_value(object_name_currency_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LEVEL.name], element_value(object_name_level_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_SYSTEM.name], element_value(object_name_system_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_TYPE.name], element_value(object_name_type_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_LANG.name], element_value(object_name_lang_input index), object_data_errors)\n text_values_match?(name[CoreObjectData::OBJ_NAME_NOTE.name], element_value(object_name_note_input index), object_data_errors)\n end\n\n object_data_errors\n end", "def display_results\r\n if @errors.empty?\r\n if @test_diff.empty?\r\n @out.puts \"Output matches exactly\"\r\n else\r\n @out.puts \"Test diff:\"\r\n @out.puts @test_diff\r\n end\r\n else\r\n @errors.each {|error| @out.puts error }\r\n end\r\n end", "def test_standard_credit_results\n @standard_credit_Value.each { |key, value| assert_in_delta @calc_standard[@row_number][key], value, 0.03 }\n check_count @calc_standard\n end", "def verifierCorrect()\n return @solution.equals(@partie.getCurrentGrid())\n end", "def pix_feed_compare\n test_plan.expected = PatientIdentifier.new params[:patient_identifier]\n\n test_plan.patient.patient_identifiers.each do |pi|\n if test_plan.matches_expected? pi\n test_plan.pass\n break\n end\n end\n\n unless test_plan.passed?\n test_plan.fail\n end\n\n redirect_to test_plans_url\n end", "def test_result_content_should_match_provided_array_content\n @scenarios.each do |scenario|\n expectation = scenario[:expectation].with_indifferent_access[:artworks]\n result = GoogleImageSearch.search(q: scenario[:search_keyword]).with_indifferent_access[:artworks]\n\n 0.upto(expectation.length - 1) do |index|\n assert_equal expectation[index], result[index], \"unexpected result at #{(index+1).ordinalize} thumbnail\"\n end\n end\n end", "def test_num_transactions_correct_not_0_true\n assert @bv.num_transactions_correct?(1, [0,2,3])\n end", "def valid?(result)\n log(result)\n\n true\n end", "def test_hash_match\n v = Verify.new\n return_code = v.verify_second_pipeset('as3', 'as3')\n assert_equal 0, return_code\n end", "def test_exercise_1113\n verify_method :exercise_1113,\n :with => [{param: [[0]], expect: [[0]]},\n {param: [[0, 1]],\n expect: [[0],\n [1]]},\n {param: [[0, 1],\n [2, 3]],\n expect: [[0, 2],\n [1, 3]]}]\n\n end", "def check_solution(test_number, string, expected)\n actual = compress_string(string)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def check_solution(test_number, string, expected)\n actual = compress_string(string)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def test_num_transactions_correct_0_true\n assert_equal(false, @bv.num_transactions_correct?(0, [0,1]))\n end", "def check_data_values(data)\n data.each do |id, values|\n out, back = values[values.keys[0]], values[values.keys[1]]\n if back > out\n puts \"+%s+\" % [\"-\" * 57]\n puts \"|%32s%26s\" % [\"WARNING\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n puts \"%s%21s\" % [\"| Bad data record! -- sample #{id}\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[0]} --\", \"#{dose_unit_text(values[values.keys[0]])}/day,\", \"|\"]\n puts \"%s%15s%22s\" % [\"| PDE in #{values.keys[1]} --\", \"#{dose_unit_text(values[values.keys[1]])}/day.\", \"|\"]\n puts \"%s%7s\" % [\"| Sample #{id} will not include in the analysis!\", \"|\"]\n puts \"+%s+\" % [\"-\" * 57]\n data.delete(id)\n end\n end\n data\n end", "def verify\n end", "def assert_test_result_valid(test_target_instance, member, test_case_name, value, weighted_value = nil, test_results_size = 1)\n test_case = TestCase.where(name: test_case_name, test_target_id: test_target_instance.test_target_id).first\n\n test_results = TestResult.where(test_case_id: test_case.id, test_target_instance_id: test_target_instance.id, created_by: member.id)\n assert_equal(test_results_size, test_results.size)\n\n weighted_value ||= test_results.inject {|weight_result, result| weight_result.value | result.value}.value\n\n weighted_test_results = WeightedTestResult.where(test_case_id: test_case.id, test_target_instance_id: test_target_instance.id)\n assert_equal(1, weighted_test_results.size)\n assert_equal(weighted_value, weighted_test_results.first.value)\n end", "def validate()\n validation_errors = []\n @expected_results.each_pair do |key,expected_result|\n result_key = expected_result[\"population_ids\"].dup\n\n reported_result, errors = extract_results_by_ids(expected_result['measure_id'], result_key)\n @reported_results[key] = reported_result\n validation_errors.concat match_calculation_results(expected_result,reported_result)\n end\n\n validation_errors\n end", "def test_second_table_has_correct_length\n assert_equal( 2, @result.values.last.size )\n end", "def test_type_match(subject)\n if !is_well_formed_query_result?(subject)\n throw_no_match \"Can perform query matches only against a well formed query result subject\"\n end\n \n if (@golden_master.kind_of? Array) && !is_well_formed_query_result?(@golden_master)\n throw_no_match \"Cannot match against a non-well formed golden master array\"\n end\n end", "def verify()\n # TODO\n end", "def compare_tests(test_a, test_b); end", "def compare_tests(test_a, test_b); end", "def test_complete_sudoku_true\n assert_equal(true, @c_sudoku_1.sudoku_complete?(@c_sudoku_1))\n end", "def verify\n\n end", "def compare_db_results(e, sequel_result, debug = false)\n results = sequel_result.all\n \n if (debug)\n puts(\"Expected:\")\n puts(e.length)\n p(e)\n puts(\"Actual:\")\n puts(results.length)\n p(results)\n end\n expect(results.length).to eq(e.length)\n (0...e.length).each do |i|\n a = results[i].values\n expect(a.length).to eq(e[i].length)\n (0...e[i].length).each do |j|\n expect(a[j]).to eq(e[i][j])\n end\n end\n end", "def matches?\n @actual == @expected\n end", "def report expected, actual\n if expected == actual\n puts \"Yes, found '#{actual}'\"\n else\n puts \"Failed, found '#{actual}' but was expecting '#{expected}'\"\n end\nend", "def test_annuity_credit_results\n @annuity_credit_Value.each { |key, value| assert_in_delta @calc_annuity[@row_number][key], value, 0.03 }\n check_count @calc_annuity\n end", "def test_true_for_ravenclaw()\n result = true_for_ravenclaw( [ 'Hufflepuff', 'Slytherin', 'Gryffindor', 'Ravenclaw' ], 'Ravenclaw' )\n assert_equal(true, result)\n end", "def validate(parsed_data)\n graph_name = load_data parsed_data\n \n begin \n results = @tests.map do |test|\n run_test(test, graph_name)\n end\n ensure\n clear_graph graph_name\n end\n\n # Remove empty results\n results.flatten.reject(&:empty?)\n end", "def check_result(filename, result, must_fail, tag)\n if must_fail && !result.match(/^No search results$/)\n s = \"\"\n s << \"This case must be failed (type unsafe)\\n\"\n\n return s\n end\n\n if File.exists?(filename)\n content = File.read(filename)\n if result != content\n s = \"\"\n s << \"===== expect:\\n\"\n s << content\n s << \"\\n\"\n s << \"===== actual:\\n\"\n s << result\n s << \"\\n\"\n s << \"=====\"\n\n return s\n else\n return nil\n end\n\n else\n if result.length > 0\n puts \"[!] WARNING: no test for #{tag} (#{filename}) ===== \"\n\n # auto_generate_testcase(filename, result)\n\n puts result\n puts \" \" + \"=\" * 20\n end\n\n return nil\n end\nend", "def test_check_hash_unequal\r\n assert_equal false, @g.check_hash(1, 0)\r\n end", "def check_solution(test_number, array, target, expected)\n actual = linear_search(array, target)\n if actual != expected\n puts \"Test ##{test_number}: Incorrect value: got #{actual}, expected #{expected}\"\n return false\n end\n\n puts \"Test ##{test_number}: Correct\"\n return true\nend", "def verify\n end", "def test_exercise_1111\n verify_method :exercise_1111,\n :with => [{param: [[true]], expect: \" 1\\n1*\\n\"},\n {param: [[false]], expect: \" 1\\n1 \\n\"},\n {param: [[true, false]], expect: \" 12\\n1* \\n\"},\n {param: [[true, false], [true, false]], expect: \" 12\\n1* \\n2* \\n\"}]\n end", "def test_exercise_1115\n verify_method :exercise_1115,\n :with => [{params: [[0], 1], expect: [1]},\n {params: [[0], 2], expect: [1, 0]},\n {params: [[1, 1], 2], expect: [0, 2]},\n {params: [[1, 2, 3, 3, 3, 4], 5], expect: [0, 1, 1, 3, 1]}]\n end", "def test_contains_13_eachsuit\n assert true == false\n end", "def given_block\n examples = [\n [{ :year => '2018', :make => 'fo', :model => 'focus', :trim => 'blank' },\n { :year => 2018, :make => 'Ford', :model => 'Focus', :trim => nil }],\n [{ :year => '200', :make => 'blah', :model => 'foo', :trim => 'bar' },\n { :year => '200', :make => 'blah', :model => 'foo', :trim => 'bar' }],\n [{ :year => '1999', :make => 'Chev', :model => 'IMPALA', :trim => 'st' },\n { :year => 1999, :make => 'Chevrolet', :model => 'Impala', :trim => 'ST' }],\n [{ :year => '2000', :make => 'ford', :model => 'focus se', :trim => '' },\n { :year => 2000, :make => 'Ford', :model => 'Focus', :trim => 'SE' }]\n ]\n\n examples.each_with_index do |(input, expected_output), index|\n if (output = normalize_data(input)) == expected_output\n puts \"Example #{index + 1} passed!\"\n else\n puts \"Example #{index + 1} failed,\n Expected: #{expected_output.inspect}\n Got: #{output.inspect}\"\n end\n end\n end", "def get_testable_data\n wrong.length > 0 ? wrong : right\n end", "def assert(expected, output)\n left = expected.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n right = output.to_s.gsub(/\\s+/, ' ').gsub(/>\\s+</, '><').strip\n nodiff = left.scan(/./).sort == right.scan(/./).sort\n unless ( nodiff )\n puts \"\\nERROR in comparaison\\n\"\n puts \"EXPECTED : #{left}\"\n puts \"RETURNED : #{right}\"\n end\n nodiff.should == true\n end", "def test_validate_user_info\n data = {\n username: \"\",\n password: \"1234567890\",\n password_confirmation: \"1234567890\",\n firstname: \"Anh\",\n lastname: \"Hoang\",\n avatar: \"avatar.png\",\n address: \"111D Ly Chinh Thang\",\n city: \"Ho Chi Minh\",\n email: \"anh@gmallds.sl\",\n mobile: \"0309433343545\",\n gender: 1,\n birthday: \"1991/10/10\"\n }\n #Call function insert_user in model V1::User\n user = V1::User.insert_user(data)\n\n #Get value code which is returned when call function insert_user\n actual = user[:meta][:code]\n\n expected = 1001\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_equals\n result = Person.new(\"Fred\", \"Jones\", 34) == Person.new(\"Fred\", \"Jones\", 34)\n assert_equals(true, result, \"The same person was not found to be equal.\")\nend", "def test(msg, expected, actual)\n if expected == actual\n puts \"pass!! #{msg}\"\n else\n puts \"fail!! #{msg}\"\n end\nend", "def test_true\n\t\tassert_equal(true, winning_numbers(4,[1,2,3,4]))\n\tend", "def test_function_update_token_unsuccessfully\n user_id = \"wrong-id\"\n #Get value boolean which is returned when call function update_token\n actual = V1::User.update_token(user_id)\n\n expected = false\n #Show result of this function(true=>pass)\n puts this_method_name + \" - \" +assert_equal(expected, actual).to_s\n end", "def test_unranked_recall\n\n add_test_judgements \n add_unranked_query_result\n assert_equal(1.0, @query_result.statistics[:recall])\n \n end", "def test_contains_four_eachface\n assert true == false\n end", "def test_failure\n \t\tassert_equal(@c,(@a+@b))\n \tend", "def test_num_transactions_correct_0_true\n assert @bv.num_transactions_correct(0, [0])\n end", "def test_values_are_arrays_of_hashes\n @result.values.each do |table|\n assert_instance_of( Array, table )\n table.each do |entry|\n assert_instance_of( Hash, entry )\n end\n end\n end", "def parse_tests(records, expected_result)\n comment = nil\n records.each do |test|\n if test[0].is_a?(Array)\n if test.size != 3 || !test[1].is_a?(String) || !test[2].is_a?(String)\n raise \"Bad test: #{test.inspect} (#{test.size} #{test[1].class} #{test[2].class})\"\n end\n mapprevOutScriptPubKeys = {} # Outpoint => Script\n inputs = test[0]\n inputs.each do |input|\n raise \"Bad test: input is not an array: #{test.inspect}\" if !input.is_a?(Array)\n raise \"Bad test: input is an array of 3 items: #{test.inspect}\" if input.size != 3\n previd, previndex, scriptstring = input\n \n outpoint = BTC::Outpoint.new(transaction_id: previd, index: previndex)\n \n mapprevOutScriptPubKeys[outpoint] = parse_script(scriptstring)\n end\n \n tx = BTC::Transaction.new(hex: test[1])\n flags = parse_flags(test[2])\n \n if debug_filter(test)\n validation_proc = lambda do\n validation_passed = BTC::Validation.new.check_transaction(tx, BTC::ValidationState.new)\n if expected_result\n validation_passed.must_equal expected_result\n end\n script_passed = false\n \n if validation_passed\n tx.inputs.each do |txin|\n output_script = mapprevOutScriptPubKeys[txin.outpoint]\n raise \"Bad test: output script not found: #{test.inspect}\" if !output_script\n sig_script = txin.signature_script\n if !sig_script\n sig_script = BTC::Script.new(data: txin.coinbase_data)\n end\n \n checker = BTC::TransactionSignatureChecker.new(transaction: tx, input_index: txin.index)\n extensions = []\n extensions << BTC::P2SHExtension.new if (flags & BTC::ScriptFlags::SCRIPT_VERIFY_P2SH) != 0\n extensions << BTC::CLTVExtension.new if (flags & BTC::ScriptFlags::SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY) != 0\n interpreter = BTC::ScriptInterpreter.new(\n flags: flags,\n extensions: extensions,\n signature_checker: checker,\n raise_on_failure: expected_result,\n )\n #Diagnostics.current.trace do\n script_passed = interpreter.verify_script(signature_script: sig_script, output_script: output_script)\n if !script_passed\n break\n end\n #end\n end\n end\n (script_passed && validation_passed).must_equal expected_result\n end # proc\n \n yield(comment || test.inspect, validation_proc)\n end # if not filtered\n \n comment = nil\n else\n comment ||= \"\"\n comment += test[0].gsub(/\\.$/,\"\") + \". \"\n comment.gsub!(/\\. $/, \"\")\n end\n end\n end", "def test_result_new_success?(test_result)\n run_result = test_result.run_result\n test = test_result.test\n changed = run_result.change_events.where(test_id: test, value: Automation::Test::Change::TestStartedPassing.value).first\n\n !changed.nil?\n end", "def == expected\n self.out == expected\n end", "def test_first_table_has_correct_length\n assert_equal( 1, @result.values.first.size )\n end", "def verify_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n errors = []\n test_terms.each_with_index do |test_term, index|\n text_values_match?(test_term[Org::TERM_DISPLAY_NAME.name], element_value(org_display_name_input index), errors)\n text_values_match?(test_term[Org::TERM_NAME.name], element_value(org_term_name_input index), errors)\n text_values_match?(test_term[Org::TERM_QUALIFIER.name], element_value(org_term_qualifier_input index), errors)\n text_values_match?(test_term[Org::TERM_STATUS.name], element_value(org_term_status_input index), errors)\n text_values_match?(test_term[Org::TERM_TYPE.name], element_value(org_term_type_input index), errors)\n text_values_match?(test_term[Org::TERM_FLAG.name], element_value(org_term_flag_input index), errors)\n text_values_match?(test_term[Org::TERM_LANGUAGE.name], element_value(org_term_language_input index), errors)\n # TODO - element does not indicate its state # text_values_match?(test_term[CoreOrgData::TERM_PREF_FOR_LANGUAGE.name], element_value(org_term_pref_for_lang_input index), errors)\n text_values_match?(test_term[Org::MAIN_BODY_NAME.name], element_value(main_body_name_input index), errors)\n text_values_match?(test_term[Org::ADDITIONS_TO_NAME.name], element_value(addition_to_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE.name], element_value(org_term_source_name_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_DETAIL.name], element_value(org_term_source_detail_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_ID.name], element_value(org_term_source_id_input index), errors)\n text_values_match?(test_term[Org::TERM_SOURCE_NOTE.name], element_value(org_term_source_note_input index), errors)\n end\n errors\n end", "def test_values_unique\n\n #Arrange\n @user3 = User.new\n @user4 = User.new\n\n # Act\n @user3.name = \"fede\"\n @user3.surname = \"guti\"\n @user3.username = \"fede3\"\n @user3.email = \"fede3@gmail.com\"\n @user3.password = \"123456789\"\n\n @user4.name = \"fede\"\n @user4.surname = \"guti\"\n @user4.username = \"luca\"\n @user4.email = \"luca@gmail.com\"\n @user4.password = \"123456789\"\n\n\n # Assert\n @user3.save\n @user4.save\n all_ok = assert_equal @user3.valid? && @user4.valid? , true\n\n # Act\n @user4.email = \"fede3@gmail.com\"\n @user4.save\n\n # Assert\n email_check = assert_equal @user4.valid?, false\n\n # Act\n @user4.email = \"luca@gmail.com\"\n @user4.username = \"fede3\"\n @user4.save\n\n # Assert\n user_check = assert_equal @user4.valid?, false\n\n # Assert\n assert_equal (all_ok || email_check || user_check) , true\n\n end", "def test_equality(expected, actual)\n \tif expected == actual\n \t\tputs \"pass :):):)\"\n \telse\n \t\tputs \"fail :(:(:(\"\n\tend\nend", "def consistency_checks\n unless certificate_serial_number == voucher_serial_number\n error_report << \"serial number mismatch certificate '#{certificate_serial_number}' vs '#{voucher_serial_number}'\"\n return false\n end\n # other tests here.\n return true\n end", "def evaluateDiffResult()\n\n end", "def test_2022_batch_values\n hash = extract_result\n\n assert_includes hash[2][6], \"Daris\"\n assert_includes hash[3][5], \"Aurika\"\n assert_includes hash[3][17], \"Gerhards\"\n assert_includes hash[4][6], \"Dzintis\"\n assert_includes hash[4][20], \"Meija\"\n assert_includes hash[4][23], \"Jurgita\"\n assert_includes hash[9][17], \"Vaiva\"\n assert_includes hash[9][29], \"Jumis\"\n assert_includes hash[11][7], \"Pērle\"\n assert_includes hash[12][3], \"Ako\"\n end", "def test_it_evaluates_card_value_when_same\n card = Card.new(\"10\",\"Hearts\")\n response = \"10 of Clubs\"\n guess = Guess.new(response, card)\n assert_equal :same, Evaluation.evaluate_value(guess)\n end" ]
[ "0.77462626", "0.7147781", "0.7025612", "0.6886706", "0.66408885", "0.6549903", "0.65296674", "0.6512537", "0.64803106", "0.6453954", "0.6433727", "0.6397276", "0.63816094", "0.62602884", "0.6233375", "0.6233375", "0.62136537", "0.62130344", "0.61987656", "0.61943716", "0.61927056", "0.61785305", "0.6160267", "0.6157629", "0.61565125", "0.6155391", "0.61456513", "0.61456513", "0.6137982", "0.61347693", "0.61225986", "0.6095782", "0.6095758", "0.60729223", "0.6070784", "0.60639125", "0.60456496", "0.6045139", "0.6043477", "0.6041011", "0.60258836", "0.60220116", "0.6006651", "0.60019207", "0.60013515", "0.5985384", "0.5985146", "0.59841686", "0.5975437", "0.5970543", "0.5970543", "0.5970297", "0.59697074", "0.59681016", "0.59504735", "0.5937109", "0.5932292", "0.59269226", "0.5909594", "0.5905135", "0.5905135", "0.59031", "0.5899238", "0.5899035", "0.58987147", "0.58979106", "0.5895681", "0.58938336", "0.5893266", "0.5892769", "0.5887758", "0.587358", "0.58693796", "0.5863655", "0.5845255", "0.5843919", "0.5827242", "0.58253795", "0.5824017", "0.582144", "0.5811577", "0.5811476", "0.5811248", "0.58015656", "0.58006316", "0.5798422", "0.5776699", "0.57750803", "0.57704073", "0.5767451", "0.5763886", "0.5760541", "0.57592106", "0.5757959", "0.5755752", "0.5755141", "0.5755045", "0.57513136", "0.5747671", "0.5745903" ]
0.78071636
0
OBLIGATIONS Clicks the obligations fulfilled checkbox, though it knows nothing about whether it is checking or unchecking
def click_obligations_fulfilled wait_for_element_and_click obligations_input end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check\n click unless checked?\n end", "def offenses_to_check; end", "def check_box; end", "def legal_terms_acceptance_on!\n @legal_terms_acceptance = true\n end", "def uncheck\n click unless unchecked?\n end", "def ensure_user_checked_terms\n account_required(nil)\n end", "def checked; end", "def waiver_submitted\n requested_decision\n end", "def enable_require_ingredient\n change_ingredient_status_link.click\n ingredient_status_select.select('Yes')\n submit_ingredient_status_btn.click\n wait_until{ !submit_ingredient_status_btn.visible? }\n end", "def checkboxes; end", "def consent_checkbox\n # unit_test_no_generate: consent_checkbox, input.className(create_ats_regex_string(\"ats-consentbox\"))\n $tracer.trace(__method__)\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-consentbox\")), __method__)\n end", "def have_read_and_agree\r\n puts \"+ <action> have_read_and_agree --- begin\"\r\n read_and_agree_the_term_checkbox.click\r\n accept_btn.click\r\n puts \"+ <action> have_read_and_agree --- end\"\r\n end", "def withdrawing_eligible(option)\r\n $tables.attach(\"Withdrawing\").withdrawing_eligible\r\n end", "def data_com_checked!\n update_attributes(data_com_checked_c: true)\n end", "def set_eligibility\n update_attribute_without_callbacks(:eligible,\n mandatory ||\n (amount != 0 && eligible_for_originator?))\n end", "def check_for_buyout\n if self.is_bought_out\n if self.bought_out_by_team_id\n self.subcontracts.future_years.each do |sub|\n sub.salary_amount *= 0.6\n sub.this_is_a_buyout = true\n sub.save!\n\n # update GM's annual actions to not allow more buyouts\n actions = AnnualGmAction.find_by_team_id_and_year(self.bought_out_by_team_id, current_year)\n actions.has_bought_out = true\n actions.bought_out_player_id = self.player.id\n actions.save!\n end\n end\n end\n end", "def check_if_approval_is_required\n !offer_request.blank?\n end", "def check_if_approval_is_required\n check_by_families || check_by_supplier || check_by_project ||\n check_by_office || check_by_company || check_by_zone\n end", "def add_obligation(expense, name, amount, is_editable = true, is_average = true)\n return unless expense.obligations.where(:user_id => self.id, :is_tip => !is_editable).empty?\n\n obligation = ExpenseObligation.new(:name => name, :amount => amount)\n obligation.user = self\n obligation.expense = expense\n obligation.is_tip = !is_editable\n obligation.is_average = is_average\n obligation.save!\n obligation\n end", "def disable_require_ingredient\n change_ingredient_status_link.click\n ingredient_status_select.select('No')\n submit_ingredient_status_btn.click\n wait_until{ !submit_ingredient_status_btn.visible? }\n end", "def toggle_officer\n self.is_officer = !self.is_officer\n save!(:validate => false)\n end", "def business_decision_support \n end", "def checkbox(key)\n field_type = @form.getFieldType(key.to_s)\n return unless field_type == @acrofields.FIELD_TYPE_CHECKBOX\n\n all_states = @form.getAppearanceStates(key.to_s)\n yes_state = all_states.reject{|x| x == \"Off\"}\n \n \n @form.setField(key.to_s, yes_state.first) unless (yes_state.size == 0)\n end", "def baptized_catholic_yes_checked\n chosen_baptized_catholic? && baptized_catholic\n end", "def offenses_to_check=(_arg0); end", "def assert_checkbox_not_selected(checkbox_name)\n assert_togglebutton_not_selected checkbox_name\n end", "def on_pou_ok\n @party_or_unit_win.hide\n @select_text_win.text = \"Select the items to give to #{@actor.name}\"\n @select_text_win.show\n @category_window.show\n deactivate_all_but(@category_window)\n @category_window.activate\n @item_window.show\n end", "def user_consenting?; end", "def invoice_agreement_required?\n !self.billable? && !self.invoice_agreement_accepted?\n end", "def obligatory?\n data[:obligatory] === true\n end", "def check_for_selected\n if changes[:selected] && self.selected == true\n BetaMailer.send_beta_acceptance_email(self).deliver_later\n end\n end", "def select_group_loan_for_setup_payment_collection_approval\n @office = current_user.active_job_attachment.office\n @pending_setup_collection_group_loans = @office.pending_setup_collection_group_loans\n end", "def check_in(b)\n if b.checked_out == false\n puts \"It is already checked in, please make another choice: \\n\"\n found_it(b)\n else\n b.update(checked_out: false, patron_id: 00)\n end\nend", "def defunct_checkbox\n '//*[@id=\"lightweight_activity_defunct\"]'\nend", "def check_room_form\n has_element(\"input#bigbluebutton_room_name\",\n { :name => 'bigbluebutton_room[name]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_meetingid\",\n { :name => 'bigbluebutton_room[meetingid]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_private\",\n { :name => 'bigbluebutton_room[private]', :type => 'checkbox' })\n has_element(\"input#bigbluebutton_room_attendee_key\",\n { :name => 'bigbluebutton_room[attendee_key]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_moderator_key\",\n { :name => 'bigbluebutton_room[moderator_key]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_welcome_msg\",\n { :name => 'bigbluebutton_room[welcome_msg]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_logout_url\",\n { :name => 'bigbluebutton_room[logout_url]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_dial_number\",\n { :name => 'bigbluebutton_room[dial_number]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_max_participants\",\n { :name => 'bigbluebutton_room[max_participants]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_external\",\n { :name => 'bigbluebutton_room[external]', :type => 'checkbox' })\n has_element(\"input#bigbluebutton_room_slug\",\n { :name => 'bigbluebutton_room[slug]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_voice_bridge\",\n { :name => 'bigbluebutton_room[voice_bridge]', :type => 'text' })\n has_element(\"label\", { :for => 'bigbluebutton_room_name' })\n has_element(\"label\", { :for => 'bigbluebutton_room_meetingid' })\n has_element(\"label\", { :for => 'bigbluebutton_room_private' })\n has_element(\"label\", { :for => 'bigbluebutton_room_attendee_key' })\n has_element(\"label\", { :for => 'bigbluebutton_room_moderator_key' })\n has_element(\"label\", { :for => 'bigbluebutton_room_welcome_msg' })\n has_element(\"label\", { :for => 'bigbluebutton_room_logout_url' })\n has_element(\"label\", { :for => 'bigbluebutton_room_dial_number' })\n has_element(\"label\", { :for => 'bigbluebutton_room_max_participants' })\n has_element(\"label\", { :for => 'bigbluebutton_room_external' })\n has_element(\"label\", { :for => 'bigbluebutton_room_slug' })\n has_element(\"label\", { :for => 'bigbluebutton_room_voice_bridge' })\n has_element(\"input\", { :name => 'commit', :type => 'submit' })\n end", "def validate_event_complete(_options = {})\n # 0: user has never saved this thus when baptized_at_home_parish will not show yes or no as selected\n # 1: user has saved a selection for baptized_at_home_parish\n # if baptized_at_home_parish == true then done\n # if baptized_at_home_parish == false then baptized_catholic will not show yes or no as selected\n # 2: User has chosen baptized_catholic(true or false)\n case show_empty_radio\n when 0\n errors.add(:base, I18n.t('messages.error.baptized_should_be_checked', home_parish: Visitor.home_parish))\n false\n when 1\n basic_valid = validate_basic_info\n church_info = validate_other_church_info\n return basic_valid && church_info if baptized_at_home_parish\n\n errors.add(:base, I18n.t('messages.error.baptized_catholic_should_be_checked'))\n\n false\n when 2\n basic_valid = validate_basic_info\n church_info = validate_other_church_info\n\n if baptized_catholic\n church_info && basic_valid\n else\n validate_profession_of_faith && church_info && basic_valid\n end\n else\n raise(I18n.t('messages.error.unknown_show_empty_radio', show_empty_radio: show_empty_radio))\n end\n end", "def assert_checkbox_selected(checkbox_name)\n assert_togglebutton_selected checkbox_name\n end", "def toggle_service_announcement_checkbox\n logger.info 'Clicking the service announcement posting checkbox'\n (el = post_service_announcement_checkbox_element).when_present Utils.short_wait\n js_click el\n el.when_not_present Utils.short_wait\n post_service_announcement_checkbox_element.when_present Utils.short_wait\n end", "def user_consenting; end", "def baptized_catholic_no_checked\n chosen_baptized_catholic? && !baptized_catholic?\n end", "def checkbox(criteria = T.unsafe(nil)); end", "def toggle!\n\t\tif self.can_mark_complete?\n\t\t\tself.mark_complete!\n\t\telsif self.can_re_open?\n\t\t\tself.re_open!\n\t\tend\n\tend", "def set_visit_dosing(visit, dosing_option)\n index = get_element_index(visit_names, visit, true, 'value')\n dosing_chk_boxes[index].set(dosing_option)\n save.click\n end", "def show_selected_lawyer\n if is_secretary? && is_lawyer_selected?\n return true\n end\n return false\n end", "def under_check\r\n # Define permitted moves for the king, when under check.\r\n end", "def check_ending\n frm.checkbox(:id=>\"use_end_date\").set\n end", "def check_out(b)\n if b.checked_out == false\n search_patron\n else puts \"It is already checked in, please make another choice: \"\n choice = gets.chomp.downcase\n end\nend", "def fill_out_admission_form(options = {})#incomplet fill out\n @org_codes = AdmissionHelper.get_org_codes_info(CONFIG['location'], options[:org_code] || \"0287\") if options[:org_code]\n org_code = @org_codes[:org_code]\n room_charge = options[:room_charge] || \"REGULAR PRIVATE\"\n select \"roomChargeCode\",room_charge\n click \"roomNoFinder\"\n type \"rbf_entity_finder_roomChargeCode\", options[:rch_code] if options[:rch_code]\n type \"rbf_entity_finder_key\", org_code\n type \"rbf_room_no_finder_key\", \"XST\"\n click \"//input[@value='Search' and @type='button' and @onclick='RBF.search();']\"\n sleep 4\n click Locators::Admission.room_bed\n sleep 2\n if options[:diagnosis]\n click \"//input[@value='' and @type='button']\"\n type \"diagnosis_entity_finder_key\", options[:diagnosis]\n click \"//input[@value='Search' and @type='button' and @onclick='Diagnosis.search();']\", :wait_for => :element, :element => \"link=#{options[:diagnosis]}\"\n click \"link=#{options[:diagnosis]}\"\n end\n sleep 8\n if options[:doctor]\n self.doctor_finder(:doctor => options[:doctor])\n end\n type \"guarantorTelNo\", \"1230988\"\n sleep 1\n if options[:preview]\n go_to_preview_page\n end\n end", "def approve_initial_requirements?\n approve_step?('#2')\n end", "def approve_initial_requirements?\n approve_step?('#2')\n end", "def questionGradable (question)\n return true if question.input.is_a? org.concord.otrunk.ui.OTChoice and question.correctAnswer \nend", "def questionGradable (question)\n return true if question.input.is_a? org.concord.otrunk.ui.OTChoice and question.correctAnswer \nend", "def select_hobby_option\n ran_num = rand(2)\n hobby = @chrome_driver.find_elements(:name, \"checkbox_5[]\")\n hobby.each do |hob|\n if hob['value'] == HOBBY_STATUS[ran_num]\n hob.click\n end\n end\n end", "def choice_a_hold\n item_id = @item_list[@index]\n return action_b if item_id.nil?\n return play_buzzer_se if item_id == 0 || !GameData::Item[item_id].holdable\n\n play_decision_se\n @running = false\n @return_data = @item_list[@index]\n end", "def money_approved?\n true\n end", "def build_check_box(unchecked_value, options); end", "def loyalty_allowance\n if @faculty.eligible_for_loyality_allowance?(@generation_date)\n ((component_criterias[:loyalty_allowance]/100)*basic) #* eligibility_fraction)\n end\n end", "def approved?\n closed? && has_met_requirement?\n end", "def select_group_loan_for_grace_period_payment_approval\n @office = current_user.active_job_attachment.office\n @group_loans = @office.group_loans_with_unapproved_grace_period_payment\n end", "def checkin\n update_attributes(:occupied => false)\n end", "def marked_choices\n return if not_registered\n @mim.marked\n end", "def awaiting_financial_aid_approval?\n dean_approved? && !financial_aid_approved?\n end", "def consent_checkbox_label\n # unit_test_no_generate: consent_checkbox_label, label.className(create_ats_regex_string(\"ats-consentboxlbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(label.className(create_ats_regex_string(\"ats-consentboxlbl\")), __method__)\n end", "def marked_group_loan_memberships_attendance_for_financial_education\n self.group_loan_memberships.where(:is_attending_financial_lecture => [true, false] )\n end", "def approve_initial_requirements?\n approve_step?('#3')\n end", "def approve_initial_requirements?\n approve_step?('#3')\n end", "def approve_initial_requirements?\n approve_step?('#3')\n end", "def approved?\n !self.pending\n end", "def test_negative_case\n #Open the page\n @driver.get(@base_url)\n\n #Click on the submit button without filling out the mandatory forms\n submitButton = @driver.find_element(:xpath, @loc.submitButton)\n submitButton.click\n\n #Verify that the required indicators are displayed for the mandatory fields\n reqText = @driver.find_element(:xpath,@loc.reqText)\n #name box input field would not have the required indicator as it should \n #automatically become active for input when submission is made without mandatory fields filled out\n nameBoxActive = @driver.find_element(:xpath,@loc.nameBoxActive)\n enjoyDevReq = @driver.find_element(:xpath,@loc.enjoyDevReq)\n enjoyDevReqTxt = @driver.find_element(:xpath,@loc.enjoyDevReqTxt)\n\n #Verify that required text is displayed at the top\n assert_equal(true, reqText.displayed?) \n #Verify that the name box does not show the required indicator as it is currently cursor-active\n assert_equal(true, nameBoxActive.displayed?) \n #Verify that the red box highlight indicator is applied for the 'do you enjoy dev? question\n assert_equal(true, enjoyDevReq.displayed?) \n #Verify that the 'This is a required question' text appears below the do you enjoy \n #developement section's checkboxes\n assert_equal(true, enjoyDevReqTxt.displayed?)\n\n #click elsewhere on the page to confirm that the name box field also has the required indicator\n enjoyDevReq.click\n #Verify that the red box highlight indicator is displayed for the name input field\n nameBoxReq = @driver.find_element(:xpath, @loc.nameBoxReq)\n assert_equal(true, nameBoxReq.displayed?)\n #Verify that the 'This is a required question' text appears below the name input field\n nameBoxReqTxt = @driver.find_element(:xpath,@loc.nameBoxReqTxt)\n assert_equal(true, nameBoxReq.displayed?) \n end", "def chosen_baptized_catholic?\n show_empty_radio == 2\n end", "def approved?\n !pending\n end", "def checkbox(key)\n field_type = @form.getFieldType(key.to_s)\n return unless is_checkbox(field_type)\n\n all_states = @form.getAppearanceStates(key.to_s)\n yes_state = all_states.reject{|x| x == \"Off\"}\n \n \n @form.setField(key.to_s, yes_state.first) unless (yes_state.size == 0)\n end", "def wrt_checkbox(chkbox, state,loc = nil, ret = nil)\n if loc \n loc.click \n edit.click\n chkbox.send state \n save.click_no_wait\n jsClick(\"OK\")\n sleep 1\n ret.click \n else\n chkbox.send state\n end\n end", "def alliance_draws_ready!\n return false if not self.candidate_draws_ready?\n\n Result.transaction do\n update_attributes!(:alliance_draws_ready => true)\n recalculate!\n create_coalition_draws!\n processed!\n end\n end", "def check_checkbox (check, element, internally = false)\n element = element.downcase.gsub(' ', '_')\n wait_until{send(\"#{element}?\")}\n\n select = send(\"#{element}_element\")\n\n if check.downcase == 'check'\n if internally\n script = <<-JS\n arguments[0].checked = true;\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n send(\"check_#{element}\")\n end\n\n elsif check.downcase == 'uncheck'\n if internally\n script = <<-JS\n arguments[0].checked = false;\n JS\n self.execute_script(script, select)\n else\n wait_until{select.visible?}\n send(\"uncheck_#{element}\")\n end\n else\n raise 'invalid option for step definition selected!'\n end\n end", "def show_limiter_checkbox limiter, count\n applied_limiter = @results.fetch('SearchRequestGet', {}).fetch('SearchCriteriaWithActions', {}).\n fetch('LimitersWithAction', []).find { |applied_limiter|\n applied_limiter[\"Id\"] == limiter[\"Id\"]\n }\n limiter_checked = applied_limiter.present?\n limiter_action = limiter_checked ? applied_limiter[\"RemoveAction\"].to_s : limiter[\"AddAction\"].to_s.gsub('value', 'y')\n\n clickURL = eds_action_url limiter_action\n clickaction = \"window.location.assign('\" + clickURL + \"');\"\n\n check_box_tag(\"limiters\", limiter_action, limiter_checked, :id => (\"limiter-\" + count.to_s), :style => \"margin-top:-5px;\", :onclick => clickaction)\n end", "def activate_status_2(electionId)\n @election = Election.find(electionId) \n @result = true\n @election.proposals.each do |proposal|\n if proposal.options.length == 0\n @result = false\n break\n end\n end\n @result\n end", "def reveal_quest(quest_id); quest(quest_id).concealed = false; end", "def ensure_eligible_for_confirmation\n unless @offering.confirmations_allowed?\n flash[:error] = \"We're sorry, but the confirmation process is currently disabled.\"\n redirect_to apply_url(@offering) and return\n end\n unless @user_application.passed_status?(\"fully_accepted\") || @user_application.passed_status?(\"fully_accepted_vad\")\n flash[:error] = \"You cannot go through the confirmation process until your application has been fully accepted.\"\n redirect_to apply_url(@offering) and return\n end\n end", "def activate\r\n @quest = @kingdom.quests.find(params[:id])\r\n \r\n if @kingdom.quests.where(quest_status: '1').size > 16\r\n flash[:notice] = 'A kingdom can have only 16 active quests at a time.'\r\n elsif @quest.reqs.size == 0\r\n flash[:notice] = \"Quest must have at least one requirement in order to be activated\"\r\n else\r\n @quest.quest_status = SpecialCode.get_code('quest_status','active')\r\n quest_status_change_update\r\n end\r\n redirect_to :action => 'index', :page => params[:page]\r\n end", "def approve_setup_fee_collection( current_user )\n self.is_setup_fee_collection_approved = true \n self.setup_fee_collection_approver_id = current_user.id \n self.save\n \n # create all those payment payable : loan disbursement \n end", "def approved?\n Weam.match('aprvd', poo_status) && \n !Weam.match(\"^(#{ALC1}|#{ALC2})\", applicable_law_code) &&\n (\n institution_of_higher_learning_indicator || \n ojt_indicator ||\n correspondence_indicator ||\n flight_indicator ||\n non_college_degree_indicator\n )\n end", "def build_check_box_without_hidden_field(options); end", "def check\n authorize :donation\n @donation.check(ConvertHelpers::string_to_bool params[:shown])\n\n if @donation.save\n flash[:notice] = \"Uspešno ažuriranje\"\n redirect_to donations_for_check_path\n else\n flash[:error] = \"Došlo je do greške, pokušajte ponovo\"\n redirect_to donations_for_check_path\n end\n end", "def waiting?\n !checked_in?\n end", "def can_change_office?\n s = setting(Setting::OFFICE_SELECTION)\n s.is? Setting::OFFICE_SELECTION_ASK or s.is? Setting::OFFICE_SELECTION_ASK_AND_ASSUME\n end", "def check_assignment(assignment_name)\n assignment_row(assignment_name).checkbox.set\n end", "def marked_group_loan_memberships_attendance_for_loan_disbursement\n self.group_loan_memberships.where(:is_attending_financial_lecture => [true, false] , \n :is_attending_loan_disbursement => [true,false])\n end", "def mark_as_complete(options)\n self.is_complete = options[:is_complete]\n self.is_applicable = true # if item.is_complete\n self.save_with_validation(false)\n end", "def remove_donation_button_if_no_accounts\n unless has_an_approved_account_set?\n self.show_donation_basket = false\n end\n true\n end", "def test_observation_edit_uncheck_project\n user = users(:dick)\n # user owns this Observation,\n observation = observations(:collected_at_obs)\n # which is part of this Project.\n project = projects(:obs_collected_and_displayed_project)\n\n # Log in user\n login(user)\n\n # Edit the Observation, unchecking the Project.\n visit(\"/observer/edit_observation/#{observation.id}\")\n uncheck(\"project_id_#{project.id}\")\n click_on(\"Save Edits\", match: :first)\n\n assert_not_includes(project.observations, observation)\n end", "def checked?; end", "def any_unsub?\n chosen = false\n choices = params[:user][:choices_attributes]\n choices.each do |unsub, v|\n if v['completed'] == \"1\"\n chosen = true\n end\n end\n chosen\n end", "def check!\n update_attribute :checked, true\n end", "def donable_selected_edit\n @donable = @donation.donable\n render_donable_partial\n end", "def to_be_performed?\n self.research_billing_qty > 0\n end", "def awaiting_disbursement?\n financial_aid_approved? && !disbursed?\n end", "def unanswered_check_in_questions\n action_items.where(component_type:Check::COMPONENT_TYPE, day:1..day.to_i).select{|i| !i.complete?}\n end", "def force_check!\n # Disable all hidden teams that weren't disabled yet.\n Team.where(hidden: true).where.not(ldap_group_checked: Team.ldap_statuses[:disabled])\n .update_all(ldap_group_checked: Team.ldap_statuses[:disabled])\n\n # Force the check for teams that have never been checked (checked_at is\n # nil and they have not been disabled), or that they have been checked a\n # long time ago.\n Team\n .where(checked_at: nil)\n .where.not(ldap_group_checked: Team.ldap_statuses[:disabled])\n .or(\n Team.where(ldap_group_checked: Team.ldap_statuses[:checked])\n .where(\"checked_at < ?\", FORCE_CHECK_IN_DAYS.days.ago)\n ).update_all(ldap_group_checked: Team.ldap_statuses[:unchecked])\n end" ]
[ "0.60629874", "0.5994372", "0.5858613", "0.57750976", "0.5540947", "0.5488588", "0.5463598", "0.5460786", "0.5459908", "0.5417722", "0.5397253", "0.53897214", "0.5342777", "0.5339122", "0.53008366", "0.5289087", "0.5288259", "0.52799505", "0.527131", "0.52597016", "0.5257368", "0.52414685", "0.52409273", "0.5234304", "0.5220141", "0.5215958", "0.52011216", "0.5197337", "0.5162579", "0.5152664", "0.5151351", "0.51486295", "0.5142036", "0.51419866", "0.5136609", "0.5136206", "0.5132805", "0.51319194", "0.51291543", "0.5123787", "0.51136595", "0.5106651", "0.5098669", "0.50811756", "0.5077052", "0.5066461", "0.50486857", "0.5047931", "0.50421816", "0.50421816", "0.5040679", "0.5040679", "0.50289816", "0.50197774", "0.5009629", "0.5007952", "0.4992716", "0.49846745", "0.49835342", "0.49826702", "0.4982081", "0.497435", "0.49643064", "0.49623814", "0.49576867", "0.49576867", "0.49576867", "0.49547333", "0.49510828", "0.49506718", "0.49478477", "0.4939667", "0.49395823", "0.49282065", "0.4924528", "0.49198312", "0.49192247", "0.49146926", "0.49120808", "0.49075004", "0.49022052", "0.49012825", "0.4897158", "0.48883718", "0.48877275", "0.48870718", "0.48802084", "0.48797655", "0.48776793", "0.48762876", "0.48717624", "0.48678857", "0.4866851", "0.48543316", "0.48529384", "0.48510534", "0.485021", "0.48449916", "0.48430052" ]
0.71981066
1
Because any nonregular fraction m / n is periodic, and has a period (i.e. recurring cycle length) independent of m, which is at most n 1 digits long. Equality happens when n is a prime. Return the cycle length of 1 / n; n is a prime.
def recurringCycleLengthOfPrime(n) return 0 if n == 2 || n == 5 # Solve multiplicative order of 10 (mod n) i = 1 until (10 ** i - 1) % n == 0 i = i.next end i end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cycle_length(n,d)\n remainders = [n.remainder(d) * 10]\n finished = false\n\n until remainders.include?(remainders.last.remainder(d) * 10)\n remainders << remainders.last.remainder(d) * 10\n end\n return remainders[remainders.index(remainders.last.remainder(d) * 10)..remainders.size - 1].size\n end", "def rec_cycle_length(n)\n decimals = []\n remainder = 1\n remainders = []\n continue = true\n while continue do\n remainders << remainder\n remainder = (remainder * 10 % n)\n if remainders.include? remainder\n continue = false\n end\n end\n remainders.length - remainders.find_index(remainder)\nend", "def recurring_decimal_length(num)\n\tdecimalArray, numerator = Array.new, 1\n\twhile true\n\t\tremainder = numerator%num\n\t\tif decimalArray.count(remainder) == 0\n\t\t\tdecimalArray.push(remainder)\n\t\telse\n\t\t\treturn decimalArray.count\n\t\tend\n\t\tnumerator = remainder*10\n\tend\nend", "def find_period_one(n)\n x = Math.sqrt(n).to_i\n frac = Math.sqrt(n) - x\n p = [x]\n until p[-1] == 2 * p[0]\n frac = 1 / frac\n x = frac.to_i\n frac -= x\n p << x\n end\n p.size - 1\nend", "def solve( n = 1_000 )\n # Divide 1 by every number up to n, recording the length of repeating\n # digits that repeat.\n lens = (2...n).map do |i|\n d = {}\n r = 1\n\n # Do long division, stopping only if the decimal terminates or we see\n # a remainder we've seen before (indicating the beginning of a cycle).\n while true\n r = 10 * (r % i)\n break if 0 == r || d[r]\n\n # No cycle, but it didn't terminate. Add the remainder and calculate\n # a new one.\n d[r] = true\n r = r % i\n end\n\n d.length\n end\n\n # Return the index of the largest length value, offset to account for the\n # fact that we didn't divide by 0 or 1.\n 2 + lens.each_with_index.max[1]\n end", "def reciprocal_cycles n\n den = 1\n cache = Array.new\n loop do\n den *= 10\n point = den / n\n next if cache.empty? and point.zero?\n\n den = den % n\n return 0 if den.zero?\n\n break if cache.include? [point, den]\n cache << [point, den]\n end\n cache.map(&:first).size\nend", "def recursive_gcd_proper_fractions(n)\n return 0 if n == 1\n proper_fractions_found = 0\n\n (1..n-1).each do |i|\n if recursive_gcd(i, n) == 1\n proper_fractions_found += 1\n else\n next\n end\n end\n\n proper_fractions_found\nend", "def divisors(n)\n (1.upto(n ** 0.5).select { |d| (n % d).zero? }.size * 2) - 1\nend", "def divisor_counter(n)\n i, count = 1, 0\n\n until i * i > n\n if n % i == 0\n count += 1\n count += 1 if i * i != n\n end\n i += 1\n end\n\n count\nend", "def divisor(n)\n count = 0\n (1..n).each do |d|\n if n % d == 0\n count += 1\n end \n end \n count \nend", "def num_of_divisors(n)\n count = 1\n 1.upto(n/2+1) do |i|\n if n % i == 0\n count += 1\n end\n end\n count\nend", "def continued_fraction(n)\n a0 = Math.sqrt(n).floor\n cf = [a0]\n\n m = 0\n d = 1\n loop do\n m = d * cf.last - m\n d = (n - m**2)/d\n a = (a0 + m)/d\n cf << a\n\n break if a == 2 * a0\n end\n\n cf\nend", "def number_of_divisors\n (1..Math.sqrt(self)).inject(0) {|sum, i| modulo(i) == 0 ? sum + 2 : sum}\n end", "def divisors(n)\n count = 0\n (1..n).each { |div| count += 1 if n % div == 0 }\n return count\nend", "def problem_57a\n root2 = lambda do |depth|\n if depth == 0\n Rational(1,2) \n else\n Rational(1,(root2.call(depth - 1) + 2))\n end\n end\n ret = 0\n 1000.times do |n|\n r = root2.call(n) + 1\n ret += 1 if r.numerator.to_s.length > r.denominator.to_s.length\n end\n ret\nend", "def numDivisors(n)\n exponents = []\n remaining = n\n\n return 1 if n == 1\n\n for i in 0...@primes.length\n\n if remaining == 1 then\n return exponents.inject(:*)\n end\n\n if remaining % @primes[i] == 0 then\n exponent_count = 0\n while remaining % @primes[i] == 0 do\n remaining /= @primes[i]\n\n exponent_count += 1\n end\n exponents.push(exponent_count + 1)\n end\n end\n return 1\nend", "def gcd(n, m)\n n % m == 0 ? m : gcd(m, n % m)\nend", "def proper_divisors n\n if (n < 2)\n return []\n end\n\n r = Math.sqrt(n)\n p = (r - 1).ceil\n d = (2..p).collect { |x| [x, n/x] if n % x == 0 }.compact.flatten\n if (r == r.floor)\n d.concat([r.floor])\n end\n return d.concat([1])\nend", "def seqlength(n)\n seen = []\n m = 1\n\n 1.upto(n) do |i|\n rem = m % n\n return i if seen.include?(rem)\n seen.<< rem\n m = 10 * rem\n end\nend", "def divisor_count_of(number)\n divisors = divisors_of(number)\n\n return divisors.length\n end", "def findDigits(n)\n x = n.to_s.split(//)\n x = x.each_index {|i| x[i] = x[i].to_i}\n p x\n c = x.count { |j| n % j == 0 if j != 0}\n p c\nend", "def digit_replacement_cycle(n)\n return 0 unless prime?(n)\n s = n.to_s\n s.chars.uniq.map do |d|\n digit_replacement_cycle_length(s.gsub(d, \"*\"))\n end.max\n end", "def d(n)\n divisors = (1...n).select{ |i| n % i == 0 }\n divisors.reduce(&:+)\nend", "def totient_phi(n)\n n == 1 ? 1 : (1...n).select {|v| coprime(n, v) }.length\nend", "def modulo_of(fraction); end", "def euler028 n\n (4*n**3 + 3*n**2 + 8*n - 9) / 6\nend", "def solution(n, m)\n n / gcd(n, m)\nend", "def number_of_factors(n)\n # bruteforce, simplest\n # least efficient way\n count = 0\n\n (1..n).each do |i|\n if n % i == 0\n count += 1\n end\n end\n\n count\nend", "def get_divisors n\n n = n/2 if n % 2 == 0 \n divisors = 1\n count = 0\n while n % 2 == 0\n count += 1\n n = n/2\n end\n divisors *= (count + 1)\n p = 3\n while n != 1\n count = 0\n while n % p == 0\n count += 1\n n = n/p\n end\n divisors *= (count + 1)\n p += 2\n end\n #puts divisors\n return divisors\nend", "def reciprocal\n dividend = 1\n answer = max = remainder = count = 0\n 999.downto(7) do |divisor|\n next if divisor % 2 == 0 || divisor % 5 == 0\n count = 0\n until count > 2 && remainder == 1\n remainder = dividend % divisor\n dividend = remainder * 10\n count += 1\n end\n if count > max\n max = count\n answer = divisor\n end\n end\n answer\nend", "def count_1s n\n count = 0\n while n > 0\n # tricks: if n&(n-1) == 0(decimal form), n is 0 or power of 2.\n n = n&(n-1)\n count += 1\n end\n count\nend", "def divisors(num)\n\tcount = 0\n\tfor i in 1..Math.sqrt(num)\n\t\tif num % i == 0\n\t\t\tcount += 2\n\t\tend\n\tend\n\treturn count\nend", "def check_circular( p )\n\n\treturn true if p < 10 \n\n\tary_p = p.to_s.split(//).map(&:to_i)\n\n\t# when the number contains the even digit (inclued '0')\n\t# return false.\n\tary_p.each{ |n|\n\t\treturn false if n % 2 == 0\n\t\treturn false if n == 5\n\t}\n\n\t1.upto( ary_p.size - 1 ){\n\t\tfirst = ary_p.shift\n\t\tary_p << first\n\t\tnewval = ary_p.inject{|memo,n| memo * 10 + n }\n\t\t#return false if newval < p\t# the value is already checked.\n\t\treturn false unless Prime.prime?( newval )\t\n\t}\n\treturn true\nend", "def d(n)\n (2..Math.sqrt(n)).inject(1){|s, i| n % i == 0 ? s + i + n/i : s}\nend", "def proper_divisors(n)\r\n divisors = Array.new\r\n 1.upto(Math.sqrt(n)) do |x|\r\n if n % x == 0\r\n divisors << x\r\n if x != n / x && x != 1\r\n divisors << n / x\r\n end\r\n end\r\n end\r\n divisors\r\n end", "def count_divisors(num)\n count = 0\n top = Math.sqrt(num)\n (1..top).each { |n| count += 2 if num % n == 0 }\n count -= 1 if is_square?(num)\n count\n end", "def cantDivisores(n,cont)\n if(n==cont)\n return 1\n elsif (n%cont == 0)\n return 1+ cantDivisores(n,cont+1)\n else\n return 0+ cantDivisores(n,cont+1)\n end\nend", "def solution(n)\n factors = 0\n (1..Math.sqrt(n)).each do |i|\n if n % i == 0\n factors += i == Math.sqrt(n) ? 1 : 2\n end\n end\n factors\nend", "def numbers_of_multiple (number)\n divisors = []\n (1..20).each do |divisor|\n if number % divisor ==0\n divisors.push divisor\n end\n end\n #if divisors.length == 20\n # return true\n #else\n # puts divisors.length\n # return false\n #end\n return divisors.length\nend", "def count_divisors(num)\n\n (1..num).count {|n| num % n == 0}\n\nend", "def solution(n)\n number = 1\n stop = false\n while !stop\n results = []\n (1..n).each do |divider| \n if number % divider != 0\n results << false\n else\n results << true\n end\n end\n if results.count {|x| x == false } > 0\n stop = false\n number += 1\n else \n stop = true\n end \n end\n number\nend", "def sqrt_convergents()\r\n\tthe_div = [1, 2]\t\t# Numerator and Denominator\r\n\titerations = 1000\r\n\treturner = 0\r\n\r\n\twhile iterations > 0\r\n\t\t# Every next fraction has previouse one in the denominator.\r\n\t\tthe_div = [the_div[1], 2*the_div[1] + the_div[0]]\t\t# Simplify the fraction.\r\n\t\tto_test = the_div[0] + the_div[1]\t\t\t\t\t\t# 1 + fraction\r\n\t\treturner += 1 if to_test.to_s.size > the_div[1].to_s.size\r\n\t\titerations -= 1\r\n\tend\r\n\treturn returner\r\nend", "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend", "def p003(total_remaining = 600_851_475_143)\n divisor = 2\n until divisor >= total_remaining\n if (total_remaining % divisor).zero?\n total_remaining /= divisor\n else\n divisor += 1\n end\n end\n divisor\nend", "def d(n)\r\n proper_divisors(n).reduce(:+)\r\nend", "def euler29(n)\n terms = []\n 2.upto(n) do |i|\n 2.upto(n) do |j|\n if terms.include?(i ** j) == false\n terms << i ** j\n end\n end\n end\n \n terms.length\nend", "def num_prime_factors(num)\n (prime_factors(num)).length\nend", "def problem_80(size = 100)\n total = 0\n (2..100).each do |n|\n n,d = n.sqrt_frac(2*size)\n next unless n\n r = n * (10 ** (size * 1.1).to_i) / d\n r = r.to_s[0,size].split(//).map(&:to_i).reduce(&:+)\n total += r\n# puts r.inspect\n end\n total\nend", "def divisors(n)\n div = Array.new\n curr = n - 1\n while curr > 1\n div.unshift(curr) if n % curr == 0\n curr -= 1\n end\n div.empty? ? \"#{n} is prime\" : div\nend", "def problem_5(lower_limit, upper_limit)\n searching = true\n numerator = upper_limit\n while searching == true\n numerator += 2\n searching = false\n (lower_limit..upper_limit).each do |denominator|\n searching = true unless numerator % denominator == 0\n end\n end\n return numerator\nend", "def number_of_divisors(num)\r\n\tprime_array = num.prime_division\r\n\tnum_of_divisors = 1\r\n\t(0..prime_array.length - 1).each do |x|\r\n\t\tnum_of_divisors *= (prime_array[x][1] + 1)\r\n\tend\r\n\treturn num_of_divisors\r\nend", "def problem3 ( )\n n = 600851475143\n i = 1\n while (i < n)\n if n % i == 0\n n /= i\n i -= 2\n end\n i += 2\n end\n n\nend", "def number_of_divisors\n return 1 if self == 1\n self.prime_division.map{|num, power| power + 1 }.inject(&:*)\n end", "def is_circular_prime?(number)\n rotation = number.to_s.split(//).map! {|i| i.to_i}\n\n (rotation.length).times do\n rotation.push(rotation.shift)\n number = rotation.join().to_i\n\n if !is_prime?(number)\n return false\n end\n end\n\n if number == 9\n return false\n end\n\n return true\nend", "def sum_divisors(n)\r\n (1...n).select { |x| (n % x).zero? }.sum - 1\r\nend", "def totient4 n\n Prime.prime_division(n).each do |factor, _|\n n = n * (factor - 1) / factor\n end\n return n\nend", "def multiple_of(n, x)\n x.modulo(n).zero?\n end", "def num_prime_factors(num)\n prime_factors(num).length\nend", "def num_prime_factors(num)\n prime_factors(num).length\nend", "def num_prime_factors(num)\n prime_factors(num).length\nend", "def factor_gcd(n, g)\n m = 0\n while((m = gcd(n, g)) != 1) do\n n /= m\n end\n n\nend", "def get_number_of_divisors(number)\n\t\tdivisors = 2 # 1 and number\n\t\tif (number == 1)\n\t\t\tdivisors = 1\n\t\telsif (number == 2)\n\t\t\tdivisors = 2\n\t\telse\t\t\n\t\t\tfor i in 2..Math.sqrt(number)\n\t\t\t\tif (number%i == 0)\n\t\t\t\t\tdivisors += 2\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tp \"number: #{number}, divisors: #{divisors}\"\n\t\tif (Math.sqrt(number)*Math.sqrt(number) == number)\n\t\t\tdivisors -= 1\n\t\tend\t\n\t\t@divisors = divisors\n\tend", "def p206\n re = /1.2.3.4.5.6.7.8.9.0/\n max = Math.sqrt(1929394959697989990).floor\n\n # Round since only squares of multiples of 30 and 70 end with 9_0 (e.g. 900)\n i = round_up Math.sqrt(1020304050607080900).floor, 100\n while i < max\n p30 = (i+30) ** 2\n p70 = (i+70) ** 2\n\n if re === \"#{p30}\"\n return \"#{i+30}^2 = #{p30}\"\n elsif re === \"#{p70}\"\n return \"#{i+70}^2 = #{p70}\"\n end\n\n i += 100\n end\nend", "def num_prime_factors(num)\n prime_factors(num).length\nend", "def fast_solution(n, m)\n # eaten = c * n / m. Find c that makes (c * n) % m == 0.\n c = 0\n begin\n c += 1\n c = m / n if m == 1000000000\n end until (c * n) % m == 0\n c * n / m\nend", "def aofn( n )\n# Guaranteed in this context...\n# return 0 unless n.coprime?( 10 )\n\n x, k = 1, 1\n until 0 == x\n x = (10*x + 1) % n\n k += 1\n end\n\n k\n end", "def divisors(n)\n divs = []\n # NOT INCLUDING ITSELF\n (1...n).each do |i|\n if n % i == 0\n divs << i\n end\n end\n divs\nend", "def num_prime_factors(num)\n return prime_factors(num).length\nend", "def num_prime_factors(num)\n return prime_factors(num).length\nend", "def circular_primes(max)\n idx = 2 #numbers lower than 2 aren't prime\n circ_primes = []\n\n while idx<max\n if only_odd_digits?(idx) #Check to see if all digits in number are odd\n if is_circular_prime?(idx)\n circ_primes << idx\n end\n end\n\n if idx%2==0 #Only check odd numbers, because evens besides 2 aren't prime\n idx += 1\n else\n idx +=2\n end\n end\n\n return circ_primes.length\nend", "def factors(noriginal) # gives n's proper divisors\n factors = [1] # 1 is always a factor. Exclude n to get \"proper divisors\"\n f = 2\n\n begin\n n = noriginal\n\n while f * f <= n # Only check up to sqrt(n)\n if n % f == 0\n factors << f << n / f \n n /= f\n else\n\n f += 1\n if noriginal % f == 0 # catches divisors you missed with n < noriginal\n factors << f << noriginal / f\n end\n end\n end \n\n f += 1\n end until f * f > noriginal # Overall, only check up to sqrt(noriginal)\n\n factors.uniq.sort # sort and remove duplicates\nend", "def num_prime_factors(num)\n prime_factors(num).length\n\nend", "def counting_the_divisor\n i = 12370\n count = 0\n triagular_factor = 0\n loop do\n triagular_factor = triangular_number_logic(i)\n p triagular_factor\n count = divisors(triagular_factor)\n break if count > 500\n\n p count\n i += 1\n end\n p triagular_factor\n p count\nend", "def list_factors(n)\r\n m = 0\r\n #even\r\n if (n % 2 == 0)\r\n for i in 1..n\r\n if (n%i == 0)\r\n m+=1\r\n end\r\n end\r\n #odd\r\n else\r\n for i in (1..n).step(2) do\r\n if (n%i == 0)\r\n m+=1\r\n end\r\n end\r\n end \r\n return m\r\nend", "def count(n)\n sum = 1\n n.prime_division.each do |x|\n sum *= (x[1] + 1)\n end\n sum\n end", "def solution(n)\n # write your code in Ruby 2.2\n a = Math.sqrt(n).floor\n a -= 1 while n % a != 0\n b = n / a\n (a + b) * 2\nend", "def c(n, m) # m should <= n\n\treturn 1 if m == 1\n\tfactorial(n) / factorial(n - m)\nend", "def divisors(n)\n results = []\n max = Math.sqrt(n).floor\n (1..(max)).each do |div|\n # next if results.include?(div)\n x, y = n.divmod(div)\n results << x << div if y == 0\n end\n results.uniq.sort\nend", "def recursive_gcd(numerator, denominator)\n if d != 0\n return n\n else\n return recursive_gcd(denominator, numerator % denominator)\n end\nend", "def lcm_1_to_n (num)\n answer = 1\n answer_factors = Hash.new(0) #key is prime factor, val is number of occurences\n (0..num).each do |x|\n f = 2 #start with first possible prime factor\n x_factors = Hash.new(0)\n\n #find prime factors for x\n while (x >= f)\n while (x % f == 0)\n x_factors[f] += 1\n x /= f\n end\n f += 1\n end\n\n #the answer must have as many occurrences of each prime factor as each\n #individual number (1..num).\n x_factors.each do |factor, occurrences|\n if (occurrences > answer_factors[factor])\n answer_factors[factor] = occurrences\n end\n end\n end\n\n #answer_factors has correct factors. Multiply them for the answer\n answer_factors.each do |factor, occurrences|\n occurrences.times do\n answer *= factor\n end\n end\n answer\nend", "def circular_prime?(number)\n if number.to_s.size == 1\n return true\n end\n rotations = circular_rotations(number)\n rotations.each do |r|\n if !prime?(r)\n return false\n end\n end\n return true\nend", "def num_prime_factors(num)\n\tprime_factors(num).length\nend", "def digit_match(n, m)\n \n return 1 if n == 0 && m == 0 \n count = 0\n if n % 10 == m % 10\n count += 1\n end\n if (n / 10 == 0 || m / 10 == 0) \n return count\n end\n\n return count + digit_match(n / 10, m / 10)\n \nend", "def circular_primes(n)\n circular_primes = Set.new\n Prime.each(n) do |prime|\n circular = true\n rotations = prime.to_s.length - 1\n digits = prime.to_s.chars.map(&:to_i)\n rotations.times do # For an n-digit number, there are n-1 rotations.\n digits << digits.shift # 'Rotate' the digits. Ex: 197 -> 971\n circular = false unless digits.reduce { |ac, i| ac*10 + i }.prime?\n end\n circular_primes << prime if circular\n end\n return circular_primes\nend", "def mod(n, m)\n return ((n % m) + m) % m\nend", "def factors_of(n)\n result = []\n (1..n/2).each do |x|\n quotient, remainder = n.divmod x\n if remainder.zero?\n result << quotient\n result << x\n end\n end\n result.uniq\nend", "def divisors(n)\n divisors_found = []\n (1..n).each do |i|\n divisors_found << i if n % i == 0\n end\n divisors_found.uniq.sort\nend", "def factors(number)\n # TODO: can optimise by only going up to the square of the number\n (1..number).select { |x| number % x == 0 }.count\nend", "def largest_prime_factor(n)\n divisor = 2\n while(divisor <= n)\n n%divisor == 0 ? n = n/divisor : divisor += 1\n end\n divisor\nend", "def getSequenceLength(num)\r\n seqLength = 0\r\n\r\n while num > 1\r\n if $seqLengthArray[num]\r\n return seqLength + $seqLengthArray[num] \r\n end\r\n num.even? ? num = num/2 : num = 3 * num +1\r\n seqLength += 1\r\n end\r\n\r\n return seqLength + 1\r\nend", "def triangle_divisors(n)\n count = 2\n triangle = 1\n \n while\n triangle += count\n puts \"triangle is #{triangle}\"\n if number_of_factors(triangle) > n\n return triangle\n end\n count += 1\n end\nend", "def divisor_count_of(number)\n # Count the divisors by computing the prime factorization of the number and\n # multiplying PF exponents. 1 is added to the exponents since each base can\n # be raised to the 0 power, which is still a divisor of the given number.\n prime_factorization = prime_factorization_of(number)\n exponents = prime_factorization.values\n result = exponents.inject(1) {|accum, val| accum * (val + 1)}\n\n return result\nend", "def num_prime_factors(num)\r\n # your code goes here\r\n prime_factors(num).length\r\n\r\nend", "def primeFactors(n)\n i = 2\n npf = 0 #number of prime factors\n while i < n-1\n if n % i == 0 && Prime.prime?(i)\n npf += 1\n end\n i+=1\n end\n npf\nend", "def length n\n Math.log10(n).floor \nend", "def length(prec = 100, dec = toDigArray(prec))\n (prec/2).times{dec.shift}\n for len in 1...(dec.length/2)\n ret = true\n for x in 0...len\n value = dec[x]\n for iter in 1...(dec.length/len)\n ret = false if value != dec[iter*len+x]\n end\n end\n return len if ret\n end\n return length(prec*2)\n end", "def divisors(n)\n\th = [1]\n\ti = 2\n\twhile i**2 < n\n\t\tif n % i == 0\n\t\t\th << i << (n / i)\n\t\tend\n\t\ti += 1\n\tend\n\tif i**2 == n\n\t\th << i\n\tend\n\th\nend", "def divisors(n)\n current_num = 1\n divs = []\n loop do\n result = n.divmod(current_num)\n return divs.uniq.sort if result[0] < current_num\n divs.concat([result[0], current_num]) if result[1].zero?\n current_num += 1\n end\nend", "def totient(n)\n return n if n == 1\n return n - 1 if @prime_hash[n]\n factors = prime_factors(n)\n numerator = n * factors.map { |i| i - 1 }.inject(:*)\n denominator = factors.inject(:*)\n return numerator / denominator\nend", "def isMultiple(a, b, n)\n fractional_part = (a.to_f/b.to_f).round(1).to_s[-1].to_i\n return false if fractional_part <= 0\n fractional_part % n == 0 ? true : false\nend" ]
[ "0.7258266", "0.7096669", "0.7076458", "0.6855291", "0.6838141", "0.68158853", "0.6477822", "0.6476729", "0.64062476", "0.6399346", "0.63765496", "0.62871647", "0.6273994", "0.62450063", "0.6242124", "0.6230203", "0.6217357", "0.621171", "0.61949706", "0.6187867", "0.61663246", "0.61054397", "0.610231", "0.60924906", "0.6089504", "0.60842514", "0.6082921", "0.6062762", "0.60281706", "0.6004075", "0.59943247", "0.59547794", "0.59367025", "0.5917693", "0.5900191", "0.5899606", "0.5893783", "0.58924973", "0.5886389", "0.58780783", "0.5871335", "0.58710754", "0.5868648", "0.5856472", "0.58484524", "0.58263725", "0.58228093", "0.5821295", "0.58173734", "0.58143365", "0.5808942", "0.5804811", "0.5800815", "0.5792985", "0.579085", "0.57736474", "0.5766531", "0.5759557", "0.5759557", "0.5759557", "0.5758549", "0.5758016", "0.57554305", "0.5750635", "0.57452047", "0.5742491", "0.5734564", "0.57282925", "0.57282925", "0.57215005", "0.57152903", "0.5713057", "0.57129896", "0.5707632", "0.56914103", "0.5688712", "0.5685737", "0.5672895", "0.5670067", "0.5663711", "0.56612885", "0.56537193", "0.5645997", "0.56228775", "0.56149566", "0.56069505", "0.56050926", "0.5603877", "0.56027925", "0.5589593", "0.55878836", "0.55842966", "0.5582774", "0.55822396", "0.55757993", "0.55653036", "0.55646515", "0.5563174", "0.55623174", "0.5556323" ]
0.70092076
3
return the line and column of a given offset into this string line and column are 1based
def line_column(string, offset) return 1,1 if string.length==0 || offset==0 lines = (string[0..offset-1] + " ").split("\n") return lines.length, lines[-1].length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_line_and_column_from_chunk(offset)\n if offset.zero?\n return [@chunk_line, @chunk_column]\n end\n\n string =\n offset >= @chunk.size ? @chunk : @chunk[0..offset-1]\n\n line_count = string.count(\"\\n\")\n\n column = @chunk_column\n if line_count > 0\n lines = string.split(\"\\n\")\n column = lines.empty? ? 0 : lines[-1].size\n else\n column += string.size\n end\n\n [@chunk_line + line_count, column]\n end", "def line_offset(pos=pos())\n p = 0\n string.each_line do |line|\n len = line.length\n return (pos - p) if p + len >= pos\n p += len\n end\n 0\n end", "def line_offset(pos=pos)\n p = 0\n string.each_line do |line|\n len = line.length\n return (pos - p) if p + len >= pos\n p += len\n end\n 0\n end", "def line_and_column(pos); end", "def line_char_to_offset(text, line, character); end", "def pos_on_line(offset)\n end", "def offset_on_line(offset)\n line_offset = line_index[ line_for_offset(offset)-1 ]\n @string.byteslice(line_offset, offset-line_offset).length\n end", "def offset_on_line(offset)\n line_offset = line_index[line_for_offset(offset)-1]\n if multibyte?\n @string.byteslice(line_offset, offset-line_offset).length\n else\n offset - line_offset\n end\n end", "def position(index)\n return [-1, -1] unless index < string.length\n\n row_start = @line_starts.select { |line_start| line_start <= index }.last\n row = @line_starts.index(row_start)\n column = index - row_start\n [row, column]\n end", "def offset_on_line(offset)\n end", "def line_for_offset(offset)\n end", "def line_and_column(position = T.unsafe(nil)); end", "def to_offset(text, position); end", "def char_offset(offset)\n effective_line = @locator.line_for_offset(offset)\n locator.char_offset(offset) + (effective_line * @leading_line_offset) + @leading_offset\n end", "def line_for_offset(offset)\n if line_nbr = line_index.index {|x| x > offset}\n return line_nbr\n end\n # If not found it is after last\n return line_index.size\n end", "def token_pos offset\n [offset - @line_pos, @line]\n end", "def line_offset\n\t\t\t@offset - @line_range.min\n\t\tend", "def get_char_position_in_line\n raise NotImplementedError\n end", "def column\n\t return -1 if @inputStack.empty? # only if initialize() arg is bogus\n\n\t input = @inputStack[0] # not @inputStack.last\n\t currLineStart = input.string.rindex(\"\\n\", input.pos)\n\t return input.pos + 1 if currLineStart.nil?\n\t return input.pos - currLineStart + 1\n\tend", "def line_for_position(position); end", "def line_for_position(position); end", "def line_for_position(position); end", "def pos_on_line(offset)\n offset_on_line(offset) +1\n end", "def pos_on_line(offset)\n offset_on_line(offset) +1\n end", "def character_at(source_position, offset = 0)\n actual_line = source_position.line - 1\n actual_offset = source_position.offset + offset - 1\n\n # Return a newline if offset points at the very end of the line\n return \"\\n\" if actual_offset == engine.lines[actual_line].length\n\n engine.lines[actual_line][actual_offset]\n end", "def byte_offset(loc) loc.y * line_byte_size + loc.x * pixel_byte_size; end", "def get_line_and_col_pos(pos)\n pos = self.size if pos > self.size\n pos = 0 if pos < 0\n\n lpos = get_line_pos(pos)\n\n lpos = @line_ends.size if lpos == nil\n cpos = pos\n cpos -= @line_ends[lpos - 1] + 1 if lpos > 0\n\n return [lpos, cpos]\n end", "def line_before\n line[0..column - 1].to_s\n end", "def token_pos(byte_offset) # :nodoc:\n [byte_offset - @line_pos, @line]\n end", "def line_index(pos=pos())\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end", "def offset_to(source_position, pattern, offset = 0)\n actual_line = source_position.line - 1\n actual_offset = source_position.offset + offset - 1\n\n return nil if actual_line >= engine.lines.size\n\n actual_index = engine.lines[actual_line].index(pattern, actual_offset)\n\n actual_index && actual_index + 1 - source_position.offset\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def line_index(pos=pos)\n p = n = 0\n string.each_line do |line|\n p += line.length\n return n if p >= pos\n n += 1\n end\n 0\n end", "def index_line_and_col(index) \n\t\ti = 0\n\t\ti += 1 while index_of_position(i) <= index\n\t\ti -= 1\n\t\t[i, index - index_of_position(i)]\n\tend", "def lines_offset\n @starting_line - 1\n end", "def pos_on_line(obj, offset)\n # TODO: Should really use the SourceAdpater\n # https://github.com/puppetlabs/puppet-strings/blob/ede2b0e76c278c98d57aa80a550971e934ba93ef/lib/puppet-strings/yard/parsers/puppet/statement.rb#L22-L25\n\n # Puppet 5 exposes the source locator on the Pops object\n return obj.locator.pos_on_line(offset) if obj.respond_to?(:locator)\n\n # Revert to Puppet 4.x location information. A little more expensive to call\n obj_loc = Puppet::Pops::Utils.find_closest_positioned(obj)\n obj_loc.locator.pos_on_line(offset)\n end", "def offset_on_line(offset)\n @locator.offset_on_line + @leading_line_offset\n end", "def index_of_position(row, col = 0)\n\t\tline_index(row) + col + 1\n\tend", "def find_vertical(str, offset = 0, length = str.length-offset)\n node = nil\n i = offset\n while (i<offset+length)\n c = str[i]\n if (node == nil)\n node = self.find_horizontal(c)\n elsif (node.down != nil)\n node = node.down.find_horizontal(c)\n else\n return nil\n end\n\n return nil if (node == nil)\n i += 1\n end\n node\n end", "def line_for_offset(offset)\n @locator.line_for_offset(offset) + @leading_line_count\n end", "def current_line_pos\n pos - col\n end", "def text_at(location, offset, length)\n line = lines[location[0] - 1]\n line[location[1] + offset, length]\n end", "def column_at(x, y, y_is_line = false)\n x = @text.x if x < x-@text.x\n line = @newline_data.dig(row_at(y)) unless y_is_line\n line = @newline_data.dig(y) if y_is_line\n column= 0\n return unless line\n\n text = line[:text]\n buffer= \"\"\n local_x=0\n\n text.size.times do |i|\n local_x = @text.font.text_width(buffer)\n\n break if local_x >= x\n column+=1\n buffer+=text.chars[i]\n end\n\n return column\n end", "def line_for_offset(offset)\n if @prev_offset == offset\n # use cache\n return @prev_line\n end\n line_nbr = ary_bsearch_i(line_index, offset)\n if line_nbr\n # cache\n @prev_offset = offset\n @prev_line = line_nbr\n return line_nbr\n end\n # If not found it is after last\n # clear cache\n @prev_offset = @prev_line = nil\n return line_index.size\n end", "def line_pos(row)\n (row > 0 ? src.split(\"\\n\")[0..(row - 1)].inject(0) { |pos, line| pos + line.length + 1 } : 0)\n end", "def locate_line(line)\n offsetlines.each_pair do |offset, val|\n return offset if val.member?(line)\n end\n nil\n end", "def char_offset(offset)\n raise \"Should not be called\"\n end", "def from_line_index\n from_line - 1\n end", "def line_offset(line_index)\n return unless line_exists?(line_index)\n line_index == 0 ? 0 : @line_lengths[0..(line_index - 1)].sum\n end", "def line\n return 1 unless lexing_context && locator\n locator.line_for_offset(lexing_context[:end_offset])\n end", "def line_index()\n end", "def compute_line_index\n scanner = StringScanner.new(@string)\n result = [0] # first line starts at 0\n while scanner.scan_until(/\\n/)\n result << scanner.pos\n end\n @line_index = result\n end", "def offset_of_regexp_in_line(line, regexp)\n if match = regexp.match(line)\n match.offset(match.size > 1 ? 1 : 0)[0]\n else\n -1\n end\n end", "def row_col(pos)\n _pos = 0\n row = 0\n col = 1\n @codes.each do |code|\n break if _pos >= pos\n if line_terminator?(code)\n row += 1\n col = 0\n else\n col += 1\n end\n _pos += 1\n end\n return [row+1, col+1]\n end", "def char_offset(byte_offset)\n string.byteslice(0, byte_offset).length\n end", "def char_offset(byte_offset)\n end", "def char_at(column)\n line[column, 1]\n end", "def character_location\n ((@cr[5] ^ 0x08) & 0x08) << 12 | (@cr[5] & 0x07) << 10\n end", "def line_for_offset(token, offset = nil)\n locator_method_with_offset(token, :line_for_offset, offset || token.offset)\n end", "def line_for_offset(obj, offset)\n # TODO: Should really use the SourceAdpater\n # https://github.com/puppetlabs/puppet-strings/blob/ede2b0e76c278c98d57aa80a550971e934ba93ef/lib/puppet-strings/yard/parsers/puppet/statement.rb#L22-L25\n\n # Puppet 5 exposes the source locator on the Pops object\n return obj.locator.line_for_offset(offset) if obj.respond_to?(:locator)\n\n # Revert to Puppet 4.x location information. A little more expensive to call\n obj_loc = Puppet::Pops::Utils.find_closest_positioned(obj)\n obj_loc.locator.line_for_offset(offset)\n end", "def xy(offset_x, offset_y)\n @board[3 * offset_y + offset_x - 4]\n end", "def location\n\t\treturn \"line %s, column %s\" % [\n\t\t\tself.linenum || '??',\n\t\t\tself.colnum || '??',\n\t\t]\n\tend", "def position_in_source\n pos = @locator.pos_on_line(lexing_context[:offset])\n offset = @locator.char_offset(lexing_context[:offset])\n length = @locator.char_length(lexing_context[:offset], lexing_context[:end_offset])\n start_line = @locator.line_for_offset(lexing_context[:offset])\n\n return { :line => start_line, :pos => pos, :offset => offset, :length => length}\n end", "def elmt_offset_at token_index\n # Defaults to the character position BEYOND the last text element\n (self[token_index]&.last if token_index) || (last.last + self.last.first.to_s.length)\n end", "def get_line_pos(pos)\n lpos = @line_ends.bsearch_index { |x, _| x >= pos }\n return lpos\n end", "def advance_position\n matched_fragment = @str[@pos...@s.pos]\n new_lines = matched_fragment.count(\"\\n\")\n if new_lines > 0\n characters_after_last_newline = matched_fragment.size - matched_fragment.rindex(\"\\n\") - 1\n [@line + new_lines, 1 + characters_after_last_newline]\n else\n [@line, @char + matched_fragment.size]\n end\n end", "def char_offset(byte_offset)\n if multibyte?\n @string.byteslice(0, byte_offset).length\n else\n byte_offset\n end\n end", "def line_num_to_coord(n)\n\t\t(n + 1) * font_metrics.height\n\tend", "def translate_offset(str, byte_offset)\n chunk = str[0..byte_offset]\n begin\n chunk.unpack(\"U*\").length - 1\n rescue ArgumentError # we damaged a character\n chunk = str[0..(byte_offset+=1)]\n retry\n end\n end", "def col\r\n @lines[@line_num].cursor\r\n end", "def determine_end_offset_relative_to_source(end_offset, last_line_length)\n end_offset - last_line_length - 1\n end", "def line_after\n line[column..-1].to_s\n end", "def offset_after_match\n offset + match_length\n end", "def offset\n\t\t\t@position + @offset\n\t\tend", "def get_new_position line, start_pos, keypad\n line.each_char.with_object(start_pos.dup) do |c, new_pos|\n new_pos[1] -= 1 if c == \"U\" && new_pos[1].positive? && !keypad[new_pos[1] - 1][new_pos[0]].nil?\n new_pos[1] += 1 if c == \"D\" && new_pos[1] < (keypad.length - 1) && !keypad[new_pos[1] + 1][new_pos[0]].nil?\n new_pos[0] -= 1 if c == \"L\" && new_pos[0].positive? && !keypad[new_pos[1]][new_pos[0] - 1].nil?\n new_pos[0] += 1 if c == \"R\" && new_pos[0] < (keypad.length - 1) && !keypad[new_pos[1]][new_pos[0] + 1].nil?\n end\n end", "def offset(*) end", "def get_column_index(line, col_name)\n line_ar = (line.is_a? Array) ? line : line.split\n line_ar.find_index(col_name)\nend", "def text_coordinate\n return 39, 5, 222, 16\n end", "def get_string(offset)\n @contents.pos = offset\n return @contents.gets\n end", "def offset; end", "def offset; end", "def offset; end", "def first_position_from_expression(node)\n expression = node.loc.expression\n if node.parent && node.parent.loc.expression.line != expression.line\n expression.begin_pos - expression.column\n else\n expression.begin_pos\n end\n end", "def offset\n match = File.basename(@path).match(/\\d+\\.\\d\\d\\b/)\n return match[0] if match\n end", "def position_for(char)\n return ''.freeze if char.position.y == @y\n\n @y = char.position.y\n char.position.to_s\n end", "def line_number\n number[6..-1]\n end", "def coordinates(string)\n return nil if string.length != 2\n # interpret letter as column\n column = self.class::COLUMNS.index(string[0])\n row = self.class::ROWS.index(string[1])\n return nil if !column || !row\n [row, column]\n end", "def from_line\n position.new_line\n end", "def get\n @source_index += 1\n\n # Maintain line count.\n prev_char = @source_text[@source_index - 1]\n if @source_index.positive? && prev_char == \"\\n\"\n @line_index += 1\n @col_index = -1\n end\n\n @col_index += 1\n char = if @source_index > @last_index\n # Read past the end of source text.\n END_MARK\n else\n @source_text[@source_index]\n end\n Character.new(char, @line_index, @col_index, @source_index, @source_text)\n end", "def line_index(num)\n\t\tif num == 0\n\t\t\treturn -1\n\t\telsif num <= @line_indices.length\n\t\t\treturn @line_indices[num - 1]\n\t\telsif num == @line_indices.length + 1\n\t\t\treturn @text.length\n\t\telse\n\t\t\treturn -999 # todo\n\t\tend \n\tend", "def current_line\n # get the actual offset\n start = @buffer.get_iter_at_offset(@@offset)\n\n # get the command\n line = @buffer.get_text(start, @buffer.end_iter)\n\n return line\n end", "def linenumber\n return @cmd.nil? ? 0 : @cmd.linenumber\n end", "def parse_position(content)\n return content.lstrip.rstrip.to_i\n end", "def return_location(location, line)\n\t\n\nend", "def line_at(start_x, str)\n x = start_x\n move_to_x(start_x) if start_x > 1\n str.length.times do |i|\n $stdout.putc str[i] if x > 0 && x < @width\n x += 1\n end\n $stdout.putc \"\\n\"\n end", "def coordinate_from_string(s)\n matches = coordinate?(s)\n if matches\n column, row = matches.captures\n return [column, row.to_i]\n else\n raise Xl::CellCoordinatesError, \"Invalid cell coordinates #{s}\"\n end\n end", "def input_to_index(position)\nindex = position.strip.to_i - 1\nreturn index\nend", "def get_line(code)\n return code[2][0]\n end", "def get_offset\n @offset\n end" ]
[ "0.7780862", "0.777223", "0.77504903", "0.771346", "0.7664354", "0.75300133", "0.7514555", "0.7513169", "0.74829495", "0.7435217", "0.7395403", "0.72273517", "0.72117454", "0.7208537", "0.70074046", "0.69908077", "0.6919554", "0.69150877", "0.68561566", "0.6836645", "0.6836645", "0.6836645", "0.68232244", "0.68232244", "0.68180835", "0.6728047", "0.66818476", "0.6678121", "0.6638204", "0.66276455", "0.66182077", "0.6611061", "0.6611061", "0.6602145", "0.6599177", "0.65933233", "0.65742314", "0.657273", "0.6565288", "0.65637463", "0.6560506", "0.655974", "0.6546504", "0.6526183", "0.6484561", "0.6481667", "0.6471366", "0.6462678", "0.64610004", "0.6459139", "0.6444413", "0.6442701", "0.64351016", "0.6367175", "0.6340464", "0.6324947", "0.63173926", "0.63049406", "0.6290496", "0.6285484", "0.6252064", "0.6244771", "0.6229828", "0.62231266", "0.6215161", "0.62033844", "0.62009186", "0.619604", "0.6161978", "0.6117197", "0.60877585", "0.6087138", "0.6082003", "0.6062234", "0.60038316", "0.597032", "0.5965593", "0.5958611", "0.5942675", "0.5931673", "0.5929644", "0.5929644", "0.5929644", "0.592647", "0.59177506", "0.5917029", "0.59053326", "0.59048265", "0.58947647", "0.5892296", "0.58792233", "0.58736956", "0.5862325", "0.5845829", "0.58150804", "0.5801628", "0.5788551", "0.5781418", "0.5779836", "0.5774834" ]
0.79417413
0
sort strings first, regexp second sort strings by lenght, longest first will then match first to last
def sort_operator_patterns(array) array.sort_by {|a| a.kind_of?(Regexp) ? 0 : -a.length} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest(str)\n \n alphabet_substr = find_substr(str).select do |substr|\n substr.chars == substr.chars.sort\n end\n alphabet_substr.sort_by! { |str| str.length }\n\n longest = alphabet_substr.select { |str| str.length == alphabet_substr.last.length }\n longest.shift\nend", "def sort_by_length(my_sentence)\n words = my_sentence.split(/\\W+/)\n\n words.size.times do |first_index| \n min_index = first_index\n\n (words.size-first_index).times do |subarray_index|\n if words[first_index+subarray_index].length < words[min_index].length \n min_index = first_index + subarray_index\n end\n end\n \n unless min_index == first_index #don't swap the same index with itself\n holder = words[first_index]\n words[first_index] = words[min_index]\n words[min_index] = holder\n end\n end\n\n return words\nend", "def sort_string(string)\n string.split.sort_by(&:length)\nend", "def longest(s)\n\tall_results = []\n\n\tlist_of_chars = s.chars\n\n\tlist_of_chars.each_with_index do |char, index|\n\n\t\tresult = ''\n\t\tnext_index = index + 1 \n\t\tcurrent_index = index\n\t\tresult << char\n\n\t\tif current_index == list_of_chars.length - 1\n\t\t\tall_results = all_results.max { |a,b| a.length <=> b.length }\n\t\telse\n\t\t loop do\n\t\t \tif list_of_chars[next_index] == nil\n\t\t \t\tall_results << result\n\t\t \t\tbreak\n\t\t\t\telsif list_of_chars[next_index] >= list_of_chars[current_index]\n\t\t\t\t\tresult << list_of_chars[next_index]\n\t\t\t\t\tcurrent_index += 1\n\t\t\t\t\tnext_index += 1\n\t\t\t\telse\n\t\t\t\t\tall_results << result\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\tall_results\nend", "def sort_string(string)\n string.split.sort { |w1,w2| w1.length <=> w2.length }.join(\" \")\nend", "def sort_string(string)\n string.split(' ').sort {|x,y| x.length <=> y.length }.join(' ')\nend", "def sort_string(string)\n string.split.sort_by{|x| x.length}.join(' ')\nend", "def longest(input)\n array = input.sort do |first, second|\n first.length <=> second.length # sorts by length from greatest to least\n # can also do array = input.sort_by do |word| word.length end\n # can also do input.max_by do |word| word.length end\n end\n array.last\nend", "def string_sort(string)\n\tstring.split(' ').sort{|x,y| x.length <=> y.length}.join(' ')\nend", "def longest_word(str)\n arr = str.split()\n sortedArr = arr.sort_by!(&:length).reverse! \n p sortedArr[0]\nend", "def longest_string(list_of_words)\n list_of_word = list_of_words.sort_by { |x| x.length }\n return list_of_word[-1]\nend", "def longest_string(strings)\r\n#+++solution+++\r\n strings.inject('') { | best, this | (best.length < this.length) ? this : best }\r\n#---solution---\r\nend", "def longest_sentence(str)\n str.gsub(/[?!]/, '.').split('.').sort_by { |sentence| sentence.length }.pop.split.length\nend", "def longest_string(list_of_words)\n long_string = list_of_words[0]\n counter = 0\n while counter < list_of_words.length\n if long_string.length < list_of_words[counter].length\n long_string = list_of_words[counter]\n end\n counter += 1\n end\n p long_string\n #return list_of_words.sort {|x,y| y.length <=> x.length}[0]\nend", "def words_by_length(str)\r\n words = str.split\r\n words.sort_by {|word| word.length}\r\nend", "def longest_two_words(string)\n string.delete!(\",.:;?!\")\n string.split.sort_by {|x|x.length}[-2..-1]\n\nend", "def sort_string(string)\n # your code here\n array = string.split(' ')\n array.sort {|x, y|x.length <=> y.length}.join(' ')\n \nend", "def sort_string(string)\n words = string.split\n words = words.sort_by{|x| x.length} \n return words.join(\" \")\nend", "def best_substrings(str1, str2)\n#keep track of the starting index, initialize\n\tlongest = \"\"\n\tstart_idx = 0\nwhile start_idx < str1.length\n\t#doesn’t matter what we pick here\n\t#now, we will only consider at least n+1 greater than the longest string length\n\tlen = longest.length + 1\n\t#make sure still in scope of str, right?\n\t#this inner while loop is a lot like insertion sort, in that it only checks for substrings if there exists the possibility that there is a bigger one\nwhile (start_idx + len) <= str1.length\n\t\tend_idx = start_idx + len\n\t\tsubstr = str1[(start_idx..end_idx)]\n\t\tlongest = substr if str2.include?(substr)\n\t\t#let’s check the rest of them that begin at the current index\n\t\tlen += 1\nend\n#let’s say we left the loop, and we haven’t found anyone, then we need to move to the next idx\nstart_idx += 1\nend\nlongest\nend", "def longest(a1, a2)\n a1 << a2\n combined_strings = a1.split(//).sort\n letter = \"\"\n longest_array = []\n combined_strings.each do |current_letter|\n if letter != current_letter\n longest_array << current_letter\n letter = current_letter\n end\n end\n longest_array.join\nend", "def sort_string(string)\n string.split(' ').sort{|a, b| a.length - b.length}.join(' ')\nend", "def longest(a1, a2)\n (a1.split(\"\") + a2.split(\"\")).uniq.sort.join(\"\")\nend", "def sort_by_length(my_sentence)\n sorted = []\n split_sentence = my_sentence.split(\" \")\n while !split_sentence.empty?\n sorted << split_sentence.delete(split_sentence.min { |a, b| a.length <=> b.length }) #push the word with the min value into sorted then delete it\n end\n return sorted\nend", "def sort_by_length(my_sentence)\n if my_sentence.nil? || my_sentence == \"\"\n return []\n end\n word_array = my_sentence.split(\" \")\n sorted = []\n sorted << word_array[0]\n \n \n word_array.each do |word|\n index = 0\n while index < word_array.length\n if word.length < sorted[index].length\n sorted.insert(index, word)\n break\n elsif word.length == sorted[index].length\n sorted.insert(index+1,word)\n break\n elsif index == sorted.length-1\n sorted.insert(index+1,word)\n break\n end\n index += 1\n end\n end\n return sorted.uniq\nend", "def longest_prefix(strings)\n length = strings.min_by { |string| string.length }.length\n strings = strings.sort!\n substring = \"\"\n \n i = 0\n while i <= length\n if strings[0][0..i] == strings[-1][0..i]\n substring = strings[0][0..i]\n end\n i += 1\n end\n \n return substring\nend", "def sort_string(string)\n\twords = string.split\n\t#loop through array, get length and sort by length. \n\twords.sort! { |x,y| x.length <=> y.length }\n\twords.join(\" \")\nend", "def sort_by_length(my_sentence)\n raise ArgumentError if !my_sentence\n # I'm not sure if I can use .split() here. I can write my own split method\n # if .split() is not allowed here\n output = my_sentence.split(\" \")\n length = output.length()\n\n if length > 0\n (0...length - 1).each do |i|\n swapped = false\n (0...length - i - 1).each do |j|\n first = output[j]\n second = output[j + 1]\n\n if first.length() > second.length\n output[j + 1] = first\n output[j] = second\n swapped = true\n end\n end\n break if !swapped\n end\n end\n \n return output\nend", "def sort_by_length(my_sentence)\n #raise NotImplementedError, \"Method not implemented\"\n new_sentence = my_sentence.split()\n n = new_sentence.length\n for j in 0..n-1\n for i in 0..n-2-j\n if new_sentence[i].length > new_sentence[i + 1].length\n temp = new_sentence[i]\n new_sentence[i] = new_sentence[i+1]\n new_sentence[i + 1] = temp\n end\n end\n end\n return new_sentence\nend", "def sort_string(string)\n words = string.split.sort do |word1, word2|\n word1.length <=> word2.length\n end\n words.join(\" \")\nend", "def sentence_sort (sentence)\n\tsentence.split(\" \").sort_by(&:length)\nend", "def sort_tokens\n @string_tokens.sort! { |a, b| b.string.length <=> a.string.length }\n end", "def ordering_string(str, pat)\n i = j = count = 0\n patcount = pat.length\n while i < pat.length && j < str.length do\n while !(pat[i] == str[j]) && j < str.length do\n j += 1\n end\n j += 1\n count += 1 if j <= str.length\n i += 1\n end\n return count == patcount\nend", "def sort_by_length(my_sentence)\n array = my_sentence.split\n length = array.length\n i = 0\n\n while i < length-1 \n j = 0\n while j < length-i-1 \n if array[j].length > array[j+1].length # compares the length of each word\n temp = array[j]\n array[j] = array[j+1]\n array[j+1] = temp\n end\n j += 1\n end\n i += 1\n end\n\n return array \nend", "def sort_by_length(my_sentence)\n split_array = my_sentence.split\n\n (split_array.length - 1).times do |i|\n value = split_array[i + 1]\n j = i + 1\n\n while j > 0 && split_array[j - 1].length > value.length\n split_array[j] = split_array[j - 1]\n j -= 1\n end\n split_array[j] = value\n end\n\n return split_array \nend", "def longest_two_words(string)\n string.split.sort_by { |word| word.length }[-2..-1]\nend", "def longest_two_words(string)\n string.split.sort_by { |word| word.length }[-2..-1]\nend", "def longestSub(str)\n\n\nend", "def longest_two_words(string)\n string.delete!(',.?:;\"!\"')\n word_arr = string.split(\" \").sort_by { |word| word.length }.reverse!\n word_arr[0..1]\nend", "def longest_two_words(string)\n string = string.delete(\".,\")\n words = string.split(\" \")\n words.sort_by {|word| word.length}[-2..-1]\n\nend", "def longest(s1, s2)\n (s1 + s2).split(//).sort.uniq.join\nend", "def longest_string(list_of_words)\n list_of_words.max { |a,b| a.size <=> b.size }\n\nend", "def substrings_at_start(str)\n subs = []\n str.chars.each_with_index do |ch, i|\n subs << str.slice(0..i)\n end \n subs.sort {|a, b| a.length <=> b.length} \nend", "def sort_by_length(my_sentence)\n if my_sentence == \"\" \n return []\n end\n\n array = my_sentence.split\n\n i = 1\n while i < array.length \n j=i \n while j > 0 && array[j-1].length > array[j].length \n array[j-1],array[j] = array[j], array[j-1]\n end\n i=i+1\n end\n return array \nend", "def shortest_string(list_of_words)\n\n return nil if list_of_words.length == 0\n return \" \" if list_of_words.length == 1 && list_of_words[0] == \" \"\n return list_of_words[0] if list_of_words.length == 1\n\n test_word = list_of_words.pop\n not_it = []\n solution = []\n list_of_words.each do |word|\n if word.length < test_word.length\n not_it << test_word\n test_word = word\n else\n not_it << word\n end\n end\n\n solution.push test_word\n return solution[0]\n\n #------SOLUTION WITH sort_by METHOD:\n\n # new_list = list_of_words.sort_by {|x| x.length}\n # return new_list[0]\n\nend", "def sort_by_length(my_sentence)\n raise ArgumentError unless my_sentence.class == String\n\n sentence_array = my_sentence.split(\" \")\n my_array = []\n my_length = sentence_array.length\n \n until my_array.length == my_length\n sentence_array.length.times do |i|\n shortest = sentence_array.min { |x, y| x.length <=> y.length }\n my_array << shortest \n sentence_array.delete(shortest)\n end\n end\n return my_array\nend", "def sort_by_length(my_sentence)\n \n array = my_sentence.split(/\\s/)\n\n # using selection sort here\n i = 0\n while i < array.length - 1\n min_index = i\n j = i + 1\n while j < array.length\n if array[j].length < array[min_index].length\n min_index = j\n end\n j += 1\n end\n if min_index != i\n temp = array[min_index]\n array[min_index] = array[i]\n array[i] = temp\n end\n i += 1\n end\n \n return array\n\nend", "def longest_two_words(string)\n arr = string.split(' ')\n sorted = arr.sort_by {|str| str.length}\n sorted[-2..-1]\nend", "def sort_by_length(my_sentence)\n array = my_sentence.split\n length = array.length\n \n index = 0\n while index < (length - 1)\n other_index = 0\n while other_index < (length - index - 1)\n if array[other_index].length > array[other_index + 1].length\n temp = array[other_index]\n array[other_index] = array[other_index + 1]\n array[other_index + 1] = temp\n end\n other_index += 1\n end\n index += 1\n end\n \n return array\nend", "def longest(string)\n sliced = string.chars.slice_when {|a,b| a > b}.to_a\n longest = sliced.max_by {|sub_arr| sub_arr.length}.join\nend", "def sort_by_length(my_sentence)\n i = 0\n sentence_array = my_sentence.split(\" \")\n\n while i < (sentence_array.length)-1\n j = 0\n while j < (sentence_array.length)-i-1\n if (sentence_array[j].length) > (sentence_array[j+1].length)\n temp = sentence_array[j]\n sentence_array[j] = sentence_array[j+1]\n sentence_array[j+1] = temp\n end\n j += 1\n end\n i += 1\n end\n return sentence_array\nend", "def length_of_longest_substring(s)\n # find each substring and compare lengths\n # as i move through the string, have a store that keeps building until it finds a repeated character\nend", "def order(words)\n words.split.sort_by { |word| word.chars.min }.join(\" \")\nend", "def longest(string)\n if string.class == String\n words = string.split(' ').sort_by! {|word| word.length}\n words.last\n else\n nil\n end\nend", "def sort_by_length(my_sentence)\n my_sentence = my_sentence.split\n\n my_sentence.length.times do |i|\n j = 0\n\n while j < (my_sentence.length - i - 1)\n if my_sentence[j].length > my_sentence[j + 1].length\n temp = my_sentence[j]\n my_sentence[j] = my_sentence[j + 1]\n my_sentence[j + 1] = temp\n end\n \n j += 1\n end\n end\n\n return my_sentence\nend", "def find_short(string)\n string.split.map(&:length).sort.first\nend", "def short_long_short(string1, string2)\n array = [string1, string2].sort_by{|x| x.length} \n array.first + array.last + array.first\nend", "def sort_by_length(my_sentence)\n if my_sentence == \"\"\n return []\n end\n \n array = my_sentence.split(' ')\n # longest_string = array.first\n length = array.length\n \n # If the inner loop runs with no swaps, exit\n swapped = true\n i = 0\n while i < length-1 && swapped # outer loop\n j = 0\n # Assume you won't have to make a swap\n swapped = false\n while j < length-i-1 # inner loop\n if array[j].length > array[j+1].length # swap\n temp = array[j]\n array[j] = array[j+1]\n array[j+1] = temp\n # Since we just made a swap, set swapped to true\n swapped = true\n end\n j += 1\n end\n i += 1\n end\n \n return array\n raise NotImplementedError, \"Method not implemented\"\nend", "def sort_by_length(my_sentence)\n\n man = my_sentence.split\n measure = man.length\n birth = 0\n\n while birth < (measure - 1)\n iron_mask = 0\n\n while iron_mask < (measure - birth - 1) \n\n if man[iron_mask].length > man[iron_mask + 1].length\n placeholder = man[iron_mask]\n man[iron_mask] = man[iron_mask + 1]\n man[iron_mask + 1] = placeholder\n end\n\n iron_mask += 1\n end\n \n birth += 1\n end\n\n return man\nend", "def sortMe(arr)\n arr.sort_by { |word| word.to_s[word.to_s.length-1] }\nend", "def find_longest_word(input)\n array = input.split(\" \")\n array.sort! { |x, y| y.length <=> x.length }\n array[0]\nend", "def sort_by_length(my_sentence)\n return [] if my_sentence == \"\"\n\n array = my_sentence.split\n # swapped is not necessary for code to work, but reduces number of loops if inner loop runs without swapping anything (no swaps means everything is sorted)\n swapped = true\n i = 0\n while i < array.length-1 && swapped\n j = 0\n # Assume you won't have to make a swap\n swapped = false\n while j < array.length-i-1\n # word being checked is at the index of j (starts at 0 & increments by 1 each iteration)\n current_word = array[j]\n # if current word is longer then the word after it,\n if current_word.length > array[j+1].length\n # word at current index is swapped with the word at the next index\n array[j] = array[j+1]\n array[j+1] = current_word\n # since we just made a swap, set swapped to true\n swapped = true\n end\n # increment j so the next word will be checked on the next iteration\n j += 1\n end\n i += 1\n end\n\n return array\nend", "def longest_length(validwords)\n validwords = validwords.sort_by(&:length).reverse\n validwords[0].length\nend", "def longest_two_words(string)\n string.split(\" \").sort_by { |word| word.length }[-2..-1]\nend", "def double_sort(arr)\n sorted_strings = []\n arr.each do |string|\n sorted_strings << string.sort\n end\n #O(n * m * log m, where m is the length of the longest string)\n sorted_strings.sort\n # there are n * log n comparisons in this sort, but each string\n # comparisons takes m time to perform.\n # Therefore, calling .sort on an array of strings takes n * m log n\nend", "def longest_repeated_substring(string)\n\n size = string.length\n\n # put every possible suffix into an array\n suffixes = Array.new(size)\n size.times do |i|\n suffixes[i] = string.slice(i, size)\n end\n\n # sort the array of suffixes, so common substrings (i.e., prefixes\n # of suffixes) will be found in neighboring elements of the array\n suffixes.sort!\n\n best = \"\"\n at_least_size = 1 # the size to meet or exceed to be the new best\n distance = nil\n neighbors_to_check = 1\n\n # compare pairs of consecutive suffixes and see how much initial\n # commonality there is\n # (size - 1).times do |i|\n (1...size).each do |i|\n # p [i, neighbors_to_check]\n s1 = suffixes[i]\n\n # generally we will only need to compare the ith item and the one\n # preceding it; however if we were in a position to reject a long\n # enough common substring due to overlap issues, then we may have\n # to compare an ith item with additional preceding items;\n # neighbors_to_check tracks how many neighbors we need to check\n neighbors_to_check.downto(1) do |neighbor|\n s2 = suffixes[i - neighbor]\n\n # make sure that these to suffixes further apart than the size\n # of the current best; we don't explicitly track the index of\n # these suffixes, but since all suffixes go to the end of the\n # initial string, the size can be used as a proxy\n distance = (s1.size - s2.size).abs\n if distance < at_least_size\n if s1.size >= at_least_size &&\n s2.size >= at_least_size &&\n s1.slice(0, at_least_size) == s2.slice(0, at_least_size)\n neighbors_to_check = max(neighbors_to_check, neighbor + 1)\n else\n neighbors_to_check = neighbor\n end\n next\n end\n\n # if neighboring suffixes don't at least match as far as the best,\n # no need to check more carefully\n unless s1.slice(0, at_least_size) == s2.slice(0, at_least_size)\n neighbors_to_check = neighbor\n next\n end\n\n # get the longest common prefix that's no larger than distance,\n # since at that point the substrings overlap\n best = longest_common_prefix(s1, s2, distance)\n at_least_size = best.size + 1\n if best.size == distance\n neighbors_to_check = max(neighbors_to_check, neighbor + 1)\n else\n neighbors_to_check = neighbor\n end\n end\n end\n\n best.strip\n end", "def lps(s)\n return \"\" if s.empty?\n longest = [0,0]\n s.chars.each_with_index do |ch, idx|\n for i,j in [[idx, idx + 1], [idx, idx]]\n until s[i] != s[j]\n break if i < 0 || j >= s.length\n longest = [i,j] if longest[1] - longest[0] < j - i\n i -= 1\n j += 1\n end\n end\n end\n s[longest[0]..longest[1]]\nend", "def sort_string(string)\n splitted_words = string.split(' ')\n sorted_split = splitted_words.sort{|x, y| x.size <=> y.size}\n return sorted_split.join(' ')\nend", "def two_sort(s)\n s.min.chars.join('***')\nend", "def longest_two_words(string)\n string.gsub(/[[:punct:]]/, '').split.sort_by(&:length)[-2..-1]\nend", "def two_sort(s)\n s.min.chars.join(\"***\")\nend", "def find_shortest_words(str)\n words = str.downcase.split(/[^a-z0-9]/)\n words = words.sort_by {|word| word.size}\n shortest = []\n\n words = words.select {|word| word.size > 0}\n\n size = words[0].size\n words.each do |word|\n break if word.size > size\n shortest << word\n end\n shortest.sort\nend", "def longest_sentence(string)\n sentences = string.split(/[.?!]/)\n sentences.sort_by! { |sentence| sentence.split(' ').size }\n\n sentences.last.split(' ').size\nend", "def shorter(str1, str2)\n arr = [str1, str2].sort_by { |el| el.length }\n arr.first + arr.last + arr.first\nend", "def longest_palindrome(string)\n\n palindromes = []\n\n (0...string.length).each do |i|\n (i+1...string.length).each do |j|\n sub = string[i..j]\n palindromes << sub if sub == sub.reverse\n end\n end\n\n palindromes.sort_by(&:length).last \n\nend", "def longest_prefix(strings)\n prefix = ->s1, s2 { s1.each_char.zip(s2.each_char)\n .take_while { |c1, c2| c1 == c2 }\n .map(&:first).join }\n \n strings.reduce(&prefix)\nend", "def longest(a1, a2)\na1arr = a1.split(\"\").uniq\na2arr = a2.split(\"\").uniq\na3 = (a1arr + a2arr).sort.uniq.join\na3\n\nend", "def longest_string(list_of_words)\n list_of_words.max { |a, b| a.length <=> b.length }\n end", "def longest_string(arr)\n arr.max_by { |word| word.length }\nend", "def longest\n @strings.max { |a,b| a.length <=> b.length}\n end", "def ThirdGreatest(strArr)\n strArr.group_by(&:length).to_a.sort_by(&:first).reverse.flat_map { |_, words| words }[2]\nend", "def sort_by_length(my_sentence)\n array_of_words = my_sentence.split\n sorted_array = []\n array_of_words.each_with_index do |word, index_on_normal_array|\n if index_on_normal_array == 0\n sorted_array.push(array_of_words[0])\n else\n sorted_array_clone = sorted_array.clone\n sorted_array_clone.each_with_index do |word_in_sorted_array,index_in_sorted_array| \n if word.length < word_in_sorted_array.length\n sorted_array.insert(index_in_sorted_array,word)\n elsif word.length == word_in_sorted_array.length && word.length < word_in_sorted_array.length\n sorted_array.insert(sorted_array_clone.length,word) \n elsif word.length >= word_in_sorted_array.length && index_in_sorted_array == (sorted_array_clone.length - 1)\n sorted_array.insert(sorted_array_clone.length,word) \n end\n\n end\n\n end\n\n end\n return sorted_array\nend", "def english(str)\n result = []\n arr = str.split(' ')\n result << arr.uniq.group_by { |v| arr.count(v) }.max.last.join\n result << arr.max_by{ |x| x.length } \nend", "def substrings_at_start(string)\n strings_array = (1..(string.length)).map { |idx| string[0, idx] }\n strings_array.sort_by { |string| string.length }\nend", "def substrings_at_start(string)\n strings_array = (1..(string.length)).map { |idx| string[0, idx] }\n strings_array.sort_by { |string| string.length }\nend", "def sort_by_length(sentence)\n word_arr = sentence.split(\" \")\n\n i = 0\n while i < word_arr.length\n j = 0\n while j < word_arr.length - i - 1\n if word_arr[j].length > word_arr[j+1].length\n temp = word_arr[j]\n word_arr[j] = word_arr[j+1]\n word_arr[j+1] = temp \n end\n\n j += 1\n end\n i += 1\n end\n\n return word_arr\nend", "def longest_string(list_of_words)\n # Your code goes here!\n word_hash = Hash.new\n list_of_words.each do |word|\n word_hash[word] = word.length\n end\n word_length = Array.new\n word_hash.each_value do |value|\n word_length.push(value)\n end\n length_sorted = word_length.sort\n tall_one = length_sorted.last\n word_hash.key(tall_one)\nend", "def sort_by_length(sentence)\n #Step_1: break the sentence into an array of words\n array = sentence.split(/\\W+/)\n #Step_2: use insertion sort to sort the array\n i = 1\n while i < array.length\n to_insert = array[i]\n j = i\n while j > 0 && array[j-1].length > to_insert.length\n array[j] = array[j-1]\n j -= 1\n end\n array[j] = to_insert\n i += 1\n end\n\n return array\nend", "def longest_string(list_of_words)\n\treturn list_of_words.max {|x,y| x.length <=> y.length}\nend", "def longest_parlindrom_substring string\n return string if string.length < 2\n\n length = string.length\n memo = {}\n\n 1.upto(length) do |sub_length|\n 0.upto(length - sub_length) do |start_i|\n\n last_i = start_i + sub_length - 1\n indice = [start_i, last_i]\n\n next unless string[start_i] == string[last_i]\n\n memo[indice] = 1 if start_i == last_i\n memo[indice] = 2 if start_i + 1 == last_i\n\n indice_of_sub_substring = [start_i+1, last_i-1]\n \n if memo.has_key?(indice_of_sub_substring)\n memo[indice] = 2 + memo[indice_of_sub_substring]\n end\n end\n end\n indice = memo.key(memo.values.max)\n string[indice[0]..indice[1]]\nend", "def substrings_at_start(string)\n result = []\n string = string.chars\n string.size.times do\n result << string.join('')\n string.pop\n end\n\n result.sort\nend", "def sort_by_length(my_sentence)\n return [] if my_sentence == \"\"\n\n words = my_sentence.split\n i = 1\n \n # implement selection sort \n while i < words.length \n adjacent_word = words[i]\n j = i \n\n while j > 0 && words[j-1].length > adjacent_word.length\n words[j] = words[j-1]\n j -= 1\n end\n\n words[j] = adjacent_word\n i += 1\n end\n\n return words\nend", "def longest_two_words(string)\n str_arr = string.split.sort_by {|el| el.length}\n [str_arr[-2],str_arr[-1]]\nend", "def sort_by_length(my_sentence)\n array = my_sentence.split\n words_by_length = {}\n i = 0\n while i < array.length #O(m)\n if words_by_length[array[i].length] == nil\n words_by_length[array[i].length] = []\n end\n words_by_length[array[i].length] << array[i]\n i += 1\n end\n\n j = 0\n new_array = [] #space = O(n)\n while j < my_sentence.length #O(n)\n if words_by_length[j] != nil\n new_array << words_by_length[j]\n end\n j += 1\n end\n\n final_array = [] #space = O(n)\n k = 0\n while k < new_array.length #O(m) \n l = 0\n while l < new_array[k].length #O(p)\n final_array << new_array[k][l]\n l += 1\n end\n k += 1\n end\n\n return final_array\n \nend", "def longest_two_words(string)\n sorted = string.split.sort_by {|word| word.length}\n [sorted[-2], sorted[-1]]\nend", "def longest_repeated_substring(input)\n len = input.size / 2 # Max size is half total length, since strings cannot overlap\n\n while len > 0\n # Find all substrings of given length\n sub_strings = {}\n for i in 0...input.size-len\n sub_str = input[i..i+len]\n\n if not sub_strings.has_key?(sub_str)\n sub_strings[sub_str] = i+len # Add to list, track end pos for overlaps\n elsif sub_strings[sub_str] < i\n return sub_str # First non-overlapping match ties for longest\n end\n end\n\n len -= 1\n end\n\n nil\nend", "def longest_string(list_of_words)\n if list_of_words == []\n return nil\n elsif list_of_words == ['']\n return ''\n elsif list_of_words.length == 1\n return list_of_words[0]\n elsif\n sorted_words = list_of_words.sort_by { |x| x.length}\n return sorted_words[-1]\n end\nend", "def longest_prefix(strings)\n min = strings.min \n max = strings.max\n string_pre = min.size.times do |i| \n break i if min[i] != max[i]\n end\n min[0...string_pre]\nend", "def find_short(sentence)\n word_array = sentence.split\n\n word_array.sort! do |word_a, word_b|\n word_a.length <=> word_b.length\n end\n\n return word_array.first.length\nend", "def longest_prefix(strings)\n return \"\" if strings.empty? \n index = 0\n min = strings.min_by{|s| s.length} # find the shortest string\n longest_prefix = \"\"\n while index < min.length # keep running based on the length of the sortest the string \n strings.each do |string|\n if min[index] != string[index] # if the it's not equal, return the \"\"\n return longest_prefix\n end\n end\n longest_prefix += min[index]\n index +=1\n end \n return longest_prefix\nend", "def jumble_sort(str, alphabet = nil)\n return str.split(//).sort.join if alphabet.nil?\n\n str.split(//).sort_by { |x| alphabet.index(x) }.join\nend", "def sort_by_length(my_sentence)\n split_sentence = my_sentence.split(\" \")\n\n split_sentence.each_with_index do |word, index|\n previous_word = split_sentence[index - 1]\n if index == 0 \n elsif word.length < previous_word.length\n split_sentence[index - 1], split_sentence[index] = word, previous_word\n end\n end\nend" ]
[ "0.718832", "0.6930336", "0.6835696", "0.68058467", "0.67672914", "0.67205065", "0.6704554", "0.66997546", "0.6674899", "0.6660011", "0.6640362", "0.66145897", "0.6612656", "0.66058177", "0.65998316", "0.65588486", "0.6557286", "0.65525705", "0.65395004", "0.6513521", "0.6508438", "0.6499779", "0.64936465", "0.6492506", "0.6489607", "0.6481804", "0.6472732", "0.6463332", "0.6458393", "0.64309776", "0.642965", "0.64289486", "0.64245236", "0.6416667", "0.64150995", "0.64150995", "0.64143693", "0.641322", "0.64030313", "0.6394706", "0.6384154", "0.637438", "0.63700306", "0.63687867", "0.6366489", "0.6365513", "0.63612056", "0.63500166", "0.63469034", "0.6340412", "0.63397044", "0.63374215", "0.6330641", "0.632905", "0.6313071", "0.6312348", "0.6311953", "0.63033545", "0.630081", "0.6298196", "0.6290487", "0.6284193", "0.6283145", "0.6280021", "0.62692624", "0.6267796", "0.62676895", "0.62553155", "0.62442285", "0.6242786", "0.6240611", "0.6225702", "0.6223375", "0.6213467", "0.6211866", "0.6208006", "0.6199346", "0.6192885", "0.6171924", "0.6169098", "0.61594534", "0.61528665", "0.61454344", "0.61454344", "0.61446315", "0.6138083", "0.6137135", "0.6133769", "0.61290044", "0.61216134", "0.61174715", "0.61129767", "0.6112038", "0.61108166", "0.6100396", "0.6098489", "0.6094483", "0.6092316", "0.6080994", "0.6072883", "0.60654145" ]
0.0
-1
Takes an array of Strings and Regexp and generates a new Regexp that matches the or ("|") of all strings and Regexp
def array_to_or_regexp_string(array) array = symbols_to_strings array.flatten array = sort_operator_patterns array array = regexp_and_strings_to_regexpstrings array array.collect {|op| "(#{op})"}.join('|') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_regex(arr)\n return nil if arr.empty?\n\n regex_str = arr.join('|')\n Regexp.new(regex_str)\nend", "def or(*array_matchers, **keyword_matchers)\n create_matcher('or', array_matchers, keyword_matchers)\n end", "def or(*array_matchers, **keyword_matchers)\n create_matcher('or', array_matchers, keyword_matchers)\n end", "def build_regex(fields)\n fields_or = fields.map { |field| \"#{field}(\\\\[\\\\])?\" }.join('|')\n\n Regexp.new(\"^#{fields_or}$\")\n end", "def build_string_regex(elements)\n\n starting_with = \"\"\n elements.each_with_index do |el, i|\n starting_with += el.starts_with.to_s\n if i < elements.size - 1\n starting_with += \"|\"\n end\n end\n\n string_regex = /\\A[^\\s]+?(?=(#{starting_with}))/\n end", "def array_to_regexp(arr)\n arr = arr.map { |x| \"(.{\" + x + \"}?) \" }\n arr.push('/').unshift('/')\n structure_reg = to_regexp(arr.join(\"\"))\n end", "def define_match_any_of\n klass.send(:define_method, :match_any_of) do |tags|\n if tags.empty?\n str(\"\")\n else\n tags.map { |tag| str(tag) }.inject do |tag_chain, tag|\n tag_chain.send :|, tag\n end\n end\n end\n end", "def |( other )\n\t\treturn Regexp.new( \"(?:%s|%s)\" % [self.to_s, other.to_s] )\n\tend", "def array_or(a,b)\n c = []\n for i in 0...a.length\n if a[i] or b[i]\n c[i] = true\n else\n c[i] = false\n end\n end\n c\nend", "def or( *args ); { $or => args } end", "def possible_regexes(w)\n possible = []\n w_as_regex = escape_regex(w)\n\n # Here we specify many different functions that generate regex criterias,\n #\n # For example, /\\$10/ and /\\$[0-9]+/ for $10\n possible << w_as_regex\n possible << w_as_regex.gsub(/[0-9]/, \"[0-9]+\")\n\n possible.uniq.map { |p| Regexp.new(p, Regexp::IGNORECASE) }\n end", "def |(matcher)\n OrMatcher.new([self,matcher])\n end", "def create_reg_exp(sport)\n sport_regexp = \"\"\n sport_chars = sport.split \"\"\n sport_chars.each_index do |i|\n # regular expression contains substrings of various lengths\n sport_regexp += \"|\" + \"#{sport_chars[i]}#{sport_chars[i + 1]}#{sport_chars[i + 2]}#{sport_chars[i+3]}\" if i < sport.length - 3\n sport_regexp += \"|\" + \"#{sport_chars[i]}#{sport_chars[i + 1]}#{sport_chars[i + 2]}\" if i < sport.length - 2\n sport_regexp += \"|\" + \"#{sport_chars[i]}#{sport_chars[i + 1]}\" if i < sport.length - 1\n sport_regexp += \"|\" + \"#{sport_chars[i]}\" if i < sport.length\n end\n Regexp.new sport_regexp[1, sport_regexp.length]\nend", "def test_extended_patterns_no_flags\n [\n [ \".*\", \"abcd\\nefg\", \"abcd\" ],\n [ \"^a.\", \"abcd\\naefg\", \"ab\" ],\n [ \"^a.\", \"bacd\\naefg\", \"ae\" ],\n [ \".$\", \"bacd\\naefg\", \"d\" ]\n ].each do |reg, str, result|\n m = RustRegexp.new(reg).match(str)\n puts m.inspect\n unless m.nil?\n assert_equal result, m[0]\n end\n end\n end", "def create_filter(regexs, field = nil)\n return nil if regexs.nil? || regexs.empty?\n\n # /<regex>/i match pattern ignore case\n proc { |e| regexs.index do |regex|\n return /#{regex}/i =~ e if field\n return /#{regex}/i =~ e[field] if field\n end }\n end", "def joinor(array, symbol = ', ', symbol_2 = 'or')\n if array.size == 2\n array.join(' ').insert(-2, 'or ')\n elsif array.size == 1\n array.join\n else\n array.join(\"#{symbol}\").insert(-2, \"#{symbol_2} \")\n end\nend", "def joinor(array, delimiter = ', ', word = 'or')\n if array.size == 2\n array.join(\" #{word} \")\n else\n array[-1] = \"#{word} #{array.last}\"\n array.join(delimiter)\n end\nend", "def or_matcher(*args)\n OrMatcher.new(args)\n end", "def reduce_any_of(_production, _range, _tokens, theChildren)\n first_alternative = theChildren[3].first\n result = nil\n\n # Ugly: in SRL, comma is a dummy separator except in any of construct...\n if theChildren[3].size == 1 && first_alternative.kind_of?(Regex::Concatenation)\n result = Regex::Alternation.new(*first_alternative.children)\n else\n result = Regex::Alternation.new(*theChildren[3])\n end\n\n result\n end", "def where_any_in_array_matches_regex(attr, regex, flags: \"e\")\n where(\"? ~<< ANY(#{qualified_column_for(attr)})\", \"(?#{flags})#{regex}\")\n end", "def where_any_in_array_matches_regex(attr, regex, flags: \"e\")\n where(\"? ~<< ANY(#{qualified_column_for(attr)})\", \"(?#{flags})#{regex}\")\n end", "def joinor(array, separator = ', ', word = 'or')\n case array.size\n when 0, 1\n array.join\n when 2\n array.join(\" #{word} \")\n else\n last_element = array.pop.to_s\n array.join(separator) << last_element.prepend(\"#{separator}#{word} \")\n end\nend", "def rewrite_or(expression)\n first = expression[1]\n second = expression[2]\n\n VirtualKeywords.call_operator_replacement(:call_or, first, second)\n end", "def process_or(exp)\n lhs = process exp.shift\n rhs = process exp.shift\n\n return \"#{lhs} || #{rhs}\"\n end", "def sort_operator_patterns(array)\n array.sort_by {|a| a.kind_of?(Regexp) ? 0 : -a.length}\n end", "def all_or(*args)\n Term.get OrTerm, *args\n end", "def arr_in_phrase? (arr, string)\n\t#might be unefficient to recreate the reg each time, maybe better to return a regex?\n\treg = arr.map {|str| Regexp.escape(str)}\n\treg = /#{arr.join(\"|\")}/ \n\treturn reg === string\nend", "def joinor(arr, delimiter=', ', word='or')\n arr[-1] = \"#{word} #{arr.last}\" if arr.size > 1\n arr.join(delimiter)\nend", "def find_regex(words)\n Array(words).map do |w|\n regexes_for_word = []\n\n possible_regexes(w).each do |regex|\n #puts \"Word: #{w} against #{regex} -> #{w =~ regex}\"\n if w =~ regex\n regexes_for_word << regex\n end\n end\n\n regexes_for_word.uniq\n end\n end", "def filepath_pattern(filepaths)\n return \"\" if filepaths.nil?\n\n filepaths.map! { |path| '^' + path + '$' }\n filepaths.join('|')\n end", "def as_regex\n Regexp.new('/' + split.map do |element|\n replace element\n end.join('/'))\n end", "def logical_or\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n return_value = LogicalOrReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n string_literal229 = nil\n logical_and228 = nil\n logical_and230 = nil\n\n tree_for_string_literal229 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 581:5: logical_and ( '||' logical_and )*\n @state.following.push( TOKENS_FOLLOWING_logical_and_IN_logical_or_3844 )\n logical_and228 = logical_and\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, logical_and228.tree )\n end\n # at line 581:17: ( '||' logical_and )*\n while true # decision 52\n alt_52 = 2\n look_52_0 = @input.peek( 1 )\n\n if ( look_52_0 == OR )\n alt_52 = 1\n\n end\n case alt_52\n when 1\n # at line 581:20: '||' logical_and\n string_literal229 = match( OR, TOKENS_FOLLOWING_OR_IN_logical_or_3849 )\n if @state.backtracking == 0\n\n tree_for_string_literal229 = @adaptor.create_with_payload( string_literal229 )\n root_0 = @adaptor.become_root( tree_for_string_literal229, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_logical_and_IN_logical_or_3853 )\n logical_and230 = logical_and\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, logical_and230.tree )\n end\n\n else\n break # out of loop for decision 52\n end\n end # loop for decision 52\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n end\n \n return return_value\n end", "def monocle(inputString)\n\toptic = Regexp.new(inputString)\n\treturn optic\nend", "def logical_or\n expr = logical_and\n\n while match?(:or)\n operator = previous\n right = logical_and\n expr = Ringo::Logical.new(expr, operator, right)\n end\n\n expr\n end", "def joinor(arr, delimiter=', ', word='or')\n case arr.size\n when 0 then ''\n when 1 then arr.first\n when 2 then arr.join(\" #{word} \")\n else\n arr[-1] = \"#{word} #{arr.last}\"\n arr.join(delimiter)\n end\nend", "def pattern\n Regexp.union(pattern_classifiers.map(&:pattern))\n end", "def multireg(regpexp, str)\n result = []\n while regpexp.match(str)\n result.push regpexp.match(str)\n str = regpexp.match(str).post_match\n end\n result\n end", "def match(array_of_words)\n matches = [] #Flag\n anagram_execute = anagram.split(//)\n anagram_execute = anagram_execute.sort!\n array_of_words.each do |possible_match|\n array_of_letters = possible_match.split(//)\n array_of_letters = array_of_letters.sort!\n matches << possible_match if array_of_letters == anagram_execute\n #use truncated, cleaner if statement\n end\n matches #return the matches array\n end", "def make_regexp\n @intent = self.intent\n regexp = self.pattern.dup.downcase\n words = regexp.split(\" \")\n words.each do |word|\n if word.include? '/'\n regexp = regexp.gsub(word,\"(#{word})\")\n\n end\n\n end\n regexp = regexp.gsub('/',\"|\")\n regexp = regexp.gsub('^ ','.{0,60}').gsub(' ^','.{0,60}').gsub(' *','.{1,60}').gsub('* ','.{1,60}').gsub('^','.{1,60}').gsub(' [','.{0,60}[')\n regexp = regexp.gsub(' .{0,60}','.{0,60}')\n regexp = regexp.gsub(' .{1,60}','.{1,60}')\n regexp = '.{0,60}' + regexp + '.{0,60}'\n self.regexp = regexp\n chunks = self.pattern.split(' ')\n chunks.each do |ch|\n result= Regexp.new(/\\[.{0,12}\\]/) =~ ch\n if(result==0)\n set = WordSet.find_by_keyword(ch[1..-2])\n str = '(' + set.words.join('|') + ')'\n regexp = self.regexp.gsub(ch,str)\n self.regexp = regexp\n end\n end\n self.save\n end", "def joinor(arr, delimiter = ', ', conjunction = 'or')\n return '' if arr.empty?\n arr.map!(&:to_s)\n return arr[0] if arr.size == 1\n str = arr.size > 2 ? arr[0..-2].join(delimiter) + delimiter : arr[0] + ' '\n # str = arr[0..-2].join(delimiter)\n # str << (arr.size > 2 ? delimiter : ' ')\n str << conjunction + ' ' + arr[-1]\nend", "def make_pattern pattern\n state = :close\n rule = ''\n last_ch = ''\n pattern.split('').each do |ch|\n case ch\n when '('\n state = :open\n rule << '('\n when ')'\n state = :close\n rule << ')'\n else\n case state\n when :open\n case last_ch\n when '('\n else\n rule << '|'\n end\n rule << ch\n when :close\n rule << \"[#{ch}]\"\n end\n end\n last_ch = ch\n end\n Regexp.new rule\nend", "def joinor(ary, delimiter = ', ', last_word = 'or')\n return ary.first if ary.size == 1\n return \"#{ary.first} #{last_word} #{ary.last}\" if ary.size == 2\n\n last_element = ary.pop\n ary << ''\n\n \"#{ary.join(delimiter)}\"\\\n \"#{last_word} \"\\\n \"#{last_element}\"\n end", "def split_or_clauses(args)\n level = 0\n i = 0\n or_positions = []\n while i < args.length\n arg = args[i]\n if arg == BOOLEAN_OR && level == 0\n or_positions << i\n end\n if arg == OPEN_PAREN\n level += 1\n elsif arg == CLOSE_PAREN\n level -= 1\n if level == -1\n or_positions << i\n return or_positions\n end\n end\n i += 1\n end\n or_positions << args.length unless or_positions.empty?\n or_positions\nend", "def get_regex(separator, container, multiword)\n # We get the default separator & containers if none were specified\n tag_separator = separator || TagExtractor::tag_separator\n tag_container = container || TagExtractor::words_container\n\n # Transforms the container string into an array like ['[', ']'].\n left, right = container_array(tag_container)\n\n # Word matching regex for simple and multiple words.\n mono_word = '(?:[a-zA-Z](?:\\w|-)*)'\n multi_words = '(?:[a-zA-Z](?:\\w|-|\\s)*)'\n\n # Escapes everything.\n left, right, tag_separator = [left, right, tag_separator].map { |s| Regexp::escape(s) }\n\n if multiword\n %r(#{tag_separator}(?:#{mono_word}|(?:#{left}{1}#{multi_words}#{right}{1})))\n else\n %r(#{tag_separator}(?:#{mono_word}))\n end\n end", "def joinor(arr, grammar = \", \" , or_str = \"or\")\n return puts \"#{arr[0]} #{or_str} #{arr[1]}\" if arr.size < 3\n\n output_str = \"\"\n\n arr.each do |num|\n if num == arr.last\n output_str << \"#{or_str} #{num}\"\n else\n output_str << \"#{num}#{grammar}\"\n end\n end\n\n\n puts output_str\nend", "def process_op_asgn_or(exp)\n ref = exp.shift\n asgn = exp.shift\n asgn[2] = [:or, ref, asgn[2]]\n process(asgn)\n end", "def apply_boolean_nodes(input_array)\n last_index = input_array.size - 1\n return input_array.first if last_index < 1\n result = nil\n i = 0\n while i < last_index\n left = result || input_array[0]\n raise \"Invalid boolean syntax: #{params[:where]}\" unless left.is_a?(Arel::Nodes::Node)\n i += 1\n bool = input_array[i]\n raise \"Invalid boolean syntax: #{params[:where]}\" unless @boolean_operators.include?(bool)\n i += 1\n right = input_array[i]\n raise \"Invalid boolean syntax: #{params[:where]}\" unless right.is_a?(Arel::Nodes::Node)\n result = case input_array[1]\n when 'and'\n Arel::Nodes::And.new(input_array[0], input_array[2])\n when 'or'\n # noinspection RubyArgCount\n Arel::Nodes::Or.new(input_array[0], input_array[2])\n end\n end\n result\n end", "def joinor(ary, delimiter = ', ', final_word = 'or')\n result = ''\n count = 0\n\n case ary.size\n when 0 then ''\n when 1 then ary[0].to_s\n when 2 then \"#{ary[0]} #{final_word} #{ary[1]}\"\n else\n while count <= ary.length - 2\n result += ary[count].to_s + delimiter\n count += 1\n end\n\n result + final_word + ' ' + ary[-1].to_s\n end\nend", "def either_matcher *pattern\n lambda do |string, index = 0, counts:|\n original_counts = counts.dup\n\n pattern.each do |matcher|\n found = matcher.call(string, index, counts: counts)\n\n if match? found\n return found\n else\n counts.replace(original_counts)\n end\n end\n\n nil\n end\n end", "def autoregex(anything)\n deb \"Autoregex() supercool! With a #{blue anything.class}\"\n case anything.class.to_s\n when 'String' \n if anything.match(/^\\/.*\\/$/) # '/asd/' is probably an error! The regex builder trails with '/' automatically\n fatal 23,\"Attention, the regex is a string with trailing '/', are you really SURE this is what you want?!?\"\n end\n return Regexp.new(anything)\n when 'Regexp'\n return anything # already ok\n when 'Array'\n return Regexp.new(anything.join('|'))\n else\n msg = \"Unknown class for autoregexing: #{red anything.class}\"\n $stderr.puts( msg )\n raise( msg )\n end\n return nil\nend", "def joinor(ary, punc=', ', conj='or')\n if ary.size <= 1\n ary.first.to_s\n elsif ary.size == 2\n ary.join(\" #{conj} \")\n else\n \"#{ary[0..-2].join(punc)}#{punc + conj} #{ary.last}\"\n end\nend", "def alert_terms_regex\n unless alert_terms.nil? or alert_terms.empty?\n @alert_terms_regex ||= Regexp.new(alert_terms.gsub(/\\s+/, '|'), true)\n end\n end", "def convert_regexp_handlings str, attrs, exclusive = false\n @regexp_handlings.each do |regexp, attribute|\n next unless exclusive == exclusive?(attribute)\n str.scan(regexp) do\n capture = $~.size == 1 ? 0 : 1\n\n s, e = $~.offset capture\n\n attrs.set_attrs s, e - s, attribute | @attributes.regexp_handling\n end\n end\n end", "def pattern2regex(pattern); end", "def regexize_words(words)\n return '' if !words.is_a?(Array) && !words.is_a?(String)\n words = [words] if words.is_a?(String)\n words = words.reject{ |w| !w.is_a?(String) || w.empty? }\n return '' if words.empty?\n words = '(?:' + words.map{ |w| \"(?:\\\\b#{Regexp.escape(w.strip)}\\\\b)\" }.join('|') + ')'\nrescue\n ''\nend", "def recursive_compile(regexps, paths = [])\n return paths if regexps.length.zero?\n paths << Regexp.union(regexps)\n regexps.shift\n recursive_compile(regexps, paths)\n end", "def or(*exps)\n joined_exps = exps.join(' and ')\n @query[:filters] += \" or #{joined_exps}\"\n self\n end", "def translate_pattern_to_regexp(pat)\n i = 0\n n = pat.size\n res = ''\n while i < n\n c = pat[i]\n i = i + 1\n if c == '*'\n j = i\n if j < n and pat[j] == '*'\n res[-1] = '(\\/)?(?<double_asterisk>.*)?'\n i = j + 1\n else\n res = res + '.*'\n end\n elsif c == '?'\n res = res + '.'\n elsif c == '['\n j = i\n # The following two statements check if the sequence we stumbled\n # upon is '[]' or '[^]' because those are not valid character\n # classes.\n if j < n and pat[j] == '^'\n j = j + 1\n end\n if j < n and pat[j] == ']'\n j = j + 1\n end\n # Look for the closing ']' right off the bat. If one is not found,\n # escape the opening '[' and continue. If it is found, process\n # he contents of '[...]'.\n while j < n and pat[j] != ']'\n j = j + 1\n end\n if j >= n\n res = res + '\\\\['\n else\n stuff = pat[i...j].gsub('\\\\', '\\\\\\\\')\n i = j + 1\n #if stuff[0] == '!'\n # stuff = '^' + stuff[1..-1]\n #elsif stuff[0] == '^'\n # stuff = '\\\\' + stuff\n #end\n res = \"#{res}[#{stuff}]\"\n end\n else\n res = res + Regexp.escape(c)\n end\n end\n\n return Regexp.new(res + '$')\nend", "def arel_compound_predicate(string_array)\n @boolean_operators ||= %w{and or not}\n # make a pass through the array, replacing non-boolean strings with Arel nodes\n node_array = string_array.map { |s| @boolean_operators.include?(s) ? s : arel_condition_node(s) }\n # reduce 'not',node pairs into Arel::Nodes::Not nodes\n node_array_2 = apply_negation_nodes(node_array)\n # reduce left,boolean,right,... sequences into Arel::Nodes::And or Arel::Nodes::Or\n result = apply_boolean_nodes(node_array_2)\n result\n end", "def joinor(arr, str1 = ', ', str2 = 'or')\n case arr.size\n when 0 then ''\n when 1 then arr.first\n when 2 then arr.join(\" #{str2} \")\n else\n arr[-1] = \"#{str2} #{arr.last}\"\n arr.join(str1)\n end\nend", "def reduce_one_of(_production, _range, _tokens, theChildren)\n raw_literal = theChildren[-1].token.lexeme.dup\n alternatives = raw_literal.chars.map do |ch|\n if Regex::Character::MetaCharsInClass.include?(ch)\n chars = [Regex::Character.new('\\\\'), Regex::Character.new(ch)]\n Regex::Concatenation.new(*chars)\n else\n Regex::Character.new(ch)\n end\n end\n\n # TODO check other implementations\n Regex::CharClass.new(false, *alternatives)\n end", "def make_regexp(word)\n\t\texps = word.scan(/./).map do |c|\n\t\t\tif c =~ /[aeiou]/i\n\t\t\t\t\"[aeiou]+\"\n\t\t\telse\n\t\t\t\t\"#{c}+\"\n\t\t\tend\n\t\tend\n\t\t# make it a regular expression and ignore the case, also match the whole expression\n\t\tRegexp.new(\"^#{exps.join}$\", Regexp::IGNORECASE)\n\tend", "def get_and_or_not_of str\n # @param str is a string (not normalized!)\n # ie. ['big','OR','middle','OR','large','sandwich','NOT','cheese']\n # @returns and_phrases -- list of normalized words\n # @returns or_phrases -- list of lists of normalized words\n # @returns not_phrases -- list of normalized words\n # actually and_phrases is the same to or_phrases but in and_phrases\n # single words have replaced or-sublists\n \n r = str.split\n \n # returns or-words and indexes of already analyzed words\n def getOr_ r\n or_= []; del_ = []; cur = []\n status = :start\n x = 0\n while x < r.length do\n if r[x] == OR_OPERATOR\n if status == :start\n cur = [r[x-1]]\n status = :cont\n del_.push x-1\n end\n cur.push r[x+1]\n del_ += [x, x+1]\n x += 2\n else\n if status == :cont\n status = :start\n or_.push cur\n cur = []\n end\n x += 1\n end\n end\n if not cur.empty?\n or_.push cur\n end\n return or_, del_\n end\n \n def getAndNot_ r, skip\n and_ = []; not_ = []\n r.length.times do |x|\n if not skip.include?(x)\n # if previous or last (if x = 0) in array is NOT\n if r[x-1] == NOT_OPERATOR\n not_ |= [r[x]]\n elsif r[x] != NOT_OPERATOR\n and_ |= [r[x]]\n end\n end\n end\n return and_, not_\n end\n \n or_phrases, skip = getOr_ r\n and_phrases, not_phrases = getAndNot_ r, skip\n \n return normalize_list(and_phrases), normalize_list(or_phrases), normalize_list(not_phrases)\n end", "def logical_calc(arr, op)\n op=='AND' ? arr.reduce(:&) : op=='OR' ? arr.reduce(:|) : arr.reduce(:^)\nend", "def getOr_ r\n or_= []; del_ = []; cur = []\n status = :start\n x = 0\n while x < r.length do\n if r[x] == OR_OPERATOR\n if status == :start\n cur = [r[x-1]]\n status = :cont\n del_.push x-1\n end\n cur.push r[x+1]\n del_ += [x, x+1]\n x += 2\n else\n if status == :cont\n status = :start\n or_.push cur\n cur = []\n end\n x += 1\n end\n end\n if not cur.empty?\n or_.push cur\n end\n return or_, del_\n end", "def joinor(arr, separator = \", \", ending = \"or\")\n final_string = \"\"\n n = 0\n\n case arr.length()\n when 1\n final_string = arr[0].to_s\n when 2\n final_string = arr[0].to_s + \" \" + ending + \" \" + arr[1].to_s\n when 3..\n while n < (arr.length()-1)\n final_string += (arr[n].to_s) + separator\n n += 1\n end\n final_string += ending + \" \" + (arr[-1].to_s)\n end\nend", "def escape_for_tsquery(array)\n keywords = array.map do |token|\n next if token.empty?\n escaped_token = token.gsub(/\\\\|'/, '\\0\\0\\0\\0')\n \"'\" + escaped_token + \"'\"\n end.compact\n query = []\n if keywords.any?\n query << \"(\" + keywords.join(\" & \") + \")\"\n end\n query\n end", "def process_match2(exp)\n left = exp.shift\n right = exp.shift\n return process(s(:call, left, :=~, s(:array, right)))\n end", "def |(arg)\n Anagram::Matching::TypeMatcher.new(self)|arg\n end", "def define_regexp\n # Default pattern if there is no tags specified on command line\n if @options[:tags].nil?\n pattern = 'TODO|FIXME'\n else\n # Parse defined tags on command line\n pattern = ''\n tags_names = @options[:tags].split(',')\n tags_names.each do |tag_name|\n pattern << (pattern.empty?) ? \"#{tag_name}\" : \"|#{tag_name}\"\n end\n end\n pattern\n end", "def process_or(exp)\n a = exp.shift\n b = exp.shift\n\n res = without_result do\n want_expression do\n with_temporary_variable do |tmp|\n @local_variables_need_no_initialization.add(tmp)\n \"(#{tmp}=#{process(a)}, (#{tmp}!==false&&#{tmp}!==nil) ? #{tmp} : (#{process(b)}))\"\n end\n end\n end\n\n return resultify(res)\n end", "def get_regular_expression_of_symbols\n regular_expression = nil\n @symbols.each do |symbol|\n formated_symbol = Regexp.escape(symbol[:symbol])\n regular_expression = if regular_expression.nil?\n \"(#{formated_symbol})\"\n else\n \"#{regular_expression}|(#{formated_symbol})\"\n end\n end\n Regexp.new(regular_expression)\n end", "def apply_patterns(patterns=Pattern.all)\n raise 'Not an array' unless patterns.instance_of?(Array)\n patterns.each do |pattern|\n raise 'Not a pattern' unless pattern.instance_of?(Pattern)\n if self.apply_pattern(pattern)\n # only apply first pattern\n return true\n end\n end\n false\n end", "def test_two_artgs\n assert_true ArrayPatternMatcher.new(1, 2) === [1, 2]\n assert_true ArrayPatternMatcher.new(Integer, 2) === [1, 2]\n assert_true ArrayPatternMatcher.new(/\\s/, 'a') === [' ', 'a']\n assert_false ArrayPatternMatcher.new(/\\s/, 'b') === [' ', 'a']\n assert_false ArrayPatternMatcher.new(/\\s/) === [' ', 'a']\n end", "def match a, pattern, out = {}\n return false if a.length != pattern.length\n pattern.length.times do |i|\n if pattern[i].class == Array\n if a[i].class == Array\n res = match a[i], pattern[i], out\n return false if not res\n else\n return pattern[i][0] == :op\n end\n else\n if not (pattern[i].class == Symbol or pattern[i].lower?) or\n pattern[i] == '_' or\n /\\$/.match(pattern[i])\n if out[pattern[i]] and pattern[i] != '_'\n return false if a[i] != out[pattern[i]]\n else\n out[pattern[i]] = a[i]\n end\n else\n return false if a[i] != pattern[i]\n end\n end\n end\n return out\nend", "def or_expr\n expr = and_expr()\n\n while match(:or)\n operator = previous()\n right = and_expr()\n expr = Expr::Logical.new expr, operator, right\n end\n\n expr\n end", "def |(other)\n RLSM::RegExp.new \"#@string|#{other.string}\"\n end", "def reduce_to_any_true(source_array)\n return source_array.any? {|word| word}\nend", "def bitwise_or(a, b)\n\tresult = ''\n\ta.each_char.with_index do |val, index|\n\t\tif val == '1' || b[index] == '1'\n\t\t\tresult.concat '1'\n\t\telse\n\t\t\tresult.concat '0'\n\t\tend\n\tend\n\treturn result\nend", "def prepare_for_regexp(output_str)\n split_lines(output_str).map do |str|\n Regexp.new(Regexp.escape(str), Regexp::EXTENDED)\n end\n end", "def match_maker(opposites_attract, *elements)\n to_return = []\n elements.each_slice 2 do |first, last|\n first = !!first\n last = !!last\n result = if opposites_attract\n first != last\n else\n first == last\n end\n to_return << result\n end\n to_return\n end", "def pregex2regex(regex, br_flg = false)\n this_regex = regex.dup\n br_ex = br_flg ? '' : '?:'\n %w(girl_name human_name precure_name cast_name color).each do |attr|\n expression = '\\[:' + attr + ':\\]'\n precures_ex = cure_list(attr.to_sym).join('|')\n replaced = \"(#{br_ex}#{precures_ex})\"\n this_regex.gsub!(/#{expression}/, replaced)\n end\n this_regex\n end", "def match(*list)\n @match.concat(makelist(list)) unless list.empty?\n @match\n end", "def strings_for_select( *_array)\n _array = _array.flatten\n if _array.blank?\n []\n else\n _array.zip _array\n end\n end", "def match_maker(opposites_attract, *elements)\n to_return = []\n elements.each_slice 2 do |first, last|\n first = !!first\n last = !!last\n result = if opposites_attract\n first != last\n else\n first == last\n end\n to_return << result\n end\n to_return\nend", "def build_regex_mask(start, finish)\n s = \"\"\n start_a, end_a = start.to_s.split(//), finish.split(//)\n start_a.each_with_index do | x, y |\n if x == end_a[y]\n s << end_a[y]\n else\n start_c = start_a[y].to_i\n end_c = end_a[y].to_i\n s << \"[\"\n (start_c .. end_c).each { | i | s << i.to_s }\n s << \"]+\"\n break\n end\n end\n /#{s}/\n end", "def process(items) \n out = []\n \n if items.is_a?(Array)\n items.each do |item|\n out << item.scan(@regex).flatten\n end\n \n elsif items.is_a?(String)\n out = items.scan(@regex).flatten#{|m| m.to_s}\n \n else\n out = items\n end\n \n out.flatten\n end", "def |(ce)\n BooleanExpression.new(:OR, self, ce)\n end", "def has_match_for_all(text, regexp)\n text.to_a.all?{ |line| line =~ regexp }\n end", "def process_match3(exp)\n right = exp.shift\n left = exp.shift \n return process(s(:call, left, :=~, s(:array, right)))\n end", "def bit_or\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 51 )\n return_value = BitOrReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal235 = nil\n bit_xor234 = nil\n bit_xor236 = nil\n\n tree_for_char_literal235 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 589:5: bit_xor ( '|' bit_xor )*\n @state.following.push( TOKENS_FOLLOWING_bit_xor_IN_bit_or_3894 )\n bit_xor234 = bit_xor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bit_xor234.tree )\n end\n # at line 589:13: ( '|' bit_xor )*\n while true # decision 54\n alt_54 = 2\n alt_54 = @dfa54.predict( @input )\n case alt_54\n when 1\n # at line 589:15: '|' bit_xor\n char_literal235 = match( PIPE, TOKENS_FOLLOWING_PIPE_IN_bit_or_3898 )\n if @state.backtracking == 0\n\n tree_for_char_literal235 = @adaptor.create_with_payload( char_literal235 )\n root_0 = @adaptor.become_root( tree_for_char_literal235, root_0 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_bit_xor_IN_bit_or_3902 )\n bit_xor236 = bit_xor\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, bit_xor236.tree )\n end\n\n else\n break # out of loop for decision 54\n end\n end # loop for decision 54\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 51 )\n\n end\n \n return return_value\n end", "def get_letter_mask(array, valid_array)\n array = array.split(/[ ,\\.:;\\-+]/) if array.class != Array\n \n str = ''\n array.each do |word|\n word.upcase!\n next if word == 'AND'\n str += word[0].chr if valid_array.include? word[0].chr\n end\n return str\n end", "def bitSetOr (a,b)\n\t\tresult = Array.new\n\t\tfor i in 0...(a.size)\n\t\t\tresult[i] = a[i] || b[i]\n\t\tend\n\t\treturn result\n\tend", "def tag_match?(tags, tag_patterns, last_only)\n if last_only\n tags.last.match(Regexp.new(tag_patterns.last))\n else\n return false if tags.count != tag_patterns.count\n all_match = true\n tags.each_with_index do |tag, i|\n unless tag.match(Regexp.new(tag_patterns[i]))\n all_match = false\n break\n end\n end\n all_match\n end\n end", "def reduce_to_all_true(source_array)\n return source_array.all? {|word| word}\nend", "def generate_OR_clauses(rule)\n #First, split rule into positive and negative sets of clauses.\n parts = rule.split(@NOT)\n positive_clauses = parts[0]\n negative_clauses = parts[1]\n\n @or_clauses_pos = positive_clauses.split('OR')\n @or_clauses_neg = negative_clauses.split('OR')\n end", "def regexps; end", "def or_exp(expression)\n @use_disjunction = true\n @disjunction = @builder.and(@disjunction,expression)\n\n self\n end", "def nonstrict_match(tokens)\n matchset = MatchSet.new()\n index = 0;\n tokens.each do |token|\n break unless pattern[index]\n tagger_name = pattern[index].to_s\n klass = constantize(tagger_name)\n match = token.has_tag?(klass) \n if match\n matchset << token.get_tag(klass);\n index += 1; \n next; \n else\n next\n end\n end\n\n return false if matchset.size != pattern.size\n return matchset\n end", "def xor_select(arr, prc_1, prc_2)\n new_arr = []\n\n arr.each do |ele|\n if prc_1.call(ele) && !prc_2.call(ele) || !prc_1.call(ele) && prc_2.call(ele)\n new_arr << ele\n end\n end\n\n new_arr\nend" ]
[ "0.7485174", "0.6648452", "0.6648452", "0.6321851", "0.6293496", "0.6088856", "0.5971724", "0.5868424", "0.57127434", "0.57005244", "0.5695597", "0.5613001", "0.55720836", "0.5564028", "0.5548862", "0.55442566", "0.5536933", "0.54876405", "0.54561657", "0.54528064", "0.54528064", "0.54244834", "0.54161537", "0.53801423", "0.53536654", "0.53381455", "0.5318612", "0.53059673", "0.53037107", "0.5301832", "0.5298822", "0.52703977", "0.5268742", "0.52518076", "0.5245432", "0.5206609", "0.52041495", "0.52030355", "0.518713", "0.518187", "0.51813203", "0.5180267", "0.5163396", "0.5158136", "0.51466256", "0.5144199", "0.51256776", "0.5122429", "0.5095548", "0.50942254", "0.506296", "0.50571215", "0.5055185", "0.5049237", "0.5043876", "0.5041023", "0.50193465", "0.5011866", "0.50087535", "0.5002917", "0.49971452", "0.49903098", "0.49678963", "0.4965423", "0.49573624", "0.4954287", "0.49482358", "0.49474308", "0.49419615", "0.49419206", "0.49331114", "0.49320242", "0.4930897", "0.4925614", "0.49183825", "0.49161315", "0.49145433", "0.4908926", "0.49082103", "0.49056068", "0.4903187", "0.48997834", "0.48983142", "0.4880182", "0.48764598", "0.4872445", "0.4872392", "0.4872003", "0.48655593", "0.4854143", "0.48519367", "0.48506734", "0.48457715", "0.4828149", "0.48248518", "0.48139322", "0.48096547", "0.48082697", "0.48079047", "0.48044086" ]
0.6960057
1
associativity = :left => operators of the same precidence execut from left to right :right => operators of the same precidence execut from right to left
def index_of_lowest_precedence(operators,associativity=:left) lowest = lowest_precedence = nil operators.each_with_index do |operator,i| operator_string = operator.to_s precedence = operator_precedence(operator_string) right_associative = @right_operators_regexp && operator_string[@right_operators_regexp] if !lowest || (right_associative ? precedence < lowest_precedence : precedence <= lowest_precedence) lowest = i lowest_precedence = precedence end end lowest end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reduce_associativity\n pos, neg = [], []\n\n @x.each do |x_el|\n case x_el\n when CAS::Invert\n neg << x_el.x\n when CAS::Diff\n pos << x_el.x\n neg << x_el.y\n else\n pos << x_el\n end\n end\n\n pos, neg = self.reduce_associativity_array pos, neg\n pos = self.__reduce_multeplicity(pos)\n neg = self.__reduce_multeplicity neg\n\n # TODO : Add rules for simplifications\n left, right = nil, nil\n left = CAS::Sum.new(pos) if pos.size > 1\n left = pos[0] if pos.size == 1\n right = CAS::Sum.new(neg) if neg.size > 1\n right = neg[0] if neg.size == 1\n\n return CAS::Zero unless left || right\n return left unless right\n return -right unless left\n return left - right\n end", "def precedence; end", "def prescedence_of operator\n case operator\n when \"*\" then 2\n when \"/\" then 2\n when \"+\" then 1\n when \"-\" then 1\n when \"(\" then 0 \n end\n end", "def stackPrecedence(operator)\n if ['+', '-'].include? operator\n return 1\n elsif ['*', '/', '%'].include? operator\n return 2\n elsif '^'.eql? operator\n return 3\n else\n return -1\n end\n end", "def evaluate_operator(left, right)\n left <= right\n end", "def precedence\n case @operator\n when '+', '-'\n # addition and subtraction\n 0\n when '*', '/'\n # multiplication and division\n 1\n when '**', '^'\n # powers / roots (e.g. 2^(1/2))\n 2\n end\n end", "def stackPrecedence(operator)\n if operator == \"+\" || operator == \"-\"\n\t\t\treturn 1\n\t\tend\n\n if operator == \"*\" || operator == \"/\" || operator == \"%\"\n\t\t\treturn 2\n\t\tend\n\n if operator == \"^\"\n\t\t\treturn 3\n\t\tend\n\n if operator == \"(\"\n\t\t\treturn -1\n\t\tend\n\n end", "def inputPrecedence(operator)\n if operator == \"+\" || operator == \"-\"\n\t\t\treturn 1\n\t\tend\n\n if operator == \"*\" || operator == \"/\" || operator == \"%\"\n\t\t\treturn 2\n\t\tend\n\n if operator == \"^\"\n\t\t\treturn 4\n\t\tend\n\n if operator == \"(\"\n\t\t\treturn 5\n\t\tend\n\n end", "def evaluate_operator(left, right)\n left >= right\n end", "def evaluate_operator(left, right)\n left < right\n end", "def stackPrecedence(operator)\n @operaters[operator][:stack_prec]\n end", "def inputPrecedence(operator)\n if ['+', '-'].include? operator\n return 1\n elsif ['*', '/', '%'].include? operator\n return 2\n elsif '^'.eql? operator\n return 4\n else\n return 5\n end\n end", "def result \n return @left_operand + @right_operand\n end", "def elementwise_op(op,left_val,right_val)\n\n end", "def ops(node)\n if node.left.nil? || node.right.nil?\n return 1 if /[\\+\\-\\*\\%\\/\\.]/.match(node.value)\n else\n return (ops(node.left) + ops(node.right))\n end\nend", "def precedence_of(ch)\n \tcase ch\n \t\twhen '^'\n \t10\n \t\twhen '*', '/'\n \t5\n \t\twhen '+', '-'\n \t1\n \t\telse\n \t0\n \tend\n end", "def evaluate (left_right_evaluated, relationship_expression, scope)\n # assert operator (should have been validated, but this logic makes assumptions which would\n # screw things up royally). Better safe than sorry.\n unless RELATIONSHIP_OPERATORS.include?(relationship_expression.operator)\n fail(Issues::UNSUPPORTED_OPERATOR, relationship_expression, {:operator => relationship_expression.operator})\n end\n\n begin\n # Turn each side into an array of types (this also asserts their type)\n # (note wrap in array first if value is not already an array)\n #\n # TODO: Later when objects are Puppet Runtime Objects and know their type, it will be more efficient to check/infer\n # the type first since a chained operation then does not have to visit each element again. This is not meaningful now\n # since inference needs to visit each object each time, and this is what the transformation does anyway).\n #\n # real is [left, right], and both the left and right may be a single value or an array. In each case all content\n # should be flattened, and then transformed to a type. left or right may also be a value that is transformed\n # into an array, and thus the resulting left and right must be flattened individually\n # Once flattened, the operands should be sets (to remove duplicate entries)\n #\n real = left_right_evaluated.collect {|x| [x].flatten.collect {|y| transform(y, scope) }}\n real[0].flatten!\n real[1].flatten!\n real[0].uniq!\n real[1].uniq!\n\n # reverse order if operator is Right to Left\n source, target = reverse_operator?(relationship_expression) ? real.reverse : real\n\n # Add the relationships to the catalog\n source.each {|s| target.each {|t| add_relationship(s, t, RELATION_TYPE[relationship_expression.operator], scope) }}\n\n # The result is the transformed source RHS unless it is empty, in which case the transformed LHS is returned.\n # This closes the gap created by an empty set of references in a chain of relationship\n # such that X -> [ ] -> Y results in X -> Y.\n #result = real[1].empty? ? real[0] : real[1]\n if real[1].empty?\n # right side empty, simply use the left (whatever it may be)\n result = real[0]\n else\n right = real[1]\n if right.size == 1 && right[0].is_a?(Puppet::Pops::Evaluator::Collectors::AbstractCollector)\n # the collector when evaluated later may result in an empty set, if so, the\n # lazy relationship forming logic needs to have access to the left value.\n adapter = Puppet::Pops::Adapters::EmptyAlternativeAdapter.adapt(right[0])\n adapter.empty_alternative = real[0]\n end\n result = right\n end\n result\n\n rescue NotCatalogTypeError => e\n fail(Issues::NOT_CATALOG_TYPE, relationship_expression, {:type => @type_calculator.string(e.type)})\n rescue IllegalRelationshipOperandError => e\n fail(Issues::ILLEGAL_RELATIONSHIP_OPERAND_TYPE, relationship_expression, {:operand => e.operand})\n end\n end", "def conjunction_expressions(left_expression, left_expression_joins, right_expression,\n right_expression_joins)\n if left_expression == ALWAYS_FALSE || right_expression == ALWAYS_FALSE\n [ALWAYS_FALSE, []]\n elsif left_expression == ALWAYS_TRUE\n [right_expression, right_expression_joins]\n elsif right_expression == ALWAYS_TRUE\n [left_expression, left_expression_joins]\n else\n [left_expression & right_expression, left_expression_joins + right_expression_joins]\n end\n end", "def reduce_associativity_array(p_old, n_old)\n p_del, n_del = [], []\n p_old.each do |p|\n n_old.each do |n|\n if p == n\n p_del << p\n n_del << n\n end\n end\n end\n\n return (p_old - p_del), (n_old - n_del)\n end", "def operators(node)\n return if node == nil\n operators(node.left)\n if node.left != nil || node.right != nil\n print node.value + \" \"\n end\n operators(node.right)\nend", "def is_associative?\n @associative_operators.include?(@operator)\n end", "def operators\n {\n \"+\" => -> {@num1 + @num2},\n \"-\" => -> {@num1 - @num2}\n }\n end", "def optimize_left\n Function.optimize_operand(operation.left)\n end", "def to_s\n # Wrap the expression on the left/right in parentheses if the operation of\n # the expression on the left/right has a lower precedence than this\n # Expression's, e.g. 2 * (3 + 5) because without parentheses it becomes 6 +\n # 5\n [@left, @right].each do |operand|\n if operand.class == Expression\n operand.do_parens = (has_lower_precedence?(operand) or ! operand.is_associative?)\n end\n end\n string = \"#{@left} #{@operator} #{@right}\"\n # Wrap in parentheses if necessary\n string = \"(#{string})\" if @do_parens\n return string\n end", "def pp(indent = \"\")\n newindent = indent + \" \"\n \"#{indent}(#{@operator}\\n#{@left.pp(newindent)}\\n#{@right.pp(newindent)})\"\n end", "def inputPrecedence(operator)\n @operaters[operator][:input_prec]\n end", "def interpret\r\n return @leftExpression.interpret - @rightExpression.interpret\r\n end", "def <=>(other) = self.precedence <=> other.precedence", "def eval_operation(node, env, stack_trace)\n\n\t# Evaluate both sides of operation (discard returned environment)\n\tleft, _ = eval_node_under(node.left, env, stack_trace)\n\tright, _ = eval_node_under(node.right, env, stack_trace)\n\n\tif left == nil or right == nil\n\t\treturn nil, env\n\tend\n\n\t# TODO: Add more operations.\n\tcase node.operator.value\n\twhen \"+\"\n\t\tcase [left, right]\n\t\tin [Term, Term]\n\t\t\treturn add_two_terms(left, right), env\n\t\tin [Term, TermList]\n\t\t\treturn add_term_and_term_list(left, right), env\n\t\tin [TermList, Term]\n\t\t\treturn add_term_and_term_list(left, right), env\n\t\tin [TermList, TermList]\n\t\t\treturn add_term_list_and_term_list(left, right), env\n\t\tin [Fraction, Term]\n\t\t\treturn add_fraction_and_term(left, right), env\n\t\tin [Term, Fraction]\n\t\t\treturn add_fraction_and_term(right, left), env\n\t\tin [Fraction, TermList]\n\t\t\treturn add_fraction_and_term_list(left, right), env\n\t\tin [TermList, Fraction]\n\t\t\treturn add_fraction_and_term_list(right, left), env\n\t\tin [Fraction, Fraction]\n\t\t\treturn add_fraction_and_fraction(left, right), env\t\n\t\tin [Matrix, Matrix]\n\t\t\treturn add_two_matrices(left, right), env\n\t\t\tthrow_error(\"Operator '#{node.operator.value}' not implemented for left: #{left.type}, right: #{right.type}.\", node, stack_trace) \n\t\tend\n\twhen \"-\"\n\t\tputs \"inter l: #{__LINE__} -- IMPORTANT NOTE: Using a subtraction.\" # TODO: Does this ever get used now that I've inverted a - b to a + (-b)?\n\t\tcase [left, right]\n\t\tin [Term, Term]\n\t\t\treturn subtract_two_terms(left, right), env\n\t\tin [Term, TermList]\n\t\t\treturn subtract_term_list_from_term(right, left), env\n\t\tin [TermList, Term]\n\t\t\treturn subtract_term_from_term_list(right, left), env\n\t\tin [TermList, TermList]\n\t\t\treturn subtract_term_list_from_term_list(left, right), env\n\t\tin [Matrix, Matrix]\n\t\t\treturn subtract_matrix_minus_matrix(left, right), env\n\t\telse\n\t\t\tthrow_error(\"Operator '#{node.operator.value}' not implemented for left: #{left.type}, right: #{right.type}.\", node, stack_trace) \n\t\tend\n\twhen \"*\"\n\t\tcase [left, right]\n\t\tin [Term, Term]\n\t\t\treturn multiply_two_terms(left, right), env\n\t\tin [Term, TermList]\n\t\t\treturn multiply_term_and_term_list(left, right), env\n\t\tin [TermList, Term]\n\t\t\treturn multiply_term_and_term_list(left, right), env\n\t\tin [TermList, TermList]\n\t\t\treturn multiply_term_list_and_term_list(left, right), env\n\t\tin [Fraction, Term]\n\t\t\treturn multiply_fraction_and_term(left, right), env\n\t\tin [Term, Fraction]\n\t\t\treturn multiply_fraction_and_term(right, left), env\n\t\tin [Fraction, TermList]\n\t\t\treturn multiply_fraction_and_term_list(left, right), env\n\t\tin [TermList, Fraction]\n\t\t\treturn multiply_fraction_and_term_list(right, left), env\n\t\tin [Fraction, Fraction]\n\t\t\treturn multiply_fraction_and_fraction(left, right), env\t\n\t\tin [Matrix, Matrix]\n\t\t\treturn multiply_two_matrices(left, right), env\n\t\tin [Matrix, Term]\n\t\t\treturn multiply_matrix_and_term(left, right), env\n\t\tin [Term, Matrix]\n\t\t\treturn multiply_matrix_and_term(right, left), env\n\t\tin [Matrix, TermList]\n\t\t\treturn multiply_matrix_and_term_list(left, right), env\n\t\tin [TermList, Matrix]\n\t\t\treturn multiply_matrix_and_term_list(right, left), env\n\t\tin [Matrix, Fraction]\n\t\t\treturn multiply_matrix_and_fraction(left, right), env\n\t\tin [Fraction, Matrix]\n\t\t\treturn multiply_matrix_and_fraction(right, left), env\n\t\telse\n\t\t\tthrow_error(\"Operator '#{node.operator.value}' not implemented for left: #{left.type}, right: #{right.type}.\", node, stack_trace) \n\t\tend\n\twhen \"/\"\n\t\tcase [left, right]\n\t\tin [Term, Term]\n\t\t\treturn divide_two_terms(left, right), env\n\t\tin [Term, TermList]\n\t\t\treturn divide_term_by_term_list(left, right), env\n\t\tin [TermList, Term]\n\t\t\treturn divide_term_list_by_term(left, right), env\n\t\tin [TermList, TermList]\n\t\t\treturn divide_term_list_by_term_list(left, right), env\n\t\tin [Fraction, Term]\n\t\t\treturn divide_fraction_by_term(left, right), env\n\t\tin [Term, Fraction]\n\t\t\treturn divide_term_by_fraction(right, left), env\n\t\tin [Fraction, TermList]\n\t\t\treturn divide_fraction_by_term_list(left, right), env\n\t\tin [TermList, Fraction]\n\t\t\treturn divide_term_list_by_fraction(right, left), env\n\t\tin [Fraction, Fraction]\n\t\t\treturn divide_fraction_by_fraction(left, right), env\t\n\t\telse\n\t\t\tthrow_error(\"Operator '#{node.operator.value}' not implemented for left: #{left.type}, right: #{right.type}.\", node, stack_trace) \n\t\tend\n\twhen \"*!\"\n\t\tcase [left, right]\n\t\tin [Matrix, Matrix]\n\t\t\treturn tensor_product_of_two_matrices(left, right), env\n\t\telse\n\t\t\tthrow_error(\"Operator '#{node.operator.value}' not implemented for left: #{left.type}, right: #{right.type}.\", node, stack_trace) \n\t\t\treturn nil, env\n\t\tend\n\telse\n\t\tthrow_error(\"Operator '#{node.operator.value}' not implemented.\", node, stack_trace) \n\tend\nend", "def alternate_operator\n logical_operator? ? SEMANTIC_AND : LOGICAL_AND\n end", "def left_optimizable?\n !left.equal?(operation.left)\n end", "def _calc operator\n (operand1, operand2) = @stack.pop 2\n @stack.unshift @stack.first\n @stack.push operand1.send(operator.to_sym, operand2)\nend", "def operator; end", "def read_operator_node(node)\n first_node = node.children.first\n solution = first_node.is_a?(GivenThatOperatorNode) ? read_operator_node(first_node) : first_node\n\n push_connector(node)\n #group =\n node.children[1..-1].inject(solution) do |sum, i|\n i = read_operator_node(i) if i.is_a?(GivenThatOperatorNode)\n if MULTIPLICATIVE_OPERATORS.include?(node.value)\n sum = sum | i\n else # Assume it's in ADDITIVE_OPERATORS\n sum = sum & i\n end\n end\n end", "def either(_left, right); end", "def operator_node\n key_op_val? && @elements[1]\n end", "def right_optimizable?\n !right.equal?(operation.right)\n end", "def operators\n hash_key_operators\n end", "def first_assignment_in?(left, right); end", "def evaluate(rule_base)\n left_side = lhs.evaluate(rule_base)\n right_side = rhs.evaluate(rule_base)\n if self.operator == AND\n #Return true if both lhs and rhs are true\n return Rule::TRUE if left_side == Rule::TRUE && right_side == Rule::TRUE\n return Rule::FALSE if left_side == Rule::FALSE || right_side == Rule::FALSE\n return Rule::UNKNOWN\n else #OR\n #Return true if either lhs or rhs are true\n return Rule::TRUE if left_side == Rule::TRUE || right_side == Rule::TRUE\n return Rule::FALSE if left_side == Rule::FALSE && right_side == Rule::FALSE\n return Rule::UNKNOWN\n end\n end", "def generate_tree(operands, operators, parent_node)\n return operands[0] if operands.length==1\n\n i = index_of_lowest_precedence(operators)\n operator = operators[i]\n new_operand = node_class.new(parent_node)\n new_operand.add_match generate_tree(operands[0..i], operators[0..i-1],new_operand), :left\n new_operand.add_match operators[i], :operator_node\n new_operand.add_match generate_tree(operands[i+1..-1], operators[i+1..-1],new_operand), :right\n new_operand\n end", "def execWithOperator(env)\n operatorToken = Ruby::Token.new(self.operator.token[/(.*)=/, 1])\n binaryExpression = Ruby::Binary.new(operatorToken, self.left, self.right)\n #return the partial evaluation result of the newly created binary expression.\n binaryExpression.pe(env)\n end", "def merge_final_ops(seq1, seq2, res = [])\n ops1, ops2 = [], []\n ops1 << seq1.pop while seq1.last.is_a?(String)\n ops2 << seq2.pop while seq2.last.is_a?(String)\n\n # Not worth the headache of trying to preserve newlines here. The most\n # important use of newlines is at the beginning of the selector to wrap\n # across lines anyway.\n ops1.reject! {|o| o == \"\\n\"}\n ops2.reject! {|o| o == \"\\n\"}\n\n return res if ops1.empty? && ops2.empty?\n if ops1.size > 1 || ops2.size > 1\n # If there are multiple operators, something hacky's going on. If one\n # is a supersequence of the other, use that, otherwise give up.\n lcs = Sass::Util.lcs(ops1, ops2)\n return unless lcs == ops1 || lcs == ops2\n res.unshift(*(ops1.size > ops2.size ? ops1 : ops2).reverse)\n return res\n end\n\n # This code looks complicated, but it's actually just a bunch of special\n # cases for interactions between different combinators.\n op1, op2 = ops1.first, ops2.first\n if op1 && op2\n sel1 = seq1.pop\n sel2 = seq2.pop\n if op1 == '~' && op2 == '~'\n if sel1.superselector?(sel2)\n res.unshift sel2, '~'\n elsif sel2.superselector?(sel1)\n res.unshift sel1, '~'\n else\n merged = sel1.unify(sel2)\n res.unshift [\n [sel1, '~', sel2, '~'],\n [sel2, '~', sel1, '~'],\n ([merged, '~'] if merged)\n ].compact\n end\n elsif (op1 == '~' && op2 == '+') || (op1 == '+' && op2 == '~')\n if op1 == '~'\n tilde_sel, plus_sel = sel1, sel2\n else\n tilde_sel, plus_sel = sel2, sel1\n end\n\n if tilde_sel.superselector?(plus_sel)\n res.unshift plus_sel, '+'\n else\n merged = plus_sel.unify(tilde_sel)\n res.unshift [\n [tilde_sel, '~', plus_sel, '+'],\n ([merged, '+'] if merged)\n ].compact\n end\n elsif op1 == '>' && %w(~ +).include?(op2)\n res.unshift sel2, op2\n seq1.push sel1, op1\n elsif op2 == '>' && %w(~ +).include?(op1)\n res.unshift sel1, op1\n seq2.push sel2, op2\n elsif op1 == op2\n merged = sel1.unify(sel2)\n return unless merged\n res.unshift merged, op1\n else\n # Unknown selector combinators can't be unified\n return\n end\n return merge_final_ops(seq1, seq2, res)\n elsif op1\n seq2.pop if op1 == '>' && seq2.last && seq2.last.superselector?(seq1.last)\n res.unshift seq1.pop, op1\n return merge_final_ops(seq1, seq2, res)\n else # op2\n seq1.pop if op2 == '>' && seq1.last && seq1.last.superselector?(seq2.last)\n res.unshift seq2.pop, op2\n return merge_final_ops(seq1, seq2, res)\n end\n end", "def state2\n if current_tk.tag == :OPERATOR then\n if @op.size == 0 then\n @op.push current_tk.value\n elsif priority(current_tk.value) >= priority(@op.last)\n @op.push current_tk.value\n elsif priority(current_tk.value) < priority(@op.last)\n make_op\n @op.push current_tk.value\n end\n else\n @error = true\n end\n return :state0_1\n end", "def higher_or_equal_precedence?(op1,op2)\n return true if LOW_PRIORITY_OPERATORS.include?(op2)\n return true if HIGH_PRIORITY_OPERATORS.include?(op1)\n return false\n end", "def either(left, _right); end", "def test_or_implies(stmt)\n l = eval_side(stmt.left)\n r = eval_side(stmt.right)\n if !l.nil? && !l\n set_truth(stmt.right.left) if stmt.right.type == :terminal\n elsif !r.nil? && !r\n set_truth(stmt.left.left) if stmt.left.type == :terminal\n end\n end", "def expressions_over(op1, op2)\n expressions_over_lists( asArray(op1), asArray(op2))\nend", "def get_relational(expr)\n\t\t[\"==\", \"!=\", \">\", \"<\", \">=\", \"<=\"].each do |ope|\n\t\t\tif expr.scan(ope).length == 1\n\t\t\t\treturn ope\n\t\t\tend\n\t\tend\n\tend", "def arithmeticBinary(op)\n str = getTopTwoFromStack + \"M=M\"+op+\"D\"+\"\\n\"\n return str+\"\\n\"\nend", "def operator?(node, operator)\n return if node == nil\n operator?(node.left, operator) #starts recursion -- go left\n if node.value.match(/\\+|\\-|\\/|\\%|\\*/) && (node.value == operator.value) #if operators included\n return true #true\n end\n operator?(node.right, operator) #recursion -- go right\nend", "def priority(op)\n case op\n when \"+\",\"-\"\n return 1\n when \"*\",\"/\"\n return 2\n when /\\^/\n return 3\n end\n end", "def optimize_right\n Function.optimize_operand(operation.right)\n end", "def and_op(left, right, result) #method\n left = get_dir(left)\n right = get_dir(right)\n @current_context[result] = get_value(left) && get_value(right)\n end", "def next_operator(expr)\n return '*' if expr.index('*')\n return '/' if expr.index('/')\n return '+' if expr.index('+')\n return '-' if expr.index('-')\n end", "def operators= new_ops\n @operators = new_ops.gsub(/[^+*-]/, '').split(//)\n reset\n end", "def restriction_commutative?\n ! (partition_left_tautology? && partition_right_tautology?)\n end", "def relational\r\n node = add()\r\n\r\n loop do\r\n if consume(\"<\")\r\n node = new_binary(ND_LT, node, add())\r\n elsif consume(\"<=\")\r\n node = new_binary(ND_LE, node, add())\r\n elsif consume(\">\")\r\n node = new_binary(ND_LT, add(), node)\r\n elsif consume(\">=\")\r\n node = new_binary(ND_LE ,add(), node)\r\n else\r\n return node\r\n end\r\n end\r\nend", "def apply_operator(operator, states, ops, goal, goal_stack)\n\n # Satify all of operator's preconditions\n result = achieve_all(states, ops, operator['preconds'], [goal] + goal_stack)\n if !result\n return nil\n end\n\n # Merge the old states with operator's add-list, filtering out delete-list\n add_list, delete_list = operator['add'], operator['delete']\n result = result.select do |state|\n !delete_list.include?(state)\n end\n return result.concat add_list\nend", "def additive_expression\n substraction_expressions = recursive_expression(:substraction_expression, :plus)\n if substraction_expressions.class == Array.class\n {plus: substraction_expressions}\n else\n substraction_expressions\n end\n end", "def new_simplification_rules_for_conjunction\n end", "def combine_squeel_expressions(left_expression, left_expression_joins, operator,\n right_expression, right_expression_joins)\n case operator\n when :& then conjunction_expressions(left_expression, left_expression_joins,\n right_expression, right_expression_joins)\n when :| then disjunction_expressions(left_expression, left_expression_joins,\n right_expression, right_expression_joins)\n else\n raise ArgumentError, \"#{operator} must either be :& or :|\"\n end\n end", "def operator\n case @matches[2]\n when \"plus\" then :+\n when \"minus\" then :-\n when \"divided by\" then :/\n when \"multiplied by\" then :*\n end\n end", "def simplification_rules_for_conjunction\n if is_formula_and_formula?\n copy @left_sentence\n update\n elsif is_formula_and_not_formula?\n @left_sentence, @right_sentence, @operator = nil,nil,nil\n update(Constant::VALUES[:bottom])\n elsif is_formula_and_up?\n if @left_sentence.is_constant?\n copy @right_sentence\n else\n copy @left_sentence\n end\n update\n elsif is_formula_and_bottom?\n @left_sentence, @right_sentence, @operator = nil,nil,nil\n update(Constant::VALUES[:bottom])\n end\n end", "def disjunction_expressions(left_expression, left_expression_joins, right_expression,\n right_expression_joins)\n if left_expression == ALWAYS_TRUE || right_expression == ALWAYS_TRUE\n [ALWAYS_TRUE, []]\n elsif left_expression == ALWAYS_FALSE\n [right_expression, right_expression_joins]\n elsif right_expression == ALWAYS_FALSE\n [left_expression, left_expression_joins]\n else\n [left_expression | right_expression, left_expression_joins + right_expression_joins]\n end\n end", "def right; return self[0]+self[2]; end", "def achieve(states, operators, goal, goal_stack)\n\n # Let's check to see if the state already holds before we do anything.\n if states.include? goal\n return states\n end\n\n # Prevent going in circles: look through the goal stack to see if the\n # specified goal appears there. If so, then we are indirectly trying to\n # achieve goal while already in the process of achieving it. For example,\n # while trying to achieve state A, we try to achieve state B--a precondition\n # for applying an appropriate operator. However, to achieve B, we try to\n # satisfy the preconditions for another operator that contains A in its\n # preconditions.\n if goal_stack.include? goal\n return nil\n end\n\n operators.each do |op|\n # Is op appropriate? Look through its add-list to see if goal is there.\n if !op['add'].include?(goal)\n next\n end\n\n # Is op applicable? Try to apply it--if one of its preconditions cannot\n # be satisifed, then it will return None.\n result = apply_operator(op, states, operators, goal, goal_stack)\n if result\n return result\n else\n next\n end\n end\nend", "def min_ops(n)\n\n # Step 1:\n # Create a table containing the minimum operations\n # needed to reach n given our permitted operators.\n all_parents = Array.new\n all_min_ops = [0] + [nil] * n\n\n (1..n+1).each do |k|\n curr_parent = k - 1\n curr_min_ops = all_min_ops[curr_parent] + 1\n [2, 3].each do |i|\n if k % i == 0\n parent = k / i\n num_ops = all_min_ops[parent] + 1\n if num_ops < curr_min_ops\n curr_parent, curr_min_ops = parent, num_ops\n end\n end\n end\n all_parents[k], all_min_ops[k] = curr_parent, curr_min_ops\n end\n\n # Step 2: Trace back to find the optimal choices\n # made in the previous step.\n numbers = Array.new\n k = n\n while k > 0\n numbers << k\n k = all_parents[k]\n end\n puts numbers.size - 1\n numbers.reverse\nend", "def applyOperator(num1, num2, operator)\n #eval((num1.to_s + operator + num2.to_s).gsub(\"^\", \"**\"))\n @operators[operator][:action].call(num1.to_i, num2.to_i)\n end", "def command\n associations.reduce(left.command.curry(left)) do |a, (assoc, other)|\n case other\n when Changeset\n a >> other.command.with_association(assoc).curry(other)\n when Associated\n a >> other.command.with_association(assoc)\n when Array\n raise NotImplementedError, \"Changeset::Associate does not support arrays yet\"\n else\n a.with_association(assoc, parent: other)\n end\n end\n end", "def plus\n\t\tif @operands.size>= 2\n\t\t\t@operands.push (@operands.pop + @operands.pop)\n\t\telse\n\t\t\traise \"calculator is empty\"\n\t\tend\n\tend", "def print_operators(node)\n return if node == nil\n print_operators(node.left) #starts recursion -- go left\n if node.value.match(/\\+|\\-|\\/|\\%|\\*/) #if operators included\n print node.value + \" \" #print value of this node\n end\n print_operators(node.right) #recursion -- go right\nend", "def cops; end", "def cops; end", "def cops; end", "def assign_operator()\n\n\n\n # 289:5: ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' )\n alt42 = 12\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n case look_ahead(1)\n when :EQUAL\n alt42 = 1\n when :PLUS\n alt42 = 2\n when :MINUS\n alt42 = 3\n when :TIMES\n alt42 = 4\n when :SLASH\n alt42 = 5\n when :ECOMMERCIAL\n alt42 = 6\n when :PIPE\n alt42 = 7\n when :WEDGE\n alt42 = 8\n when :MODULUS\n alt42 = 9\n when :LEFT_ANGULAR_BRACKET\n alt42 = 10\n when :RIGHT_ANGULAR_BRACKET\n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n look_ahead42_11 = look_ahead(2)\n if look_ahead42_11 == :RIGHT_ANGULAR_BRACKET \n # 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\n look_ahead42_12 = look_ahead(3)\n if look_ahead42_12 == :RIGHT_ANGULAR_BRACKET \n alt42 = 11\n elsif look_ahead42_12 == :EQUAL \n alt42 = 12\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n end\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n end\n else\n raise \"Expected: 288:1: assign_operator : ( '=' | '+' '=' | '-' '=' | '*' '=' | '/' '=' | '&' '=' | '|' '=' | '^' '=' | '%' '=' | '<' '<' '=' | '>' '>' '>' '=' | '>' '>' '=' );\"\n\n end\n case alt42\n when 1\n # 289:9: '='\n match(:EQUAL)\n when 2\n # 290:9: '+' '='\n match(:PLUS)\n match(:EQUAL)\n when 3\n # 291:9: '-' '='\n match(:MINUS)\n match(:EQUAL)\n when 4\n # 292:9: '*' '='\n match(:TIMES)\n match(:EQUAL)\n when 5\n # 293:9: '/' '='\n match(:SLASH)\n match(:EQUAL)\n when 6\n # 294:9: '&' '='\n match(:ECOMMERCIAL)\n match(:EQUAL)\n when 7\n # 295:9: '|' '='\n match(:PIPE)\n match(:EQUAL)\n when 8\n # 296:9: '^' '='\n match(:WEDGE)\n match(:EQUAL)\n when 9\n # 297:9: '%' '='\n match(:MODULUS)\n match(:EQUAL)\n when 10\n # 298:9: '<' '<' '='\n match(:LEFT_ANGULAR_BRACKET)\n match(:LEFT_ANGULAR_BRACKET)\n match(:EQUAL)\n when 11\n # 299:9: '>' '>' '>' '='\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:EQUAL)\n when 12\n # 300:9: '>' '>' '='\n match(:RIGHT_ANGULAR_BRACKET)\n match(:RIGHT_ANGULAR_BRACKET)\n match(:EQUAL)\n end\n\n\n\n end", "def result\n return @left_operand - @right_operand\n end", "def comparison\n expr = addition\n\n while match?(:greater, :greater_equal, :less, :less_equal)\n operator = previous\n right = addition\n expr = Ringo::Binary.new(expr, operator, right)\n end\n\n return expr\n end", "def operator\n node_parts[1]\n end", "def operators\n [:is]\n end", "def or_op(left, right, result) #method\n left = get_dir(left)\n right = get_dir(right)\n @current_context[result] = get_value(left) || get_value(right)\n end", "def arithmeticUnary(op)\n str = getTopOfStack + \"M=\"+op+\"M\"+\"\\n\"\n return str+\"\\n\"\nend", "def evaluate_expression_inner(expression)\n expression_string = evaluate_expression(expression.left)\n expression_string << ' ' + expression.operator.to_s + ' '\n expression_string << evaluate_expression(expression.right)\n expression_string\n end", "def rank_precedence() = RANKS_SCORES[self.rank]", "def left_of?(p1, p2)\n cross(p1, p2) > 0\n end", "def optimize\n operation.class.reverse.new(right, left)\n end", "def operator\n self.class.operator\n end", "def scopify(expr)\n expr = insert_b(expr)\n @i = 0\n n_expr = \"\"\n last_empty = 0\n open_b = 0\n open_p_b = 0\n open_m_b = 0\n eq = false\n stack = Array.new\n last_e = Array.new\n state = 0\n while @i < expr.size\n case expr[@i]\n # Each part between brackets is seen as a subexpression\n # and it is analyzed recoursively.\n when '('\n scp = Scp.new\n n_expr += expr[@i] + scp.scopify(extract(expr[(@i + 1)...expr.length])) \n @i += scp.count \n when /[\\*\\/]/\n # If there are open brackets of higher opertions\n # it closes them\n if open_m_b > 0\n n_expr += ')' * open_m_b\n last_empty = last_e.pop\n open_m_b = 0\n #open_b -= 1\n end\n if state == 2\n n_expr += ')' * open_p_b\n open_p_b = 0\n state = (stack.size > 0 ? stack.pop : 0)\n end\n # If it is not still analyzing a multiplication, it adds the brackets \n # following the rules\n unless state == 1\n n_expr.insert last_empty, '(' \n state = 1\n open_b += 1\n end\n n_expr += expr[@i]\n last_empty = n_expr.size # + 1\n when /[\\+\\-]/\n # higher priority operation brackets are closed\n # last_empty is shifted\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n state = 0\n open_b = 0\n open_p_b = 0\n n_expr += expr[@i]\n last_empty = n_expr.size\n when /\\^/\n # It begins to put between brackets the operation and its exponent\n if open_m_b > 0 then\n n_expr += \")\" * open_m_b\n last_empty = last_e.pop\n #open_b -= 1\n open_m_b = 0\n end\n n_expr.insert last_empty, '(' unless state == 2\n last_empty += 1 unless state == 2\n n_expr += expr[@i] + (expr[@i+1] == '(' ? '' : '(')\n open_p_b += (expr[@i+1] == '(' ? 1 : (state == 2 ? 1:2))\n stack.push state unless state == 2\n state = 2\n when /\\=/\n # The expression at the left of `=` is put between brackets\n # and a bracket at the right is opened\n # It closes previously opened brackets\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n n_expr += ')' * open_m_b if open_m_b >0\n open_b = 0\n open_p_b = 0\n open_m_b = 0\n n_expr = '(' + n_expr + ')' + expr[@i]\n n_expr += '('\n last_empty = n_expr.size\n state = 0\n eq = true\n when /\\>/\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n open_b = 0\n open_p_b = 0\n n_expr = '(' + n_expr + ')' + expr[@i]\n last_empty = n_expr.size\n when /\\:/\n n_expr.insert last_empty, '('\n n_expr += expr[@i]\n last_k = n_expr[(last_empty+1)...n_expr.size]\n open_m_b += 1 if \"mx:integ:as:from:\".include? last_k\n last_e.pop if last_e.count > 0 and (last_k == \"mx:\" or last_k == \"integ:\")# or last_k == \"solve:\")\n last_e.push last_empty if last_k == \"mx:\" or last_k == \"integ:\"# or last_k == \"solve:\"\n last_empty = n_expr.size\n open_b += 1 unless \"mx:integ:as:from:\".include? last_k\n when /\\\"/\n n_expr += expr[@i]\n @i += 1\n n_expr += discard(expr)\n last_empty = n_expr.length\n when /\\~/\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * (open_b - 1 ) if open_b - 1 > 0\n open_p_b = 0\n open_b = 1\n state = (stack.size > 0 ? stack.pop : 0)\n n_expr += expr[@i]\n last_empty = n_expr.size \n else\n n_expr += expr[@i]\n end\n @i += 1\n end\n # it closes all the opened brackets\n n_expr += ')' * open_m_b if open_m_b > 0\n n_expr += ')' * open_p_b if open_p_b > 0\n n_expr += ')' * open_b if open_b > 0\n n_expr += ')' if eq\n return n_expr\n end", "def non_operators(node)\n return if node == nil\n non_operators(node.left)\n if node.left.nil? || node.right.nil?\n print node.value + \" \"\n end\n non_operators(node.right)\nend", "def operator_to_string\n {\n \"+\" => 'plus', \n \"-\" => 'minus'\n }\n end", "def optimize\n left.ne(right.first)\n end", "def select_operator\n return '>' if self.class.name.downcase.include?('arm')\n return '==' if self.class.name.downcase.include?('leg')\n end", "def left_expr_node\n key_op_val? && @elements[0]\n end", "def evaluate(ops)\n \t\tops = tokens(ops)\n \t\tmethods = {:+ => Proc.new{plus()}, :- => Proc.new{minus()}, :* => Proc.new{times()}, :/ => Proc.new{divide()}}\n \t\tops.each do |op|\n \t\t\tif methods.has_key?(op)\n \t\t\t\tmethods[op].call\n \t\t\telse\n \t\t\t\tpush(op)\n \t\t\tend\n \t\tend\n \t\tvalue()\n end", "def parse_additive\n tree = parse_multiply()\n\n while additive?\n operator, multiply = parse_additive_tail()\n tree = [operator, tree, multiply]\n end\n\n tree\n end", "def Calculator(leftParam, rightParam, operator)\n\n case operator\n\n when \"+\"\n return leftParam + rightParam;\n when \"*\"\n\n i = 0\n result = 0\n while i < leftParam #2\n result = result + rightParam #@\n i= i + 1\n end\n\n return result\n end\nend", "def command\n case right\n when Changeset\n left.command.curry(left) >> right.command.with_association(association).curry(right)\n when Associated\n left.command.curry(left) >> right.command.with_association(association)\n else\n left.command.with_association(association).curry(left, right)\n end\n end", "def has_lower_precedence?(other_expression)\n precedence > other_expression.precedence\n end", "def test_implies(stmt)\n l = eval_side(stmt.left)\n r = eval_side(stmt.right)\n if r.nil?\n set_truth(stmt.right.left) if l && stmt.right.type == :terminal\n elsif l.nil? && !r.nil?\n set_truth(stmt.left.left, false) if !r && stmt.left.type == :terminal\n end\n end", "def evaluate() \n # operand stack\n opStack = []\n \n # iterate over the tokens\n @postfix.split(\"\").each do |c|\n # check if an operator\n if %w[+ - * / ^].include? c\n # pop the stack for the two operands where\n # a [operator] b\n b, a = opStack.pop, opStack.pop\n \n # evaluate the string as an arithmetic expression\n # replace all '^' characters with '**' operator\n opStack.push(eval(\"(#{a})#{c}(#{b})\".gsub(/\\^/,'**')))\n else\n # push any operands onto stack\n opStack.push(c)\n end\n end\n \n # Last item in stack should be the final answer!\n opStack.pop\n end" ]
[ "0.73216146", "0.6714029", "0.64412826", "0.6320429", "0.6286455", "0.6284881", "0.6246867", "0.6164832", "0.6150292", "0.61183876", "0.60515356", "0.6016038", "0.59278256", "0.58445466", "0.57779664", "0.57339877", "0.5723413", "0.5699328", "0.56726533", "0.56667364", "0.56393284", "0.5638985", "0.5624978", "0.56132925", "0.56079286", "0.5594218", "0.5591534", "0.55891913", "0.5571916", "0.5562071", "0.5552173", "0.5538666", "0.5534138", "0.55150485", "0.55143976", "0.54725987", "0.54575354", "0.5451046", "0.5433522", "0.5419629", "0.54018295", "0.53714764", "0.53695506", "0.5369215", "0.53604054", "0.53430784", "0.5335699", "0.5332059", "0.53272396", "0.5324913", "0.5322537", "0.53088325", "0.5307427", "0.5303249", "0.52913964", "0.5287618", "0.5285722", "0.5278215", "0.52759975", "0.52674884", "0.5246757", "0.5237513", "0.5237021", "0.52357423", "0.52317375", "0.5231672", "0.5214825", "0.5204819", "0.51936495", "0.5182753", "0.518", "0.5178944", "0.51770616", "0.51770616", "0.51770616", "0.51759845", "0.5172047", "0.5168229", "0.51662767", "0.5159", "0.514812", "0.5137137", "0.5133721", "0.51297134", "0.51224214", "0.51106954", "0.510805", "0.51057094", "0.509335", "0.50866145", "0.5085113", "0.5082898", "0.5082608", "0.50746423", "0.5071044", "0.50670695", "0.506018", "0.50557536", "0.5051833", "0.50492156" ]
0.6673662
2
generates a tree of nodes of the specified node_class The nodes have access to the following useful methods: self.left > return the left operand parsetreenode self.right > return the right operand parsetreenode self.operator_node > return the operator parsetreenode self.operator > return the operator as a ruby symbol
def generate_tree(operands, operators, parent_node) return operands[0] if operands.length==1 i = index_of_lowest_precedence(operators) operator = operators[i] new_operand = node_class.new(parent_node) new_operand.add_match generate_tree(operands[0..i], operators[0..i-1],new_operand), :left new_operand.add_match operators[i], :operator_node new_operand.add_match generate_tree(operands[i+1..-1], operators[i+1..-1],new_operand), :right new_operand end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tree\n while token = @tokens.next\n case token.type\n when :operator\n token.build(@nodes.pop, tree).tap do |node|\n @nodes.push(node)\n end\n when :value\n token.build.tap do |leaf|\n @nodes.push(leaf)\n end\n end\n end\n rescue StopIteration\n @nodes.last || Lexeme::Null.new\n end", "def generate_tree\n root =\tTreeNode.new(3)\n root.left =\tTreeNode.new(9)\n right = \t\tTreeNode.new(20)\n right.left = \tTreeNode.new(15)\n right.right = TreeNode.new(7)\n root.right = \tright\n root\nend", "def create_tree(exp)\n \toperatorStack, nodeStack = [], []\n \n # define function to create new tree segment\n subtree = Proc.new {\n # pop operands where\n # a [operator] b\n b, a = nodeStack.pop, nodeStack.pop\n\t\t\tnodeStack.push(Tree::Node.new(operatorStack.pop, a, b))\n\t\t}\n \n \texp.split(\"\").each do |c|\n \t\t# Skip whitespace characters\n \t\tif c === \"\\s\"\n \t\t\tnext\n \t\telsif c === ')'\n \t\t\tuntil operatorStack.last === '(' do\n \t\t\t\tsubtree.call\n \t\t\tend\n \t\t\t# remove the remaining open parenthesis\n \t\t\toperatorStack.pop\n \t\telsif %w|+ - * / ^ (|.include? c\n \t\t\tif operatorStack.empty? || c === '('\n \t\t\t\toperatorStack.push(c)\n \t\t\telse\n \t\t\t\twhile precedence_of(operatorStack.last) >= precedence_of(c)\n \t\t\t\t\tsubtree.call\n \t\t\t\tend\n \t\t\t\toperatorStack.push(c)\n \t\t\tend\n \t\telse\n \t\t\tnodeStack.push(Tree::Node.new(c))\n \t\tend\n \tend\n\n \tuntil operatorStack.empty? do\n \t\tsubtree.call\n \tend\n \n # top element of the stack is the root element\n \tTree.new(nodeStack.pop)\n end", "def create_node(class_name, parent)\n Tree.const_get(class_name.to_s + 'Node')\n .new(parent)\n end", "def build_node(*args)\n node_class.new(*args)\n end", "def tree(capa = 1)\n R3::Tree.new(capa)\nend", "def latex_qtree\n \"\\\\Tree \" + to_s(delim='[]', nonterm_prefix='.')\n end", "def build\n nodes = []\n chars = []\n\n expression.each_char do |character|\n\n if '(' == character\n\n chars << character\n\n elsif /\\d+/.match(character)\n\n nodes.push Tree.new(character.to_i)\n\n elsif operands.include?(character)\n\n while(chars.any? && chars.last != '(')\n t = Tree.new(chars.pop)\n t.right = nodes.pop\n t.left = nodes.pop\n nodes << t\n end\n\n chars << Operation::OPERATIONS[character].new\n\n elsif ')' == character\n\n while(chars.any? && chars.last != '(')\n t = Tree.new(chars.pop)\n t.right = nodes.pop\n t.left = nodes.pop\n nodes << t\n end\n\n chars.pop\n\n end\n\n end\n\n unless nodes.empty? && chars.empty?\n self.root = Tree.new(chars.pop)\n root.right = nodes.pop\n root.left = nodes.pop\n end\n\n raise \"Ka-Blam! You still have nodes and/or chars\" if nodes.any? || chars.any?\n\n root\n end", "def build_expression_node(node, model_class, comparator, conditions, root = false)\n conditions.reduce([nil, []]) do |(left_expression, joins), (key, value)|\n comparison_node, node_joins = build_comparison_node(root ? node : node.dup, model_class,\n key, comparator, value)\n if left_expression\n [left_expression & comparison_node, joins.concat(node_joins)]\n else\n [comparison_node, node_joins]\n end\n end\n end", "def make_node(type, *args)\n elem = type.new self, *args\n @nodes << elem\n self.core_node ||= elem.id\n elem.expand\n elem\n end", "def instantiate_node(node_type,*args)\n if node_type.respond_to? :new \n node_type.new(*args)\n else\n SyntaxNode.new(*args).extend(node_type)\n end\n end", "def build_tree\n c1 = ComponentNode.new(110)\n c2 = ComponentNode.new(20)\n c3 = ComponentNode.new(20)\n c4 = ComponentNode.new(150)\n c5 = ComponentNode.new(80)\n c6 = ComponentNode.new(120, [c1, c2, c3])\n c7 = ComponentNode.new(180, [c4, c5])\n return(ComponentNode.new(200, [c6, c7]))\n end", "def to_tree() = puts(TTY::Tree.new({ '.' => as_tree }).render)", "def gen_tree\n new_tree = {}\n node_list = {}\n @json_tree.each do |k, v|\n if v['child_of'].nil?\n # top\n new_tree[k] = v\n node_list[k] = new_tree[k]\n else\n parent = v['child_of']\n if v['condition'] == 'and'\n node_list[parent]['and'] ||= {}\n node_list[parent]['and'][k] = v\n node_list[k] = node_list[parent]['and'][k]\n elsif v['condition'] == 'or'\n node_list[parent]['or'] ||= {}\n node_list[parent]['or'][k] = v\n node_list[k] = node_list[parent]['or'][k]\n else\n # TODO: sink?\n node_list[parent]['or'] ||= {}\n node_list[parent]['or'][k] = v\n node_list[k] = node_list[parent]['or'][k]\n end\n end\n end\n\n @json_tree_type = 'tree'\n @json_tree = new_tree\n end", "def tree(data_path, options = {})\n\t\t\t\tresult = \"\"\n\n\t\t\t\t# Unique hash\n\t\t\t\t@hash = Digest::SHA1.hexdigest(data_path.to_s)\n\n\t\t\t\t# Options\n\t\t\t\t@options = options.nil? ? {} : options\n\n\t\t\t\t# Clipboard\n\t\t\t\tif @options[:clipboard_attrs]\n\t\t\t\t\tclipboard = true\n\t\t\t\t\t@options[:clipboard_attrs] = [@options[:clipboard_attrs]] if !@options[:clipboard_attrs].is_a?(Array)\n\t\t\t\t\tclipboard_attrs_js = \"[\" + @options[:clipboard_attrs].map { |item| \"'#{item}'\" }.join(\",\") + \"]\"\n\t\t\t\telse\n\t\t\t\t\tclipboard = false\n\t\t\t\t\tclipboard_attrs_js = \"[]\"\n\t\t\t\tend\n\n\t\t\t\t# Actions\n\t\t\t\tif @options[:actions]\n\t\t\t\t\tactions_js = \"[\"\n\t\t\t\t\toptions[:actions].each do |key, action|\n\t\t\t\t\t\tactions_js += %{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: '#{action[:path] ? @path_resolver.resolve(action[:path], \":id\") : \"\"}',\n\t\t\t\t\t\t\t\ticon: '#{action[:icon]}',\n\t\t\t\t\t\t\t\tlabel: '#{action[:label]}',\n\t\t\t\t\t\t\t\tcollapsed: #{action[:collapsed] == true ? \"true\" : \"false\"},\n\t\t\t\t\t\t\t\tstyle: '#{action[:style] ? action[:style] : \"default\"}',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\t\tactions_js += \"]\"\n\t\t\t\telse\n\t\t\t\t\tactions_js = \"[]\"\n\t\t\t\tend\n\n\t\t\t\t# Parent\n\t\t\t\tparent = (options[:parent] ? options[:parent] : nil)\n\n\t\t\t\t# Save state\n\t\t\t\tsave_state = (options[:save_state] ? options[:save_state] : :simple)\n\n\t\t\t\t# Application JS\n\t\t\t\tresult += @template.javascript_tag(%{\n\t\t\t\t\tvar rug_tree_#{@hash} = null;\n\t\t\t\t\t$(document).ready(function() {\n\t\t\t\t\t\trug_tree_#{@hash} = new RugTree('#{@hash}', {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Model\n\t\t\t\t\t\t\tmodel: 'node',\n\n\t\t\t\t\t\t\t// State\n\t\t\t\t\t\t\tsaveState: '#{save_state.to_s}',\n\n\t\t\t\t\t\t\t// Parent element\n\t\t\t\t\t\t\tparent: '#{parent.to_s}',\n\n\t\t\t\t\t\t\t// Icons\n\t\t\t\t\t\t\tclosedIcon: '#{@icon_builder.render(@options[:closed_icon] ? @options[:closed_icon] : \"chevron-right\")}',\n\t\t\t\t\t\t\topenedIcon: '#{@icon_builder.render(@options[:opened_icon] ? @options[:opened_icon] : \"chevron-down\")}',\n\n\t\t\t\t\t\t\t// Show\n\t\t\t\t\t\t\tshow: #{check_show(@options) ? 'true' : 'false'},\n\t\t\t\t\t\t\tshowEvent: '#{@options[:show_event] && @options[:show_event].to_sym == :double_click ? \"dblclick\" : \"click\"}',\n\t\t\t\t\t\t\tshowUrl: '#{@path_resolver.resolve(@options[:paths][:show], \":id\")}',\n\n\t\t\t\t\t\t\t// Create\n\t\t\t\t\t\t\tcreate: #{check_create(@options) ? 'true' : 'false'}, \n\t\t\t\t\t\t\tcreateUrl: '#{@path_resolver.resolve(@options[:paths][:create])}',\n\t\t\t\t\t\t\tcreateIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"plus\")}',\n\t\t\t\t\t\t\tcreateLabel: '#{I18n.t(\"general.action.create_child\").upcase_first}',\n\t\t\t\t\t\t\tcreateActionCollapsed: #{@options[:create_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\tcreateSuccessMessage: '#{I18n.t(\"general.messages.create.success\")}',\n\n\t\t\t\t\t\t\t// Update\n\t\t\t\t\t\t\tupdate: #{check_update(@options) ? 'true' : 'false'}, \n\t\t\t\t\t\t\tupdateUrl: '#{@path_resolver.resolve(@options[:paths][:update], \":id\")}', \n\t\t\t\t\t\t\tupdateIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"pencil\")}',\n\t\t\t\t\t\t\tupdateLabel: '#{I18n.t(\"general.action.update\").upcase_first}',\n\t\t\t\t\t\t\tupdateActionCollapsed: #{@options[:update_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\tupdateSuccessMessage: '#{I18n.t(\"general.messages.create.success\")}',\n\n\t\t\t\t\t\t\t// Destroy\n\t\t\t\t\t\t\tdestroy: #{check_destroy(@options) ? 'true' : 'false'}, \n\t\t\t\t\t\t\tdestroyUrl: '#{@path_resolver.resolve(@options[:paths][:destroy], \":id\")}', \n\t\t\t\t\t\t\tdestroyIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"trash\")}',\n\t\t\t\t\t\t\tdestroyLabel: '#{I18n.t(\"general.action.destroy\").upcase_first}',\n\t\t\t\t\t\t\tdestroyActionCollapsed: #{@options[:destroy_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\tdestroyConfirmMessage: '#{I18n.t(\"general.are_you_sure\")}',\n\t\t\t\t\t\t\tdestroySuccessMessage: '#{I18n.t(\"general.messages.destroy.success\")}',\n\n\t\t\t\t\t\t\t// Moving\n\t\t\t\t\t\t\tmoving: #{check_moving(@options) ? 'true' : 'false'},\n\t\t\t\t\t\t\tmovingUrl: '#{@path_resolver.resolve(@options[:paths][:move], \":id\", \":relation\", \":destination_id\")}',\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Type\n\t\t\t\t\t\t\ttypeIconTemplate: '#{@icon_builder.render(\":icon\", class: \"jqtree-icon\")}',\n\t\t\t\t\t\t\ttypeIconAttr: '#{@options[:type_icon_attr]}',\n\n\t\t\t\t\t\t\t// Actions\n\t\t\t\t\t\t\tactions: #{actions_js},\n\t\t\t\t\t\t\tactionsIconTemplate: '#{@icon_builder.render(\":icon\")}',\n\n\t\t\t\t\t\t\t// Clipboard\n\t\t\t\t\t\t\tclipboard: #{clipboard ? 'true' : 'false'},\n\t\t\t\t\t\t\tclipboardIcon: '#{@icon_builder.render(@options[:clipboard_icon] ? @options[:clipboard_icon] : \"clipboard\")}',\n\t\t\t\t\t\t\tclipboardTemplate: \"#{clipboard ? (@options[:clipboard_template] ? @options[:clipboard_template].gsub('\"', \"'\") : \":\" + @options[:clipboard_attrs].first) : \"\"}\",\n\t\t\t\t\t\t\tclipboardAttrs: #{clipboard_attrs_js},\n\t\t\t\t\t\t\tclipboardActionCollapsed: #{@options[:clipboard_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Select\n\t\t\t\t\t\t\tselectByDefault: #{@options[:select_by_default] ? @options[:select_by_default].to_i : \"null\"},\n\n\t\t\t\t\t\t\t// Reload\n\t\t\t\t\t\t\treloadIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"refresh\")}',\n\t\t\t\t\t\t\treloadLabel: '#{I18n.t(\"general.action.reload\").upcase_first}',\n\t\t\t\t\t\t});\n\t\t\t\t\t\trug_tree_#{@hash}.ready();\n\t\t\t\t\t});\n\t\t\t\t\t$(document).on('turbolinks:load', function() {\n\t\t\t\t\t\trug_tree_#{@hash}.repair();\n\t\t\t\t\t});\n\t\t\t\t})\n\n\t\t\t\tresult += %{\n\t\t\t\t\t<div id=\"tree-#{@hash}\" data-url=\"#{data_path.to_s}\"></div>\n\t\t\t\t}\n\n\t\t\t\treturn result.html_safe\n\t\t\tend", "def show_tree\n htmltree = \"\"\n self.each { |node| \n htmltree += \"<li><a href='#{normalize(node.name)}'>\"\n htmltree += '&nbsp; ' * node.node_depth * 3\n htmltree += \"#{node.name}</a></li>\\n\"\n }\n htmltree\n end", "def tree\n Tree.new(self)\n end", "def tree(node, *children, **typed_children)\n children += children_for(typed_children)\n children = children.flatten.grep(Tree)\n infos = sub(0, node.start), sub(node.start, node.length), sub(node.stop..-1)\n description = Hansi.render(THEME[:green], node.type.to_s.tr(\"_\", \" \"))\n after = Hansi.render(TEMPLATE, *infos, theme: THEME, tags: true)\n Tree.new(description, *children, after: after, prefix_color: PREFIX_COLOR)\n end", "def create_branch\n @tree_class.new\n end", "def node(type_or_token, params = nil)\n if type_or_token.is_a?(RBS::Token)\n token = type_or_token\n\n if token === :identifier\n Node.new(token.name, name: token.value)\n else\n Node.new(token.name, value: token.value)\n end\n else\n Node.new(type_or_token, params)\n end\n end", "def relational\r\n node = add()\r\n\r\n loop do\r\n if consume(\"<\")\r\n node = new_binary(ND_LT, node, add())\r\n elsif consume(\"<=\")\r\n node = new_binary(ND_LE, node, add())\r\n elsif consume(\">\")\r\n node = new_binary(ND_LT, add(), node)\r\n elsif consume(\">=\")\r\n node = new_binary(ND_LE ,add(), node)\r\n else\r\n return node\r\n end\r\n end\r\nend", "def node kind, params\n send(\"node_#{kind.downcase}\".to_sym, params)\n end", "def node_tree(nodes, &block)\n \n nodes = nodes.dup\n printed_nodes = []\n \n result = \"<ul>\"\n \n # top level nodes first, then others\n for node in nodes\n next if node.instance_of?(Center) || node.instance_of?(Team)\n next unless node.parent == nil\n printed_nodes << node\n result += \"<li>\"\n\n if block_given?\n result += yield node\n else\n result += node.title\n end\n\n children = node.children.dup\n children.delete_if { |r| not nodes.include?(r) }\n if not children.empty?\n result += node_tree_help(children, nodes, printed_nodes, &block)\n end\n \n result += \"</li>\"\n end\n \n # TODO: Add depth counting here to get a minimum of trees\n for node in nodes\n next if printed_nodes.include? node\n printed_nodes << node\n \n result += \"<li>\"\n\n if block_given?\n result += yield node\n else\n result += node.title\n end\n\n children = node.children #.dup\n children.delete_if { |r| not nodes.include?(r) }\n\n if not children.empty?\n result += node_tree_help(children, nodes, printed_nodes, &block)\n end\n \n result += \"</li>\"\n end\n\n result += '</ul>'\n\n return result\n end", "def tree\n root = Node.new(1)\n root.left = Node.new(2)\n root.right = Node.new(3)\n root.left.left = Node.new(4)\n root.left.right = Node.new(5)\n root.right.left = Node.new(6)\n root.right.right = Node.new(7)\n root.right.right.right = Node.new(8)\n root\nend", "def buildTree( prefixArray )\n return nil if prefixArray.empty?\n value = prefixArray.pop\n if( root.nil? )\n @root = TreeNode.new(value, nil, nil)\n # the right child comes before left since prefixArray \n # is really a _stack_\n @root.rightChild = buildTree( prefixArray )\n @root.leftChild = buildTree( prefixArray )\n elsif( isOp?(value) )\n newNode = TreeNode.new(value, nil, nil)\n newNode.rightChild = buildTree( prefixArray )\n newNode.leftChild = buildTree( prefixArray )\n return newNode\n else\n return TreeNode.new(value, nil, nil)\n end\n end", "def to_node\n self\n end", "def build_node(node, text)\n\t\t#node.type = :BasicNode\n\n\t\twhitespace = text.partition(\".\").first\n\t\tpure_text = text.partition(\".\").last\n\t\tnode.depth = (whitespace.length)/3 #+2?\n\n\t\t#get the category string, use it to pull a category id\n\t\tif pure_text.include?(\",\") #split by the comma if there is one\n\t\t\tcategory_name = pure_text.partition(\",\").first\n\t\t\ttitle = pure_text.partition(\",\").last\n\t\telse #default to no category\n\t\t#\tcategory_name = pure_text.partition(\" \").first\n\t\t\ttitle = pure_text\n\t\t\tcategory_name = \"\"\n\t\tend\n\n\t\t#need to make these only the categories that belong to the user\n\t\tcategory = self.categories.find_by name: category_name.downcase\n\t\tif category == nil\n\t\t\tcategory = self.categories.create(name: category_name.downcase)\n\t\tend\n\t\tnode.category = category\n\t\ttitle = title.strip\t\n\t\t\n\t\tnode.title = title\n\t\tnode.work_id = self.id\n\t\treturn node\n\tend", "def to_tree\n if term?\n [type, *args]\n else\n [type, *args.map(&:to_tree)]\n end\n end", "def build_tree(arr)\n #arr.shuffle!\n arr.each do |x|\n if @root == nil\n @root = Node.new(x)\n else\n current_node = @root\n until current_node == nil\n if x < current_node.value\n parent = current_node\n direction = \"left\"\n current_node = current_node.left_child\n elsif x > current_node.value\n parent = current_node\n direction = \"right\"\n current_node = current_node.right_child\n end\n end\n if direction == \"left\"\n parent.left_child = Node.new(x)\n elsif direction == \"right\"\n parent.right_child = Node.new(x)\n end\n end\n end\n end", "def to_s\n lft = self.left.to_s if self.left.is_a? Pow or !(self.left.is_a? BinaryOp)\n lft = \"(#{self.left.to_s})\" unless self.left.is_a? Pow or !(self.left.is_a? BinaryOp)\n rht = self.right.to_s if self.right.is_a? Pow or !(self.right.is_a? BinaryOp)\n rht = \"(#{self.right.to_s})\" unless self.right.is_a? Pow or !(self.right.is_a? BinaryOp)\n return \"#{lft}*#{rht}\"\n end", "def make_tree_for(position)\n root = TreeNode.new(nil, position)\n\n\nend", "def build_node_class_hash(class_hash)\n # First, create a hash with the following structure:\n #\n # - key: The name of the class to be added to the Node Group\n # - value: The parameters to be assigned to the class (generally an empty hash)\n #\n # Example: { 'pe_repo::platform::el_7_x86_64' => {} }\n class_parameters_hash = Hash.new\n class_parameters_hash[class_hash['name']] = class_hash['parameters']\n\n # Now, create a node that defines a new class association with a node group.\n # This hash will have the following structure:\n #\n # - key: 'classes' (Each node group has a 'classes' key, which contains a has for each class associated with that node group)\n # - value: class_parameters_hash (The hash created above, which defines the class name and parameters to add to the node group)\n #\n # Example: { 'classes' => { 'pe_repo::platform::el_7_x86_64' => {} } }\n node_class_hash = Hash.new\n node_class_hash['classes'] = class_parameters_hash\n\n # Return the newly constructed hash\n node_class_hash\nend", "def nodes\n left_nodes + [self] + right_nodes\n end", "def node(*args)\n Node.new(self, *args)\n end", "def node(*args)\n Node.new(self, *args)\n end", "def generate (node)\n\n\tif node.symbol != nil\n\t\treturn generate_id(node)\n\tend\n\t\n\tcase node.name\n\twhen \"block\"\n\t\treturn generate_block(node)\n\twhen \"while\"\n\t\treturn generate_while(node)\n\twhen \"if\"\n\t\treturn generate_if(node)\n\twhen \"declaration\"\n\t\treturn generate_declaration(node)\n\twhen \"assign\"\n\t\treturn generate_assignment(node)\n\twhen \"print\"\n\t\treturn generate_print(node)\n\twhen \"+\"\n\t\treturn generate_add(node)\n\twhen \"==\"\n\t\treturn generate_equals(node)\n\twhen \"!=\"\n\t\treturn generate_notequal(node)\n\tend\n\t\n\tcase node.token.type\n\twhen \"T_BOOLEAN\"\n\t\treturn generate_boolean(node)\n\twhen \"T_DIGIT\"\n\t\treturn generate_digit(node)\n\twhen \"T_STRING\"\n\t\treturn generate_string(node)\n\tend\n\t\n\nend", "def node\n returning \"#{@name}_node\" do |nodename|\n @canvas << \"var #{nodename} = #{@name}.node;\"\n end\n end", "def node(type, *args)\n AST.new(type, args)\n end", "def tree\r\n @rootNode\r\n end", "def create_node(t)\n raise NotImplementedError\n end", "def build(squeel, model_class, comparator, conditions)\n build_expression_node(squeel, model_class, comparator, conditions, true)\n end", "def produce_tree(ary); end", "def create_node(test_method, *params)\n # Get available nodes so we can find the one we need, this has to be\n # done since we don't know which letters should be capitalized.\n available_nodes = Dunder::Nodes::Node.sub_classes\n \n node_name_lower_case = \"dunder::nodes::#{get_last_word_in test_method}\"\n node_name = available_nodes.select { |node| node.to_s.downcase == node_name_lower_case }.first\n \n node_name.new *params\n end", "def node_for(node_type, s, opt={}, &block)\n name = determine_name s\n return if name.nil?\n \n node = if opt[:not_sure_if_nested]\n search_for_node_in_parent(@scope.last, name) ||\n Node.new(name, :node_type => node_type)\n else\n Node.new name, :parent => @scope.last, :node_type => node_type\n end\n\n node = add_or_find_duplicate node\n unless block.nil?\n @scope << node\n block.call node\n @scope.pop\n end\n node\n end", "def to_ruby; Tree.of_term term_t end", "def node_tree\n @node_tree ||= Node.all({:fields => \"title, permalink, parent_id, _id, path, _type\", :published_at => { :$lte => Time.zone.now }, :published_to => { :$gte => Time.zone.now }, :order => 'parent_id ASC, position ASC'}).group_by{|n| n.parent_id.to_s }\n end", "def tree\n @flow_expression.tree\n end", "def operators(node)\n return if node == nil\n operators(node.left)\n if node.left != nil || node.right != nil\n print node.value + \" \"\n end\n operators(node.right)\nend", "def new_node\n\t\t\traise NotImplementedError.new('#new_node must be implemented')\n\t\tend", "def build_tree(data, par_node)\n return nil if data.empty?\n \n if @node.value <= par_node.value\n if par_node.left == nil\n par_node.left = @node\n else\n build_tree(data, par_node.left)\n end\n else\n if par_node.right == nil\n par_node.right = @node\n else\n build_tree(data, par_node.right)\n end\n end\n\n @node = Node.new(data.shift)\n build_tree(data, @root)\n end", "def create_node(type, properties = {})\n {:node => type}.merge!(properties)\n end", "def parse_tree\n id = attribute( 'id' )\n label = attribute( 'label' )\n\n type = attribute( 'xsi:type' )[4..-1]\n klass = NeXML.const_get( type )\n tree = klass.new( id, :label => label )\n\n #a 'tree' element *will* have child nodes.\n while next_node\n case local_name\n when \"node\"\n #parse child 'node' element\n node = parse_node\n\n #and add it to the 'tree'\n tree.add_node node\n\n #root?\n tree.roots << node if node.root?\n when \"rootedge\"\n #parse child 'edge' element\n rootedge = parse_rootedge\n\n #and add it to the 'tree'\n # tree.add_rootedge rootedge # XXX it looks like the super class(es)\n # can only deal with edges that have source and target\n when \"edge\"\n #parse child 'edge' element\n edge = parse_edge( type )\n\n #and add it to the 'tree'\n tree.add_edge edge\n when \"tree\"\n #end of current 'tree' element has been reached\n break\n end\n end\n\n #return the 'tree' object\n tree\n end", "def create_node(node, token)\n raise NotImplementedError\n end", "def build_tree(arr)\n #take array, turn into bt with node objs\n return nil if arr.empty?\n\n mid = (arr.size - 1)/2\n current_node = Node.new(arr[mid])\n\n current_node.left = build_tree(arr[0...mid])\n current_node.right = build_tree(arr[(mid+1)..-1])\n \n current_node\n end", "def tree\n {\n snp_sample_size: @tree_SNP_sample_size,\n snp_total_count: @tree_SNP_total_count,\n tree_node_min_size: @tree_node_min_size,\n classes: @classes\n }\n end", "def make_tree(pre, inord)\n return if pre.size == 0\n root_node = Node.new(pre[0])\n idx = inord.index(pre[0])\n root_node.left = make_tree(pre[1..idx], inord[0...idx])\n root_node.right = make_tree(pre[idx+1...pre.size], inord[idx+1...inord.size])\n return root_node\nend", "def node_create(node, node_class=Deployment::Node)\n if node_present? node\n node = node_get node\n elsif node.is_a? Deployment::Node\n node = node_add node\n else\n node = node_class.new node, self\n node = node_add node unless node_present? node\n end\n node\n end", "def node_type; end", "def node_type; end", "def factor()\n node = nil\n\n if accept(:operator_not)\n node = Nodes::Not.new()\n node.child = factor()\n elsif accept(:paren_open)\n node = expression()\n expect(:paren_close)\n else\n node = subexpression()\n end\n\n node\n end", "def build_tree(elements)\n return if elements.empty?\n char = elements.shift\n node = BinaryTree.new(char)\n if char == \"I\"\n node.left = build_tree(elements)\n node.right = build_tree(elements)\n end\n return node\nend", "def create_node(type, properties = T.unsafe(nil)); end", "def to_s\n\t\t\"<Node:#{@e}>\"\n\tend", "def to_string_tree\n if ((@children).nil? || (@children.size).equal?(0))\n return self.to_s\n end\n buf = StringBuffer.new\n if (!is_nil)\n buf.append(\"(\")\n buf.append(self.to_s)\n buf.append(Character.new(?\\s.ord))\n end\n i = 0\n while !(@children).nil? && i < @children.size\n t = @children.get(i)\n if (i > 0)\n buf.append(Character.new(?\\s.ord))\n end\n buf.append(t.to_string_tree)\n i += 1\n end\n if (!is_nil)\n buf.append(\")\")\n end\n return buf.to_s\n end", "def parse_new_node(node, options = {})\n content = \"\"\n parser = nil\n\n case node.type\n # Any function call\n when :send\n parser = CallParser.new(node, options)\n\n # Function args\n when :args\n parser = ArgsParser.new(node)\n\n # Class declaration\n when :class\n parser = ClassParser.new(node)\n\n # Assign var\n when :lvasgn, :ivasgn, :cvasgn\n parser = VarParser.new(node, options)\n\n when :lvar, :ivar\n return unless node.children.length > 0\n return node.children[0].to_s\n\n # Function declaration\n when :def, :defs\n parser = FunctionParser.new(node, options)\n\n # Basic types\n when :str, :int, :float, :true, :false, :nil\n parser = BaseTypeParser.new(node, node.type)\n\n # Blocks\n when :begin\n node.children.each do |child|\n parser = MasterParser.new\n content << parser.parse_new_node(child, options).to_s << \"\\n\"\n end\n\n return content\n\n # Else, error\n else\n raise \"Unsupported type \" + node.type.to_s\n end\n\n parser.parse\n parser\n end", "def create_tree(vupper, vlower, &block)\n @root = Node.new(vupper, vlower, @depth)\n @root.create_children &block\n end", "def kind\n self[:node_kind]\n end", "def tree\n @stack = @rpn.clone\n get_tree\n end", "def node(klass = nil)\n return @context[:node] if !klass\n @context[:node].get(klass)\n end", "def as_welo_node(persp=:default)\n klass = self.class.to_welo_node(persp)\n obj = klass.new\n obj.represents(self, persp)\n obj\n end", "def dump_node\n field_sep = self.class.field_sep\n \"#{@name}#{field_sep}#{self.class}#{field_sep}#{root? ? @name : parent.name}\"\n end", "def build_node\n \"\"\n end", "def print_operators(node)\n return if node == nil\n print_operators(node.left) #starts recursion -- go left\n if node.value.match(/\\+|\\-|\\/|\\%|\\*/) #if operators included\n print node.value + \" \" #print value of this node\n end\n print_operators(node.right) #recursion -- go right\nend", "def subexpression()\n node = nil\n\n if current(:operator_less_than) || current(:operator_less_than_equal) ||\n current(:operator_greater_than) || current(:operator_greater_than_equal)\n\n node = operator()\n node.child = browser()\n elsif current(:boolean_true) || current(:boolean_false)\n node = boolean()\n else\n #No comparison operator is assuming equals\n node = Nodes::Equal.new()\n node.child = browser()\n end\n\n node\n end", "def generate_tree_nodes(ttt)\n while !@avail_moves.empty?\n player_moves = create_new_players_moves_array\n player_makes_move(player_moves)\n create_new_child_node(ttt, player_moves)\n end\n end", "def to_text\n self_and_descendants.map do |node|\n if block_given?\n inspect = yield(node)\n else\n inspect = node.class.inspect\n end\n \"#{'*'*(node.level+1)} #{inspect} (#{node.parent_id.inspect}, #{node.left}, #{node.right})\"\n end.join(\"\\n\")\n end", "def node()\n self.root.node()\n end", "def build_tree(data, node=self)\n data = data.sort\n build_bin_tree(data, 0, data.length - 1, node)\n end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end", "def node; end" ]
[ "0.6275866", "0.62736005", "0.6018715", "0.60012925", "0.585359", "0.5835047", "0.58197993", "0.58078945", "0.57921153", "0.57454836", "0.5729815", "0.57293296", "0.56752497", "0.5658922", "0.56317186", "0.5609146", "0.556063", "0.5557924", "0.5543804", "0.553794", "0.5505827", "0.55026585", "0.54985976", "0.549621", "0.54925597", "0.5489454", "0.54885364", "0.54777175", "0.54680514", "0.54670763", "0.54656947", "0.54506755", "0.54332215", "0.5404552", "0.5404552", "0.54010075", "0.5400625", "0.53977954", "0.5389311", "0.53825635", "0.53813016", "0.5376195", "0.53674555", "0.5348159", "0.5345248", "0.5342069", "0.53284866", "0.5312765", "0.53121215", "0.5311877", "0.5303856", "0.52945405", "0.529325", "0.52847266", "0.5283594", "0.52614105", "0.5252815", "0.5247932", "0.5247932", "0.5221018", "0.52207255", "0.5219104", "0.5212899", "0.5209667", "0.52058035", "0.5199628", "0.51978636", "0.5193319", "0.5192026", "0.5187687", "0.5187076", "0.51853853", "0.51804775", "0.51804477", "0.5179099", "0.5177036", "0.51704466", "0.5162857", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741", "0.5162741" ]
0.6900111
0
ajust 1..1 scale to 1..5
def corrected_rating [(weighted_rating + 2) * 1.6666666666666667, 5.0].min end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale(*amount)\n self.dup.scale! *amount\n end", "def scales\n \n end", "def scale(range)\n u = uninterpolate\n i = interpolate(range[0], range[1])\n\n lambda do |x|\n x = ([0.0, x, (wrong + right).to_f].sort[1]).to_f\n i.call(u.call(x))\n end\n end", "def scale_up(scale)\n self.side_length *= scale\n end", "def scale_by num\n min = 0.001\n num = min if num < min and num > -min\n self.x = self.x / num\n self.y = self.y / num\n self\n end", "def scale(*args, &block); end", "def transforms( inputs, type ) #:nodoc:\n nsamples = inputs.size\n result = [1.0]\n (nsamples-1).times do\n result << result[-1] / @factor\n end\n range = (1.0..result[-1])\n result = result.map {|v| range.abscissa( v )}\n return result\n end", "def scale(number, range, zero)\n if range.zero?\n # No scaling\n lambda do |scale|\n [number, scale, true]\n end\n else\n # Shrink range exponentially, and -1 + scale reduces the\n # rng_ to 0 when scale = 0, but rng_ = range when scale = 1.\n lambda do |scale|\n rng_ = (range ** scale) - 1 + scale\n pct = (number - zero) / range\n [zero + rng_ * pct, scale, true]\n end\n end\n end", "def scale_fixed old_min, old_max, new_min, new_max\n self.map do |elem|\n Rya::ExtendedClasses::MATH.scale elem, old_min, old_max, new_min, new_max\n end\n end", "def * scale\n scale == 1 ? self : Scaled.new(self, scale)\n end", "def scale(value)\r\n value * @height/2 + @height/4\r\n end", "def scale( value )\n ( value - @min ) / ( @max - @min )\n end", "def rate_scale=(_arg0); end", "def scale_unit(n, start1, stop1, start2, stop2, limit = false)\r\n norm = (n - start1) / (stop1 - start1).to_f\r\n norm = norm.clamp(0,1) if limit\r\n\t((norm * (stop2 - start2)) + start2)\r\nend", "def scale pairs\n @scale.call pairs\n end", "def scale!(rhs)\n scale rhs, self\n end", "def scale(name)\n \n end", "def scale(factor_x, factor_y=factor_x, &rendering_code); end", "def scale_values(values)\n return values if values.length == Merit::POINTS\n\n raise IncorrectLoadProfileError, values.length unless (Merit::POINTS % values.length).zero?\n\n factor = Merit::POINTS / values.length\n\n values.each_with_object([]) do |value, scaled|\n factor.times { scaled.push(value) }\n end\n end", "def scale( scale_x, scale_y = scale_x )\n dup.scale!(scale_x, scale_y)\n end", "def scale factor\n Vector.new factor * @x, factor * @y, factor * @z\n end", "def clamp; end", "def setscale(*)\n super\n end", "def scale(sx,sy)\n set RGhost::Scale.new(sx,sy)\n \n end", "def sub_scale _value, _abs=0\n send_cmd(\"sub_scale #{_value} #{_abs}\")\n end", "def rate_scale; end", "def scale(example)\n example.length.times do |i|\n # note that if the vector outside training set contains new feature value\n # (and training set contained only one other value) it'll be ignored\n @example_template[i].value = @max_vector[i] == @min_vector[i] ? @max_vector[i]\n : (example[i] - @min_vector[i]).to_f / (@max_vector[i] - @min_vector[i])\n end\n @example_template\n end", "def scale(min_from, max_from, min_to, max_to)\n normalize(min_from, max_from).denormalize(min_to, max_to)\n end", "def scale(value)\n @tileset.scale = value\n end", "def to_scale(*args)\n Statsample::Vector.new(self, *args)\n end", "def scale\n raise NotImplementedError, \"Subclass responsibility\"\n end", "def scale!(alpha, incx=1, n=nil)\n #FIXME\n # raise(DataTypeError, \"Incompatible data type for the scaling factor\") unless\n # NMatrix::upcast(self.dtype, NMatrix::min_dtype(alpha)) == self.dtype\n raise(DataTypeError, \"Incompatible data type for the scaling factor\") if\n self.dtype == :int8\n @s.mapMultiplyToSelf(alpha)\n return self\n end", "def mult5 array\n array.map do |value| \n value * 5 \n end\nend", "def scale(factor_x, factor_y, around_x, around_y, &rendering_code); end", "def set_fixed_scale(vmin,vmax,divisions=5,vxmin=0,vxmax=0,xdivisions=5)\n @vmin = vmin\n @vmax = vmax\n @divisions = divisions\n #TODO check\n #if (!vxnin == 0 )\n if (vxnin != 0 )\n @vxmin = vxmin\n @vxmax = vxmax\n @xdivisions = xdivisions\n end\n end", "def rescale\r\n unless self.is_si?\r\n return self.to_base_unit.rescale\r\n end\r\n scale=Math.log10(self.value)+self.unit.scale\r\n\r\n unit_scales=self.class.si_unit_scales.sort\r\n\r\n if scale<unit_scales[0][0]\r\n return self.send unit_scales[0][1].name\r\n end\r\n if scale>=unit_scales.last[0]\r\n return self.send unit_scales.last[1].name\r\n end\r\n unit_scales.each_cons(2) do |us|\r\n if us[0][0]<=scale && us[1][0]>scale\r\n return self.send us[0][1].name\r\n end\r\n end\r\n end", "def scale_mixes(mix_list, scl)\n as_one_edit_rb(get_func_name) do\n mix_list.each do |m|\n set_mix_amp(m, scl * mix_amp(m))\n end\n end\n end", "def normalize! level = 1.0\n self.divide!(@data.max / level)\n end", "def inqscale\n inquiry_int { |pt| super(pt) }\n end", "def scale(series, control, multiplier=1)\n map_over series, control, multiplier do |val,previous|\n [val * multiplier, val]\n end\n end", "def scale(arr)\n arr.sum(0){ |e| e * e } if arr.is_a?(Array)\n end", "def mix mixed_ammount = 0.25\n last_start = 0.0\n dist.branches.times do |i|\n self[i].clear_hits\n self[i] << last_start\n last_start = last_start + (1.0 - mixed_ammount) * (1.0/dist.branches)\n end\n end", "def scale!(type, size)\n @transforms << \"#{SCALE_TYPES[type]}#{size}\"\n self\n end", "def scale(f)\n @x *= f\n @y *= f\n self\n end", "def vscale(factor)\n @height = @height * factor\n @top *= factor\n self\n end", "def map(value, v_min, v_max, d_min, d_max)\n v_value = value.to_f # so it returns float\n\n v_range = v_max - v_min\n d_range = d_max - d_min\n (v_value - v_min) * d_range / v_range + d_min\n end", "def strauss; end", "def scale(by)\n @x = @x * by\n @y = @y * by\n @z = @z * by\n self\n end", "def constrain_one( *vector_or_number )\n scale = Vector2d::new(vector_or_number) / self\n if (scale.x > 0 && scale.y > 0)\n scale = (scale.x<scale.y) ? scale.y : scale.x\n self * scale\n else\n constrain_both(vector_or_number)\n end\n end", "def scale(x, xmin, xmax, ymin, ymax)\n xrange = xmax - xmin\n yrange = ymax - ymin\n ymin + (x - xmin) * (yrange.to_f / xrange) \n end", "def suggest_axis_scale(values)\n min = values.min\n max = values.max\n\n zero = min <= 0 && max >= 0\n range = max - min\n\n return 1 if range == 0\n\n good_steps = [0.1, 0.2, 0.5, 1, 0.15, 0.25, 0.75]\n ticks = 10\n\n steps = range.to_f / (ticks - 1)\n digits = 0\n if steps >= 1\n digits = steps.round.to_s.length\n else\n places = steps.to_s.split('.')[1]\n first_place = 0\n\n places.length.times do |i|\n (first_place = i) and break if places[i] != '0'\n end\n digits = -first_place\n end\n\n candidate_steps = []\n good_steps.each do |step|\n candidate_steps.push step * 10 ** digits\n candidate_steps.push step * 10 ** digits - 1\n candidate_steps.push step * 10 ** digits + 1\n end\n candidate_steps.reject! {|x| x <= 0}\n candidate_steps.uniq!\n\n candidate_arrays = []\n candidate_steps.each do |steps|\n step_array = []\n if zero\n min_steps = (min.abs / steps).ceil\n step_array.push -min_steps * steps\n else\n step_array.push (min / steps).floor * steps\n end\n\n while step_array[-1] < max\n step_array.push(step_array[-1] + steps)\n end\n\n next if step_array.length >= 11 or step_array.length < 4\n candidate_arrays.push step_array\n end\n\n # Special case for a small number of fixed-space integers\n if values.all? {|x| x == x.floor} && values.each_cons(2).map {|e| e[1] - e[0]}.uniq.length == 1\n # TODO: Try to select an appropriate candidate_array\n end\n\n # Minimise the number of numbers on display\n # Surprisingly not a terrible heuristic. 2 * length of all digits - length of non-zero digits\n # Maximises zeroes (so we end up with e.g. 10 20 30 not 11 22 33) and minimises length so we don't have extraneous labels\n candidate_arrays = candidate_arrays.sort_by { |a| l = a.map(&:to_s).map(&:length).inject(:+); l + l - a.map(&:to_s).map {|v| v.count('0')}.inject(:+) }\n candidate_arrays[0][1] - candidate_arrays[0][0]\n end", "def hscale(factor)\n @width *= factor\n @left *= factor\n self\n end", "def create_scale(*args)\n end", "def scaledRand(rand, scale)\n proc {\n rand.call() * scale\n }\nend", "def eva\n [[super, 0].max, 100].min\n end", "def scale!(*amount)\n x, y, z = amount.extract_vector3i!\n\n self.x, self.y, self.z = self.x*x, self.y*y, self.z*z\n self\n end", "def solution5(input)\n # Approach\n # Map over the initial array (to return a transformed array)\n # Map over each interal array (to return a transformed array)\n # Creates an enumerable range up to the value in the array\n # Multiple each value in the range using the inject method\n # which iterates and keeps the running total\n\n # Final solution\n # Uses shorthand version of inject\n # Remove the useless multiple by 1\n # Note the use of the starting value of 1 for inject\n # which makes this work properly for all values (including 0, 1)\n input.map do |ary|\n ary.map do |value|\n (2..value).inject(1, :*)\n end\n end\n\n # First solution\n # Mostly optimized\n # Does 1 more multiplication than needed (mult by 1)\n #\n # input.map do |ary|\n # ary.map do |value|\n # (1..value).inject(1) do |factorial, value|\n # factorial *= value\n # end\n # end\n # end\n end", "def range_remap(input_range:0..255, output_range:0.0..1.0, value:0)\n\t\tsrc = input_range\n\t\tdest = output_range\n\t\t\n\t\t# src: http://stackoverflow.com/questions/3451553/value-remapping\n\t\t# low2 + (value - low1) * (high2 - low2) / (high1 - low1)\n\t\treturn dest.first + (value - src.first) * (dest.last - dest.first) / (src.last - src.first)\n\tend", "def multiply_by_1_5(n)\n n = n.to_i\n is_one_third = rand(3) == 0\n result = (n * 1.5).floor\n result += 1 if is_one_third && n.odd?\n result -= 1 if is_one_third && n.even?\n result\n end", "def students_grow (list)\nlist.transform_values! {|v| v * 1.05}\nputs list\nend", "def scaled_using(source, destination)\n Scale.transform(self).using(source, destination)\n end", "def scale!(scalar=1)\n if scalar.kind_of? Numeric\n multiply! scalar, scalar, scalar\n elsif scalar.point3_like?\n multiply! scalar\n else\n raise_no_conversion scalar\n end\n end", "def setScaleShiftByBoundaryBox(x0,y0,x1,y1)\n @device.setScaleShiftByBoundaryBox(x0,y0,x1,y1) ;\n end", "def constrain_one( *vector_or_number )\n scale = Vector2d::new( vector_or_number ) / self\n if ( scale.x > 0 && scale.y > 0 )\n\t scale = ( scale.x<scale.y) ? scale.y : scale.x\n\t self * scale\n else\n constrain_both( args )\n end\n end", "def reduce_interval(a, b)\n a *= mul\n b *= mul\n return [a, -(get :width) * 1.1].max / mul, [b, (get :width) * 1.1].min / mul\n end", "def unscaleX(x)\n return @device.unscaleX(x) ;\n end", "def leaky_rectified_liniar_unit(x)\n\t\tx > 0 ? x : (x / 5.0)\n\tend", "def blur(n)\n\t\tn.times do\n\t\t\ttransform(one_index)\n\t\tend\n#\t\tupdate_cell(row_index+1,col_index,1)\n#\t\tupdate_cell(row_index,col_index+1,1)\n#\t\tupdate_cell(row_index,col_index-1,1)\n#\t\tupdate_cell(row_index-1,col_index,1)\n\tend", "def scaled_from(source)\n Scale.transform(self).from(source)\n end", "def mul( val )\n @x.scale( val )\n @y.scale( val )\n self\n end", "def adjust w\n w[\"mu\"] = [[0.001, w[\"mu\"]].max, 0.999].min\n end", "def adjust w\n w[\"mu\"] = [[0.001, w[\"mu\"]].max, 0.999].min\n end", "def normalize(value)\n value -= value.floor \n value += 1 if value < 0\n value\n end", "def health_scale(users, executions)\n # Each unique user counts 10x. Full confidence around 5 users.\n x = (users - 1) * 10 + [executions, 1].max\n return 0.0 if x < 1\n return 1.0 if x > 40\n 0.75 + 0.25 * Math.log(x) / Math.log(40)\n end", "def normalize\n normalization_factor = norm_2(self)\n return self if normalization_factor.zero?\n\n self.scale (1.0 / normalization_factor.to_f)\n end", "def range_weighting\n if @range.include?(25, 50)\n @weight_1 = 3\n elsif @range.include?(75, 100, 150)\n @weight_1 = 2\n else\n @weight_1 = 1\n end\n end", "def price_setter(min, max)\n price_range = []\n (min..max).step(5) { |x| price_range.push(x) }\n return price_range.sample\nend", "def ramp(step, total_steps)\n (255 * Math::sin(Math::PI/2.0/total_steps * step)).round\nend", "def normalize_range(range)\n ar = range.to_a\n if ar.min > 2 # normalizacja zadanego zakresu aby zawsze zakres zaczynał się od 2\n ar += (2..ar.min-1).to_a\n ar = ar.sort\n else\n ar.delete_if { |e| e < 2 }\n end\n ar\nend", "def scale(scale_val, objectify = false)\n scaled = Array.new(@n) { Array.new(@m) }\n 0.upto(@n - 1) do |i|\n 0.upto(@m - 1) do |j|\n scaled[i][j] = scale_val * @matrix[i][j]\n end\n end\n return VectorMatrix.new(nil, nil, nil, scaled) if objectify\n scaled\n end", "def scale= scale\n protected_use_method(MM::Scaling, :@scale, scale)\n end", "def zoom(factor = 5)\n upstream_slice = self.class.sketch.slices.select{|s| s.start_cumulative_bp < @start_cumulative_bp}.sort_by{|s| s.start_cumulative_bp}[-1]\n downstream_slice = self.class.sketch.slices.select{|s| s.start_cumulative_bp > @start_cumulative_bp}.sort_by{|s| s.start_cumulative_bp}[0]\n\n center_bp = (@start_cumulative_bp + @length_bp.to_f/2).round\n\n @length_bp = (@length_bp.to_f/factor).round\n @start_cumulative_bp = (center_bp - @length_bp.to_f/2).round\n @stop_cumulative_bp = (center_bp + @length_bp.to_f/2 - 1).round\n @resolution = @length_pixel.to_f/@length_bp\n self.fetch_sequence\n\n upstream_slice.stop_cumulative_bp = @start_cumulative_bp - 1\n downstream_slice.start_cumulative_bp = @stop_cumulative_bp + 1\n [upstream_slice, downstream_slice].each do |s|\n s.length_bp = s.stop_cumulative_bp - s.start_cumulative_bp + 1\n s.resolution = s.length_pixel.to_f/s.length_bp\n s.range_cumulative_bp = Range.new(s.start_cumulative_bp, s.stop_cumulative_bp)\n s.fetch_sequence\n end\n self.class.sketch.slices.each{|s| s.format_resolution}\n\n self.class.sketch.buffer_images[:zoomed] = self.class.sketch.draw_zoomed_buffer\n self.class.sketch.buffer_images[:information_panel] = self.class.sketch.draw_information_panel\n end", "def scale(key, value)\n (value - @smallest_seen_values[key]) / (@largest_seen_values[key] - @smallest_seen_values[key])\n end", "def melody scales\n oct = rand(4) + 2\n scales.scale.map {|note|\n MidiCalc.new(Pitch.new(note, oct)).pc_to_midi\n }.shuffle\nend", "def scale(*args)\n r = Rect.new x, y, w, h\n r.resolution = r.resolution * Vector2[args.singularize]\n r\n end", "def normalize!\n if self[2] < 0\n self[0], self[2] = self[0]+self[2], -self[2]\n end\n if self[3] < 0\n self[1], self[3] = self[1]+self[3], -self[3]\n end\n self\n end", "def round_to_five(numbers)\n numbers.map { |n| (n / 5.0).round * 5 }\nend", "def *(n) self.class.from_hz(self.to_hz * n) end", "def scale_bilinear(*args)\n @source = BilinearScaler.new(@source, *args)\n self\n end", "def zoom_1\n return 1.0\n end", "def scale(factor)\n Point.new(self.x * factor, self.y * factor)\n end", "def correct_scale_to(current, min, max, scale_to)\n if current < min\n log_txt \"current replicas for deployment #{config.deploy_name} \" \\\n \"are less then min replicas, will scale to #{min} replicas\"\n return min\n elsif current > max\n log_txt \"current replicas for deployment #{config.deploy_name} \" \\\n \"are more then max replicas, will scale to #{max} replicas\"\n return max\n else\n return scale_to\n end\n end", "def normalize(min, max, val)\n\t\t(val - min) / (max - min)\n\tend", "def scaled_to(destination)\n Scale.transform(self).to(destination)\n end", "def zoom(delay)\n self.scale += delay * ZOOM_SPEED\n end", "def scale(x, y)\n primitive 'scale ' + sprintf('%g,%g', x, y)\n end", "def scale_stack\n @scale_stack ||= MadStatter::Statistic::RATES.slice(0..MadStatter::Statistic::RATES.index(scale))\n end", "def unit!(x=1,y=1,z=1)\n scale!(1/modulus)\n end", "def get_scale\n runs = []\n 10.times do\n runs << measure(1, &@options[:fn])\n end\n runs.inject(:+) / 10\n end", "def map_value(val, from_range, to_range)\n orig_range = [1, (from_range[1] - from_range[0]).abs].max\n new_range = [1, (to_range[1] - to_range[0]).abs].max\n\n ((val.to_f - from_range[0]) / orig_range) * new_range + to_range[0]\n end", "def scale_degrees\n \n end" ]
[ "0.659849", "0.650903", "0.63455266", "0.6266132", "0.6255369", "0.61050284", "0.6043595", "0.5935968", "0.5927438", "0.5875096", "0.5863823", "0.5817157", "0.58076835", "0.5796524", "0.5790055", "0.57640874", "0.5758132", "0.568345", "0.5658112", "0.5653517", "0.56284386", "0.5622784", "0.55920345", "0.5591974", "0.5535595", "0.5504922", "0.5491604", "0.5469605", "0.5451747", "0.5450952", "0.5421758", "0.53893894", "0.5383834", "0.5380417", "0.53742826", "0.5372249", "0.53621763", "0.53326344", "0.53325427", "0.5326117", "0.5321368", "0.5306476", "0.5287961", "0.52805024", "0.52525735", "0.52488893", "0.523842", "0.5236291", "0.5224181", "0.52210665", "0.5218072", "0.5213501", "0.5210957", "0.51798636", "0.5178646", "0.5166566", "0.5150836", "0.51498455", "0.51457816", "0.5137929", "0.51332563", "0.51325315", "0.5125061", "0.5112803", "0.51095307", "0.5101059", "0.508644", "0.5082751", "0.50793195", "0.5076194", "0.5071989", "0.5071989", "0.505935", "0.5046781", "0.50445145", "0.5038928", "0.5021501", "0.50177014", "0.5007475", "0.5005694", "0.5005489", "0.4996867", "0.49918786", "0.4982328", "0.49766064", "0.4976258", "0.49695116", "0.4967757", "0.4967095", "0.49649137", "0.4964865", "0.49595645", "0.4955537", "0.49475747", "0.49343452", "0.49316567", "0.49202982", "0.49183697", "0.49173197", "0.49170202", "0.4915444" ]
0.0
-1
check getting checksums of a stream
def test_get_checksum_stream basechecksum = Cfruby::Checksum::Checksum.get_checksums(@tempfile.path) File.open(@tempfile.path) { |fp| streamchecksum = Cfruby::Checksum::Checksum.get_checksums(fp) assert_equal(basechecksum, streamchecksum) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checksums; end", "def verify_checksum!\n log.info(log_key) { \"Verifying checksum\" }\n\n expected = checksum\n actual = digest(downloaded_file, digest_type)\n\n if expected != actual\n raise ChecksumMismatch.new(self, expected, actual)\n end\n end", "def checksum\n end", "def validate_checksum\n raise Puppet::Error.new \"Inconsistent checksums. Checksum of fetched file is #{calculated_checksum}. You specified #{specified_checksum}\" if calculated_checksum != specified_checksum\n end", "def checksum\n fil_header[:checksum]\n end", "def checksum_invalid?\n !checksum_valid?\n end", "def checksum_valid?\n Digest::SHA256.file(path).hexdigest == sha256sum\n end", "def checksum\n calc_checksum = 0\n byte_bit_nbr = 0\n @fuse_data.each { |bit|\n calc_checksum += 2**byte_bit_nbr if bit == 1\n byte_bit_nbr += 1\n byte_bit_nbr = 0 if byte_bit_nbr == 8\n }\n calc_checksum = calc_checksum % 2**16\n calc_checksum\n end", "def checksum?\n self.checksum == compute_checksum\n end", "def checksum\n source[digest_type]\n end", "def can_validate_checksums?\n true\n end", "def checksum?# {{{\n self.csum == compute_checksum\n end", "def checksum\n\t\t@checksum ||= FileManager.checksum(@path)\n #\t\tif file?\n #\t\t\treturn FileManager.checksum(@path)\n #\t\tend\n end", "def checksum?\n self.checksum == self.compute_checksum\n end", "def valid?\n checksum.to_s.split(//).map(&:to_i).last == 0\n end", "def valid_checksums?\n \n p = package_path\n files.each do |f|\n file_path = File.join(p, f[:path])\n \n if File.exist?(file_path)\n digest = Digest::SHA1.hexdigest(File.read(file_path))\n errors.add :checksum_validity, \"Digest for #{file_path} in AIP does \" +\n \"not match\" unless digest == f[:sha_1]\n end \n \n end\n \n errors.on(:checksum_validity).nil?\n \n end", "def validate()\n cs = checksum()\n return cs == @header[LENGTH - 1]\n end", "def verify_checksum(res)\n msg, chksum = res.match(/^\\$(.*)#(\\h{2})$/)[1..2]\n checksum(msg) == chksum\n end", "def validate_checksum(file_to_check)\n # desired = fetch_checksum\n desired = ::File.read(\"#{Chef::Config['file_cache_path']}/#{new_resource.tarball_name}.md5\").split.last\n actual = Digest::MD5.hexdigest(::File.read(file_to_check))\n\n if desired == actual\n true\n else\n Chef::Log.fatal(\"The checksum of the splunk tarball on disk (#{actual}) does not match the checksum provided from the mirror (#{desired}). Renaming to #{::File.basename(file_to_check)}.bad\")\n ::File.rename(file_to_check, \"#{file_to_check}.bad\")\n raise\n end\n end", "def valid_checksum?(checksum_value)\n checksum_value == checksum\n end", "def fetch_checksum\n uri = URI(new_resource.checksum_uri)\n request = Net::HTTP.new(uri.host, uri.port)\n request.use_ssl = true if uri.to_s.start_with?('https')\n response = request.get(uri)\n if response.code != '200'\n Chef::Log.fatal(\"Fetching the Logstash tarball checksum at #{uri} resulted in an error #{response.code}\")\n raise\n end\n response.body.split(' ')[0]\n rescue => e\n Chef::Log.fatal(\"Could not fetch the checksum due to an error: #{e}\")\n raise\n end", "def has_checksum?(digest)\n find_checksum_by_digest(digest).nil? == false\n end", "def checksum\n Nanoc::Checksummer.calc(self)\n end", "def checksum(name)\n checksum_data[name]\n end", "def checksum(msg)\n length = msg.length\n num_short = length / 2\n check = 0\n\n msg.unpack(\"n#{num_short}\").each do |short|\n check += short\n end\n\n if length % 2 > 0\n check += msg[length-1, 1].unpack('C').first << 8\n end\n\n check = (check >> 16) + (check & 0xffff)\n return (~((check >> 16) + check) & 0xffff)\n end", "def checksum_trailer\n fil_trailer[:checksum]\n end", "def checksum\n return @checksum if @checksum\n\n raise 'number1 is required' unless self.number1\n raise 'number2 is required' unless self.number2\n raise 'challenge is required' unless self.challenge\n\n checksum = ''\n checksum += [self.number1].pack('N')\n checksum += [self.number2].pack('N')\n checksum += self.challenge\n checksum = Digest::MD5.digest(checksum)\n\n return @checksum ||= checksum\n end", "def check_read(file, bytes); end", "def check_read(file, bytes); end", "def checksum_valid?\n require 'digest'\n\n Chef::Log.info \"Validating the checkum\"\n\n if new_resource.checksum.to_s==''\n Chef::Log.info \"Skipping as no checksum is provided\"\n return true\n end\n\n if Chef::Artifact.from_nexus?(new_resource.location)\n Digest::SHA1.file(new_resource.name).hexdigest == Chef::Artifact.get_artifact_sha(node, new_resource.location)\n else\n if new_resource.checksum\n Digest::SHA1.file(new_resource.name).hexdigest == new_resource.checksum\n else\n Chef::Log.info \"[artifact_file] No checksum provided for artifact_file, not verifying against downloaded file.\"\n true\n end\n end\nend", "def validate_checksum?\n self[:checksum] !~ /time/\n end", "def checksum\n summation = 0\n @nmi.reverse.split(//).each_index do |i|\n value = nmi[nmi.length - i - 1].ord\n value *= 2 if i.even?\n value = value.to_s.split(//).map(&:to_i).reduce(:+)\n summation += value\n end\n checksum = (10 - (summation % 10)) % 10\n checksum\n end", "def checksum(path)\n FileChecksum.new(path, Digest::SHA1).checksum\n end", "def checksum_specified?\n ! specified_checksum.nil?\n end", "def checksum_valid?\n checksum_crc32? || checksum_innodb?\n end", "def content_file_checksums_match?\n checksum_failures = \"\"\n described_datafiles.each do |datafile|\n info = datafile.checksum_info\n\n if File.exists?(datafile.datapath) == false\n checksum_failures << \"#{datafile['sip-path']} - missing; \"\n elsif info[0] != info[1]\n checksum_failures << \"#{datafile['sip-path']} - expected: #{info[0]} computed: #{info[1]}; \"\n else\n next\n end\n end\n\n if checksum_failures.length > 0\n metadata[\"checksum_failures\"] = checksum_failures\n return false\n else\n return true\n end\n end", "def valid_checksum?(numbers) #:nodoc:\n sum = 0\n\n odd = true\n numbers.reverse.bytes.each do |number|\n if odd\n odd = false\n sum += ODD_LUHN_VALUE[number]\n else\n odd = true\n sum += EVEN_LUHN_VALUE[number]\n end\n end\n sum % 10 == 0\n end", "def handlesum\n currentvalue = self.retrieve\n if currentvalue.nil?\n raise Puppet::Error, \"Checksum state for %s is somehow nil\" %\n @resource.title\n end\n\n if self.insync?(currentvalue)\n self.debug \"Checksum is already in sync\"\n return nil\n end\n # If we still can't retrieve a checksum, it means that\n # the file still doesn't exist\n if currentvalue == :absent\n # if they're copying, then we won't worry about the file\n # not existing yet\n return nil unless @resource.property(:source)\n end\n\n # If the sums are different, then return an event.\n if self.updatesum(currentvalue)\n return :file_changed\n else\n return nil\n end\n end", "def checksum_ok?(csum, *strings)\n csum ? csum.chr == generate_checksum(*strings) : false\n end", "def calcChecksum(data)\n \n # calculate checksum\n checksum = 0xFF\n data.each_byte {|x| checksum ^= x }\n \n return checksum\n end", "def validate_download!(source, path, checksums)\n CHECKSUM_MAP.each do |type, klass|\n if checksums[type]\n result = checksum_file(klass, path)\n @logger.debug(\"Validating checksum (#{type}) for #{source}. \" \\\n \"expected: #{checksums[type]} actual: #{result}\")\n if checksums[type] != result\n raise Errors::DownloaderChecksumError.new(\n source: source,\n path: path,\n type: type,\n expected_checksum: checksums[type],\n actual_checksum: result\n )\n end\n end\n end\n true\n end", "def checksum\n Digest::SHA256.file(sample_dmg).hexdigest\nend", "def verify_checksum(filename)\n if options[:sha256]\n verify_sha256_hash(filename, options[:sha256])\n elsif options[:sha1]\n verify_sha1_hash(filename, options[:sha1])\n end\n end", "def calc_checksum\n # Checksum is only on header, so cannot use IP.sum16,\n # which also calculates checksum on #body.\n nb_words = ihl * 2\n self.checksum = 0\n checksum = to_s.unpack(\"n#{nb_words}\").sum\n self[:checksum].value = IP.reduce_checksum(checksum)\n end", "def validate_downloaded_file(file_path:, checksum:)\n return false unless file_path.present? && checksum.present? && File.exist?(file_path)\n\n puts 'Validating file against expected checksum...'\n\n checksum = checksum[4..] if checksum.starts_with?('md5:')\n\n actual_checksum = Digest::MD5.file(file_path).to_s\n actual_checksum == checksum\n end", "def checksum(hex)\n sha256(sha256(hex))[0...8]\nend", "def assert_has_stream(stream); end", "def pseudo_header_checksum\n sum = 0\n self[:src].to_a.each { |word| sum += word.to_i }\n self[:dst].to_a.each { |word| sum += word.to_i }\n sum\n end", "def include_checksum?\n include_checksum\n end", "def checksum\n digest = @digest_klass.new\n buf = ''\n\n File.open(@path, \"rb\") do |f|\n while !f.eof\n begin\n f.readpartial(BUFFER_SIZE, buf)\n digest.update(buf)\n rescue EOFError\n # Although we check for EOF earlier, this seems to happen\n # sometimes anyways [GH-2716].\n break\n end\n end\n end\n\n digest.hexdigest\n end", "def check( chksum_manifest )\n new_chksum_manifest = create_chksum_manifest\n changed = []\n chksum_manifest.each do |file,chksum|\n changed << file if chksum != new_chksum_manifest[file]\n end\n if changed.empty?\n chksum_manifest = new_chksum_manifest\n else\n raise ChecksumError, changed\n end\n end", "def checksum\n @checksum ||= luhn_doubled.inject(0) { |a, e| a + sum_of(e) }\n end", "def checksum(hex)\n sha256(sha256(hex))[0...8]\n end", "def checksum sequence_number\n Digest::MD5.hexdigest(@buffer[sequence_number])\n end", "def validate_checksums(thesis, body, results)\n expected_checksums = convert_checksums(thesis)\n actual_checksums = collect_checksums(body)\n\n Rails.logger.info(\"Validating Checksums for #{thesis.id}\")\n\n # confirm etd record has files to validate. This should never be an issue, but will be super confusing to figure\n # out what happened if we don't check and it is an issue.\n return unless thesis_has_files?(thesis, results)\n\n if actual_checksums.map { |c| c.in?(expected_checksums) }.all?(true)\n Rails.logger.info(\"All DSpace checksums for thesis #{thesis.id} are valid\")\n\n # since all other validations have been performed by this point, we can confirm the thesis is ready for\n # preservation if its checksums are valid.\n results[:preservation_ready] << thesis\n else\n update_status_and_log_bad_checksums(thesis, results, actual_checksums, expected_checksums)\n end\n end", "def check_digests(streamer_response:, file_model:)\n out = streamer_response\n upload = file_model\n if out[:response].nil? || out[:response][:checksum].nil?\n raise FileError, \"Error streaming file to Zenodo. No md5 digest returned:\\n#{out[:response]}\\nFile:#{upload.inspect}\"\n end\n\n if out[:response][:checksum] != \"md5:#{out[:digests]['md5']}\"\n raise FileError, \"Error MD5 digest doesn't match zenodo:\\nResponse: #{out[:response][:checksum]}\\nCalculated: md5:#{out[:digests]['md5']}\"\n end\n\n return unless upload.digest_type.present? && upload.digest.present? && out[:digests][upload.digest_type] != upload.digest\n\n raise FileError, \"Error #{upload.digest_type} digest doesn't match database value:\\nCalculated:#{out[:digests][upload.digest_type]}\\n\" \\\n \"Database: #{upload.digest}\"\n end", "def checksum!\n self.checksum = compute_checksum\n end", "def checksum!\n self.checksum = compute_checksum\n end", "def rubocop_checksum; end", "def compute_checksum# {{{\n pseudo = []\n pseudo << ((self.version << 8) | self.ttl)\n pseudo << 0\n pseudo << self.payload\n L3::Misc.checksum(pseudo.pack(\"nna*\"))\n end", "def corrupt?\n checksum_invalid? || torn? || misplaced?\n end", "def checksum(file_path, hash_class, _bit_size)\n # Size of each chunk\n chunk_size = 2048\n # Hash that is the checksum function\n # when a bitsize was specified\n if _bit_size\n hash = hash_class.new(_bit_size)\n else\n hash = hash_class.new\n end\n # File handler\n file_object = File.open(file_path, 'r')\n # loop to update the hash\n while true\n content = file_object.read chunk_size\n # Break the loop if we don't get any byte\n unless content\n return hash.hexdigest\n end\n # Update the hash\n hash.update content\n end\nend", "def checksum\n return nil if @window_bits < 0\n @deflater.closed? ? @checksum : @deflater.adler\n end", "def file_remote_digestsha2(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::SHA256.hexdigest(data)\n end\n return chksum\n end", "def checksum(hex)\n hash = hash256(hex) # Hash the data through SHA256 twice\n return hash[0...8] # Return the first 4 bytes (8 characters)\nend", "def validate_image_md5sum\n result = true\n if upload_md5sum.present? && save_to_temp_file\n sum = File.open(upload_temp_file) do |f|\n Digest::MD5.hexdigest(f.read)\n end\n if sum == upload_md5sum\n result = true\n else\n errors.add(:image, :validate_image_md5_mismatch.\n t(actual: sum.split.first, expect: upload_md5sum))\n result = false\n end\n end\n result\n end", "def get_checksum\n msg = nil\n header_only = nil\n\n if params[:chk_header_only] == '1'\n # bind header only content\n header_only = true\n msg = Checksum.get_header_info params[:excel_file]\n else\n # 2. sequentially download package in checksum file\n path = Rails.root.join('public', 'checksum_packages', params[:folder])\n msg = Checksum.dowload_files path, params['excel_file']\n end\n\n if msg == ErrorNo::UploadFile::EXCEL_INVALID_FILE_TYPE\n message = 'Please select correct excel file type: .csv/.xls/.xlsx'\n elsif msg == ErrorNo::UploadFile::EXCEPTION\n message = 'Error occurred when uploading file. Please contact administrator for more details.'\n elsif msg == ErrorNo::FileFolder::F_EXIST\n message = \"'#{params[:folder]}' folder already exists. Please enter new name\"\n elsif msg.is_a?(Array) && msg[0] == ErrorNo::UploadFile::EXCEL_MISSING_HEADER\n message = 'Below is the missing header titles list. Please update header title(s) of the excel file or contact your administrator<br/>' + msg[1]\n elsif msg == ErrorNo::UploadFile::EXCEL_CANNOT_OPEN\n message = 'Cannot open file! Please try again.'\n elsif header_only\n message = msg\n else\n message = '<p class=\\'alert alert-success\\'>Server is downloading packages sequentially. Please navigate to Checksum Comparison Result page for more details.</p>'\n end\n\n render plain: message\n end", "def checksum\n return nil if @window_bits < 0\n @inflater.closed? ? @checksum : @inflater.adler\n end", "def calc_checksum\n c0 = c1 = 0\n to_s[2..].unpack('C*').each do |byte|\n c0 += byte\n c1 += c0\n end\n c0 %= 255\n c1 %= 255\n\n x = ((sz - 17) * c0 - c1) % 255\n x += 255 if x <= 0\n y = 255 * 2 - c0 - x\n y -= 255 if y > 255\n self.checksum = (x << 8) | y\n end", "def checksum_of(url, etag, last_modified)\n #noinspection RubyArgCount\n Zlib::crc32(url + etag + last_modified).to_s\n end", "def checkStream(pkt)\n\terrorDetected = false;\n\t$incident = \"test\"\n\n\t# Check TCP vulnerabilities\n\tif pkt.proto.last == \"TCP\"\n\t\tif checkNull(pkt)\n\t\t\terrorDetected = true\n\t\t\t$incident = \"NULL\"\n\t\telsif checkFin(pkt)\n\t\t\terrorDetected = true\n\t\t\t$incident = \"FIN\"\n\t\telsif checkXMAS(pkt)\n\t\t\terrorDetected = true\n\t\t\t$incident = \"XMAS\"\n\t\tend\n\telse\n\t\tif checkNikto(pkt)\n\t\t\terrorDetected = true\n\t\t\t$incident = \"nikto\"\n\t\telsif checkNmap(pkt)\n\t\t\terrorDetected = true\n\t\t\t$incident = \"Nmap\"\n\t\telsif checkCreditCard(pkt)\n\t\t\terrorDetected = true\n\t\t\t$incident = \"Credit card leaked\"\n\t\tend\n\tend\n\n\tif errorDetected\n\t\tputs \"#{$incident_number}. ALERT: #{$incident} is detected from #{pkt.ip_saddr} (#{pkt.proto.last}) (#{pkt.payload})!\"\t\n\t\t$incident_number = $incident_number + 1\n\tend\nend", "def checksum\n Digest::SHA256.hexdigest(self.to_smash(:sorted).to_s)\n end", "def verify_update_file\n @log.info('Beginning integrity check of downloaded file .')\n @file_sha1 = Digest::SHA1.file(@update_file.path).hexdigest\n\n @log.info('Verifying integrity of downloaded file.')\n\n if download_remote_sha1 == @file_sha1\n @log.info('Integrity verified.')\n true\n else\n abort('File was not downloaded correctly. Please try again.')\n end\n end", "def validate_checksum_state\n super\n end", "def compare_stream(stream)\n open(0, 'rb') do |this|\n FileUtils.compare_stream(this, stream)\n end\n end", "def fail_if_checksum_is_wrong(path, content_checksum)\n newsum = parameter(:checksum).sum_file(path)\n return if [:absent, nil, content_checksum].include?(newsum)\n\n self.fail \"File written to disk did not match checksum; discarding changes (#{content_checksum} vs #{newsum})\"\n end", "def checksum(hex)\n hash = hash256(hex) # Hash the data through SHA256 twice\n return hash[0...8] # Return the first 4 bytes (8 characters)\n end", "def verifyMD5sum\n\n oldMD5sum = ''\n \n self.audioMD5sum if ! @audioMD5sum # compute MD5sum if it's not computed yet\n\n base = @basename.sub( /(.)\\.[^.]+$/ , '\\1') # remove suffix from audio-file\n base += '.md5' # add new suffix .md5\n md5name = File.join(@dirname,base)\n \n # if a MD5-file doesn't exist, we should create one and return TRUE ...\n if File.exists?(md5name)\n File.open( md5name ,\"r\") { |f| \n oldname,oldMD5sum = f.readline.split # read old MD5-sum\n }\n else\n oldMD5sum = self.writeMD5sum # create MD5-file and return true..\n end\n @audioMD5sum == oldMD5sum\n \n end", "def calculated_checksum\n send(\"#{@resource[:checksum_type]}_file\".to_sym, @resource[:path]) \n end", "def compare_checksum_metadata(s3_object, part)\n replicated_checksum = s3_object.metadata['checksum_md5']\n if part.md5 == replicated_checksum\n part.update(last_checksum_validation: Time.zone.now)\n true\n else\n results.add_result(\n Audit::Results::ZIP_PART_CHECKSUM_MISMATCH,\n endpoint_name: part.zipped_moab_version.zip_endpoint.endpoint_name,\n s3_key: part.s3_key,\n md5: part.md5,\n replicated_checksum: replicated_checksum,\n bucket_name: bucket_name\n )\n part.update(status: 'replicated_checksum_mismatch', last_checksum_validation: Time.zone.now)\n false\n end\n end", "def quick_verify\n cached_md5 == remote_md5 and remote_md5 == md5\n end", "def hash(handle, offset, length, block_size=0)\n if block_size != 0 && block_size < 255\n block_size = 256\n end\n send_request(FXP_EXTENDED, :string, \"check-file-handle\", :string, handle, :string, \"md5,sha256,sha384,sha512\", :int64, offset, :int64, length, :long, block_size)\n end", "def file_remote_digestsha1(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::SHA1.hexdigest(data)\n end\n return chksum\n end", "def verify_checksum(hrp, data)\n const = polymod(expand_hrp(hrp) + data)\n case const\n when 1\n Encoding::BECH32\n when BECH32M_CONST\n Encoding::BECH32M\n end\n end", "def checksum!# {{{\n self.csum = compute_checksum\n end", "def checksum(content)\n out = ''\n (0...content.size).step(2) do |idx|\n sub = content[idx..(idx + 1)]\n case sub\n when '00' then out << '1'\n when '11' then out << '1'\n when '01' then out << '0'\n when '10' then out << '0'\n else\n raise \"Unknown pattern '#{sub}'@#{idx}\"\n end\n end\n\n out = out\n if out.size.even?\n checksum(out)\n else\n out\n end\nend", "def compute_checksum\n pseudo = []\n pseudo << ((((self.version << 4) | self.hlen) << 8) | self.tos)\n pseudo << self.len\n pseudo << self.id\n pseudo << ((self.flags << 13) | self.foffset)\n pseudo << ((self.ttl << 8) | self.protocol)\n pseudo << 0 \n pseudo << L3::Misc.ipv42long(self.src_ip)\n pseudo << L3::Misc.ipv42long(self.dst_ip)\n L3::Misc.checksum(pseudo.pack(\"nnnnnnNN\"))\n end", "def chk_config(frame)\n\t#i=0\n calc_chk=0\n \n raw = frame.to_binary_s\n if @checksum_comments\n puts raw.inspect\n end\n\n raw[3..33].split(//).each do |b|\n calc_chk = 0xFF & (calc_chk+BinData::Int8.read(b))\n end\n if @checksum_comments\n puts \"_______________\"\n puts \"CHECKSUM RETURN\"\n puts calc_chk.to_s\n end\n return calc_chk\n end", "def compute_checksum(data_)\n data = data_.dup\n data[22..25] = [0].pack(\"V\")\n crc = 0\n \n data.each_byte do |byte|\n crc = (crc << 8)^CHECKSUM_TABLE[((crc >> 24)&0xff) ^ byte]\n crc = crc & 0xffffffff\n end\n crc\n end", "def checksum\n @checksum ||= begin\n voice = @attrs[:voice]\n data = [\n voice.engine_id.to_s,\n voice.lang_id.to_s,\n voice.voice_id.to_s,\n @attrs[:text].to_s,\n @attrs[:ext].to_s,\n @attrs[:fx_type].to_s,\n @attrs[:fx_level].to_s,\n @attrs[:account_id].to_s,\n @attrs[:api_id].to_s,\n @attrs[:session].to_s,\n @attrs[:secret_phrase].to_s\n ].join('')\n Digest::MD5.hexdigest(data)\n end\n end", "def test_calc_file_crc\n input = File.expand_path('B0019278.JPG')\n\n crc32 = calc_file_crc(input)\n\n assert_equal(309668251, crc32)\n end", "def update_checksum\n hh = header(\" \" * 8)\n @checksum = oct(calculate_checksum(hh), 6)\n end", "def file_remote_digestmd5(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::MD5.hexdigest(data)\n end\n return chksum\n end", "def find_checksum_by_digest(digest)\n checksum = nil\n checksums.each do |cs|\n if cs.digest == digest\n checksum = cs\n break\n end\n end\n checksum\n end", "def calc_checksum\n sum = IP.sum16(self)\n self.checksum = IP.reduce_checksum(sum)\n end", "def calc_checksum\n sum = IP.sum16(self)\n self.checksum = IP.reduce_checksum(sum)\n end", "def file_checksum(file_path)\n Digest::SHA256.file(file_path).hexdigest\n end", "def generate_checksums(package)\n File.open(package, \"r\") do |pkg|\n {\n \"MD5sum\" => checksum(pkg.rewind && pkg, :md5),\n \"SHA1\" => checksum(pkg.rewind && pkg, :sha1),\n \"SHA256\" => checksum(pkg.rewind && pkg, :sha256),\n }\n end\n end", "def validate_downloaded_file(file_path:, checksum:)\n return false unless file_path.present? && checksum.present? && File.exist?(file_path)\n\n possible_checksums = [\n Digest::SHA1.file(file_path).to_s,\n Digest::SHA256.file(file_path).to_s,\n Digest::SHA512.file(file_path).to_s,\n Digest::MD5.file(file_path).to_s\n ]\n possible_checksums.include?(checksum)\n end", "def checksum64(io)\n Base64.encode64([checksum(io)].pack(\"H*\")).strip\n end" ]
[ "0.7468779", "0.71035594", "0.6917121", "0.68430865", "0.6829304", "0.6769859", "0.6753421", "0.6686078", "0.66789913", "0.66578263", "0.66264963", "0.6616337", "0.66141623", "0.66036636", "0.6599573", "0.6489481", "0.6464086", "0.64549595", "0.6429551", "0.64264727", "0.6416146", "0.6340062", "0.6339407", "0.63196725", "0.63153535", "0.631398", "0.629954", "0.6295312", "0.6295312", "0.6290064", "0.6288772", "0.6244311", "0.6239838", "0.6217247", "0.6212812", "0.62092984", "0.6202813", "0.6189045", "0.6188649", "0.6164916", "0.6162218", "0.6145409", "0.6109895", "0.61037844", "0.61036223", "0.6086073", "0.6083324", "0.6069841", "0.6035164", "0.60062236", "0.6003097", "0.5997395", "0.5988724", "0.5984439", "0.5972004", "0.5948862", "0.59220374", "0.59220374", "0.5921815", "0.5920971", "0.58724076", "0.5871459", "0.5852383", "0.58516216", "0.5849102", "0.5844587", "0.5840446", "0.5838258", "0.5788097", "0.5783279", "0.578192", "0.57790315", "0.57737845", "0.5771769", "0.57715786", "0.5763465", "0.5756145", "0.57369405", "0.57298434", "0.5725093", "0.57210916", "0.5719878", "0.5711868", "0.57082", "0.56954026", "0.56896716", "0.56871194", "0.5679825", "0.56748325", "0.56728333", "0.5670888", "0.5664662", "0.5657851", "0.56441694", "0.5638847", "0.5638847", "0.5634459", "0.5633615", "0.5631298", "0.56303513" ]
0.75762135
0
checks the permission, existence, and ownership controls on the database file
def test_database_checks() currentmode = File.stat(@databasefile).mode Cfruby::FileOps.chmod(@databasefile, 0700) assert_not_equal(currentmode, File.stat(@databasefile).mode) assert_raise(Cfruby::Checksum::ChecksumPermissionError) { @checksum.update_all } Cfruby::FileOps.chmod(@databasefile, 0600) if(Process.euid() == 0) assert_raise(Cfruby::Checksum::ChecksumOwnershipError) { Cfruby::FileOps.chown(@databasefile, 200, 200) @checksum.update_all } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_file(file = @dbrc_file)\n File.open(file) do |f|\n # Permissions must be set to 600 or better on Unix systems.\n # Must be hidden on Win32 systems.\n if WINDOWS\n raise Error, 'The .dbrc file must be hidden' unless File.hidden?(file)\n else\n raise Error, 'Bad .dbrc file permissions' unless (f.stat.mode & 0o77) == 0\n end\n\n # Only the owner may use it\n raise Error, 'Not owner of .dbrc file' unless f.stat.owned?\n end\n end", "def validate_database\n db = @database_path\n raise \"bad mode of #{db}\" unless File.world_readable?(db).nil?\n end", "def test_set3_13_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'ALL_PRIVILEGES'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'ALTER'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n priv_name = 'ALTER'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n priv_name = 'DROP'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def checkpermissions()\n unless File.stat('/etc/hosts').writable?\n # We found it, log error and exit successfully\n @log.error('Can not write to /etc, missing required permissions.')\n abort('Can not write to /etc, are you root?')\n end\n end", "def test_set3_15_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test' \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def test_set3_16_check()\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny' \n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def test_get_permissions\r\n assert_respond_to(File, :get_permissions)\r\n assert_nothing_raised{ File.get_permissions(@file) }\r\n assert_nothing_raised{ File.get_permissions(@file, @host) }\r\n assert_kind_of(Hash, File.get_permissions(@file))\r\n assert(File.get_permissions(@file).has_key?('BUILTIN\\\\Users'))\r\n assert(File.get_permissions(@file).has_key?('BUILTIN\\\\Administrators'))\r\n end", "def create_access_check\n permission_check('create')\n end", "def create_access_check\n permission_check('create')\n end", "def create_access_check\n permission_check('create')\n end", "def validate_permissions\n return if Gem.win_platform?\n\n @specification.files.each do |file|\n next unless File.file?(file)\n next if File.stat(file).mode & 0444 == 0444\n warning \"#{file} is not world-readable\"\n end\n\n @specification.executables.each do |name|\n exec = File.join @specification.bindir, name\n next unless File.file?(exec)\n next if File.stat(exec).executable?\n warning \"#{exec} is not executable\"\n end\n end", "def test_set3_14_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny'\n res_ob_adrs='/db/temp/test'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs) \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def check_permissions\n require_privilege(Privilege::USE, @environment)\n end", "def permissionsExist(file)\n\n fAccess = File.absolute_path(file)+\".access\"\n return !File.exist?(fAccess)\n end", "def checkFileAccess(userName, fToAccess, fAccess)\n\n #return false if fAccess.end_with?(\".access\")\n if File.exist?(fAccess) && userExists(userName)\n\n fileProps = YAML.load_file(fAccess)\n fileUsers = fileProps[\"users\"]\n fileGroups = fileProps[\"groups\"]\n if fileGroups.index(\";guests;\") != nil\n return true\n end\n\n if userName == nil\n return false\n end\n\n user = loadUser(userName)\n groups = Array.new\n groupFound = true\n groupAt = 0\n while groupFound\n\n if user.key?(\"group#{groupAt}\")\n groupTmp = user[\"group#{groupAt}\"]\n groups << groupTmp\n groupAt = groupAt.next\n else\n groupFound = false\n end\n end\n\n if(fileUsers.index(\";#{userName};\") != nil || fileUsers.index(\";guest;\") != nil)\n return true\n end\n if fileGroups.index(\";guests;\") != nil\n return true\n end\n for i in 0..groups.size\n\n if(fileGroups.index(\";#{groups[i]};\") != nil)\n return true\n end\n end\n return false\n end\n return false\n end", "def validate_directory_structure\n return false unless File.exists? @root\n Find.find(@root) do |path|\n stat = File::Stat.new path\n return false unless stat.uid == OWNER and stat.gid == GROUP\n if File.directory? path\n return false unless stat.mode == DIRMODE\n else\n return false unless stat.mode == FILEMODE\n end\n end\n true\n end", "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "def file_name_exist(file_name, owner_id)\n if $db.execute(\"SELECT file_name FROM files WHERE file_name = ? AND owner_id = ?\", file_name, owner_id) == []\n return false\n else\n return true\n end\nend", "def integrity_check\n execute( \"PRAGMA integrity_check\" ) do |row|\n raise Exceptions::DatabaseException, row[0] if row[0] != \"ok\"\n end\n end", "def check_resource_ownership\n if admin_user.is_not_root?\n\n condition_typus_users = @item.respond_to?(Typus.relationship) && !@item.send(Typus.relationship).include?(admin_user)\n condition_typus_user_id = @item.respond_to?(Typus.user_foreign_key) && !admin_user.owns?(@item)\n\n not_allowed if (condition_typus_users || condition_typus_user_id)\n end\n end", "def check_user_access(user, file, flag)\n if inspec.os.linux? == true\n # use sh on linux\n perm_cmd = \"su -s /bin/sh -c \\\"test -#{flag} #{file}\\\" #{user}\"\n elsif inspec.os[:family] == 'freebsd'\n # use sudo on freebsd\n perm_cmd = \"sudo -u #{user} test -#{flag} #{file}\"\n end\n\n if !perm_cmd.nil?\n cmd = inspec.command(perm_cmd)\n cmd.exit_status == 0 ? true : false\n else\n return skip_resource 'The `file` resource does not support `by_user` on your OS.'\n end\n end", "def permissionsExist(filePath)\n\n #filePath = GlobalSettings.changeFilePathToMatchSystem(filePath)\n fAccess = filePath+\".access\"\n return !File.exist?(fAccess)\n end", "def read_access_check\n resource_check('read')\n end", "def read_access_check\n resource_check('read')\n end", "def read_access_check\n resource_check('read')\n end", "def has_access_to_file(file_id, user_id)\n if get_all_user_data(user_id).first[\"rank\"] >= 1\n return true\n end\n \n owner_id = $db.execute(\"SELECT owner_id FROM files WHERE file_id = ?\", file_id).first[\"owner_id\"]\n if owner_id == user_id\n return true\n end\n\n shared_users = $db.execute(\"SELECT user_id FROM shared_files WHERE file_id = ?\", file_id)\n shared_users.each do |user|\n if user[\"user_id\"] == user_id\n return true\n end\n end\n return false\nend", "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'deny'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "def accesible(f)\n begin\n File.open(f,\"r\")\n true\n rescue\n false\n end\nend", "def can_access_managed_file_resource?( mfr )\n\t\ttrue\n\tend", "def exists?( arg )\n begin\n super( arg )\n rescue PermissionFailure\n return true;\n end\n end", "def write_permission_check(*args)\n # Don't prevent writes if creating a new object (anyone should be able to do this)\n return unless self.exist?\n\n if LinkedData.settings.enable_security\n user = nil\n options_hash = {}\n args.each {|e| options_hash.merge!(e) if e.is_a?(Hash)}\n user = options_hash[:user]\n\n # Allow a passed option to short-cut the security process\n return if options_hash[:override_security]\n\n user ||= Thread.current[:remote_user]\n\n reference_object = self\n\n # If we have a modified object, we should do the security check\n # on the original. This allows a user to change the ownsership of\n # an object without having to add the owner and have the new owner\n # remove the original owner.\n reference_object = self.class.find(self.id).first if self.modified?\n\n # Allow everyone to write\n return if reference_object.access_for_all?\n\n # Load attributes needed by security\n if reference_object.access_control_load?\n # Only load ones that aren't loaded so we don't overwrite changes\n not_loaded = []\n reference_object.access_control_load_attrs.each do |attr|\n not_loaded << attr unless reference_object.loaded_attributes.include?(attr)\n end\n reference_object.bring(*not_loaded) unless not_loaded.empty?\n end\n\n writable = reference_object.writable?(user)\n raise LinkedData::Security::WriteAccessDeniedError, \"Write access denied: #{reference_object.id}\" unless writable\n end\n end", "def owner?\n # exists? ? `ls -al #{path} | grep '[0-9] \\.$'`.split[2] : false\n proprieties[:owner]\n end", "def verify_required_data_files!\n unless File.exists?(\"#{@working_directory}/drupal-filesystem.tar.gz\") && File.exists?(\"#{@working_directory}/drupal-db.sql.gz\")\n raise StandardError.new(\"Cannot locate both 'drupal-filesystem.tar.gz' and 'drupal-db.sql.gz' in directory '#{@working_directory}'.\")\n end\n end", "def checkGroupFileAccess(groupName, fToAccess, fAccess)\n\n if File.exist?(fAccess)\n\n fileProps = YAML.load_file(fAccess)\n\n fileGroups = fileProps[\"groups\"]\n if(fileGroups.index(\";guests;\") != nil || fileGroups.index(\";#{groupName};\") != nil)\n return true\n else\n return false\n end\n end\n return false\n end", "def ansible_check_permissions pb, u, uma\n u.info!\n perm = pb['extra_data']['PERMISSIONS'].split('')\n mod = perm.values_at(*Array.new(3) { |i| uma + 3 * i }).map { | value | value == '1' ? true : false }\n return (\n (u.id == pb['uid'] && mod[0]) ||\n (u.groups.include?(pb['gid']) && mod[1]) ||\n (mod[2]) ||\n (u.groups.include?(0))\n )\nend", "def exist_and_supported()\n case session.platform\n when 'linux'\n user = session.shell_command(\"whoami\")\n print_status(\"Current user is #{user}\")\n\n if (user =~ /root/)\n user_base = \"/root/\"\n else\n user_base = \"/home/#{user}/\"\n end\n\n dbvis_file = \"#{user_base}.dbvis/config70/dbvis.xml\"\n when 'windows'\n user_profile = session.sys.config.getenv('USERPROFILE')\n dbvis_file = \"#{user_profile}\\\\.dbvis\\\\config70\\\\dbvis.xml\"\n end\n\n unless file?(dbvis_file)\n #File not found, we next try with the old config path\n print_status(\"File not found: #{dbvis_file}\")\n print_status(\"This could be an older version of dbvis, trying old path\")\n\n case session.platform\n when 'linux'\n dbvis_file = \"#{user_base}.dbvis/config/dbvis.xml\"\n when 'windows'\n dbvis_file = \"#{user_profile }\\\\.dbvis\\\\config\\\\dbvis.xml\"\n end\n\n unless file?(dbvis_file)\n print_error(\"File not found: #{dbvis_file}\")\n return\n end\n\n old_version = true\n end\n\n print_status(\"Reading : #{dbvis_file}\" )\n raw_xml = \"\"\n begin\n raw_xml = read_file(dbvis_file)\n rescue EOFError\n # If there's nothing in the file, we hit EOFError\n print_error(\"Nothing read from file: #{dbvis_file}, file may be empty\")\n return\n end\n\n db_found = false\n alias_found = false\n db_type = nil\n db_type_ok = false\n\n # fetch config file\n raw_xml.each_line do |line|\n\n if line =~ /<Database id=/\n db_found = true\n elsif line =~ /<\\/Database>/\n db_found = false\n end\n\n if db_found == true\n\n # checkthe alias\n if (line =~ /<Alias>([\\S+\\s+]+)<\\/Alias>/i)\n if datastore['DBALIAS'] == $1\n alias_found = true\n print_good(\"Alias #{datastore['DBALIAS']} found in dbvis.xml\")\n end\n end\n\n if (line =~ /<Userid>([\\S+\\s+]+)<\\/Userid>/i)\n if alias_found\n print_good(\"Username for this connection : #{$1}\")\n end\n end\n\n # check the type\n if (line =~ /<Type>([\\S+\\s+]+)<\\/Type>/i)\n if alias_found\n db_type = $1\n alias_found = false\n end\n end\n end\n end\n if db_type.blank?\n print_error(\"Database alias not found in dbvis.xml\")\n end\n return db_type # That is empty if DB is not supported\n end", "def checkAcl(path,principal,readGranted,writeGranted)\n acl = @authz.getacl(path)\n\t# check user1\n\tassert_not_nil(acl[principal],\"Expected for find ACE for #{principal}\"+@authz.hashToString(acl))\n\tace = acl[principal]\n\tif ( readGranted || writeGranted ) then\n\t assert_not_nil(ace[\"granted\"],\"Expected ace for #{principal} to have granted something granted ace was nil \"+@authz.hashToString(acl))\n\t puts(\"ACE for user #{principal} was \"+@authz.hashToString(ace)+\":\"+ace[\"granted\"].to_s)\n\tend\n\tif ( !readGranted || !writeGranted ) then\n assert_not_nil(ace[\"denied\"],\"Expected ace for #{principal} to have denied something, denied was nil \"+@authz.hashToString(acl))\n puts(\"ACE for user #{principal} was \"+@authz.hashToString(ace)+\":\"+ace[\"denied\"].to_s)\n end\n\n if ( readGranted ) then\n assert_equal(true,ace[\"granted\"].include?(\"jcr:read\"),\"Expected ace for #{principal} to have jcr:read granted ace was \"+@authz.hashToString(ace))\n if ( ace[\"denied\"] != nil ) then\n assert_equal(false,ace[\"denied\"].include?(\"jcr:read\"),\"Expected ace for #{principal} not to have jcr:read denied ace was \"+@authz.hashToString(ace))\n\t end\n else\n assert_equal(true,ace[\"denied\"].include?(\"jcr:read\"),\"Expected ace for #{principal} to have jcr:read denied ace was \"+@authz.hashToString(ace))\n if ( ace[\"granted\"] != nil ) then\n assert_equal(false,ace[\"granted\"].include?(\"jcr:read\"),\"Expected ace for #{principal} not to have jcr:read granted ace was \"+@authz.hashToString(ace))\n\t end\n end\n if ( writeGranted ) then\n assert_equal(true,ace[\"granted\"].include?(\"jcr:write\"),\"Expected ace for #{principal} to have jcr:write granted ace was \"+@authz.hashToString(ace))\n if ( ace[\"denied\"] != nil ) then\n assert_equal(false,ace[\"denied\"].include?(\"jcr:write\"),\"Expected ace for #{principal} not to have jcr:write denied ace was \"+@authz.hashToString(ace))\n\t end\n else\n assert_equal(true,ace[\"denied\"].include?(\"jcr:write\"),\"Expected ace for #{principal} to have jcr:write denied ace was \"+@authz.hashToString(ace))\n if ( ace[\"granted\"] != nil ) then\n assert_equal(false,ace[\"granted\"].include?(\"jcr:write\"),\"Expected ace for #{principal} not to have jcr:write granted ace was \"+@authz.hashToString(ace))\n\t end\n end\n end", "def permissions_correct?\n (self.exists? & self.valid_user? & self.valid_group? & self.valid_mode?)\n end", "def FileModesOwnership\n\tarquivo = File.new(\"arquivo_novo.txt\", \"w\")\n\tarquivo.chmod(0755)\n\tarquivo.close()\nend", "def searchdb_link_verify(searchdb_file,book_final_path)\n puts \"Validating searchDB.sql\"\n if !File.exists?(searchdb_file)\n puts \"searchDB.sql missing in \"+book_final_path\n end\n db = SQLite3::Database.new(searchdb_file)\n query= \"select name from sqlite_master where type='table'\"\n tables_list = db.execute( query ) do |table|\n query=\"PRAGMA table_info(#{table[0]})\"\n columns_list = db.execute( query ) do |column|\n if(column[1]=='url')\n query= \"select url from #{table[0]}\"\n db.execute( query ) do |url|\n url[0]=url[0].split(\"#\").first\n if File.exists?(book_final_path+url[0])\n puts book_final_path+url[0]+\" -- ok\"\n else \n puts \"Page not found -\"+book_final_path+url[0]\n exit\n end\n end\n end\n end\n end\nend", "def set_database\n # Test auf Lesbarkeit von X$-Tabellen\n def x_memory_table_accessible?(table_name_suffix, msg)\n begin\n sql_select_all \"SELECT /* Panorama Tool Ramm */ * FROM X$#{table_name_suffix} WHERE RowNum < 1\"\n return true\n rescue Exception => e\n msg << \"<div>#{t(:env_set_database_xmem_line1, :user=>get_current_database[:user], :table_name_suffix=>table_name_suffix, :default=>'DB-User %{user} has no right to read on X$%{table_name_suffix} ! Therefore a very small number of functions of Panorama is not usable!')}<br/>\"\n msg << \"<a href='#' onclick=\\\"jQuery('#xbh_workaround').show(); return false;\\\">#{t(:moeglicher, :default=>'possible')} workaround:</a><br/>\"\n msg << \"<div id='xbh_workaround' style='display:none; background-color: lightyellow; padding: 20px;'>\"\n msg << \"#{t(:env_set_database_xmem_line2, :default=>'Alternative 1: Connect with role SYSDABA')}<br/>\"\n msg << \"#{t(:env_set_database_xmem_line3, :default=>'Alternative 2: Execute as user SYS')}<br/>\"\n msg << \"> create view X_$#{table_name_suffix} as select * from X$#{table_name_suffix};<br/>\"\n msg << \"> create public synonym X$#{table_name_suffix} for sys.X_$#{table_name_suffix};<br/>\"\n msg << t(:env_set_database_xmem_line4, :table_name_suffix=>table_name_suffix, :default=>'This way X$%{table_name_suffix} becomes available with role SELECT ANY DICTIONARY')\n msg << \"</div>\"\n msg << \"</div>\"\n return false\n end\n end\n\n def select_any_dictionary?(msg)\n if sql_select_one(\"SELECT COUNT(*) FROM Session_Privs WHERE Privilege = 'SELECT ANY DICTIONARY'\") == 0\n msg << t(:env_set_database_select_any_dictionary_msg, :user=>get_current_database[:user], :default=>\"DB-User %{user} doesn't have the grant 'SELECT ANY DICTIONARY'! Many functions of Panorama may be not usable!<br>\")\n false\n else\n true\n end\n end\n\n write_to_client_info_store(:last_used_menu_controller, \"env\")\n write_to_client_info_store(:last_used_menu_action, \"set_database\")\n write_to_client_info_store(:last_used_menu_caption, \"Login\")\n write_to_client_info_store(:last_used_menu_hint, t(:menu_env_set_database_hint, :default=>\"Start of application after connect to database\"))\n\n current_database = params[:database].symbolize_keys # Puffern in lokaler Variable, bevor in client_info-Cache geschrieben wird\n\n if params[:database][:modus] == 'tns' # TNS-Alias auswerten\n tns_records = read_tnsnames # Hash mit Attributen aus tnsnames.ora für gesuchte DB\n tns_record = tns_records[current_database[:tns]]\n unless tns_record\n respond_to do |format|\n format.js {render :js => \"$('#content_for_layout').html('#{j \"Entry for DB '#{current_database[:tns]}' not found in tnsnames.ora\"}'); $('#login_dialog').effect('shake', { times:3 }, 100);\"}\n end\n set_dummy_db_connection\n return\n end\n current_database[:host] = tns_record[:hostName] # Erweitern um Attribute aus tnsnames.ora\n current_database[:port] = tns_record[:port] # Erweitern um Attribute aus tnsnames.ora\n current_database[:sid] = tns_record[:sidName] # Erweitern um Attribute aus tnsnames.ora\n current_database[:sid_usage] = tns_record[:sidUsage] # :SID oder :SERVICE_NAME\n else # Host, Port, SID auswerten\n current_database[:sid_usage] = :SID unless current_database[:sid_usage] # Erst mit SID versuchen, zweiter Versuch dann als ServiceName\n current_database[:tns] = \"#{current_database[:host]}:#{current_database[:port]}:#{current_database[:sid]}\" # Evtl. existierenden TNS-String mit Angaben von Host etc. ueberschreiben\n end\n\n # Temporaerer Schutz des Produktionszuganges bis zur Implementierung LDAP-Autorisierung \n if current_database[:host].upcase.rindex(\"DM03-SCAN\") && current_database[:sid].upcase.rindex(\"NOADB\")\n if params[:database][:authorization]== nil || params[:database][:authorization]==\"\"\n respond_to do |format|\n format.js {render :js => \"$('#content_for_layout').html('#{j \"zusätzliche Autorisierung erforderlich fuer NOA-Produktionssystem\"}'); $('#login_dialog_authorization').show(); $('#login_dialog').effect('shake', { times:3 }, 100);\"}\n end\n set_dummy_db_connection\n return\n end\n if params[:database][:authorization]== nil || params[:database][:authorization]!=\"meyer\"\n respond_to do |format|\n format.js {render :js => \"$('#content_for_layout').html('#{j \"Autorisierung '#{params[:database][:authorization]}' ungueltig fuer NOA-Produktionssystem\"}'); $('#login_dialog').effect('shake', { times:3 }, 100);\"}\n end\n set_dummy_db_connection\n return\n end\n end\n\n set_current_database(current_database) # Persistieren im Cache\n current_database = nil # Diese Variable nicht mehr verwenden ab jetzt, statt dessen get_current_database verwenden\n\n # First SQL execution opens Oracle-Connection\n\n # Test der Connection und ruecksetzen auf vorherige wenn fehlschlaegt\n begin\n # Test auf Funktionieren der Connection\n begin\n sql_select_one \"SELECT /* Panorama Tool Ramm */ SYSDATE FROM DUAL\"\n rescue Exception => e # 2. Versuch mit alternativer SID-Deutung\n Rails.logger.error \"Error connecting to database: URL='#{jdbc_thin_url}' TNSName='#{get_current_database[:tns]}' User='#{get_current_database[:user]}'\"\n Rails.logger.error e.message\n Rails.logger.error 'Switching between SID and SERVICE_NAME'\n\n database_helper_switch_sid_usage\n begin\n # Oracle-Connection aufbauen mit Wechsel zwischen SID und ServiceName\n sql_select_one(\"SELECT /* Panorama Tool Ramm */ SYSDATE FROM DUAL\") # Ruft implizit open_oracle_connection\n\n rescue Exception => e # 3. Versuch mit alternativer SID-Deutung\n Rails.logger.error \"Error connecting to database: URL='#{jdbc_thin_url}' TNSName='#{get_current_database[:tns]}' User='#{get_current_database[:user]}'\"\n Rails.logger.error e.message\n Rails.logger.error 'Error persists, switching back between SID and SERVICE_NAME'\n database_helper_switch_sid_usage\n # Oracle-Connection aufbauen mit Wechsel zurück zwischen SID und ServiceName, sql_select_all ruft implizit open_oracle_connection\n sql_select_all \"SELECT /* Panorama Tool Ramm */ SYSDATE FROM DUAL\" # Provozieren der ursprünglichen Fehlermeldung wenn auch zweiter Versuch fehlschlägt\n end\n end\n rescue Exception => e\n set_dummy_db_connection\n respond_to do |format|\n format.js {render :js => \"$('#content_for_layout').html('#{j \"Fehler bei Anmeldung an DB: <br>\n #{e.message}<br>\n URL: '#{jdbc_thin_url}'<br>\n Host: #{get_current_database[:host]}<br>\n Port: #{get_current_database[:port]}<br>\n SID: #{get_current_database[:sid]}\"\n }');\n $('#login_dialog').effect('shake', { times:3 }, 100);\n \"\n }\n end\n return # Fehler-Ausgang\n end\n\n set_current_database(get_current_database.merge({:database_name => ConnectionHolder.current_database_name})) # Merken interner DB-Name ohne erneuten DB-Zugriff\n\n @dictionary_access_msg = \"\" # wird additiv belegt in Folge\n @dictionary_access_problem = false # Default, keine Fehler bei Zugriff auf Dictionary\n begin\n @banners = [] # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable\n @instance_data = [] # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable\n @dbids = [] # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable\n @platform_name = \"\" # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable\n # Einlesen der DBID der Database, gleichzeitig Test auf Zugriffsrecht auf DataDictionary\n read_initial_db_values\n @banners = sql_select_all \"SELECT /* Panorama Tool Ramm */ Banner FROM V$Version\"\n @instance_data = sql_select_all [\"SELECT /* Panorama Tool Ramm */ gi.*, i.Instance_Number Instance_Connected,\n (SELECT n.Value FROM gv$NLS_Parameters n WHERE n.Inst_ID = gi.Inst_ID AND n.Parameter='NLS_CHARACTERSET') NLS_CharacterSet,\n (SELECT n.Value FROM gv$NLS_Parameters n WHERE n.Inst_ID = gi.Inst_ID AND n.Parameter='NLS_NCHAR_CHARACTERSET') NLS_NChar_CharacterSet,\n (SELECT p.Value FROM GV$Parameter p WHERE p.Inst_ID = gi.Inst_ID AND LOWER(p.Name) = 'cpu_count') CPU_Count,\n d.Open_Mode, d.Protection_Mode, d.Protection_Level, d.Switchover_Status, d.Dataguard_Broker, d.Force_Logging,\n ws.Snap_Interval_Minutes, ws.Snap_Retention_Days\n FROM GV$Instance gi\n JOIN v$Database d ON 1=1\n LEFT OUTER JOIN v$Instance i ON i.Instance_Number = gi.Instance_Number\n LEFT OUTER JOIN (SELECT DBID, MIN(EXTRACT(HOUR FROM Snap_Interval))*60 + MIN(EXTRACT(MINUTE FROM Snap_Interval)) Snap_Interval_Minutes, MIN(EXTRACT(DAY FROM Retention)) Snap_Retention_Days FROM DBA_Hist_WR_Control GROUP BY DBID) ws ON ws.DBID = ?\n \", get_dbid ]\n\n @control_management_pack_access = sql_select_one \"SELECT Value FROM V$Parameter WHERE name='control_management_pack_access'\" # ab Oracle 11 belegt\n\n @instance_data.each do |i|\n if i.instance_connected\n @instance_name = i.instance_name\n @host_name = i.host_name\n end\n end\n @dbids = sql_select_all [\"SELECT s.DBID, MIN(Begin_Interval_Time) Min_TS, MAX(End_Interval_Time) Max_TS,\n (SELECT MIN(DB_Name) FROM DBA_Hist_Database_Instance i WHERE i.DBID=s.DBID) DB_Name,\n (SELECT COUNT(DISTINCT Instance_Number) FROM DBA_Hist_Database_Instance i WHERE i.DBID=s.DBID) Instances,\n MIN(EXTRACT(MINUTE FROM w.Snap_Interval)) Snap_Interval_Minutes,\n MIN(EXTRACT(DAY FROM w.Retention)) Snap_Retention_Days\n FROM DBA_Hist_Snapshot s\n LEFT OUTER JOIN DBA_Hist_WR_Control w ON w.DBID = s.DBID\n GROUP BY s.DBID\n ORDER BY MIN(Begin_Interval_Time)\"]\n @platform_name = sql_select_one \"SELECT /* Panorama Tool Ramm */ Platform_name FROM v$Database\" # Zugriff ueber Hash, da die Spalte nur in Oracle-Version > 9 existiert\n rescue Exception => e\n @dictionary_access_problem = true # Fehler bei Zugriff auf Dictionary\n @dictionary_access_msg << \"<div> User '#{get_current_database[:user]}' has no right for read on data dictionary!<br/>#{e.message}<br/>Functions of Panorama will not or not completely be usable<br/>\n </div>\"\n end\n\n @dictionary_access_problem = true unless select_any_dictionary?(@dictionary_access_msg)\n @dictionary_access_problem = true unless x_memory_table_accessible?(\"BH\", @dictionary_access_msg )\n\n write_connection_to_last_logins\n\n initialize_unique_area_id # Zaehler für eindeutige IDs ruecksetzen\n\n timepicker_regional = \"\"\n if get_locale == \"de\" # Deutsche Texte für DateTimePicker\n timepicker_regional = \"prevText: '<zurück',\n nextText: 'Vor>',\n monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'],\n dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],\n timeText: 'Zeit',\n hourText: 'Stunde',\n minuteText: 'Minute',\n currentText: 'Jetzt',\n closeText: 'Auswählen',\"\n end\n respond_to do |format|\n format.js {render :js => \"$('#current_tns').html('#{j \"<span title='TNS=#{get_current_database[:tns]},Host=#{get_current_database[:host]},Port=#{get_current_database[:port]},#{get_current_database[:sid_usage]}=#{get_current_database[:sid]}, User=#{get_current_database[:user]}'>#{get_current_database[:user]}@#{get_current_database[:tns]}</span>\"}');\n $('#main_menu').html('#{j render_to_string :partial =>\"build_main_menu\" }');\n $.timepicker.regional = { #{timepicker_regional}\n ampm: false,\n firstDay: 1,\n dateFormat: '#{timepicker_dateformat }'\n };\n $.timepicker.setDefaults($.timepicker.regional);\n numeric_decimal_separator = '#{numeric_decimal_separator}';\n var session_locale = '#{get_locale}';\n $('#content_for_layout').html('#{j render_to_string :partial=> \"env/set_database\"}');\n $('#login_dialog').dialog('close');\n \"\n }\n end\n rescue Exception=>e\n set_dummy_db_connection # Rückstellen auf neutrale DB\n raise e\n end", "def database_exists?\n exists = File.file?(@database_path)\n raise \"Database does not exist: #{@database_path}\" unless exists\n\n exists\n end", "def can_create?(folder_id)\n administrator? or\n permissions.for_create.exists? :folder_id => folder_id\n end", "def has_access_to_folder(folder_id, user_id)\n if get_all_user_data(user_id).first[\"rank\"] >= 1\n return true\n end\n owner_id = $db.execute(\"SELECT owner_id FROM folders WHERE folder_id = ?\", folder_id).first[\"owner_id\"]\n if owner_id == user_id\n return true\n else\n return false\n end\nend", "def check_ownership \t\n \taccess_denied(:redirect => @check_ownership_of) unless current_user_owns?(@check_ownership_of)\n end", "def db_exists? db_name\n File.exists? db_name\n end", "def restricted_by_location?\n rights.restricted_by_location?(file_name)\n end", "def custom_permissions\n can [:file_status, :stage, :unstage], FileSet\n\n if current_user.ingest_from_external_sources?\n end\n\n if current_user.manage_users?\n can [:show, :add_user, :remove_user, :index], Role\n end\n\n if current_user.manage_roles?\n can [:create, :show, :index, :edit, :update, :destroy], Role\n end\n\n if current_user.run_fixity_checks?\n can [:fixity], FileSet\n end\n # Limits deleting objects to a the admin user\n #\n # if current_user.admin?\n # can [:destroy], ActiveFedora::Base\n # end\n\n # Limits creating new objects to a specific group\n #\n # if user_groups.include? 'special_group'\n # can [:create], ActiveFedora::Base\n # end\n end", "def can_write_to_dir dir, create\n\n begin\n stat = File.stat(dir)\n return true if stat && stat.writable?\n rescue Errno::ENOENT\n end\n\n # create and try again if it doesn't exist\n if create\n begin\n FileUtils.mkdir_p dir\n #FileUtils.chmod 0644, dir \n result = can_write_to_dir dir, false\n puts \"Created #{dir}\" if result\n return result\n rescue Errno::EACCES\n end\n end\n\n return false\n end", "def read_permissions\n can :read, String do |pid|\n Rails.logger.debug(\"[READPERM] Checking from STRING\")\n test_read(pid)\n end\n\n can :read, [DRI::Batch] do |obj|\n Rails.logger.debug(\"[READPERM] Checking from Object\")\n test_read(obj.id)\n end\n\n\n can :read, SolrDocument do |obj|\n Rails.logger.debug(\"[READPERM] Checking from SolrDoc\")\n cache.put(obj.id, obj)\n test_read(obj.id)\n end\n end", "def cdb_admin_exist\n users = self.cdb_list\n users.any?{ |u| self.cdb_load(u).admin }\n end", "def searchdb_link_verify(searchdb_file,book_final_path)\n puts \"Validating searchDB.sql\"\n db = SQLite3::Database.new(searchdb_file)\n query= \"select name from sqlite_master where type='table'\"\n tables_list = db.execute( query ) do |table|\n query=\"PRAGMA table_info(#{table[0]})\"\n columns_list = db.execute( query ) do |column|\n if(column[1]=='url')\n query= \"select url from #{table[0]}\"\n db.execute( query ) do |url|\n url[0]=url[0].split(\"#\").first\n if File.exists?(book_final_path+url[0])\n puts url[0]+\" -- ok\"\n else \n puts \"Page not found -\"+url[0]\n exit\n end\n end\n end\n end\n end\nend", "def check_admin\n ac = AdminConfigFile.new\n ac.read\n @admin = ac.exist?(@user_id)\n end", "def check_file\n super\n end", "def checkGroupFileAccess(groupName, filePath)\n\n #filePath = GlobalSettings.changeFilePathToMatchSystem(filePath)\n fAccess = filePath+\".access\"\n if File.exist?(fAccess)\n\n return checkGroupFileAccess(groupName, filePath, fAccess)\n end\n return false\n end", "def chmod_unauthorized_error(args)\n return false unless MANDATORY_DIRS.any? do |md|\n args.include?(\"'#{md}'\")\n end\n\n puts \"Tu n'as pas l'autorisation de modifier les droits de ce dossier.\".red\n true\n end", "def makePriv #:doc:\n if params[:i_am_client] and params[:groups] == nil\n # Groups were searched in editRights-method\n param_groups = @groups\n else\n param_groups = params[:groups]\n end\n \n # try to get file from database\n if not fetchFile\n if params[:i_am_client] \n render :text => \"File not found\", :status => 404\n return\n else\n @error = \"File not found!\"\n render \"viewFileRights\"\n return\n end\n end\n \n begin \n # all groups owned by user\n mygroups = Group.find(:all, :conditions => [\"user_id = ?\", @user.id])\n \n # all groups associated with the file\n filegroup_ids = Array.new\n @file.groups.find(:all).each do |t|\n filegroup_ids.push(t.id)\n end\n \n # check which groups should have access to file\n delete_auth_groups = \"\"\n mygroups.each do |mygroup|\n if param_groups[mygroup.name] == \"1\" and not filegroup_ids.include?(mygroup.id)\n # if group-checkbox is checked, group gets permission to access file\n @file.devfile_auth_groups.create(:group_id => mygroup.id)\n elsif param_groups[mygroup.name] == \"0\" and filegroup_ids.include?(mygroup.id)\n # if group-checkbox is not checked, unauthorize fileaccess to this file\n if delete_auth_groups == \"\" then delete_auth_groups += \"group_id IN (#{mygroup.id}\"\n else delete_auth_groups += \", #{mygroup.id}\" end\n end\n end\n if delete_auth_groups != \"\"\n delete_auth_groups += \") AND devfile_id = ?\"\n DevfileAuthGroup.delete_all([delete_auth_groups, @file.id])\n end\n \n # make file private\n @file.update_attribute(:privatefile, true)\n \n rescue => e\n puts \"Error in editing filerights: \" + e\n if params[:i_am_client] \n render :text => \"Error in editing filerights: \" + e, :status => 409\n return\n else\n @error = \"Error in editing filerights: \" + e\n render \"Error in editing filerights: \" + e\n return\n end\n end\n \n if params[:i_am_client]\n render :text => \"#{@file.name} visibility modified.\", :status => 200\n return\n else\n flash[:notice] = \"#{@file.name} visibility modified.\"\n redirect_to :action => \"viewFileRights\"\n end\n end", "def exist?\n @access.exist?\n end", "def exist?\n @access.exist?\n end", "def writable?(base)\n info = nil\n\n begin\n info = query(base)\n rescue\n end\n\n if ((info != nil) &&\n (info['Available'] == false) &&\n (info['Protect'] & PROT_WRITE == PROT_WRITE))\n return true\n end\n\n return false\n end", "def read_safe(password = nil)\n if File.file?(@filename)\n print %[Access password safe at #@filename | ]\n @password = password || ask_for_password(%[master password])\n encrypted_data = File.read(@filename, mode: \"rb\")\n \n @data = Format.read(\n encrypted_data,\n password: @password,\n format: @options[:in],\n )\n update_abbrevs!\n else\n create_safe(password)\n end \n\n pa %[ACCESS GRANTED], :green\n end", "def validate_database(vm)\n valid = true\n \n results = \"\"\n \n check_points.each do |cp, cmd|\n msg = \"\"\n \n if valid\n begin\n conn = ActiveRecord::Base.connection\n value = conn.select_value(cmd, cp)\n valid = false unless value.to_i > 0\n rescue Exception => ex\n msg = ex.to_s\n valid = false\n end\n end\n \n results << <<HTML_TAGS\n <tr>\n <td>#{cp.to_s.titleize}</td>\n <td><img src='/images/permissions/#{valid ? 'grant' : 'revoke'}_all.gif' title='#{msg.gsub(\",\",'')}' />\n </tr>\nHTML_TAGS\n end\n \n vm[:html] = <<HTML_TAGS\n<table>\n#{results}\n</table>\nHTML_TAGS\n \n vm[:valid] = valid\n\n VirtualMemory.store(:session, :database_setting, vm, :YAML)\n\n valid\n end", "def check_database_consistency(*args)\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\t#LOG.debug(fname) {\"args=#{args}\"}\n\t\tret = nil\n\t\tif Datafile.host.nil?\n\t\t\t# \"Host not defined, define it in Type object property/sites/SITE_CENTRAL=xxx\"\n\t\t\tret = t(:host_not_defined)\n\t\tend\n\t\tret\n\tend", "def set_permissions(file, perms)\n # Check local filesystem to see if it supports ACL's. If not, bail early\n # because the GetFileSecurity function will not fail on an unsupported FS.\n unless supports_acls?(file)\n raise ArgumentError, \"Filesystem does not implement ACL support\"\n end\n\n wide_file = string_check(file).wincode\n raise TypeError unless perms.kind_of?(Hash)\n\n sec_desc = FFI::MemoryPointer.new(:pointer, SECURITY_DESCRIPTOR_MIN_LENGTH)\n\n unless InitializeSecurityDescriptor(sec_desc, 1)\n raise SystemCallError.new(\"InitializeSecurityDescriptor\", FFI.errno)\n end\n\n acl_new = FFI::MemoryPointer.new(ACL, 100)\n\n unless InitializeAcl(acl_new, acl_new.size, ACL_REVISION2)\n raise SystemCallError.new(\"InitializeAcl\", FFI.errno)\n end\n\n perms.each{ |account, mask|\n next if mask.nil?\n\n # reset account_rights for each entry in perms:\n account_rights = 0\n\n server, account = account.split(\"\\\\\")\n\n if ['BUILTIN', 'NT AUTHORITY'].include?(server.upcase)\n wide_server = nil\n elsif account.nil?\n wide_server = nil\n account = server\n else\n wide_server = server.wincode\n end\n\n wide_account = account.wincode\n\n sid = FFI::MemoryPointer.new(:uchar, 1024)\n sid_size = FFI::MemoryPointer.new(:ulong)\n sid_size.write_ulong(sid.size)\n\n domain = FFI::MemoryPointer.new(:uchar, 260)\n domain_size = FFI::MemoryPointer.new(:ulong)\n domain_size.write_ulong(domain.size)\n\n use_ptr = FFI::MemoryPointer.new(:ulong)\n\n val = LookupAccountNameW(\n wide_server,\n wide_account,\n sid,\n sid_size,\n domain,\n domain_size,\n use_ptr\n )\n\n raise SystemCallError.new(\"LookupAccountName\", FFI.errno) unless val\n\n all_ace = ACCESS_ALLOWED_ACE2.new\n\n val = CopySid(\n ALLOW_ACE_LENGTH - ACCESS_ALLOWED_ACE.size,\n all_ace.to_ptr+8,\n sid\n )\n\n raise SystemCallError.new(\"CopySid\", FFI.errno) unless val\n\n if (GENERIC_ALL & mask).nonzero?\n account_rights = GENERIC_ALL & mask\n elsif (GENERIC_RIGHTS_CHK & mask).nonzero?\n account_rights = GENERIC_RIGHTS_MASK & mask\n else\n # Do nothing, leave it set to zero.\n end\n\n all_ace[:Header][:AceFlags] = INHERIT_ONLY_ACE | OBJECT_INHERIT_ACE\n\n 2.times{\n if account_rights != 0\n all_ace[:Header][:AceSize] = 8 + GetLengthSid(sid)\n all_ace[:Mask] = account_rights\n\n val = AddAce(\n acl_new,\n ACL_REVISION2,\n MAXDWORD,\n all_ace,\n all_ace[:Header][:AceSize]\n )\n\n raise SystemCallError.new(\"AddAce\", FFI.errno) unless val\n\n all_ace[:Header][:AceFlags] = CONTAINER_INHERIT_ACE\n else\n all_ace[:Header][:AceFlags] = 0\n end\n\n account_rights = REST_RIGHTS_MASK & mask\n }\n }\n\n unless SetSecurityDescriptorDacl(sec_desc, 1, acl_new, 0)\n raise SystemCallError.new(\"SetSecurityDescriptorDacl\", FFI.errno)\n end\n\n unless SetFileSecurityW(wide_file, DACL_SECURITY_INFORMATION, sec_desc)\n raise SystemCallError.new(\"SetFileSecurity\", FFI.errno)\n end\n\n self\n end", "def does_user_with_pass_exist(name, password)\n\n begin\n\n db = SQLite3::Database.open \"PicDB.db\" \n row_count = 0\n db.execute \"SELECT * FROM User where Name = '\" + name + \"' and Password ='\" + password + \"'\" do |row|\n row_count = row_count + 1\n end\n if row_count > 0\n return true\n else\n return false\n end \n rescue SQLite3::Exception => e\n puts \"Exception Ocurred\"\n puts e\n ensure\n db.close if db\n end\n end", "def can_read?(folder_id)\n administrator? or\n permissions.for_read.exists? :folder_id => folder_id\n end", "def sanity_check\n # Check iptables FILTER table for our chef chain\n begin\n shell_out!('iptables -nL Promethean')\n rescue Mixlib::ShellOut::ShellCommandFailed\n\tinfo(\"Defining Promethean chain\")\n shell_out!('iptables -N Promethean')\n end\n\n # Check iptables FILTER INPUT chain for a jump to our chef chain\n unless shell_out!('iptables -nL INPUT').stdout.lines.find { |line| line =~ /^Promethean[ ]*all/ }\n\tinfo(\"Adding Promethean chain to input table\")\n shell_out!('iptables -A INPUT -j Promethean')\n end\n\n # Check the header of our file\n # If it's not there, blast the file and rewrite the header\n res = @new_resource\n saved_header = nil\n if ::File.exist?(res.script_path) and ::File.size(res.script_path) > 0\n saved_header = ::File.open(res.script_path) { |f| f.readline.chomp }\n end\n header = 'iptables -F Promethean'\n if saved_header.nil? || saved_header != header\n info(\"No header in #{res.script_path}, writing #{header}\")\n\t::File.open(res.script_path, 'w') do |f|\n f.puts header\n end\n return true\n end\n\n false\nend", "def check_owner_and_address\n check_owner\n check_address\n check_access\n end", "def permission?()\n return nil\n end", "def db_setup\n log_debug\n db_file = find_db\n db_tmp = '/tmp/plex_missing_tmp.db'\n @db = ''\n \n # cp to tmp as the db is locked if being used\n `cp \"#{db_file}\" #{db_tmp}`\n \n # not too sure why but i was having a problem where a 0 byte file was cp'd\n # def a local issue i assume but the check was needed\n if test ?s, db_tmp\n @db = SQLite3::Database.new db_tmp\n else \n puts \"error-> can not open #{db_tmp} for reasing\"\n exit 2\n end\n end", "def authorizedToFile(devfile)\n \n # If file is private, everyone is authorized for it\n if devfile.privatefile == false\n return true\n end\n \n ## Check user rights to devfile\n # Is user signed in\n if params[:i_am_client]\n username = authenticateClient\n elsif session[:username]\n username = session[:username]\n end\n \n if username != nil\n \n # Find the user\n user = User.find_by_username(username) \n if user != nil\n \n # If user is the owner of context\n if user.id == devfile.device.user_id\n return true\n \n # Is user in a group that is authorized for the context\n elsif\n \n # Groups that user is in\n uigroups = Usersingroup.find_all_by_user_id(user.id)\n if uigroups == nil\n return false\n end\n \n # Is group autohorized for the context\n uigroups.each do |uigroup|\n \n group = DevfileAuthGroup.find_by_group_id_and_devfile_id(uigroup.group_id, devfile.id)\n \n # If group is authorized for the context, return true\n if group != nil\n return true\n end\n end\n \n end\n end\n end\n return false\n \n end", "def check_authorizations!\n raise FphsNotAuthorized unless can_create_in_list?\n\n unless list_class.no_master_association || from_master.allows_user_access\n raise FphsNotAuthorized, 'Master does not allow user access'\n end\n\n raise FphsNotAuthorized, \"No access to #{source_type}\" unless can_access_source_type?\n\n raise FphsNotAuthorized, \"No access to #{assoc_name}\" unless can_access_associated_table?\n end", "def check_metadata\n version = @db[:schema_info].first\n unless version[:magic] == Bitcoin.network[:magic_head].hth\n name = Bitcoin::NETWORKS.find{|n,d| d[:magic_head].hth == version[:magic]}[0]\n raise \"Error: DB #{@db.url} was created for '#{name}' network!\"\n end\n unless version[:backend] == backend_name\n # rename \"sequel\" to \"archive\" when old db is opened\n if version[:backend] == \"sequel\" && backend_name == \"archive\"\n @db[:schema_info].update(backend: \"archive\")\n else\n raise \"Error: DB #{@db.url} was created for '#{version[:backend]}' backend!\"\n end\n end\n end", "def check\n super\n uncommitted = Perforce.uncommitted_files\n fail \"Uncommitted files violate the First Principle Of Release!\\n#{uncommitted.join(\"\\n\")}\" unless uncommitted.empty?\n end", "def manager_permissions\n can :manage_collection, String do |pid|\n Rails.logger.debug(\"[MANPERM] Checking from STRING\")\n test_manager(pid)\n end\n\n can :manage_collection, DRI::Batch do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from Object\")\n test_manager(obj.id)\n end\n\n can :manage_collection, SolrDocument do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from SolrDoc\")\n cache.put(obj.id, obj)\n test_manager(obj.id)\n end\n\n can :manage, String do |pid|\n Rails.logger.debug(\"[MANPERM] Checking from STRING\")\n test_manager(pid)\n end\n\n can :manage, DRI::Batch do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from Object\")\n test_manager(obj.id)\n end\n\n can :manage, SolrDocument do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from SolrDoc\")\n cache.put(obj.id, obj)\n test_manager(obj.id)\n end\n end", "def check_description_edit_permission!\n okay = true\n\n # Fail completely if they don't even have write permission.\n unless in_admin_mode? || @description.writer?(@user)\n flash_error(:runtime_edit_description_denied.t)\n if in_admin_mode? || @description.is_reader?(@user)\n redirect_to(object_path(@description))\n else\n redirect_to(object_path(@description.parent))\n end\n\n okay = false\n end\n\n filter_illegal_changes\n\n okay\n end", "def checkUserFileAccess(userName, filePath)\n return false if filePath.end_with?(\".access\")\n if(userExists(userName))\n\n fAccess = filePath+\".access\"\n if File.exist?(fAccess)\n return checkFileAccess(userName, filePath, fAccess)\n else\n return checkUserDirectoryAccess(userName,filePath[0..filePath.rindex(@FS)])\n end\n end\n return false\n\n end", "def check_for fn\n File.readable?( fn ) && fn\n end", "def hypothetically_writable?\n writable_real? || (!exists? && !root? && parent.hypothetically_writable?)\n end", "def supports_acls?(file = nil)\n bool = false\n flags_ptr = FFI::MemoryPointer.new(:ulong)\n\n if file\n file = File.expand_path(string_check(file))\n wide_file = file.wincode\n\n if !PathIsRootW(wide_file)\n unless PathStripToRootW(wide_file)\n raise SystemCallError.new(\"PathStripToRoot\", FFI.errno)\n end\n end\n else\n wide_file = nil\n end\n\n unless GetVolumeInformationW(wide_file, nil, 0, nil, nil, flags_ptr, nil, 0)\n raise SystemCallError.new(\"GetVolumeInformation\", FFI.errno)\n end\n\n flags = flags_ptr.read_ulong\n\n if flags & FILE_PERSISTENT_ACLS > 0\n bool = true\n end\n\n bool\n end", "def apply_privileges(app_name=nil)\n return if credentials(app_name).nil?\n if is_postgresql()\n cmd_acl=\"GRANT CREATE ON SCHEMA PUBLIC TO PUBLIC;\\\n GRANT ALL ON ALL TABLES IN SCHEMA PUBLIC TO PUBLIC;\\\n GRANT ALL ON ALL FUNCTIONS IN SCHEMA PUBLIC TO PUBLIC;\\\n GRANT ALL ON ALL SEQUENCES IN SCHEMA PUBLIC TO PUBLIC;\\\n ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO PUBLIC;\\\n ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO PUBLIC;\\\n ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO PUBLIC;\"\n# shell(cmd_acl,true)\n \n # reset the owner of the functions to the current user\n # when there is a 'privileged' app.\n app_name ||= @wrapped['director']['bound_app'] if @wrapped['director']\n if app_name\n cmd_select_fcts=\"SELECT pg_proc.proname FROM pg_catalog.pg_proc WHERE \\\n pg_proc.pronamespace=(SELECT pg_namespace.oid FROM pg_catalog.pg_namespace WHERE pg_namespace.nspname = 'public') \\\n AND pg_proc.proowner!=(SELECT oid FROM pg_roles WHERE rolname = 'postgres')\"\n current_owner=credentials()['username']\n unless current_owner\n STDERR.puts \"The application #{app_name} is not bound to the data-service #{name}; not applying the database privileges.\"\n return\n end\n fcts_name=shell(cmd_select_fcts,true,true)\n if fcts_name.empty?\n puts \"No need to re-assign the ownership of the functions in #{credentials()['name']}; the DB does not define its own functions.\" if VMC::Cli::Config.trace\n else\n fcts = fcts_name.split(\"\\n\").collect do |line|\n line.strip!\n \"'#{line}'\"\n end.join(',')\n cmd_change_fcts_owner=\"UPDATE pg_catalog.pg_proc \\\n SET proowner = (SELECT oid FROM pg_roles WHERE rolname = '#{current_owner}')\\\n WHERE pg_proc.proname IN (#{fcts})\"\n puts `sudo -u postgres psql --dbname #{credentials()['name']} -c \\\"#{cmd_change_fcts_owner}\\\" #{PSQL_RAW_RES_ARGS}`\n end\n end\n end\n end", "def security_create_right(data)\n plist = CFPropertyList::List.new\n plist.value = CFPropertyList.guess(data)\n tmp = Tempfile.new('puppet_macauthdb')\n begin\n plist.save(tmp.path, CFPropertyList::List::FORMAT_XML)\n tmp.close\n cmds = [:security, \"authorizationdb\", \"write\", resource[:name]]\n execute(cmds, :failonfail => false, :combine => false, \n :stdinfile => tmp.path.to_s)\n rescue Errno::EACCES => e\n raise Puppet::Error.new(\"Cannot save right to #{tmp.path}: #{e}\")\n ensure\n tmp.unlink\n end\n end", "def valid?\n ensure_file_open!\n\n ['Makefile', 'submission/', 'tests/'].all? { |entry| @file.find_entry(entry).present? }\n end", "def db_path?( path )\n path.split( \"|\" ).size == 3\n end", "def paranoid_permissions\n true\n end", "def viewFileRights\n \n @message = \"Access denied\"\n if params[:username] != session[:username]\n render :text => @message, :status => 401\n return\n end\n \n # try to get file from database\n if @error or not fetchFile\n @error = \"File not found!\"\n return\n end\n \n if @file.privatefile\n @filestate = \"private\"\n else\n @filestate = \"public\"\n end\n \n # get all groups of user\n @groups = Group.find(:all, :conditions => [\"user_id = ?\", @user.id]).sort_by { |a| a.name.downcase }\n \n # checkbox-state of each group\n @group_checked = Array.new\n \n # get all groups associated to the file\n filegroups = @file.groups.find(:all)\n filegroup_ids = []\n filegroups.each do |f|\n filegroup_ids.push(f.id)\n end\n \n # detect groups that have a permission to see file\n if @filestate == \"private\"\n @groups.each do |group|\n if filegroup_ids.include?(group.id)\n @group_checked << true\n else\n @group_checked << false\n end\n end\n else\n @group_checked = Array.new(@groups.size, true)\n end\n end", "def updatedb_file_permissions(file)\n meta = updatedb_file_ls(file)\n if meta\n permissions = meta.split(\" \")[0]\n permissions\n else\n nil\n end\n end", "def get_db\n # we want to check a couple levels 2011-09-28 \n unless @db\n unless File.exists? @file\n 3.times do |i|\n @file = \"../#{@file}\"\n break if File.exists? @file\n end\n end\n end\n @db ||= DB.new @file\n end", "def has_valid_owners_for_all_files?\n num_owned_by_wlmaster = num_files_owned_by_user('wlmaster')\n num_owned_by_wluser = num_files_owned_by_user('wluser')\n num_total = num_files_total\n # if all the files are owned by either 'wlmaster' or 'wluser', then\n # num_total must be equal to the sum of num_owned_by_wlmaster and num_owned_by_wluser.\n # If this condition is not matched, that means, there is at least one file\n # or directory, which is not owned by either of them.\n num_total == (num_owned_by_wlmaster + num_owned_by_wluser)\n end", "def check_permissions\n authorize! :create, CargoManifest\n end", "def filecheck\n return file.nil? ? false : File.exist?(file)\n end", "def setup_database_permissions(connection_string, db_name)\n # We tack on a space at the end to help regex matches\n connection_string += \" \"\n\n db_admin_user = connection_string.match db_string_regex('user')\n db_admin_user = db_admin_user[1]\n\n db_admin_password = connection_string.match db_string_regex('password')\n db_admin_password = db_admin_password[1]\n\n grant_sql = <<-SQL\n GRANT ALL PRIVILEGES ON #{db_name}.* TO #{db_admin_user}@localhost IDENTIFIED BY '#{db_admin_password}';\n SQL\n\n run \"#{connection_string} --execute=\\\"#{grant_sql}\\\"\"\nend", "def owned?(file)\n wide_file = string_check(file).wincode\n\n return_value = false\n size_needed_ptr = FFI::MemoryPointer.new(:ulong)\n\n # First pass, get the size needed\n bool = GetFileSecurityW(\n wide_file,\n OWNER_SECURITY_INFORMATION,\n nil,\n 0,\n size_needed_ptr\n )\n\n size_needed = size_needed_ptr.read_ulong\n\n security_ptr = FFI::MemoryPointer.new(size_needed)\n\n # Second pass, this time with the appropriately sized security pointer\n bool = GetFileSecurityW(\n wide_file,\n OWNER_SECURITY_INFORMATION,\n security_ptr,\n security_ptr.size,\n size_needed_ptr\n )\n\n raise SystemCallError.new(\"GetFileSecurity\", FFI.errno) unless bool\n\n sid_ptr = FFI::MemoryPointer.new(:pointer)\n defaulted = FFI::MemoryPointer.new(:int)\n\n unless GetSecurityDescriptorOwner(security_ptr, sid_ptr, defaulted)\n raise SystemCallError.new(\"GetFileSecurity\", FFI.errno)\n end\n\n sid = sid_ptr.read_pointer\n\n token = FFI::MemoryPointer.new(:uintptr_t)\n\n begin\n # Get the current process sid\n unless OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, token)\n raise SystemCallError, FFI.errno, \"OpenProcessToken\"\n end\n\n token = token.read_pointer.to_i\n rlength = FFI::MemoryPointer.new(:pointer)\n tuser = 0.chr * 512\n\n bool = GetTokenInformation(\n token,\n TokenUser,\n tuser,\n tuser.size,\n rlength\n )\n\n unless bool\n raise SystemCallError, FFI.errno, \"GetTokenInformation\"\n end\n\n string_sid = tuser[FFI.type_size(:pointer)*2, (rlength.read_ulong - FFI.type_size(:pointer)*2)]\n\n # Now compare the sid strings\n if string_sid == sid.read_string(string_sid.size)\n return_value = true\n end\n ensure\n CloseHandle(token)\n end\n\n return_value\n end", "def can_traverse?(user, path)\n return true if user == 'root'\n byme = File.stat(path).uid == -> { Etc.getpwnam(user).uid } && File.stat(path).mode & 64 == 64 # owner has x\n byus = File.stat(path).gid == -> { Etc.getpwnam(user).gid } && File.stat(path).mode & 8 == 8 # group has x\n byall = File.stat(path).mode & 1 == 1 # other has x\n byme || byus || byall\n end", "def perm_check(event)\n\t perms = {}\n @permissions.each do |p|\n if p == :bot_owner\n perms[p] = @bot.owners.include?(event.author.id)\n else\n perms[p] = event.author.permission?(p)\n end\n end\n if !perms.values.all?\n noperms = []\n perms.keys.each do |p|\n if !perms[p]\n noperms << p\n end\n end\n Commandorobo::NoPermission.new(noperms)\n else\n true\n end\n end", "def permissions = {}", "def create?\n record.resourceable.owner == user || user.is?(:admin)\n end", "def usable_with?(db)\n true\n end", "def granted?(resource, principal)\n\n # LimeBerry principal can do anything\n return true if principal == Principal.limeberry\n\n # consisting of the transitive group membership\n membership_str =\n \"(SELECT group_id, member_id FROM transitive_membership\\n\" +\n \"WHERE member_id = :principal_id\\n\" +\n \"UNION\\n\" +\n # and a pseudo-membership where principal is a member of\n # itself\n \"SELECT :principal_id group_id, :principal_id member_id) membership\\n\"\n\n # be sure to check aggregate privileges which may contain this one\n privs_str = \"(SELECT par_priv.id par_priv_id\\n\" +\n \"FROM privileges par_priv\\n\" +\n \"INNER JOIN\\n\" + # privileges joins with itself\n \"privileges chi_priv\\n\" +\n \"ON par_priv.lft <= chi_priv.lft AND par_priv.rgt >= chi_priv.rgt\\n\" +\n \"WHERE chi_priv.namespace_id = :namespace_id AND chi_priv.id = :privilege_id ) privs\\n\"\n\n # join aces to the resource in question\n # and any resources it may inherit ACLs from\n inherited_res_str = \"(SELECT par_res.resource_id resource_id, par_res.rgt par_res_rgt\\n\" +\n \"FROM acl_inheritance par_res\\n\" +\n \"INNER JOIN acl_inheritance chi_res\\n\" +\n \"ON (\\n\" +\n #\"par_res.base_id = chi_res.base_id AND\\n\" +\n \"par_res.lft < chi_res.lft AND par_res.rgt > chi_res.rgt)\\n\" +\n \"WHERE chi_res.resource_id = :resource_id\\n\" +\n \"UNION\\n\" +\n \"SELECT :resource_id resource_id, -1 par_res_rgt)\\n\" +\n \"inherited_res\\n\"\n\n sql_query = \"SELECT aces.id, aces.grantdeny, aces.protected FROM aces aces \\n\" +\n \"INNER JOIN aces_privileges ap\\n\" +\n \"ON aces.id = ap.ace_id\\n\" +\n \"INNER JOIN\\n\" +\n membership_str +\n \"ON aces.principal_id = membership.group_id\\n\" +\n \"INNER JOIN\\n\" +\n privs_str +\n \"ON ap.privilege_id = privs.par_priv_id\\n\" +\n \"INNER JOIN\\n\" +\n inherited_res_str +\n \"ON aces.resource_id = inherited_res.resource_id\\n\" +\n \"ORDER BY aces.protected DESC, par_res_rgt ASC, aces.position ASC\\n\" +\n \"LIMIT 1;\"\n\n values = {\n :namespace_id => self.namespace_id,\n :principal_id => principal.id,\n :privilege_id => self.id,\n :resource_id => resource.id\n }\n\n aces = Ace.find_by_sql( [ sql_query, values ])\n\n return false if aces.empty?\n\n aces[0].grantdeny == Ace::GRANT\n\n end", "def filecheck\n file.nil? ? false : File.exist?(file)\n end" ]
[ "0.6985257", "0.6840328", "0.6332122", "0.6323429", "0.6215494", "0.61220217", "0.6069742", "0.6066387", "0.6066387", "0.6066387", "0.6039412", "0.6029911", "0.5968827", "0.5933483", "0.5931091", "0.5923775", "0.58590275", "0.582068", "0.57200634", "0.5705908", "0.56982094", "0.56834376", "0.5681763", "0.5681763", "0.5681763", "0.56789136", "0.5660863", "0.5660178", "0.5659681", "0.56535506", "0.5619987", "0.5612907", "0.5596525", "0.5580284", "0.55565715", "0.5553914", "0.55493903", "0.5533643", "0.55113184", "0.55096024", "0.5502562", "0.5462068", "0.54513764", "0.54471713", "0.54459196", "0.5442899", "0.54326475", "0.54325527", "0.5431559", "0.5418153", "0.5402968", "0.53983545", "0.5364014", "0.5358296", "0.53462154", "0.5336668", "0.53284013", "0.5328273", "0.5328273", "0.53210676", "0.5313303", "0.53097266", "0.530919", "0.5308219", "0.5304897", "0.53008115", "0.52980334", "0.5292724", "0.5292368", "0.52879643", "0.52866834", "0.5268333", "0.52569604", "0.52529645", "0.524936", "0.5249075", "0.52458274", "0.52396005", "0.5238287", "0.5237937", "0.5235011", "0.523085", "0.5224342", "0.52238387", "0.5212285", "0.52075773", "0.5203595", "0.5203354", "0.5201977", "0.52013075", "0.5198403", "0.5190177", "0.51896507", "0.5183447", "0.5178694", "0.51702946", "0.51584756", "0.5158299", "0.5156675", "0.51503825" ]
0.7618825
0
check adding a file to the database
def test_check_new() assert_nothing_raised() { @checksum.check(@databasefile) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_file_to_database(name, path, size, owner)\n $db.execute(\"INSERT INTO files (owner_id, file_name, file_size, file_path, publicity) VALUES (?, ?, ?, ?, 0)\", [owner, name, size, path])\nend", "def insert_file_into_db(owner_id, file_name, upload_date, last_access_date, file_type, file_size, folder_id, public_status)\n p owner_id, file_name, upload_date, last_access_date, file_type, file_size, folder_id, public_status\n $db.execute(\"INSERT INTO files (owner_id,file_name,upload_date,last_access_date, file_type,file_size,folder_id,public_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\",\n owner_id,\n file_name,\n upload_date,\n last_access_date,\n file_type,\n file_size,\n folder_id,\n public_status)\nend", "def add_file(file)\n logger.info(\" ########### add file\")\n if (file.nil?)\n logger.error(\"file is nil\")\n self.original_filename = nil\n self.has_attached_file = false\n return false\n elsif (!check_file?(file))\n logger.error(\"error uploading file\")\n self.original_filename = nil\n self.has_attached_file = false\n\n return false\n else\n self.add_file_datastream(file, :label => file.original_filename, :mimeType => file.content_type, :dsid => 'content', :controlGroup => 'M')\n self.original_filename = file.original_filename\n self.mime_type = file.content_type\n self.has_attached_file = true\n end\n return true\n end", "def db_insert!( db_file )\n ####db = SQLite3::Database.new( db_file )\n ####db.transaction do |database|\n #### if not database.execute( db_fetch ).empty?\n #### raise(IndexError, \"Entry exists for #{filename}, #{@rmr_number}, #{@timestamp.to_s}... Skipping.\")\n #### end\n #### database.execute( db_insert )\n ####end\n ####db.close\n puts \"SQLite3\"\n end", "def add_files?\n true\n end", "def add1 fn, pid='NULL', fp='';\n #>! make alg. to fill pid/fp from that other value - to have known boths\n st = File .stat fp+'/'+fn\n #>! if exist update then\n sq = \\\n %Q{ INSERT INTO #{$config.local_disk}_files\n (pid,fileName,st_mode,st_nlink,st_uid,st_gid,\n st_size,st_atime,st_mtime,st_ctime,pathCache)\n VALUES\n (#{pid},'#{fn}',#{st.mode},#{st.nlink},#{st.uid},#{st.gid},\n #{st.size},'#{st.atime}','#{st.mtime}','#{st.ctime}','#{fp}'); }\n puts sq\n @db.execute sq\n check1 fn, pid\n end", "def check_new\n if File.exist?(@new_file_path)\n #TODO: error properly\n abort\n end\n end", "def add_files?\n false\n end", "def new_file?\n @new_file\n end", "def test_file\n\t\traise Store::Error, \"Error: file #{@file} does not exist\" unless is_up?\n\tend", "def add_stored(entry, src_path, &continue_on_exists_proc); end", "def has_file\n if id == nil \n false\n else\n FileTest.exists?( local_file_path )\n end\n end", "def perform\n check_file # checks if the file uploaded is valid\n save_file_entry # Uploads the file to the server and saves a entry to database\n end", "def existing_files; end", "def save_file_entry\n @user.search_files.create!(file_path: uploaded_file_path.result, file_name: @file.original_filename, status: 'initialized')\n end", "def file_name_exist(file_name, owner_id)\n if $db.execute(\"SELECT file_name FROM files WHERE file_name = ? AND owner_id = ?\", file_name, owner_id) == []\n return false\n else\n return true\n end\nend", "def file_exists\n end", "def add_file(file)\n if file.class == ActionDispatch::Http::UploadedFile\n file_object = file.tempfile\n file_name = file.original_filename\n mime_type = file.content_type\n elsif file.class == File\n file_object = file\n file_name = Pathname.new(file.path).basename.to_s\n mime_type = mime_type_from_ext(file_name)\n else\n return false\n end\n\n self.add_file_datastream(file_object, label: file_name, mimeType: mime_type, dsid: 'content')\n set_file_timestamps(file_object)\n self.checksum = generate_checksum(file_object)\n self.original_filename = file_name\n self.mime_type = mime_type\n self.size = file.size.to_s\n self.file_uuid = UUID.new.generate\n true\n end", "def test_insert_file\n job1 = @fq.insert_file(@tmp_name1)\n assert(job1, 'invalid job1: false : ' + @fq.read_log)\n\n assert_equal({:que => 1}, @fq.all_lengths)\n\n assert_equal(1, @fq.length)\n end", "def share_file(file_id, email)\n user_data = $db.execute(\"SELECT id FROM users WHERE email = ?\", [email])[0]\n if user_data == nil\n return false\n end\n user_id = user_data[\"id\"]\n $db.execute(\"INSERT INTO file_share_table (file_id, user_id) VALUES (?, ?)\", [file_id, user_id])\n return true\nend", "def already_stored?\n !file_uniqueness\n end", "def file?() end", "def file?\n not identifier.blank?\n end", "def check_for_file\n @ff.check_for_file \n end", "def photo_exists?(db, filename)\n\n query = db.exec(\"select photo from imageuploader where photo = '#{filename}'\")\n query == nil ? true : false\n\n end", "def stored?(file)\n ok_file = get_ok_file_for(file)\n fail_file = get_fail_file_for(file) \n if ( File.exists?(ok_file) or File.exists?(fail_file) )\n return true\n end \n return false\n end", "def validate_import_file(data)\n\t\tbegin\n\t\t\timport_filetype_detect(data)\n\t\trescue DBImportError\n\t\t\treturn false\n\t\tend\n\t\treturn true\n\tend", "def record_as_run!(filename)\n Preconditions.check_state(filename.match(/^\\d\\d\\d\\d\\d\\d+\\-\\d\\d\\d\\d\\d\\d\\.sql$/),\n \"Invalid filename[#{filename}]. Must be like: 20120503-173242.sql\")\n command = \"insert into %s.%s (filename) select '%s' where not exists (select 1 from %s.%s where filename = '%s')\" % [Db.schema_name, @table_name, filename, Db.schema_name, @table_name, filename]\n @db.psql_command(command)\n end", "def add_file(file_id, user, ip, source, port)\n times_to_retry = @storage_config.times_to_retry\n while (times_to_retry > 0)\n begin\n destination = File.join(@storage_config.files_storage_root_full_path, Utils.fileid2name(file_id))\n cmd_line = \"scp -P #{port} #{user}@#{ip}:#{source} #{destination}\"\n \n @logger.info(\"DSS: Saving file :#{cmd_line}\")\n if ( system(cmd_line) == false )\n message = \"DSS: Transaction faild with error #{$?}\"\n raise message\n else\n @logger.info(\"DSS: Save Successful\")\n return true;\n end \n rescue \n times_to_retry -= 1\n if (times_to_retry > 0)\n sleep(@storage_config.sleep_on_retry)\n else\n message = \"DSS: Unable to save file #{source} to #{destination}, error: #{$!.message}\"\n @logger.error(message)\n raise message\n end \n end \n end \n end", "def save\n ensure_file_open!\n @file.commit\n true\n end", "def save_file\n\t\tif file\n\t\t\tdocuments.create({\n\t\t\t\t:uploaded_file => file,\n\t\t\t\t:user_id => user_id\n\t\t\t})\n\t\tend\n\t\t#`cp \"#{file.path}\" \"#{path}\"` if file\n\tend", "def test_add_existing_file\n @gitit.add('hello.txt', 'Hello, dsyph3r')\n @gitit.commit('modifying hello world')\n\n file = @gitit.get_file('hello.txt')\n\n assert_not_nil(file)\n\n assert_equal('Hello, dsyph3r', file['data'], 'File data is incorrect')\n end", "def check_file_presence_on_update(params)\n if params[:financial_document][:file] == '{}' && params[:financial_document][:remove_file] == '1'\n errors.add(:file, I18n.t('errors.messages.blank'))\n return false\n else\n return true\n end\n end", "def ok_to_add_file(file, file_path)\n file_tags = file[\"tags\"] || []\n (files.size == 0 || files.any_matches?(file_path)) &&\n !exclude_files.any_matches?(file_path) &&\n (tags.size == 0 || (cross_any_matches?(file_tags, tags)) &&\n !cross_any_matches?(file_tags, exclude_tags))\n end", "def add(file)\n # add file to object db\n return false if !File.exists?(file)\n return false if !File.file?(file)\n \n sha = get_raw_repo.put_raw_object(File.read(file), 'blob')\n \n # add it to the index\n @git_index.add(file, sha)\n end", "def validate_file(file)\n end", "def insert_\n # new files to insert\n nfiles = @curr_schema.select_new_files\n count = nfiles.size\n Logger.<<(__FILE__,\"INFO\",\"Found #{nfiles.size} files to decode & insert for #{@curr_source.name}...\");\n return unless nfiles.size > 0\n\n SignalHandler.check\n ## Will decode them and insert their records, one by one (file)\n base_path = ::File.join(Conf::directories.store,@curr_source.name.to_s)\n ids_processed = []\n file_counter = 0\n iterate_over nfiles do |file|\n file_path = File.join(base_path,file[:folder],file[:file_name])\n begin\n file_ = CDR::File.new(file_path,search: true)\n rescue => e\n Logger.<<(__FILE__,\"WARNING\",\"File Error : #{e}\")\n raise e\n end\n records = @curr_source.decoder.decode file_\n if records.nil? \n Logger.<<(__FILE__,\"WARNING\",\"Found null output for file #{file}\")\n else\n @curr_schema.insert_records file[:file_id], records\n end\n @curr_schema.processed_files RubyUtil::arrayize(file[:file_id])\n backup_file file[:folder],file_\n str = log_file_summary file_,records\n Logger.<<(__FILE__,\"INFO\",\"(#{file_counter}/#{count}) #{str}\",inline: true)\n file_counter += 1\n end\n # so only one lookup for table cdr\n #mark_processed_decoded_files (ids_processed)\n Logger.<<(__FILE__,\"INFO\",\"Decoded & Inserted #{count} files ...\")\n Logger.<<(__FILE__,\"INFO\",\"Insert operation finished !\")\n end", "def file?\n !@file.nil?\n end", "def existing_file?(row)\n existing_files_by_filename.key?(row[\"filename\"])\n end", "def persisted?\n db_file && db_file.file?\n end", "def add_if_not_exists()\n\tif record_exists()\n\t\tprintf(\"EXISTS %s\\n\",self.digest)\n\t\treturn 0\n\tend\n\tsave()\n\treturn 1\nend", "def file_new?(file)\n MTIMES[file].nil?\n end", "def create\n if @file.present?\n @id = SecureRandom.urlsafe_base64\n FileUtils.mv @file.tempfile, temp_path\n true\n else\n errors.add(:file, 'is required')\n false\n end\n end", "def new_files; end", "def add_from_upload?(blob_params)\n !blob_params[:data].blank?\n end", "def is_new?\n !File.exists? @filename\n end", "def new_file?(name, mtime)\n # unknown file\n return true unless @table.has_key?(name)\n # updated file\n return mtime > @table[name]\n end", "def file_exists?(file)\n false\n end", "def validate_file_id\n file = ProjectFile.find_by(id: project_file_id)\n if file.nil? \n errors.add(:project_file_id, \"must be a valid file\")\n end\n end", "def save\n valid_file? and successful_conversion?\n end", "def exist; File.exist?(@fname); end", "def save\n self.id = (10 + Random.rand(99))\n FileOperations.add(self)\n puts 'Successfully Added'\n end", "def file?\n self.file.file?\n end", "def add_file(file, skip_fits)\n if file.class == ActionDispatch::Http::UploadedFile\n file_object = file.tempfile\n file_name = file.original_filename\n mime_type = file.content_type\n elsif file.class == File\n file_object = file\n file_name = Pathname.new(file.path).basename.to_s\n mime_type = mime_type_from_ext(file_name)\n else\n return false\n end\n\n self.add_file_datastream(file_object, label: file_name, mimeType: mime_type, dsid: 'content')\n set_file_timestamps(file_object)\n self.checksum = generate_checksum(file_object)\n self.original_filename = file_name\n self.mime_type = mime_type\n self.size = file.size\n self.file_uuid = UUID.new.generate\n unless skip_fits\n self.add_fits_metadata_datastream(file)\n end\n true\n end", "def check_file\n super\n end", "def add(entry, src_path, &continue_on_exists_proc); end", "def save(message)\n Log.debug(\"Database save: #{message}\")\n db_add_entry(message)\n\n if message.is_a? Evesync::IPC::Data::File\n Log.debug(\"Database save file action: #{message.action}\")\n unless message.action ==\n IPC::Data::File::Action::DELETE\n save_file(message)\n end\n end\n true\n end", "def save\n create_file\n true\n end", "def file_exist?\n return FileTest.exist?(@fileurl)\n end", "def add_media(db, mediatype, title, rentLease, mediaconsumed)\r\n\tdb.execute('INSERT INTO media (mediatype, title, rentLease, mediaconsumed) VALUES (?, ?, ?, ?)', [mediatype, title, rentLease, mediaconsumed])\r\nend", "def file_add(file)\n\t\tputs \"Add entries to the local host repository from file: #{file}\"\n\t\traise \"File non-exist. Please check your file path and name again: #{file}\" unless File.exist?(file)\n\t\thosts=file_2_list(file)\n\t\tchanges=bulk_add(hosts)\n\t\treturn changes\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\"\n\tend", "def create\n File.open(@db_file, \"w\" ) do |file|\n end\n end", "def filecheck\n file.nil? ? false : File.exist?(file)\n end", "def update_pg(db, filename)\n\n v_filename = filename\n\n begin\n db.prepare('q_statement',\n \"insert into imageuploader (photo) values ($1)\") # bind parameters\n db.exec_prepared('q_statement', [v_filename])\n db.exec(\"deallocate q_statement\")\n rescue PG::Error => e\n puts 'Exception occurred'\n puts e.message\n ensure\n db.close if db\n end\n\n end", "def exists?\n # self.class.exists?(:filename => filename)\n 'CarrierWave::Storage::ActiveRecord::File#exists? FIXME!'\n end", "def attachment_with_upload_method\n if method == \"upload\" && !attachment?\n errors.add(:base, \"Please make sure to upload your prescription.\")\n end\n end", "def add(body_number, resonance, type = 1) \n if !self.check?(body_number)\n File.open(@db_file, 'a+') do |db|\n db.puts(body_number.to_s+';'+type.to_s+';'+resonance.inspect)\n end\n true\n else\n false\n end\n end", "def update_file_in_db(file_id, filename, public_status, folder_id)\n $db.execute(\"UPDATE files SET file_name = ?, public_status = ?, folder_id = ? WHERE file_id = ?\", filename, public_status, folder_id, file_id)\nend", "def test_02b\r\n db = ITestUtils.newdb\r\n nm = File.join(test_data,'image-1.jpg')\r\n r = db.store(nm)\r\n assert_raise ::RuntimeError do\r\n r = db.store(nm)\r\n end\r\n r = db.store(nm,:force => true) # No errors this time.\r\n end", "def file_exists?(path)\n end", "def file_ok?(item = nil)\n status_ok?(item, column: :file_status)\n end", "def a_save_exists?\n DataManager.save_file_exists?\n end", "def ensure_database\n unless File.exist?(\"./items.csv\")\n puts \"Restoring items database.\"\n update_database\n end\n end", "def hook_add_files\n @flavor.class.after_add_files do |files, resource_action, type|\n files.each do |file|\n actions_taken << \"#{resource_action} #{type} #{file}\"\n end\n end\n end", "def file_name_exist?(name)\n return true if !name.blank?\n errors.add(:name, \"Nazwa nie moze byc pusta!\")\n false\n end", "def add(filename)\n not_implemented('add')\n end", "def upload_file\n @assignment = Assignment.find(params[:id])\n if ((@assignment.facebook_user.id == @fb_user.id) or (@assignment.is_author? @fb_user))\n @add_file_url = ActionController::Base.asset_host + \"/assignments/add_file/\"\n else\n flash[:alert] = \"You do not have permissions to add a file to that assignment.\"\n redirect_to @assignment\n end\n\n end", "def has_valid_file?(row, row_index)\n # Ignore FILES.csv\n filepath = get_data_path(row.fetch('path'))\n return false if filepath.nil?\n return true if filepath.end_with?(FileLocations.files_file_name)\n # the file exists on disk\n return false unless has_file?(filepath, row_index)\n # The file size matches\n has_size = has_required_size?(filepath, row, row_index)\n # The hash matches\n has_hash = has_required_hash?(filepath, row, row_index)\n # Files ias added to list of cheked files\n @checked_files_in_file << filepath\n has_size && has_hash\n end", "def contain?(filename); end", "def is_up?\n\t\tFile.exists?(@file)\n\tend", "def store(new_file)\n res = client[\"/vaults/#{vault_id}/blobs\"].post file: new_file.to_file\n json = JSON.parse(res)\n self.blob_id = json['blob_id']\n true\n end", "def db_insert(image_dataset_id)\n ####\"INSERT INTO raw_image_files\n ####(filename, header_reader, file_type, timestamp, source, rmr_number, series_description, \n ####gender, num_slices, slice_thickness, slice_spacing, reconstruction_diameter, \n ####acquisition_matrix_x, acquisition_matrix_y, rep_time, bold_reps, created_at, updated_at, image_dataset_id)\n ####VALUES ('#{@filename}', '#{@hdr_reader}', '#{@file_type}', '#{@timestamp.to_s}', '#{@source}', '#{@rmr_number}', \n ####'#{@series_description}', '#{@gender}', #{@num_slices}, #{@slice_thickness}, #{@slice_spacing}, \n #### #{@reconstruction_diameter}, #{@acquisition_matrix_x}, #{@acquisition_matrix_y}, #{@rep_time}, \n #### #{@bold_reps}, '#{DateTime.now}', '#{DateTime.now}', #{image_dataset_id})\" \n puts \"Old no raw_image_files table\"\n end", "def file_add(file)\n\t\tputs \"Add entries to the local site store from file: #{file}\"\n\t\traise \"File non-exist. Please check your file path and name again: #{file}\" unless File.exist?(file)\n\t\tchanges=Hash.new\n\t\tsites=file_2_list(file)\n\t\tchanges=bulk_add(sites) unless sites.nil? or sites.empty?\n\t\tputs \"Done loading file #{file}. \"\n\t\treturn changes\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\"\n\tend", "def exist?\n# File.exist?(file_path)\n @bson\n end", "def share_file_with_user(user_id, file_id)\n $db.execute(\"INSERT INTO shared_files (user_id, file_id) VALUES (?, ?)\", user_id, file_id)\nend", "def attach_schema_file(file_name, file_data)\n unless (@user.schema_files.blobs.find {|blob| blob.filename === file_name}).nil?\n raise ::Rbt::User::Document::Error::DuplicateDocumentError.new(\"File with name: #{file_name} already exists for user: #{@user.id}\")\n end\n\n @user.schema_files.attach(io: StringIO.new(file_data), filename: file_name)\n return @user.schema_files.blobs.find {|blob| blob.filename === file_name}\n end", "def filecheck\n return file.nil? ? false : File.exist?(file)\n end", "def check\n file_nil\n if @file.end_with?(\".txt\")\n if File.exist?(@file)\n @f = Command_File.new(@file)\n else\n raise \"File \\\"#{@file}\\\" does not Exist\n Please choose a \\\".txt\\\" file that exists\"\n end\n else\n raise \"Invalid Input File \\\"#{@file}\\\"\n File must end in \\\".txt\\\"\"\n end\n end", "def file_chk( path )\n if File.exist?( path ) == false\n raise JackRDF_Critical, \"#{path} is not a valid file\"\n end\n end", "def persist\n if current_file.new_record?\n file_set.save\n else\n current_file.save\n end\n end", "def add_uploaded_file(shf_app)\n shf_app.uploaded_files << create(:uploaded_file, actual_file: File.open(UPLOAD_PNG_FILE))\n end", "def update\n msg = FileOperations.id_exist?(self) ? FileOperations.update(self) : 'Product\n Not Found'\n puts msg\n end", "def file_exists?\n\tdirectory_name = \"db/seed_files\"\n\tunless File.exist?(directory_name)\n\t\tputs \"Created folder 'db/seed_files'\"\n\t\tDir.mkdir(directory_name)\n\tend\nend", "def file_sent( proposal, filename )\n table_name, file_field, err_field, time_field = table_and_attribute_names\n unless table_name.blank? || file_field.blank? || err_field.blank?\n time_upd = time_field.blank? ? '' : \", #{time_field} = '#{Time.now}'\"\n upd = \"UPDATE #{table_name} SET #{file_field} = '#{filename}', #{err_field} = NULL#{time_upd} WHERE id = #{proposal.record_id}\"\n ActiveRecord::Base.connection.execute(upd)\n end\n end", "def add( *files, **options )\n\t\tself.server.run( :add, *files, **options )\n\t\treturn true\n\tend", "def saved?\n return !@realfile.nil?\n end", "def file_correct?(file_path)\n raise 'ERROR: Is your file path correct ?' unless File.exist?(file_path)\n end", "def add_to_database\n if self.animal_in_non_retail?\n false\n else\n DB.execute(\"INSERT INTO products (location_id, category_id, name, cost, quantity) VALUES (#{@location_id}, #{@category_id}, '#{@name}', #{@cost}, #{@quantity});\")\n @id = DB.last_insert_row_id\n end\n end", "def checkForFileExistence(fileName)\n raise \"#{fileName} file already exists\" if File.exist?(fileName);\nend", "def file_location_exists\n if self.file_location.nil? || !File.exists?(self.file_location)\n errors.add(:file_location, \"doesn't exist on the server\")\n end\n end", "def save_to_storage\n if save_attachment?\n (db_file || build_db_file).data = temp_data\n db_file.save!\n self.class.update_all ['db_file_id = ?', self.db_file_id = db_file.id], ['id = ?', id]\n end\n true\n end" ]
[ "0.72816503", "0.6815475", "0.68144625", "0.67744654", "0.6555745", "0.6491231", "0.6410132", "0.6317758", "0.6267307", "0.6258463", "0.62376666", "0.6217068", "0.6144557", "0.6129433", "0.6120731", "0.6119832", "0.6118655", "0.6114964", "0.6090242", "0.6070681", "0.60572296", "0.6023406", "0.6017476", "0.6001667", "0.59897506", "0.59492403", "0.5944891", "0.5933128", "0.59156746", "0.5907825", "0.5896349", "0.5841806", "0.5830814", "0.58254045", "0.5821879", "0.5821146", "0.58038145", "0.57882166", "0.5785797", "0.5783508", "0.57822704", "0.5781842", "0.5775307", "0.57711816", "0.57660437", "0.5750372", "0.57448345", "0.5738504", "0.5737262", "0.5710149", "0.5696363", "0.5691719", "0.56853783", "0.56781393", "0.5675104", "0.56716436", "0.56668365", "0.56210995", "0.56205857", "0.56198066", "0.5618871", "0.5615044", "0.5609853", "0.56075114", "0.5606374", "0.5606086", "0.55963683", "0.5595365", "0.55938107", "0.5588198", "0.5586569", "0.5580517", "0.5577513", "0.5577325", "0.5574599", "0.55734223", "0.5568729", "0.5561424", "0.5554077", "0.5553967", "0.5553196", "0.55515414", "0.5547457", "0.55457354", "0.5544679", "0.5531623", "0.5529813", "0.5526331", "0.55216026", "0.5517858", "0.5512914", "0.55054164", "0.5504053", "0.55038804", "0.5497818", "0.5496798", "0.5494149", "0.54760426", "0.5467074", "0.54552454", "0.54540145" ]
0.0
-1
check a file being added to the database and then changed
def test_checksum_change() assert_nothing_raised() { @checksum.check(@databasefile) } assert_raise(Cfruby::Checksum::ChecksumMatchError, "check of changed file content in database failed to raise exception") { @checksum.check(@databasefile) } assert_equal(false, @checksum.check?(@databasefile)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_files\n updated = []\n files.each do |filename, mtime| \n begin\n current_mtime = File.stat(filename).mtime\n rescue Errno::ENOENT\n # file was not found and was probably deleted\n # remove the file from the file list \n files.delete(filename)\n next\n end\n if current_mtime != mtime \n updated << filename\n # update the mtime in file registry so we it's only send once\n files[filename] = current_mtime\n puts \"quick_serve: spotted change in #{filename}\"\n end\n end\n QuickServe::Rails::Snapshot.reset if updated != []\n false\n end", "def changed?(uploaded_file)\n record.reload\n super\n end", "def changed?(file)\n if !stored?(file)\n return true\n end\n ok_file = get_ok_file_for(file)\n fail_file = get_fail_file_for(file)\n f = File.new(file) \n if ( \n ( File.exists?(ok_file) && f.stat.mtime > File.new(ok_file).stat.mtime ) or\n ( File.exists?(fail_file) && f.stat.mtime > File.new(fail_file).stat.mtime )\n )\n return true\n end \n return false \n end", "def file_changed(f)\n if !MrBucket.exists?(f)\n return true\n end\n local_time = open(f).mtime\n live_time = Time.parse(MrBucket.find(f).about[:\"last-modified\"])\n return local_time > live_time\nend", "def change?(file)\n @file != file\n end", "def check_new\n if File.exist?(@new_file_path)\n #TODO: error properly\n abort\n end\n end", "def new_file?(name, mtime)\n # unknown file\n return true unless @table.has_key?(name)\n # updated file\n return mtime > @table[name]\n end", "def modified_files; end", "def file_changed?(file)\n file_new?(file) || File.mtime(file) > MTIMES[file]\n end", "def added_or_modified?(file)\n added?(file) || modified?(file)\n end", "def existing_files; end", "def meta_file_changed?(opts = {})\n contains_a_dsl_filename?(self[:files_modified], opts) ||\n contains_a_dsl_filename?(self[:files_added], opts)\n end", "def updatedb_file_exists?(file)\n @updatedb.key?(file)\n end", "def new_file?\n @new_file\n end", "def check_for_file_edits(committed_files)\n check_for_changes = `git ls-files --modified`\n\n if check_for_changes.each_line { |line|\n # if the user modified any files while executing this hook, then ask for a re-commit and abort the user push\n if committed_files.include?(line.rstrip())\n puts \"**File have been edited. Please stage/re-commit your changes and push again**\"\n exit(1)\n end\n }\n else\n exit(0)\n end\nend", "def verify_file_changes_for\n @user = User.find(params[:id])\n if ModelInstanceUpdater.transfer_tags params\n flash.notice = \"Files were successfully updated.\"\n @user.data = []\n @user.save\n redirect_to user_path(@user)\n else\n flash.notice = \"Invalid operation: attempted to transfer multiple files' data to one file \" +\n \"OR did not designate target for some files (make sure all pages are filled out).\"\n redirect_to view_file_changes_for_user_path(@user)\n end\n end", "def updated?\n @changed_files.clear()\n start_size = @file_cache.size\n listen_for_changes\n end_size = @file_cache.size\n start_size != end_size || !@changed_files.empty?\n end", "def check_for_file\n @ff.check_for_file \n end", "def has_changes?\r\n @source_files.size > 0\r\n end", "def is_new?\n !File.exists? @filename\n end", "def check_file_presence_on_update(params)\n if params[:financial_document][:file] == '{}' && params[:financial_document][:remove_file] == '1'\n errors.add(:file, I18n.t('errors.messages.blank'))\n return false\n else\n return true\n end\n end", "def check_file_for_changes(filepath)\n last_modified = File.mtime(filepath)\n\n if @file_cache[filepath] != last_modified && @start_time <= last_modified\n change_type = (@file_cache[filepath] ? :modified : :added)\n push_changes(filepath, change_type)\n end\n\n @file_cache[filepath] = last_modified\n end", "def image_file_changed?\n raise 'please override image_file_changed?'\n end", "def addUnchangedFilesToCommit(prev_commit, commit, changed_files) #:doc:\n# sql = \"select devfiles.path, devfiles.name, devfiles.blob_id from devfiles, blobs, blobs_in_commits where blobs.devfile_id=devfiles.id and blobs_in_commits.blob_id=blobs.id and blobs_in_commits.commit_id=#{prev_commit.id};\"\n# devfiles_of_prev_commit = ActiveRecord::Base.connection.execute(sql)\n#\n devfiles_of_prev_commit = Devfile.find_by_sql(\"select devfiles.path, devfiles.name, devfiles.blob_id from devfiles, blobs, blobs_in_commits where blobs.devfile_id=devfiles.id and blobs_in_commits.blob_id=blobs.id and blobs_in_commits.commit_id=#{prev_commit.id};\")\n if devfiles_of_prev_commit.size > 0\n ActiveRecord::Base.connection.execute(\"begin\")\n now = DateTime.now\n devfiles_of_prev_commit.each do |df|\n if not changed_files.has_key?(df.path + df.name)\n begin\n sql = \"insert into blobs_in_commits(blob_id, commit_id, created_at, updated_at) values('#{df['blob_id']}', '#{commit.id}', '#{now}', '#{now}');\"\n ActiveRecord::Base.connection.execute(sql)\n rescue\n # do nothing\n end\n end\n end\n ActiveRecord::Base.connection.execute(\"commit\")\n end\n end", "def files_changed(file, event)\n puts motivate\n # return true so that the watch loop keeps running\n return true\n end", "def files_changed?\n # initialise variables for the \n new_snapshot = snapshot_filesystem\n has_changed = false\n\n # take a new snapshot and subtract this from the old snapshot in order to get forward changes\n # then add the snapshot to the oposite subtraction to get backward changes\n changes = (@snapshot.to_a - new_snapshot.to_a) + (new_snapshot.to_a - @snapshot.to_a)\n \n # determine the event for each change\n changes.each do |change|\n if @snapshot.keys.include? change[0]\n @changed = {change[0] => change[1]}\n @event = (new_snapshot.keys.include? change[0]) ? :change : :delete\n has_changed = true\n else\n @changed = {change[0] => change[1]}\n @event = :new\n has_changed = true\n end\n end\n \n # lets reset the snapshot so that we don't create a forever loop\n @snapshot = new_snapshot\n\n return has_changed\n end", "def file_changes?\n all_files = git.modified_files + git.added_files\n Danger::Changelog::Config.ignore_files.each do |f|\n all_files.reject! { |modified_file| f.is_a?(Regexp) ? f.match?(modified_file) : f == modified_file }\n break if all_files.empty?\n end\n all_files.any?\n end", "def added?(file)\n @added.any?(file) || @untracked.any?(file)\n end", "def changelog_changes?\n git.modified_files.include?(filename) || git.added_files.include?(filename)\n end", "def handle_silent_modification_failure?\n false\n end", "def check_change (conf, curDir)\n Dir.chdir curDir\n return true unless File.exist?(FileStats)\n arr = IO.read(FileStats).split(\",\")\n return true if arr[0].to_i != conf[:fsize]\n return true if conf[:modTS ].to_i > Time.parse(arr[1]).to_i \n false\nend", "def modified?(path); end", "def already_stored?\n !file_uniqueness\n end", "def update_file_in_db(file_id, filename, public_status, folder_id)\n $db.execute(\"UPDATE files SET file_name = ?, public_status = ?, folder_id = ? WHERE file_id = ?\", filename, public_status, folder_id, file_id)\nend", "def has_changes?\n @has_changed_the_db\n end", "def check_data\n if MissouriDatum.last.new_file\n @downloads.each_with_index do |download, index|\n obj = s3.bucket('missouridata').object(\"new/#{file_names[index]}\")\n @file_status = \"new\"\n puts \"new file\"\n upload(obj, download)\n end\n else \n downloads.each_with_index do |download, index|\n obj = s3.bucket('missouridata').object(\"same/#{file_names[index]}\")\n @file_status = \"same\"\n puts \"same file\"\n upload(obj, download)\n end\n end \n end", "def modified?(file)\n @mutex.synchronize do\n @data[file.to_s].modified?(file)\n end\n end", "def altered_files; raw_changeset.files; end", "def add_stored(entry, src_path, &continue_on_exists_proc); end", "def changed?\n rotation do |file|\n break true if file_changed?(file)\n end\n end", "def check_for_update\n file = download_file(UPSTREAM_DATABASE[:URL], Dir.mktmpdir)\n # Same hash = no update\n !check_hash(file, UPSTREAM_DATABASE[:HASH])\n end", "def file_uploaded_now?(item = nil)\n item ||= default_to_self\n item.reload if item.is_a?(ActiveRecord::Base)\n file_uploaded?(item)\n end", "def changelog_has_been_modified\n\n modified = git.modified_files.include?(\"CHANGELOG.md\")\n return modified\n\nend", "def file_changed?(file, last_time)\n\t\t# Rake uses File.mtime(path_to_file) to figure out if files are out of date or not. \n\t\t\t# It also has a constant called Rake::LATE, but I can't figure out how that works.\n\t\t\t# \n\t\t\t# sources:\n\t\t\t\t# https://github.com/ruby/rake/blob/master/MIT-LICENSE\n\t\t\t\t# https://github.com/ruby/rake/blob/master/lib/rake/file_task.rb\n\t\t\n\t\t\n\t\t# Can't figure out how Rake::LATE works, but this works fine.\n\t\t\n\t\tlast_time.nil? or file.mtime > last_time\n\tend", "def should_update?(file, since_date=nil)\n if since_date.nil?\n # if there is no specified date, then update everything\n return true\n else\n # if a file has been updated since a time specified by user\n file_date = File.mtime(file)\n return file_date > since_date\n end\nend", "def save_to_dropbox_only_on_date_change(file_name)\n if @last_file_name and file_name != @last_file_name\n save_to_dropbox @last_file_name\n end\n @last_file_name = file_name\n end", "def updated_source_file?; end", "def test_update()\n\t\t@checksum.check(@databasefile)\n\t\t\n\t\tFile.open(@tempfile.path, File::WRONLY|File::APPEND) { |fp|\n\t\t\tfp.print(\"New content\")\n\t\t}\n\t\t\n\t\tassert_nothing_raised(\"update of checksum failed\") {\n\t\t\t@checksum.update(@tempfile.path)\n\t\t\t@checksum.check(@tempfile.path)\n\t\t}\n\tend", "def save\n ensure_file_open!\n @file.commit\n true\n end", "def changed?\n @changed ||= sorted_file != IO.read(file)\n end", "def modified?; end", "def save_version?\n\t\t\t \t\tchanged?\n\t\t\t \tend", "def updateDevfile(f, commit) #:doc:\n \n dev_file = nil\n \n begin\n # Checks if there is any changes in files.\n f_filedate = DateTime.strptime(f['filedate'], \"%T %F\")\n f_filedate = f_filedate.strftime('%F %T').to_s \n \n now = DateTime.now.strftime('%F %T')\nputs \"name: #{f['name']}\"\nputs \"path: #{f['path']}\"\n puts \"Finding devfile..\"\n dev_file = @device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", f['name'], f['path']])\n if dev_file != nil\n puts \"devfile found: \" + dev_file.id.to_s\n else\n puts \"Devfile not found\"\n raise Exception.new(\"Devfile not found. Can not update it!\")\n end\n \n \n blob = dev_file.blobs.find_by_blob_hash_and_devfile_id(f['blob_hash'], dev_file.id)\n if blob != nil\n puts \"Blob already exists!\"\n puts \"Blob: \" + blob.id.to_s\n return\n else\n puts \"Blob was not found!\"\n end\n \n # Finds the blob that is newest one\n previous_blob_id = nil\n current_blob = dev_file.blobs.find_by_id(dev_file.blob_id)\n if current_blob != nil\n previous_blob_id = current_blob.id.to_s\n puts \"Current blob: \" + current_blob.id.to_s\n \n end\n \n # If the blob, didn't exist yet, creates it. Ensures that blob will have version number.\n if blob == nil #or current_blob == nil\n version = 0\n if current_blob != nil\n version = current_blob.version + 1\n end\n \n puts \"Creates new blob, verion num: \" + version.to_s\n sql = \"insert into blobs(blob_hash, created_at, updated_at, size, filedate, uploaded, version, devfile_id, predecessor_id, latitude, longitude) values('#{f['blob_hash']}', '#{now}', '#{now}', '#{f['size']}', '#{f_filedate}', '0', '#{version}', '#{dev_file.id}', '#{previous_blob_id}', '#{@commit_location['latitude']}', '#{@commit_location['longitude']}');\"\n ActiveRecord::Base.connection.execute(sql)\n end\n \n puts \"Finding the newly created blob..\"\n blob = dev_file.blobs.find_by_blob_hash(f['blob_hash'])\n puts \" found blob: \" + blob.id.to_s\n \n current_blob.update_attribute(:follower_id, blob.id)\n \n puts \"Updating devfile\"\n # Updates changes in devfile (current blob)\n sql = \"update devfiles set filetype = '#{f['filetype']}', latitude = '#{f['latitude']}', longitude = '#{f['longitude']}', blob_id = '#{blob.id.to_s}', updated_at = '#{now}' where name = '#{f['name']}' and path = '#{f['path']}' and device_id = #{@device.id};\"\n puts \" SQL: \" + sql.background(:red)\n ActiveRecord::Base.connection.execute(sql)\n \n BlobsInCommit.find_or_create_by_blob_id_and_commit_id(blob.id, commit.id)\n \n \n #checkForObservers(dev_file)\n \n rescue => e\n puts \"Errors in updating file\" + e\n raise e\n end\n \n puts \"devfile updated!\"\n return dev_file\n end", "def stored?(file)\n ok_file = get_ok_file_for(file)\n fail_file = get_fail_file_for(file) \n if ( File.exists?(ok_file) or File.exists?(fail_file) )\n return true\n end \n return false\n end", "def hook_add_files\n @flavor.class.after_add_files do |files, resource_action, type|\n files.each do |file|\n actions_taken << \"#{resource_action} #{type} #{file}\"\n end\n end\n end", "def updated?(file_handle)\n c_stat = File.stat @file\n if (c_stat.size == @size) && (c_stat.mtime.to_i == @mtime.to_i) && (! @init_stat)\n Snoopit.logger.debug 'FileTracker.updated? file has not changed: ' + @file\n updated = false\n elsif c_stat.size < @size\n Snoopit.logger.debug 'FileTracker.updated? file size is smaller it is a new new file: ' + @file\n updated = new_file? file_handle, c_stat\n elsif (c_stat.size == @size) && (! @mtime.nil?) && (c_stat.mtime.to_i > @mtime.to_i)\n Snoopit.logger.debug 'FileTracker.updated? file size is same but file time is newer it is a new file: ' + @file\n updated = new_file? file_handle, c_stat\n else\n Snoopit.logger.debug 'FileTracker.updated? reading from last read location: ' + @file\n updated = read_from_last? file_handle, c_stat\n end\n @init_stat = false\n updated\n end", "def handle_silent_modification_failure?\n self[:raise_on_save_failure] == false\n end", "def brewfile_has_been_modified\n \n modified = git.modified_files.include?(\"Brewfile\")\n return modified\n \nend", "def perform\n check_file # checks if the file uploaded is valid\n save_file_entry # Uploads the file to the server and saves a entry to database\n end", "def file_new?(file)\n MTIMES[file].nil?\n end", "def changed?\n render unless result\n if exist?\n File.read(output) != result\n else\n true\n end\n end", "def save_file\n\t\t\tfile_hash = Digest::MD5.hexdigest(File.read(@file))\n\t\t\tif file = @db.find_html_file(@filename)\n\t\t\t\t@file_changed = @db.check_or_update_if_file_changed(file, @filename, file_hash)\n\t\t\telse\n\t\t\t\t@db.create_html_file(@filename, file_hash)\n\t\t\tend\n\t\tend", "def any_added?(files)\n files.any? { |file| added? file }\n end", "def file_changed(start_commit, end_commit, filepath)\n command = \"git diff --name-only '#{start_commit}..#{end_commit}' -- #{filepath}\"\n changed_file = `#{command}`.strip\n return !changed_file.empty?\n end", "def check_db_changes\n partist = DBClasses::Artist.new.ref_load(self.artist.rartist)\n precord = DBClasses::Record.new.ref_load(self.record.rrecord)\n psegment = DBClasses::Segment.new.ref_load(self.segment.rsegment)\n ptrack = DBClasses::Track.new.ref_load(self.track.rtrack)\n\n\n end", "def check_files(files)\r\n files_before = @file_info.keys\r\n used_files = {} \r\n files.each do |file|\r\n begin\r\n if @file_info[file]\r\n if @file_info[file].timestamp != File.mtime(file)\r\n @file_info[file].timestamp = File.mtime(file)\r\n digest = calc_digest(file)\r\n if @file_info[file].digest != digest\r\n @file_info[file].digest = digest \r\n @file_changed && @file_changed.call(file)\r\n end\r\n end\r\n else\r\n @file_info[file] = FileInfo.new\r\n @file_info[file].timestamp = File.mtime(file)\r\n @file_info[file].digest = calc_digest(file)\r\n @file_added && @file_added.call(file)\r\n end\r\n used_files[file] = true\r\n # protect against missing files\r\n rescue Errno::ENOENT\r\n # used_files is not set and @file_info will be removed below\r\n # notification hook hasn't been called yet since it comes after file accesses\r\n end\r\n end\r\n files_before.each do |file|\r\n if !used_files[file]\r\n @file_info.delete(file)\r\n @file_removed && @file_removed.call(file)\r\n end\r\n end\r\n end", "def update(uploaded_file)\n super\n record.save_changes(validate: false)\n end", "def saved?\n return !@realfile.nil?\n end", "def update\n msg = FileOperations.id_exist?(self) ? FileOperations.update(self) : 'Product\n Not Found'\n puts msg\n end", "def update(uploaded_file)\n super\n record.save(raise_on_failure: true)\n end", "def new_files; end", "def dirty?\n return true unless test(?e, destination)\n @mtime > ::File.mtime(destination)\n end", "def check_changed_files(git)\n git.status.select {|file| file.type || file.untracked }\n end", "def update!\n if canonical_file.exist?\n if file.mtime > canonical_file.mtime\n save!\n end\n else\n save!\n end\n end", "def modified_existing?\n false\n end", "def update_file_content(new_content)\n return false if new_content.nil?\n self.file_content = new_content\n self.save\n end", "def update_file_content(new_content)\n return false if new_content.nil?\n self.file_content = new_content\n self.save\n end", "def verify_update_file\n @log.info('Beginning integrity check of downloaded file .')\n @file_sha1 = Digest::SHA1.file(@update_file.path).hexdigest\n\n @log.info('Verifying integrity of downloaded file.')\n\n if download_remote_sha1 == @file_sha1\n @log.info('Integrity verified.')\n true\n else\n abort('File was not downloaded correctly. Please try again.')\n end\n end", "def changed?(file_stats)\n not (file_stats.size == size and file_stats.mtime.utc == modification_time.utc)\n end", "def didModify(files_array)\n\tdid_modify_files = false\n\tfiles_array.each do |file_name|\n\t\tif git.modified_files.include?(file_name) || git.deleted_files.include?(file_name)\n\t\t\tdid_modify_files = true\n\t\tend\n\tend\n\treturn did_modify_files\nend", "def check_for_changes\n\t\t\t# Check on disk changes\n\t\t\tunless @disks[0][:changes] == false\n\t\t\t\t\t$log.info \"Cachefile changed by user. Honoring changes.\"\n\t\t\t\t\t@disks[0][:changes] = false\n\t\t\t\t\twrite_disk_cache\n\t\t\t\t\treturn true\n\t\t\tend\n\t\t\treturn false\n\t\tend", "def is_up?\n\t\tFile.exists?(@file)\n\tend", "def update_file_content(new_content)\n return false if new_content.nil?\n self.file_content = new_content\n return self.save\n end", "def file_modified?\n modified = false\n\n if @name\n begin\n mtime = File.mtime( @name )\n\n if mtime > @last_modification_check\n modified = true\n @last_modification_check = mtime\n end\n rescue Errno::ENOENT\n # Ignore if file doesn't exist\n end\n end\n\n modified\n end", "def file_modified?(file, opts={})\n vf_old, vf_new = opts[:node1][file], opts[:node2][file]\n\n tests = [vf_old.flags != vf_new.flags,\n vf_old.file_node != vf_new.file_node &&\n (vf_new.changeset.include?(file) || vf_old === vf_new)]\n tests.any?\n end", "def persisted?\n db_file && db_file.file?\n end", "def test_add_existing_file\n @gitit.add('hello.txt', 'Hello, dsyph3r')\n @gitit.commit('modifying hello world')\n\n file = @gitit.get_file('hello.txt')\n\n assert_not_nil(file)\n\n assert_equal('Hello, dsyph3r', file['data'], 'File data is incorrect')\n end", "def add_files?\n true\n end", "def changed_save? save_type, r = self.repo\n save_type = save_type.to_s << '.sfs' unless save_type.include?(\".sfs\")\n r.changed.include?(save_type)\n end", "def add_file_to_database(name, path, size, owner)\n $db.execute(\"INSERT INTO files (owner_id, file_name, file_size, file_path, publicity) VALUES (?, ?, ?, ?, 0)\", [owner, name, size, path])\nend", "def modified?\n return File.mtime(@filename).to_i > @load_time\n end", "def image_changed?\n self.image_file_name_changed? ||\n self.image_content_type_changed?\n end", "def file_sent( proposal, filename )\n table_name, file_field, err_field, time_field = table_and_attribute_names\n unless table_name.blank? || file_field.blank? || err_field.blank?\n time_upd = time_field.blank? ? '' : \", #{time_field} = '#{Time.now}'\"\n upd = \"UPDATE #{table_name} SET #{file_field} = '#{filename}', #{err_field} = NULL#{time_upd} WHERE id = #{proposal.record_id}\"\n ActiveRecord::Base.connection.execute(upd)\n end\n end", "def changed?(file_stats)\n !((file_stats.size == @size) &&\n (file_stats.mtime.to_i == @modification_time))\n end", "def updated?\n !ignore? && !removed? && mtime != File.mtime(path)\n end", "def db_insert!( db_file )\n ####db = SQLite3::Database.new( db_file )\n ####db.transaction do |database|\n #### if not database.execute( db_fetch ).empty?\n #### raise(IndexError, \"Entry exists for #{filename}, #{@rmr_number}, #{@timestamp.to_s}... Skipping.\")\n #### end\n #### database.execute( db_insert )\n ####end\n ####db.close\n puts \"SQLite3\"\n end", "def isStale?(file, old_files)\n\t\treturn true unless File.exist?(file)\n\t\tnew_time = File.mtime(file)\n\t\told_files.each do |old|\n\t\t\tif File.exist?(old)\n\t\t\t\t#debug \"New Time: #{new_time}\"\n\t\t\t\t#debug \"Old Time: #{File.mtime(old)}\"\n\t\t\t\treturn true if new_time < File.mtime(old)\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend", "def file_modified?(path, last_event)\n if File.ctime(path).to_i == last_event.to_i\n file_content_modified?(path, sha1_checksum(path))\n elsif File.mtime(path).to_i > last_event.to_i\n set_sha1_checksums_hash(path, sha1_checksum(path))\n true\n else\n false\n end\n rescue\n false\n end", "def hilite_new_infections(file)\n return \"unchanged\" if prev_scan.nil? || prev_scan.infections == scan.infections\n Thread.current[:prev_infections] ||= prev_scan.infections.collect{|infection| infection.file}\n return (Thread.current[:prev_infections].include?(file) ? \"unchanged\" : \"changed\")\nend", "def save_file_entry\n @user.search_files.create!(file_path: uploaded_file_path.result, file_name: @file.original_filename, status: 'initialized')\n end", "def file_ok?(item = nil)\n status_ok?(item, column: :file_status)\n end" ]
[ "0.7124365", "0.6888104", "0.6713643", "0.6653271", "0.6636206", "0.6603193", "0.65893626", "0.65155685", "0.65058947", "0.6461709", "0.6283171", "0.62694514", "0.6246396", "0.6242405", "0.6242105", "0.6225797", "0.62089515", "0.62012064", "0.6194413", "0.6193761", "0.6178327", "0.6177555", "0.61628026", "0.6162358", "0.614297", "0.61367136", "0.61318034", "0.6114779", "0.61137867", "0.6082337", "0.60766846", "0.6072956", "0.6061093", "0.60554713", "0.604807", "0.60327613", "0.60314626", "0.6030119", "0.6029586", "0.6028517", "0.6018735", "0.60184985", "0.5995578", "0.5991627", "0.59841764", "0.5967809", "0.5963788", "0.5960653", "0.59504604", "0.5932962", "0.5932702", "0.59116936", "0.5900188", "0.5890591", "0.5890518", "0.588582", "0.588071", "0.5879271", "0.58660597", "0.5859481", "0.5859094", "0.5846233", "0.5845553", "0.58446217", "0.5835744", "0.5835268", "0.58352387", "0.58341384", "0.5833201", "0.58076835", "0.5802345", "0.5801077", "0.5797993", "0.57898724", "0.57819617", "0.5779946", "0.5779946", "0.577692", "0.577672", "0.57757384", "0.5770585", "0.57692164", "0.5766592", "0.57601863", "0.57547724", "0.5749852", "0.5749686", "0.5738374", "0.572894", "0.5728612", "0.572575", "0.57233876", "0.57217467", "0.57027936", "0.5701367", "0.56896406", "0.5681165", "0.56695145", "0.5660405", "0.565895", "0.5652619" ]
0.0
-1
check update of file in database
def test_update() @checksum.check(@databasefile) File.open(@tempfile.path, File::WRONLY|File::APPEND) { |fp| fp.print("New content") } assert_nothing_raised("update of checksum failed") { @checksum.update(@tempfile.path) @checksum.check(@tempfile.path) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_for_update\n file = download_file(UPSTREAM_DATABASE[:URL], Dir.mktmpdir)\n # Same hash = no update\n !check_hash(file, UPSTREAM_DATABASE[:HASH])\n end", "def updatedb_file_exists?(file)\n @updatedb.key?(file)\n end", "def check_files\n updated = []\n files.each do |filename, mtime| \n begin\n current_mtime = File.stat(filename).mtime\n rescue Errno::ENOENT\n # file was not found and was probably deleted\n # remove the file from the file list \n files.delete(filename)\n next\n end\n if current_mtime != mtime \n updated << filename\n # update the mtime in file registry so we it's only send once\n files[filename] = current_mtime\n puts \"quick_serve: spotted change in #{filename}\"\n end\n end\n QuickServe::Rails::Snapshot.reset if updated != []\n false\n end", "def update_file_in_db(file_id, filename, public_status, folder_id)\n $db.execute(\"UPDATE files SET file_name = ?, public_status = ?, folder_id = ? WHERE file_id = ?\", filename, public_status, folder_id, file_id)\nend", "def should_update?(file, since_date=nil)\n if since_date.nil?\n # if there is no specified date, then update everything\n return true\n else\n # if a file has been updated since a time specified by user\n file_date = File.mtime(file)\n return file_date > since_date\n end\nend", "def verify_update_file\n @log.info('Beginning integrity check of downloaded file .')\n @file_sha1 = Digest::SHA1.file(@update_file.path).hexdigest\n\n @log.info('Verifying integrity of downloaded file.')\n\n if download_remote_sha1 == @file_sha1\n @log.info('Integrity verified.')\n true\n else\n abort('File was not downloaded correctly. Please try again.')\n end\n end", "def new_file?(name, mtime)\n # unknown file\n return true unless @table.has_key?(name)\n # updated file\n return mtime > @table[name]\n end", "def changed?(uploaded_file)\n record.reload\n super\n end", "def update\n msg = FileOperations.id_exist?(self) ? FileOperations.update(self) : 'Product\n Not Found'\n puts msg\n end", "def check_change (conf, curDir)\n Dir.chdir curDir\n return true unless File.exist?(FileStats)\n arr = IO.read(FileStats).split(\",\")\n return true if arr[0].to_i != conf[:fsize]\n return true if conf[:modTS ].to_i > Time.parse(arr[1]).to_i \n false\nend", "def updated?\n @changed_files.clear()\n start_size = @file_cache.size\n listen_for_changes\n end_size = @file_cache.size\n start_size != end_size || !@changed_files.empty?\n end", "def file_changed(f)\n if !MrBucket.exists?(f)\n return true\n end\n local_time = open(f).mtime\n live_time = Time.parse(MrBucket.find(f).about[:\"last-modified\"])\n return local_time > live_time\nend", "def check_file_presence_on_update(params)\n if params[:financial_document][:file] == '{}' && params[:financial_document][:remove_file] == '1'\n errors.add(:file, I18n.t('errors.messages.blank'))\n return false\n else\n return true\n end\n end", "def updatable?(database)\n result = true\n database.execute 'BEGIN'\n begin\n database.execute update_stmt\n rescue PG::UndefinedFile, PG::UndefinedObject, PG::ReadOnlySqlTransaction => err\n @error = err.message\n result = false\n end\n database.execute 'ROLLBACK'\n\n result\n end", "def changed?(file)\n if !stored?(file)\n return true\n end\n ok_file = get_ok_file_for(file)\n fail_file = get_fail_file_for(file)\n f = File.new(file) \n if ( \n ( File.exists?(ok_file) && f.stat.mtime > File.new(ok_file).stat.mtime ) or\n ( File.exists?(fail_file) && f.stat.mtime > File.new(fail_file).stat.mtime )\n )\n return true\n end \n return false \n end", "def update!\n if canonical_file.exist?\n if file.mtime > canonical_file.mtime\n save!\n end\n else\n save!\n end\n end", "def need_update?\n return true unless @lastread\n @lastread < File::stat(@path).mtime\n end", "def updated?() updated.present?; end", "def updated?(file_handle)\n c_stat = File.stat @file\n if (c_stat.size == @size) && (c_stat.mtime.to_i == @mtime.to_i) && (! @init_stat)\n Snoopit.logger.debug 'FileTracker.updated? file has not changed: ' + @file\n updated = false\n elsif c_stat.size < @size\n Snoopit.logger.debug 'FileTracker.updated? file size is smaller it is a new new file: ' + @file\n updated = new_file? file_handle, c_stat\n elsif (c_stat.size == @size) && (! @mtime.nil?) && (c_stat.mtime.to_i > @mtime.to_i)\n Snoopit.logger.debug 'FileTracker.updated? file size is same but file time is newer it is a new file: ' + @file\n updated = new_file? file_handle, c_stat\n else\n Snoopit.logger.debug 'FileTracker.updated? reading from last read location: ' + @file\n updated = read_from_last? file_handle, c_stat\n end\n @init_stat = false\n updated\n end", "def mysql\n \n fileSize=File.stat(MYSQL_LOG_PATH).size \n range=0\n \n while true\n if File.stat(MYSQL_LOG_PATH).size>fileSize.to_i\n range=(File.stat(MYSQL_LOG_PATH).size.to_f/fileSize.to_f).to_f unless fileSize==0\n puts \"File size is increased by #{range ? range : fileSize}\"\n \n fileSize=File.stat(MYSQL_LOG_PATH).size\n if range.to_f>0.5\n #update database with warning messsage\n puts \"update database with warning messsage\"\n else\n #update database with info message\n puts \"update database with info message\"\n end\n range=0.0\n else\n puts \"File size is stable\"\n end\n sleep(5)\n end\n end", "def updated?\n !ignore? && !removed? && mtime != File.mtime(path)\n end", "def process db\n #verify if table exists\n table = EMMConfig[\"DB_TABLE_#{$opts[:table]}\"]\n sql=\"UPDATE #{table} SET processed=1 WHERE file_name IN \"\n sql << \"(\" << $files.map{ |k| \"'#{File.basename(k)}'\" }.join(',') << \");\"\n puts sql if $opts[:v]\n db.query(sql)\nend", "def file_changed?(file)\n file_new?(file) || File.mtime(file) > MTIMES[file]\n end", "def mongrel\n \n fileSize=File.stat(MONGREL_LOG_PATH).size \n range=0\n while true\n if File.stat(MONGREL_LOG_PATH).size>fileSize.to_i\n range=(File.stat(MONGREL_LOG_PATH).size.to_f/fileSize.to_f).to_f unless fileSize==0\n puts \"File size is increased by #{range ? range : fileSize}\"\n \n fileSize=File.stat(MONGREL_LOG_PATH).size\n if range.to_f>0.5\n #update database with warning messsage\n puts \"update database with warning messsage\"\n else\n #update database with info message\n puts \"update database with info message\"\n end\n range=0.0\n else\n puts \"File size is stable\"\n end\n sleep(5)\n end\n end", "def update\n @file_version = FileVersion.find(params[:id])\n params[:versioned_file_id] = @file_version.versioned_file_id\n if update_versioned_files? \n if @file_version.update(:isActive => true)\n head :no_content\n else\n render json: @file_version.errors, status: :unprocessable_entity\n end \n else \n render json: @file_version.errors, status: :unprocessable_entity\n end\n end", "def updateDevfile(f, commit) #:doc:\n \n dev_file = nil\n \n begin\n # Checks if there is any changes in files.\n f_filedate = DateTime.strptime(f['filedate'], \"%T %F\")\n f_filedate = f_filedate.strftime('%F %T').to_s \n \n now = DateTime.now.strftime('%F %T')\nputs \"name: #{f['name']}\"\nputs \"path: #{f['path']}\"\n puts \"Finding devfile..\"\n dev_file = @device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", f['name'], f['path']])\n if dev_file != nil\n puts \"devfile found: \" + dev_file.id.to_s\n else\n puts \"Devfile not found\"\n raise Exception.new(\"Devfile not found. Can not update it!\")\n end\n \n \n blob = dev_file.blobs.find_by_blob_hash_and_devfile_id(f['blob_hash'], dev_file.id)\n if blob != nil\n puts \"Blob already exists!\"\n puts \"Blob: \" + blob.id.to_s\n return\n else\n puts \"Blob was not found!\"\n end\n \n # Finds the blob that is newest one\n previous_blob_id = nil\n current_blob = dev_file.blobs.find_by_id(dev_file.blob_id)\n if current_blob != nil\n previous_blob_id = current_blob.id.to_s\n puts \"Current blob: \" + current_blob.id.to_s\n \n end\n \n # If the blob, didn't exist yet, creates it. Ensures that blob will have version number.\n if blob == nil #or current_blob == nil\n version = 0\n if current_blob != nil\n version = current_blob.version + 1\n end\n \n puts \"Creates new blob, verion num: \" + version.to_s\n sql = \"insert into blobs(blob_hash, created_at, updated_at, size, filedate, uploaded, version, devfile_id, predecessor_id, latitude, longitude) values('#{f['blob_hash']}', '#{now}', '#{now}', '#{f['size']}', '#{f_filedate}', '0', '#{version}', '#{dev_file.id}', '#{previous_blob_id}', '#{@commit_location['latitude']}', '#{@commit_location['longitude']}');\"\n ActiveRecord::Base.connection.execute(sql)\n end\n \n puts \"Finding the newly created blob..\"\n blob = dev_file.blobs.find_by_blob_hash(f['blob_hash'])\n puts \" found blob: \" + blob.id.to_s\n \n current_blob.update_attribute(:follower_id, blob.id)\n \n puts \"Updating devfile\"\n # Updates changes in devfile (current blob)\n sql = \"update devfiles set filetype = '#{f['filetype']}', latitude = '#{f['latitude']}', longitude = '#{f['longitude']}', blob_id = '#{blob.id.to_s}', updated_at = '#{now}' where name = '#{f['name']}' and path = '#{f['path']}' and device_id = #{@device.id};\"\n puts \" SQL: \" + sql.background(:red)\n ActiveRecord::Base.connection.execute(sql)\n \n BlobsInCommit.find_or_create_by_blob_id_and_commit_id(blob.id, commit.id)\n \n \n #checkForObservers(dev_file)\n \n rescue => e\n puts \"Errors in updating file\" + e\n raise e\n end\n \n puts \"devfile updated!\"\n return dev_file\n end", "def update(uploaded_file)\n super\n record.save(raise_on_failure: true)\n end", "def file_sent( proposal, filename )\n table_name, file_field, err_field, time_field = table_and_attribute_names\n unless table_name.blank? || file_field.blank? || err_field.blank?\n time_upd = time_field.blank? ? '' : \", #{time_field} = '#{Time.now}'\"\n upd = \"UPDATE #{table_name} SET #{file_field} = '#{filename}', #{err_field} = NULL#{time_upd} WHERE id = #{proposal.record_id}\"\n ActiveRecord::Base.connection.execute(upd)\n end\n end", "def has_changes?\n @has_changed_the_db\n end", "def check_db_version(full_account_log_file)\n # this will check to see what user_version of the acounting sqlite database that is now present\n # if it detects an older version it will upgrade it to the new version\n if !File.exist?(full_account_log_file)\n return\n end\n puts \"acc_log #{full_account_log_file}\"\n db = SQLite3::Database.open full_account_log_file\n result = db.execute(\"PRAGMA user_version;\")\n #puts \"#{result[0][0]}\"\n if result[0][0] == 0\n puts \"old version of account db detected will upgrade to version 1 from 0\" \n result = db.execute(\"ALTER TABLE Configs ADD COLUMN Chip_Mult REAL;\") \n result = db.execute(\"ALTER TABLE Configs ADD COLUMN Stellar TEXT;\")\n result = db.execute(\"ALTER TABLE Configs ADD COLUMN Audio TEXT;\")\n result = db.execute(\"ALTER TABLE Configs ADD COLUMN Loop_Time INT;\")\n result = db.execute(\"ALTER TABLE Configs ADD COLUMN Mode INT;\")\n result = db.execute(\"UPDATE Configs SET Chip_Mult = '1'\")\n result = db.execute(\"UPDATE Configs SET Stellar = 'Enable'\")\n result = db.execute(\"UPDATE Configs SET Audio = 'Disable'\")\n result = db.execute(\"UPDATE Configs SET Loop_Time = '2'\")\n result = db.execute(\"UPDATE Configs SET Mode = 'Standard'\")\n result = db.execute(\"PRAGMA user_version = 1;\") \n else\n puts \"new accounting version checked ok with version #{result[0][0]}\"\n #result = db.execute(\"PRAGMA user_version = '0';\")\n end\nend", "def updated?\n command.success?\n end", "def update!\n write_to_disk ? true : false\n end", "def source_file_up_to_date?\n return false unless compilation_context.incremental_build?\n\n source_db = compilation_context.source_file_database\n source_db.up_to_date?(source_path)\n end", "def check_new\n if File.exist?(@new_file_path)\n #TODO: error properly\n abort\n end\n end", "def check_for_file\n @ff.check_for_file \n end", "def execute_if_updated\n if updated?\n execute\n true\n else\n false\n end\n end", "def update(uploaded_file)\n super\n record.save_changes(validate: false)\n end", "def update\n\t\treturn true\n\tend", "def update_file_size(file_id, file_size)\n $db.execute(\"UPDATE files SET file_size = ? WHERE file_id = ?\", file_size, file_id)\nend", "def update_failed?\n @update_failed\n end", "def save_version?\n\t\t\t \t\tchanged?\n\t\t\t \tend", "def automatic_update_check_allowed?\n check_path = directory.join(\"box_update_check\")\n if check_path.exist?\n last_check_span = Time.now.to_i - check_path.mtime.to_i\n if last_check_span < BOX_UPDATE_CHECK_INTERVAL\n @logger.info(\"box update check is under the interval threshold\")\n return false\n end\n end\n FileUtils.touch(check_path)\n true\n end", "def updated_source_file?; end", "def change?(file)\n @file != file\n end", "def update\n true\n end", "def update\n\t\tfalse\n\tend", "def destination_file_up_to_date?\n return false unless compilation_context.incremental_build?\n\n source_db = compilation_context.source_file_database\n target_db = compilation_context.target_file_database\n\n destination_file_exist? && # destination file must exist\n target_db.up_to_date?(source_path) && # source file must be up-to-date from last build of this target\n source_db.file_stat_for(source_path) == target_db.file_stat_for(source_path)\n end", "def save\n ensure_file_open!\n @file.commit\n true\n end", "def update?\n true\n end", "def update_db\n\n db = Sequel.sqlite(dbfilename)\n @db_update_data.each do |key,value|\n md5sum = {:md5sum => key}\n file_tupel = md5sum.merge(value)\n db[:pdfmd_documents].insert_conflict(:replace).insert(file_tupel)\n end\n\n end", "def is_up?\n\t\tFile.exists?(@file)\n\tend", "def check_for_changes\n\t\t\t# Check on disk changes\n\t\t\tunless @disks[0][:changes] == false\n\t\t\t\t\t$log.info \"Cachefile changed by user. Honoring changes.\"\n\t\t\t\t\t@disks[0][:changes] = false\n\t\t\t\t\twrite_disk_cache\n\t\t\t\t\treturn true\n\t\t\tend\n\t\t\treturn false\n\t\tend", "def save_version?\n version_condition_met? && altered?\n end", "def verify_file_changes_for\n @user = User.find(params[:id])\n if ModelInstanceUpdater.transfer_tags params\n flash.notice = \"Files were successfully updated.\"\n @user.data = []\n @user.save\n redirect_to user_path(@user)\n else\n flash.notice = \"Invalid operation: attempted to transfer multiple files' data to one file \" +\n \"OR did not designate target for some files (make sure all pages are filled out).\"\n redirect_to view_file_changes_for_user_path(@user)\n end\n end", "def update\n version_event = false\n\n if params.has_key?(:revision) and params[:revision] != @generic_file.content.latest_version.versionID\n revision = @generic_file.content.get_version(params[:revision])\n @generic_file.add_file_datastream(revision.content, :dsid => 'content')\n version_event = true\n begin\n Resque.enqueue(ContentRestoredVersionEventJob, @generic_file.pid, current_user.user_key, params[:revision])\n rescue Redis::CannotConnectError\n logger.error \"Redis is down!\"\n end\n end\n\n if params.has_key?(:filedata)\n return unless virus_check(params[:filedata]) == 0\n add_posted_blob_to_asset(@generic_file, params[:filedata])\n version_event = true\n begin\n Resque.enqueue(ContentNewVersionEventJob, @generic_file.pid, current_user.user_key)\n rescue Redis::CannotConnectError\n logger.error \"Redis is down!\"\n end\n end\n @generic_file.update_attributes(params[:generic_file].reject { |k,v| %w{ Filedata Filename revision part_of date_modified date_uploaded format }.include? k})\n @generic_file.set_visibility(params)\n @generic_file.date_modified = Time.now.ctime\n @generic_file.save\n # do not trigger an update event if a version event has already been triggered\n begin\n Resque.enqueue(ContentUpdateEventJob, @generic_file.pid, current_user.user_key) unless version_event\n rescue Redis::CannotConnectError\n logger.error \"Redis is down!\"\n end\n record_version_committer(@generic_file, current_user)\n redirect_to sufia.edit_generic_file_path(:tab => params[:redirect_tab]), :notice => render_to_string(:partial=>'generic_files/asset_updated_flash', :locals => { :generic_file => @generic_file })\n\n end", "def updated?\n false\n end", "def check_data\n if MissouriDatum.last.new_file\n @downloads.each_with_index do |download, index|\n obj = s3.bucket('missouridata').object(\"new/#{file_names[index]}\")\n @file_status = \"new\"\n puts \"new file\"\n upload(obj, download)\n end\n else \n downloads.each_with_index do |download, index|\n obj = s3.bucket('missouridata').object(\"same/#{file_names[index]}\")\n @file_status = \"same\"\n puts \"same file\"\n upload(obj, download)\n end\n end \n end", "def check_db_changes\n partist = DBClasses::Artist.new.ref_load(self.artist.rartist)\n precord = DBClasses::Record.new.ref_load(self.record.rrecord)\n psegment = DBClasses::Segment.new.ref_load(self.segment.rsegment)\n ptrack = DBClasses::Track.new.ref_load(self.track.rtrack)\n\n\n end", "def record_updated(record)\n return unless geo_file?(record)\n publish_message(\n message(\"UPDATED\", record)\n )\n end", "def has_changes?\r\n @source_files.size > 0\r\n end", "def have_you_updated_changelog?\n if changelog_changes?\n true\n elsif file_changes?\n warn_update_changelog\n false\n else\n true\n end\n end", "def locate_updatedb?\n if @updatedb\n true\n else\n false\n end\n end", "def modified?(file)\n @mutex.synchronize do\n @data[file.to_s].modified?(file)\n end\n end", "def update_last_access(file_id, time)\n $db.execute(\"UPDATE files SET last_access_date = ? WHERE file_id = ?\", time, file_id)\nend", "def test_05b\r\n db = build\r\n nm = db.fetch 'image-1.jpg',:width => 102 # Autogenerate\r\n t1 = File.new(nm).mtime\r\n nm2 = db.fetch 'image-1.jpg',:width => 103 # Autogenerate\r\n t2 = File.new(nm2).mtime\r\n Kernel.sleep 1\r\n db.update 'image-1.jpg' # Update everything.\r\n assert_not_equal t1,File.new(nm).mtime\r\n assert_not_equal t2,File.new(nm2).mtime\r\n end", "def changed?\n render unless result\n if exist?\n File.read(output) != result\n else\n true\n end\n end", "def isStale?(file, old_files)\n\t\treturn true unless File.exist?(file)\n\t\tnew_time = File.mtime(file)\n\t\told_files.each do |old|\n\t\t\tif File.exist?(old)\n\t\t\t\t#debug \"New Time: #{new_time}\"\n\t\t\t\t#debug \"Old Time: #{File.mtime(old)}\"\n\t\t\t\treturn true if new_time < File.mtime(old)\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend", "def update_file_content(new_content)\n return false if new_content.nil?\n self.file_content = new_content\n return self.save\n end", "def updated_file_only=(flag)\r\n @conf[:update] = flag\r\n end", "def handle_silent_modification_failure?\n false\n end", "def test_05a\r\n db = build\r\n nm = db.fetch 'image-1.jpg',:width => 102 # Autogenerate\r\n t1 = File.new(nm).mtime\r\n Kernel.sleep 1\r\n nm = db.update 'image-1.jpg',:width => 102 \r\n t2 = File.new(nm).mtime\r\n assert_not_equal t1,t2\r\n end", "def file_name_exist(file_name, owner_id)\n if $db.execute(\"SELECT file_name FROM files WHERE file_name = ? AND owner_id = ?\", file_name, owner_id) == []\n return false\n else\n return true\n end\nend", "def update(_show_output)\n @check_existing_files_for_update = true\n begin\n preheat_existing_files\n ensure\n @check_existing_files_for_update = false\n end\n []\n end", "def update_file_content(new_content)\n return false if new_content.nil?\n self.file_content = new_content\n self.save\n end", "def update_file_content(new_content)\n return false if new_content.nil?\n self.file_content = new_content\n self.save\n end", "def persisted?\n db_file && db_file.file?\n end", "def dirty?\n return true unless test(?e, destination)\n @mtime > ::File.mtime(destination)\n end", "def image_file_changed?\n raise 'please override image_file_changed?'\n end", "def check_for_update(component=:vp)\n\t\tupdated=false\n\t\tself.log \"Checking for newer version of #{UPDATE_INFO[component][:fn]}....\"\n\t\tbegin\n\t\t\tcurrent_version = Net::HTTP.get_response(UPDATE_INFO[component][:curr_version]).body.to_f\n\t\t\tif current_version==0.0\n\t\t\t\tself.log \"Error: Unable to fetch number of current version\"\n\t\t\t\t# we check != rather than > bc w cvs versions, 1.2 comes before 1.11\n\t\t\t\t# assumption is that the webpage will always have the version we want\n\t\t\t\t# to run\n\t\t\telsif current_version!=UPDATE_INFO[component][:version]\n\t\t\t\tself.log \"Upgrading from #{UPDATE_INFO[component][:version]} to #{current_version}\"\n\t\t\t\tcode = Net::HTTP.get_response(UPDATE_INFO[component][:curr_source]).body\n\t\t\t\tself.log \"Preparing to write version #{current_version}\"\n\t\t\t\tFile.open(UPDATE_INFO[component][:fn], File::CREAT|File::TRUNC|File::WRONLY, 0755){|f|\n\t\t\t\t\tf.puts code\n\t\t\t\t}\n\t\t\t\tself.log \"Wrote version #{current_version}\"\n\t\t\t\tload(UPDATE_INFO[component][:fn])\n\t\t\t\tupdated=true\n\t\t\t\tUPDATE_INFO[component][:version]=current_version\n\t\t\t\tself.log \"Upgraded to version #{UPDATE_INFO[component][:version]}\"\n\t\t\t\t\t# sleep 10 to give this one a chance to shut down - only\n\t\t\t\t\t# one can run at a time\n\t\t\t\t\t# Kernel::system(\"sudo /usr/sbin/atd; echo \\\"sleep 10; ./vantage_point.rb 1>> #{$LOG_FILE} 2>&1 \\\"|at now\")\n\t\t\t\t\t# self.log \"Shutting down for upgrade to version #{current_version}\"\n\t\t\t\t\t# sleep 2\n\t\t\t\t\t# self.shutdown($UPGRADE_RESTART)\n\t\t\telse\n\t\t\t\tself.log \"No upgrade available from #{UPDATE_INFO[component][:version]}\"\n\t\t\tend\n\t\trescue Exception\n\t\t\tself.log \"Unable to check for update: #{$!.class}: #{$!.to_s}\\n#{$!.backtrace.join(\"\\n\")}\"\n\t\tend\n\t\treturn updated\n\tend", "def redis_master_file_changed?\n @last_time_master_file_changed != File.mtime(@config.redis_server)\n end", "def has_run?(filename)\n if @db.schema_schema_evolution_manager_exists?\n query = \"select count(*) from %s.%s where filename = '%s'\" % [Db.schema_name, @table_name, filename]\n @db.psql_command(query).to_i > 0\n else\n false\n end\n end", "def check_rules_on_update\n logger.debug \"Running UPDATE checks for #{name}\"\n\n db.query(\"SELECT * FROM #{audit} WHERE `_has_delta` = 1\").each do |audit_row|\n pkey = audit_row.select { |k,v| primary_key.include?(k) }\n logger.debug \"Checking row: #{pkey}\"\n\n watched_row_query = \"SELECT * FROM #{watched} WHERE #{condition_from_hashes(pkey)}\"\n watched_row = db.query(watched_row_query).first\n\n # If we do not have a matched row here it'll show in the deletion checks, so we\n # do nothing specific here\n if watched_row\n fields.each do |f|\n violations = f.on_update(audit_row, watched_row)\n violations.compact.each { |v| record_violation(v[:description], audit_row, v[:rule_name], audit_row['_last_version'], f.name) }\n end\n\n rules[:update].each do |rule|\n v = rule.execute(audit_row, watched_row, self)\n record_violation(v, [watched_row, audit_row], rule.name, audit_row['_last_version']) if v\n end\n end\n end\n end", "def check_and_update\n if File.mtime(@song_path) > @start_time\n content = File.read(@song_path)\n ITuneHelper.notify \"Setting lyrics for #{@track.name} into track\"\n if content.strip == \"\"\n clear_lyric\n else\n set_lyric(content)\n show_in_browser(@song_path)\n end\n @start_time = File.mtime(@song_path)\n end\n true\n end", "def update_files\n PhrasingPhrase.transaction do\n # 1) Get file contents as keys and values\n keys_and_values = yml_to_keys_and_values\n old_version_keys_and_values = keys_and_values.clone\n\n # 2) Update all translated values in keys_and_values\n puts \"Updating..\"\n phrasing_phrases.each do |phrase|\n print \".\"\n next if phrase.key == phrase.value\n\n @word_counter.update(keys_and_values[\"#{phrase.locale}.#{phrase.key}\"], phrase.yml_value)\n\n keys_and_values[\"#{phrase.locale}.#{phrase.key}\"] = phrase.yml_value\n end\n\n # 3) Update keys_and_values to same yml file\n if @word_counter.has_change?\n # Create last version file entry in releases\n create_to_recent_version_entry_for(old_version_keys_and_values)\n # Update root file to new version\n update_as_next_root_version(keys_and_values)\n end\n\n # 4) Delete All Database Records for lang\n # phrasing_phrases.delete_all\n\n display_word_count\n\n # Return true for successfull execution\n return @word_counter.has_change?\n end\n end", "def already_stored?\n !file_uniqueness\n end", "def update(sender)\n puts \"update was cllaed\"\n pattern=Regexp.new(sender.stringValue)\n filter_files(pattern)\n rescue\n filter_files(nil)\n end", "def update?\n @update\n end", "def validate_on_update # :doc:\n end", "def file_ok?(item = nil)\n status_ok?(item, column: :file_status)\n end", "def update_found(feed, latest_db_post)\n if latest_db_post.nil?\n Log.log.debug \"Latest Post date is nil, table is empty. Performing initial update\"\n return true\n end\n last_blog_update = feed.updated.content\n Log.log.debug \"last_blog_update: #{last_blog_update}\"\n Log.log.debug \"latest_db_post: #{latest_db_post}\" \n if last_blog_update > latest_db_post\n Log.log.debug \"Updates Detected\"\n return true\n else\n Log.log.debug \"No updates found\"\n return false\n end\nend", "def verify_existing_release_metadata\n return false if existing_files.empty?\n msg \"Verifying cached release metadata\"\n @invalid_metadata_files = existing_files.select {|f| !f.quick_verify}\n msg \"invalid_metadata_files: #{@invalid_metadata_files.size}\"\n end", "def update_available?()\n update_info != \"\"\n end", "def new_file?(file_handle, stat)\n # seek to 0\n Snoopit.logger.debug 'FileTracker.updated? file new read from start of file: ' + @file\n @offset = 0\n @size = stat.size\n @mtime = stat.mtime\n @last_line = nil\n file_handle.seek 0, IO::SEEK_SET\n true\n end", "def changed?(file_stats)\n not (file_stats.size == size and file_stats.mtime.utc == modification_time.utc)\n end", "def check_version(model, version, client_id, results)\n object = model.find_by_remote_id(version['id'])\n # if the data object already exists on the server\n if object\n # is the update obsolete? -> discard it\n if object.remote_version.obsoletes? version['version'], client_id\n false\n # does the update conflict? -> report it\n elsif object.remote_version.supersedes? version['version']\n add_update_for(object, results)\n false\n # else -> persist the update!\n else\n [true, object]\n end\n # apparently the data object does not (yet) exist in the master copy\n else\n true\n end\n end", "def verify_hash_action_notify( file )\n hash = @hasher.generate_hash( file )\n res = @dbase.search_hashes( file ) \n\n unless hash.to_s.eql?( res[\"hash\"] ) \n \n puts \"Host:\\t\\t#{res[\"host\"]}\"\n puts \"File:\\t\\t#{file}\"\n puts \"Database date:\\t#{res[\"date\"]}\"\n puts \"Current date:\\t#{Time.now}\"\n puts \"Old hash:\\t#{res[\"algo\"]},\\t#{res[\"hash\"]}\"\n puts \"New hash:\\t#{@hasher.algo},\\t#{hash.to_s}\"\n puts \"\"\n \n end\nend", "def file_uploaded_now?(item = nil)\n item ||= default_to_self\n item.reload if item.is_a?(ActiveRecord::Base)\n file_uploaded?(item)\n end", "def is_new?\n !File.exists? @filename\n end", "def save\n !update_case.has_key?(\"error\")\n end", "def checkforChange(filepath)\n size1 = File.size(filepath)\n sleep 5\n size2 = File.size(filepath)\n if size1 == size2\n 0\n else\n 1\n end\nend" ]
[ "0.7424319", "0.6938043", "0.6933724", "0.68207365", "0.6784457", "0.6688145", "0.66833335", "0.65170157", "0.6513125", "0.6511205", "0.6504571", "0.65002894", "0.64989567", "0.64021623", "0.63641363", "0.63622504", "0.6283345", "0.6265417", "0.62490267", "0.6243863", "0.6227854", "0.6211197", "0.6202899", "0.6179519", "0.61678123", "0.61345905", "0.6124644", "0.6124158", "0.6118381", "0.61128813", "0.6084272", "0.60839605", "0.6056885", "0.605425", "0.6026689", "0.60230327", "0.60165334", "0.6012812", "0.60000265", "0.59951264", "0.5984028", "0.5983591", "0.5983508", "0.5977544", "0.5965807", "0.59371626", "0.59289515", "0.59145975", "0.59109193", "0.59064096", "0.59002066", "0.58981305", "0.5885379", "0.5874469", "0.58736414", "0.58719254", "0.5839527", "0.58345896", "0.58213407", "0.5817007", "0.5808766", "0.5801414", "0.57933867", "0.5789485", "0.5789413", "0.5775791", "0.5775471", "0.5774893", "0.5770281", "0.5768667", "0.57516116", "0.57342565", "0.5723893", "0.57221603", "0.57221603", "0.5712358", "0.5707583", "0.5707424", "0.5705695", "0.57025653", "0.5701496", "0.5692065", "0.568938", "0.568927", "0.5687796", "0.5683622", "0.56647116", "0.5662134", "0.56597704", "0.56494534", "0.5647708", "0.56384754", "0.5637368", "0.5635726", "0.5633464", "0.5633099", "0.5632465", "0.56310457", "0.56203216", "0.5611224" ]
0.6363366
15
overwrite to_s to display
def to_s "ID: #{@id}\nFirst Name: #{@first_name}\nLast Name: #{@last_name}\nEmail: #{@email}\nNotes: #{@note}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s(*) end", "def to_s(*) end", "def to_s(*) end", "def to_s\n to_text\n end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s() end", "def to_s ; format ; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s; end", "def to_s\n @to_s ||= format(to_h)\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n super\n end", "def to_s\n\tend", "def to_s\n super\n end", "def to_s\n Formatter::ToString.format(self)\n end", "def to_s\n \n end", "def to_s\n\t\tsuper\n\tend", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end", "def to_s\n end" ]
[ "0.8051406", "0.8051406", "0.8051406", "0.80350894", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8019739", "0.8015104", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7963067", "0.7919518", "0.78237635", "0.78237635", "0.78237635", "0.78237635", "0.7777134", "0.7701261", "0.7689988", "0.76704293", "0.7659013", "0.7632889", "0.7628209", "0.7628209", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691", "0.7619691" ]
0.0
-1
Invoked with the form parameters when this extension point is created from a configuration screen.
def initialize(attrs = {}) @appspider_url = attrs['appspider_url'] @username = attrs['username'] @password = attrs['password'] @config_name = attrs['config_name'] @startscan = attrs['startscan'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def form_setup\n\tend", "def initialize config={}, &block\n @config = config\n\n\n widget_shortcuts_init\n @variables = {}\n # if we are creating child objects then we will not use outer form. this object will manage\n #@current_object = [] # 2014-08-29 - 17:35 unused\n @_system_commands = %w{ bind_global bind_component field_help_text }\n\n init_vars\n $log.debug \"XXX APP CONFIG: #{@config} \" if $log.debug? \n run &block\n end", "def configure_field\n end", "def initialize form, config={}, &block\n \n @text = config.fetch(:text, \"NOTFOUND\")\n @editable = false\n @focusable = false\n # we have some processing for when a form is attached, registering a hotkey\n register_events :FORM_ATTACHED\n super\n @justify ||= :left\n @name ||= @text\n @repaint_required = true\n end", "def build_line_config_form(line_config,action,caption,is_edit = nil,is_create_retry = nil)\n#\t--------------------------------------------------------------------------------------------------\n#\tDefine a set of observers for each composite foreign key- in effect an observer per combo involved\n#\tin a composite foreign key\n#\t--------------------------------------------------------------------------------------------------\n\tsession[:line_config_form]= Hash.new\n#\t---------------------------------\n#\t Define fields to build form from\n#\t---------------------------------\n\t field_configs = Array.new\n\tfield_configs[0] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'line_config_code'}\n\n\tbuild_form(line_config,field_configs,action,'line_config',caption,is_edit)\n\nend", "def configure_field\n end", "def setup(*)\n # Used to be in an after_add, updated for apotomo 1.2.\n self.respond_to_event :form_submitted, :from => self.name\n self.respond_to_event :revert, :from => self.name\n self.respond_to_event :display_form, :from => self.name\n\n self.where = nil\n self.dom_id = options[:dom_id]\n self.grid_options = {}\n # Guesses that you will use the resource name for the form template.\n self.form_template = options[:resource]\n # Assume that the form is not a multipart (uploader) form\n self.multipart_form = false\n # The orphan template is used when a parent record is needed but not selected\n self.orphan_template = 'orphan'\n # Ensure that we always have a record of some sort\n self.record = resource_model.new\n # Set the name of this resource for public display\n self.human_resource = options[:resource].humanize\n # Set the spokesfield to nil, this needs to be set explicitly\n self.spokesfield = nil\n \n @columns = []\n @sortable_columns = {}\n @default_sort = nil \n\n @filters = {}\n @filter_sequence = []\n @filter_default = {}\n \n @flash_widget = self.dom_id + '_flash'\n self << widget(:grid_flash, @flash_widget)\n \n if options[:form_only]\n @list_widget = nil\n @filters_widget = nil\n self.form_buttons = [\n ['remain', 'Save', 'Add'],\n ]\n else\n @list_widget = self.dom_id + '_list'\n @filters_widget = self.dom_id + '_filters'\n self << widget(:grid_list, @list_widget) do |lw|\n lw << widget(:grid_filters, @filters_widget)\n end\n \n self.form_buttons = [\n ['submit', 'Save+Close', 'Add+Close'],\n ['remain', 'Save', 'Add'],\n ['cancel', 'Cancel', 'Cancel'],\n ]\n end\n end", "def configuration\n HungryForm.configuration.send(self.class.name.demodulize.underscore)\n end", "def configure_form(var_oid, use_format, form_field_name, form_field_oid, form_field_label)\n wait_for_add_new\n add_new.click\n wait_for_variable_oid\n variable_oid.set var_oid\n format.set use_format\n field_name.set form_field_name\n field_oid.set form_field_oid\n label.set form_field_label\n save_form.first.click\n end", "def injection_form\n # Nothing to do here\n end", "def fill_customization_director\n end", "def set_new_form_information\n @information[:subtitle] = t('view.permissions.new_title')\n @information[:form_url] = [@parent, 'permissions', no_firm: @no_firm]\n end", "def start\n patch_shoes_app_for_gui!\n $gui_config = config # Use globals so that I have access to\n\n puts \"env: #{$environment}\"\n dev {\n event('setting config to defaults') {\n $gui_config.load_configuration DefaultConfig\n }\n }\n\n puts (Shoes.methods.sort - Object.methods).inspect\n puts Shoes.constants.sort.inspect\n puts (Shoes::Dialog.methods.sort - Object.methods).inspect\n puts Shoes::Dialog.constants.sort.inspect\n puts Shoes::Dialog::CONFIG_PATH\n puts (Shoes::Title.methods.sort - Object.methods).inspect\n puts Shoes::Title.constants.sort.inspect\n\n Shoes.app($gui_config.app) {\n flow($gui_config.main_flow) {\n stack($gui_config.main_stack) {\n caption 'Barcode Identification Terminal'\n\n flow($gui_config.id_field_box) {\n inscription 'ID #: '\n self.id_field = edit_line($gui_config.id_field) { editline_changed }\n self.load_indicator = inscription('')\n }\n\n flow($gui_config.response_box) {\n stack($gui_config.person_details_box) {\n flow{\n inscription('Name:')\n self.person_name = inscription ''\n }\n }\n image 'gui/shoes/action_check.png', :width => 60, :height => 60\n# image 'gui/shoes/action_delete.png', :width => 60, :height => 60\n }\n\n flow($gui_config.note_box_box) {\n inscription('Bulletin Messages:')\n self.note_box = edit_box($gui_config.note_box)\n self.note_box.text = 'Invalid ID'\n }\n }\n }\n self.name = 'test'\n puts (self.methods.sort - Object.methods).inspect\n focus_on_edit_line # TODO: not working\n }\n\n dev { event('saving gui config') { $gui_config.save } }\n end", "def setup_form\n build_form\n super\n end", "def initialize(*)\n super\n model.plugin :forme\n @params_name = model.new.forme_namespace\n end", "def form; end", "def set_edit_form_information\n @information[:subtitle] = t('view.permissions.edit_title')\n @information[:form_url] = [@parent, 'permission', no_firm: @no_firm]\n end", "def extension_dialog\n @parameters = {}\n\n @experiment.parameters.flatten.each do |parameter_uid|\n parameter_doc = @experiment.get_parameter_doc(parameter_uid)\n next if parameter_doc['with_default_value'] # it means this parameter has only one possible value - the default one\n parameter_info = {}\n parameter_info[:label] = @experiment.input_parameter_label_for(parameter_uid)\n parameter_info[:parametrizationType] = parameter_doc['parametrizationType']\n parameter_info[:in_doe] = parameter_doc['in_doe']\n parameter_info[:values] = @experiment.parameter_values_for(parameter_uid)\n\n @parameters[parameter_uid] = parameter_info\n end\n\n #Rails.logger.debug(\"Parameters: #{@parameters}\")\n\n render partial: 'extension_dialog'\n end", "def build_form\n super\n raise ActionController::RoutingError, 'Not Found' unless work_type_specified?\n @form.payload_concern = params[:payload_concern]\n end", "def initialize(*args)\n super\n @fields = []\n @buttons = []\n yield self if block_given? # invoke the configuration block\n end", "def set_form(easy)\n end", "def show_import_form\n end", "def setup_gui\n \n end", "def edit_config\n Log.add_info(request, params.inspect)\n\n if @login_user.admin?(User::AUTH_DESKTOP)\n @yaml = ApplicationHelper.get_config_yaml\n end\n\n @desktop = Desktop.get_for(@login_user)\n\n render(:layout => (!request.xhr?))\n end", "def ing_form; end", "def content_element_form_extension(context={})\n \n app = context[:app]\n \n locals = {:photo_album => SystemConfiguration::Variable.get('content_album_name').value, \n :width => SystemConfiguration::Variable.get('content_album_photo_width').value, \n :height => SystemConfiguration::Variable.get('content_album_photo_height').value}\n \n renderer = UIFieldSetRender::FieldSetRender.new('photo', app) \n photo_form_extension = renderer.render('formextension', 'em', locals)\n \n \n end", "def config\n options = @options.merge(:text => human_name)\n options.merge!(:menu => @menus.collect(&:config)) if @menus.size > 0\n options.merge!(:handler => \"function(){ Backend.app.load('#{url_for(@url.merge(:only_path => true))}') }\".to_l) if @url\n options\n end", "def configuration; end", "def configuration; end", "def configuration; end", "def configuration; end", "def configuration; end", "def forms; end", "def custom_fields\n if debug?\n channel_fields = ChannelFieldForm.new\n channel_fields.create_field(\n group_id: 1,\n type: 'Checkboxes',\n label: 'Checkboxes',\n fields: {\n field_list_items: \"Yes\\nNo\\nMaybe\"\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Radio Buttons',\n label: 'Radio Buttons',\n fields: {\n field_list_items: \"Left\\nCenter\\nRight\"\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Multi Select',\n label: 'Multi Select',\n fields: {\n field_list_items: \"Red\\nGreen\\nBlue\"\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Select Dropdown',\n label: 'Select Dropdown',\n fields: {\n field_list_items: \"Mac\\nWindows\\nLinux\"\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Select Dropdown',\n label: 'Prepopulated',\n fields: {\n field_pre_populate: 'y'\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Rich Text Editor',\n label: 'Rich Text Editor',\n fields: {\n field_ta_rows: 20,\n field_text_direction: 'Right to left'\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Toggle',\n label: 'Toggle'\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Text Input',\n label: 'Text Input',\n fields: {\n field_maxl: 100,\n field_fmt: 'None',\n field_show_fmt: 'y',\n field_text_direction: 'Right to left',\n field_content_type: 'Decimal',\n field_show_smileys: 'y',\n field_show_file_selector: 'y'\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'Textarea',\n label: 'Textarea',\n fields: {\n field_ta_rows: 20,\n field_fmt: 'None',\n field_show_fmt: 'y',\n field_text_direction: 'Right to left',\n field_show_formatting_btns: 'y',\n field_show_smileys: 'y',\n field_show_file_selector: 'y'\n }\n )\n channel_fields.create_field(\n group_id: 1,\n type: 'URL',\n label: 'URL Field',\n fields: {\n url_scheme_placeholder: '// (Protocol Relative URL)'\n }\n ) do |page|\n page.all('input[name=\"allowed_url_schemes[]\"]').each do |element|\n element.click unless element.checked?\n end\n end\n\n @page.load\n else\n $db.query(IO.read('channel_sets/custom-fields.sql'))\n clear_db_result\n end\n end", "def configure_information\n @config[\"config\"][\"contact\"] = {}\n if @args.empty?\n @config[\"config\"][\"organization_name\"] = @prompt.ask(prompt_box(\"What is your organization\\'s name?\"), required: true)\n @config[\"config\"][\"organization_description\"] = @prompt.ask(prompt_box(\"What is your organization\\'s description?\"))\n @config[\"config\"][\"organization_domain\"] = @prompt.ask(prompt_box(\"What is your organization\\'s custom URL that you would like to host the app at? (ex. demo.perlmutterapp.com) Leave blank to use the default instead.\"))\n prefs = @prompt.multi_select(prompt_box(\"Please select contact preferences to configure for your users to view:\"), %W[email phone facebook twitter instagram website])\n if prefs.count != 0\n @config[\"config\"][\"contact\"][\"description\"] = @prompt.ask(prompt_box(\"Enter a description for your contact page:\"), default: \"Fill out the form to send us a message!\", required: true)\n end\n if prefs.include? \"email\"\n @config[\"config\"][\"contact\"][\"email\"] = @prompt.ask(prompt_box(\"What is your contact email?\"), default: @config[\"config\"][\"contact\"][\"email\"], required: true) { |q| q.validate :email, \"Invalid email\" }\n end\n if prefs.include? \"phone\"\n @config[\"config\"][\"contact\"][\"phone\"] = @prompt.ask(prompt_box(\"What is your contact phone?\"), default: @config[\"config\"][\"contact\"][\"phone\"], required: true)\n end\n if prefs.include? \"facebook\"\n @config[\"config\"][\"contact\"][\"facebook\"] = @prompt.ask(prompt_box(\"What is your Facebook account?\"), default: @config[\"config\"][\"contact\"][\"facebook\"], required: true)\n end\n if prefs.include? \"twitter\"\n @config[\"config\"][\"contact\"][\"twitter\"] = @prompt.ask(prompt_box(\"What is your Twitter account?\"), default: @config[\"config\"][\"contact\"][\"twitter\"], required: true)\n end\n if prefs.include? \"instagram\"\n @config[\"config\"][\"contact\"][\"instagram\"] = @prompt.ask(prompt_box(\"What is your Instagram account?\"), default: @config[\"config\"][\"contact\"][\"instagram\"], required: true)\n end\n if prefs.include? \"website\"\n @config[\"config\"][\"contact\"][\"website\"] = @prompt.ask(prompt_box(\"What is your external website?\"), default: @config[\"config\"][\"contact\"][\"website\"], required: true)\n end\n else\n @config[\"config\"][\"organization_name\"] = get_argument_value(\"org_name\", true, nil)\n description = get_argument_value(\"org_desc\", false, nil)\n unless description.nil?\n @config[\"config\"][\"organization_description\"] = description\n end\n domain = get_argument_value(\"org_domain\", false, nil)\n unless domain.nil?\n @config[\"config\"][\"organization_domain\"] = domain\n end\n contact_description = get_argument_value(\"contact_desc\", false, nil)\n unless contact_description.nil?\n @config[\"config\"][\"contact\"][\"description\"] = contact_description\n end\n email = get_argument_value(\"org_email\", false, nil)\n unless email.nil?\n @config[\"config\"][\"contact\"][\"email\"] = email\n end\n phone = get_argument_value(\"org_phone\", false, nil)\n unless phone.nil?\n @config[\"config\"][\"contact\"][\"phone\"] = phone\n end\n facebook = get_argument_value(\"org_facebook\", false, nil)\n unless facebook.nil?\n @config[\"config\"][\"contact\"][\"facebook\"] = facebook\n end\n twitter = get_argument_value(\"org_twitter\", false, nil)\n unless twitter.nil?\n @config[\"config\"][\"contact\"][\"twitter\"] = twitter\n end\n instagram = get_argument_value(\"org_instagram\", false, nil)\n unless instagram.nil?\n @config[\"config\"][\"contact\"][\"instagram\"] = instagram\n end\n website = get_argument_value(\"org_website\", false, nil)\n unless website.nil?\n @config[\"config\"][\"contact\"][\"website\"] = website\n end\n end\n success_prompt(\"Organization details configured.\")\nend", "def before_show()\n $ENV = VR::load_yaml(SavableSettings, \"settings.yaml\")\n @builder[:window1].resize $ENV.width, $ENV.height\n refresh()\n end", "def form_params\n @form_params ||= FormParamsController.new config\n end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def hook_params\n params.permit(:name, :config, :events)\n end", "def settings\n frm.link(:text=>\"Settings\").click\n AssessmentSettings.new(@browser)\n end", "def set_form\n form = params[:form_txt] + \"_form\"\n @tab = params[:tab_id]\n form_hash_for_loan_details if !@loan_hash\n update_respond_to_parent(form,@tab,FLASH_MESSAGES['properties']['406'],nil)\n end", "def execute\n report_invalid_config_items\n begin\n AppConfig[:logger].info('Configuration Editor')\n\n # get the list of config fields\n fields = AppConfig.navigation.collect do |page|\n page.values.flatten.select do|field|\n AppConfig.data_type[field]\n end\n end.flatten.uniq.compact\n\n # edit the fields\n while(field = menu_select('field', fields))\n begin\n edit_field(field)\n rescue\n end\n end\n\n # save changes?\n if agree(\"Save? yes/no\") {|q| q.default = 'yes'}\n AppConfig.save\n end\n rescue\n end\n end", "def autofill_from_config\n self.pid ||= Config.credentials[:PID] if self.respond_to?(:pid=)\n self.pak ||= Config.credentials[:PAK] if self.respond_to?(:pak=)\n \n # Note: URLs are optional fields, but prefilling from config anyway\n self.cancel_url ||= Config.endpoints[:cancel] if self.respond_to?(:cancel_url=)\n self.success_url ||= Config.endpoints[:success] if self.respond_to?(:success_url=)\n self.failure_url ||= Config.endpoints[:failure] if self.respond_to?(:failure_url=)\n end", "def initialize(name, form)\n @name = name\n @form = form\n @fields = []\n\n fields = get_screen_config['fields']\n if [\"infrastructure\", \"monitoring\"].include?(@form.name)\n fields.each do |field|\n @fields << Field.new(field['name'], self, @form)\n end\n else\n field_class_name = \"#{form.product_name.capitalize}Field\"\n fields.each do |screen_field|\n @fields << Uhuru::BoshCommander.const_get(field_class_name).new(screen_field['name'], self, @form)\n end\n end\n\n end", "def fbo_updated_form\n end", "def build_default_screen\n# self.parent.set_cannot_cancel\n self.parent.set_cannot_undo\n field_configs = Array.new\n qty_pallets_required = @parent.qty_pallets_required.to_s\n output_value = \"scanned pallets: \" + @parent.qty_pallets_scanned.to_s + \" of \" + qty_pallets_required\n field_configs[field_configs.length] = {:type=>\"text_line\",:name=>\"qty_pallets_to_load\",:value=>output_value}\n field_configs[field_configs.length] = {:type=>\"text_box\",:name=>\"pallet_number\",:is_required=>\"true\"}\n field_configs[field_configs.length] = {:type=>\"text_box\",:name=>\"carton_number\",:is_required=>\"true\"}\n field_configs[field_configs.length] = {:type=>\"text_box\",:name=>\"qc_barcode\",:scan_only=>\"false\"}\n\n screen_attributes = {:auto_submit=>\"false\",:content_header_caption=>\"scan pallets\",:cache_screen=>true}\n buttons = {\"B3Label\"=>\"Clear\" ,\"B2Label\"=>\"Cancel\",\"B1Submit\"=>\"scan_pallet_submit\",\"B1Label\"=>\"submit\",\"B1Enable\"=>\"true\",\"B2Enable\"=>\"false\",\"B3Enable\"=>\"false\" }\n plugins = nil\n result_screen_def = PdtScreenDefinition.gen_screen_xml(field_configs,buttons,screen_attributes,plugins)\n\n return result_screen_def\n end", "def initialize(name, screen, form)\n @screen = screen\n @form = form\n @name = name\n @error = ''\n\n if get_data_type != TYPE_SEPARATOR && get_field_config[\"yml_key\"] == nil\n raise \"yml_key not found for field #{html_form_id}\"\n end\n end", "def setup\n allow_cors unless !ConcertoConfig[:public_concerto]\n @preview = params.has_key?(:preview) && params[:preview] == \"true\"\n begin\n @screen = Screen.find(params[:id])\n allow_screen_if_unsecured @screen\n auth! action: (@preview ? :preview : :display)\n rescue ActiveRecord::ActiveRecordError\n render json: {}, status: 404\n rescue CanCan::AccessDenied\n render json: {}, status: 403\n else\n # If we got the dimensions then keep them so we can indicate its orientation in the screen list.\n if params['width'].present? and params['height'].present? and !@preview\n height = params['height'].to_i rescue nil\n width = params['width'].to_i rescue nil\n @screen.update_columns(height: height, width: width)\n Rails.logger.debug(\"updated screen #{@screen.id} dimensions #{width}w x #{height} h\")\n end\n\n # field_configs = [] # Cache the field_configs\n @screen.run_callbacks(:frontend_display) do\n # Inject paths into fake attribute so they gets sent with the setup info.\n # Pretend that it's better not to change the format of the image, so we detect it's upload extension.\n if !@screen.template.media.preferred.first.nil?\n template_format = File.extname(@screen.template.media.preferred.first.file_name)[1..-1]\n @screen.template.path = frontend_screen_template_path(@screen, @screen.template, format: template_format)\n else\n template_format = nil\n @screen.template.path = nil\n end\n css_media = @screen.template.media.where({key: 'css'})\n if !css_media.empty?\n @screen.template.css_path = media_path(css_media.first)\n end\n @screen.template.positions.each do |p|\n p.field_contents_path = frontend_screen_field_contents_path(@screen, p.field, format: :json)\n p.field.config = {}\n FieldConfig.default.where(field_id: p.field_id).each do |d_fc|\n p.field.config[d_fc.key] = d_fc.value\n # field_configs << d_fc\n end\n @screen.field_configs.where(field_id: p.field_id).each do |fc|\n p.field.config[fc.key] = fc.value\n # field_configs << fc\n end\n # add how to handle when content cannot be loaded or has run out\n p.field.config['screens_clear_last_content'] = ConcertoConfig['screens_clear_last_content']\n end\n end\n\n frontend_cache_key = @screen.frontend_cache_key\n response.headers[\"X-Concerto-Frontend-Setup-Key\"] = frontend_cache_key\n\n @screen.time_zone = ActiveSupport::TimeZone::MAPPING[@screen.time_zone]\n if stale?(etag: frontend_cache_key, public: true)\n respond_to do |format|\n format.json {\n render json: @screen.to_json(\n only: [:name, :id, :time_zone, :locale],\n include: {\n template: {\n include: {\n positions: {\n except: [:created_at, :updated_at, :template_id, :field_id],\n methods: [:field_contents_path],\n include: {\n field: {\n methods: [:config],\n only: [:id, :name, :config]\n }\n }\n },\n },\n only: [:id, :name],\n methods: [:path, :css_path]\n }\n }\n )\n }\n end\n end\n\n unless @preview\n @screen.mark_updated\n end\n end\n end", "def help; @form.help_manager.display_help; end", "def setting; end", "def initialize(form_values, options)\n @form_values = form_values\n @form_args = options.dup\n @g = Gestalt.new\n end", "def custom_extension(context={}, element, aspect_model)\n\n app = context[:app]\n \n renderer = ::UI::FieldSetRender.new('location', app)\n renderer.render('viewextension','',{:element => element})\n \n end", "def new_wizard_selection\n init_variables_from_sessions\n end", "def initialize form=nil, config={}, &block\n @form = form\n @buffer = String.new\n #@type=config.fetch(\"type\", :varchar)\n @row = 0\n @col = 0\n @editable = true\n @focusable = true\n #@event_args = {} # arguments passed at time of binding, to use when firing event\n map_keys \n init_vars\n register_events(:CHANGE)\n super\n @width ||= 20\n @maxlen ||= @width\n end", "def create\n super\n show(PLACEMENT_SCREEN)\n end", "def configure_admin\n @config[\"config\"][\"admin\"] = {}\n if @args.empty?\n box(\"You will now need to input credentials for the admin user you would like to create.\")\n @config[\"config\"][\"admin\"][\"email\"] = @prompt.ask(prompt_box(\"What is your admin\\'s email?\"), default: @config[\"config\"][\"contact\"][\"email\"], required: true) { |q| q.validate :email, \"Invalid email\" }\n @config[\"config\"][\"admin\"][\"password\"] = @prompt.mask(prompt_box(\"What is your admin\\'s password?\"), required: true) { |q| q.validate /^.{6,}$/, \"Must be at least 6 characters\" }\n @config[\"config\"][\"admin\"][\"first_name\"] = @prompt.ask(prompt_box(\"What is your admin\\'s first name?\"), required: true)\n @config[\"config\"][\"admin\"][\"last_name\"] = @prompt.ask(prompt_box(\"What is your admin\\'s last name?\"), required: true)\n else\n @config[\"config\"][\"admin\"][\"email\"] = get_argument_value(\"admin_email\", true, nil)\n @config[\"config\"][\"admin\"][\"password\"] = get_argument_value(\"admin_password\", true, nil)\n @config[\"config\"][\"admin\"][\"first_name\"] = get_argument_value(\"admin_first_name\", false, \"Admin\")\n @config[\"config\"][\"admin\"][\"last_name\"] = get_argument_value(\"admin_last_name\", false, \"User\")\n end\n success_prompt(\"Admin user created.\")\nend", "def create\n super\n show PLACEMENT_SCREEN\n end", "def config\n\n end", "def landing_page_config_params\n params.require(:landing_page_config).permit(:header, :description, :fa_icon)\n end", "def addInputs(forms)\n forms.push( {\"description\"=>\"Config\",\n \"label\"=>\"Config\",\"name\"=>\"config\",\n \"property_inputs\"=>[{\"description\"=>\"Stack\",\"label\"=>\"Stack\",\"reference\"=>\".diego_cell\"+deploymentName+\".stack\"},\n {\"description\"=>\"Virtual IP\",\"label\"=>\"Virtual IP\",\"reference\"=>\".ha_proxy\"+deploymentName+\".keepalived_vip\"},\n {\"description\"=>\"Same Keepalived group share same virtual router ID \",\"label\"=>\"Virtual Router ID\",\"reference\"=>\".ha_proxy\"+deploymentName+\".keepalived_virtual_router_id\"}] });\nend", "def cfg_params\n params.require(:cfg).permit(:sale_tel, :email, :company_name, :address, :content)\n end", "def output(form_name, model, options = {})\n @model = model\n @disabled_on_update = options[:disabled_on_update] || []\n @disabled_on_create = options[:disabled_on_create] || []\n @hidden_on_update = options[:hidden_on_update] || []\n @hidden_on_create = options[:hidden_on_create] || []\n @save_attribs = options[:save_attribs] || []\n\n\n setup if self.respond_to?(:setup)\t\t# you might want to use a method for setup\n\n\n options[:default_values] = model.attributes.merge(options[:default_values] || {})\n @save_attribs.each do |sa|\n options[:default_values][sa] = model.send(sa.intern) if model.respond_to?(sa.intern)\n end\n\n super(form_name, options)\n end", "def call\n add_fields(confirm_registration: true)\n end", "def init_forms\n super\n\n ### UPDATE NOW ###\n fo = @fw.add_form(\"update_now\")\n fo.required_notice = false\n fo.per_field_action = true\n fi = fo.add_field(\"update_file\", \"file\", { \"action\" => \"update\", \"size\" => 30 })\n end", "def attach_form c\n c.form = @form\n c.override_graphic @graphic\n c.parent_component = self\n end", "def element_form_extension(context={}, aspect_model)\n \n app = context[:app]\n \n aspect = aspect_model.aspect('photo')\n \n locals = {:photo_album => aspect.get_aspect_attribute_value('album_name'),\n :photo_width => aspect.get_aspect_attribute_value('album_photo_width').to_i,\n :photo_height => aspect.get_aspect_attribute_value('album_photo_height').to_i,\n :photo_accept => aspect.get_aspect_attribute_value('media_accept'),\n :photo_max_size => aspect.get_aspect_attribute_value('max_size').to_i}\n \n renderer = UI::FieldSetRender.new('photo', app) \n photo_form_extension = renderer.render('formextension', 'em', locals)\n \n end", "def welcome_params\n end", "def set_config\n redirect\n end", "def form_params\n params.require(:form).permit(:name, :alias, :type, :active, :structure_id, :user_id)\n end", "def title; self.config['title']; end", "def build_subline_form(action,caption)\n\n\tline_config_codes = LineConfig.find_by_sql('select distinct line_config_code from line_configs').map{|g|[g.line_config_code]}\n\tline_config_codes.unshift(\"<empty>\")\n#\t---------------------------------\n#\t Define fields to build form from\n#\t---------------------------------\n\t field_configs = Array.new\n\t field_configs[0] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'subline_code'}\n\n\t field_configs[1] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'subline_description'}\n\n#\t----------------------------------------------------------------------------------------------\n#\tCombo fields to represent foreign key (line_config_id) on related table: line_configs\n#\t----------------------------------------------------------------------------------------------\n\tfield_configs[2] = {:field_type => 'DropDownField',\n\t\t\t\t\t\t:field_name => 'line_config_code',\n\t\t\t\t\t\t:settings => {:list => line_config_codes}}\n\n\tbuild_form(nil,field_configs,action,'subline',caption)\n\nend", "def element_form(context={}, aspect_model)\n \n app = context[:app]\n \n renderer = ::UI::FieldSetRender.new('location', app) \n location_form = renderer.render('form', 'em')\n \n end", "def after_form_update(options)\n main_id = find_or_add_main(options)\n # If the person was new, add contact and note\n if options[:was_new]\n new_contact = Contact.create(:person_id => options[:record].id,\n :contact_category => ContactCategory.where(:email => true).first,\n :data => \"#{record.bulogin}@bu.edu\")\n end\n trigger :display_form, {:pid => options[:record].id, :id => main_id}\n super(options)\n end", "def action_add\n notifying_block do\n create_config\n end\n end", "def verify_configuration\n return if has_configuration?\n\n @ui.setup do |config|\n @config.merge!(config)\n self.password = config[:password] if config.has_key? :password\n save_configuration\n end\n end", "def build_default_screen\n\n hauliers = PartiesRole.find_by_sql(\"SELECT party_type_name,role_name,party_name FROM parties_roles WHERE parties_roles.party_type_name = 'ORGANIZATION' and parties_roles.role_name = 'HAULIER'\").map{|g|g.party_name}.join(\",\")\n hauliers = \", ,\" + hauliers\n\n field_configs = Array.new\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"load_number\",:value=>@parent.load_number.to_s}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"booking_reference\",:value=>@parent.booking_reference.to_s}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"vessel_name\",:value=>@parent.vessel_name.to_s}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"voyage_number\",:value=>@parent.voyage_number.to_s}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"shipping_agent\",:value=>@parent.shipping_agent.to_s}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"shipping_line\",:value=>@parent.shipping_line}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"discharge_port\",:value=>@parent.discharge_port}\n field_configs[field_configs.length()] = {:type=>\"static_text\",:name=>\"quay_of_discharge_port\",:value=>@parent.quay_of_discharge_port.to_s}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"scan_load_bay\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"truck_number\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"seal_number\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"container_number\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"temperature_rhine\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"temperature_rhine2\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"drop_down\",:name=>\"haulier_code\",:is_required=>\"true\", :list => hauliers, :value =>'haulier_party_role_id'}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"container_size\",:is_required=>\"true\"}\n field_configs[field_configs.length()] = {:type=>\"text_box\",:name=>\"cto_consec_no\",:is_required=>\"false\"}\n\n\n screen_attributes = {:auto_submit=>\"false\",:content_header_caption=>\"load_container\"}\n buttons = {\"B3Label\"=>\"\" ,\"B2Label\"=>\"\",\"B1Submit\"=>\"load_container_submit\",\"B1Label\"=>\"submit\",\"B1Enable\"=>\"true\",\"B2Enable\"=>\"false\",\"B3Enable\"=>\"false\" }\n plugins = nil\n result_screen_def = PdtScreenDefinition.gen_screen_xml(field_configs,buttons,screen_attributes,plugins)\n\n return result_screen_def\n end", "def config=(_arg0); end", "def config=(_arg0); end", "def config=(_arg0); end", "def config=(_arg0); end", "def config=(_arg0); end", "def edit_settings\n hide_properties\n require 'settings_dialog'\n stg = @stage\n this = self\n stage(init_style: :utility, init_modality: :app, title: \"SmartDashboard Settings\") do\n init_owner stg\n fxml SD::SettingsDialog, :initialize => [this]\n show_and_wait\n end\n end", "def create\n super\n show(PLACEMENT_SCREEN)\n end", "def custom_form_params\n params.require(:custom_form).permit!\n end" ]
[ "0.627893", "0.6001749", "0.5884149", "0.5882792", "0.5880317", "0.58374894", "0.58089715", "0.5787512", "0.5776966", "0.57768196", "0.5758157", "0.57458335", "0.57381916", "0.57308215", "0.56495804", "0.5596882", "0.5539714", "0.5524258", "0.54859304", "0.5446382", "0.5438929", "0.5417846", "0.5403936", "0.53878284", "0.5380048", "0.5374644", "0.53542167", "0.53515893", "0.53515893", "0.53515893", "0.53515893", "0.53515893", "0.5294266", "0.52652854", "0.52649266", "0.5262961", "0.5257718", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.523641", "0.52348185", "0.5231423", "0.52272224", "0.5207713", "0.51963395", "0.51934767", "0.5185045", "0.5184561", "0.5170722", "0.51641226", "0.5157486", "0.5143267", "0.5139585", "0.5138443", "0.5133416", "0.51264507", "0.5111607", "0.5110138", "0.5103033", "0.5087926", "0.5084072", "0.5081233", "0.50801164", "0.5077789", "0.5061066", "0.5053815", "0.50535625", "0.50528187", "0.5049645", "0.50482607", "0.5045657", "0.50393206", "0.5037056", "0.5031568", "0.50313944", "0.502637", "0.502146", "0.5014471", "0.5012472", "0.5012472", "0.5012472", "0.5012472", "0.5012472", "0.5002057", "0.49960044", "0.49948207" ]
0.0
-1
Runs before the build begins
def prebuild(build, listener) # do any setup that needs to be done before this build runs. end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prebuild(build, listener)\n # do any setup that needs to be done before this build runs.\n end", "def before_setup\n # do nothing by default\n end", "def before_run; end", "def post_setup\n end", "def prebuild(build, listener)\n end", "def prebuild(build, listener)\n end", "def prebuild(build, listener)\n end", "def pre_install; end", "def pre_task\n end", "def pre_process\n end", "def before_setup; end", "def before_run(ant)\n end", "def prepare_pre_import\n end", "def after_setup\n # do nothing by default\n end", "def install_pre_hook\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def run_pre_assembly\n log \"\\nstarting run_pre_assembly(#{info_for_log})\"\n pre_assemble_objects\n log \"\\nfinishing run_pre_assembly(#{info_for_log})\"\n end", "def precheck\n end", "def before(*args)\n require_libs\n require_ing_file\n end", "def begin_build\n build_stack.push(true)\n end", "def pre_execute(&block)\n @hooks[:pre_execute] = block\n end", "def pre_setup_suite()\n @cfg['pre_setup'] =\"defined\"\n return true\n end", "def setup\n true\n end", "def setup\n\t\t# Do nothing\n\tend", "def setup\n\t\t# Do nothing\n\tend", "def before\n end", "def globalSetup()\n # Build\n run(\"cd '#{Embedding::CODE_PATH}' && make clean && make\")\nend", "def setup\n # noop\n end", "def before_start\n super\n self.sub_state = :before unless self.sub_state\n end", "def post_init\n end", "def before_processing\n end", "def before\n if @pkg.has_key? :cmd and @pkg[:cmd].has_key? :before\n logger.info \"Executing before commands...\"\n run :before\n end\n end", "def prepare\n unless pre_commands.empty?\n checkout.in_build do |r|\n pre_commands.each { |c| r.run! c }\n end\n end\n end", "def post_init\n end", "def before() ; end", "def setup\n # no setup\n\tend", "def setup()\n end", "def compile_android_before\n # TODO\n end", "def compile_android_before\n # TODO\n end", "def run!\n # Validate paths\n validate_paths!\n \n # Extract mockup\n copy_source_path_to_build_path!\n \n validate_stack!\n \n # Run stack\n run_stack!\n \n # Run finalizers\n run_finalizers!\n \n # Cleanup\n cleanup! if self.config[:cleanup_build]\n \n end", "def before\n\t\t\ttrue\n\t\tend", "def setup\n # override this if needed\n end", "def on_before_load\n end", "def before_resolution\n output.print 'Resolving dependencies...'\n end", "def _before_all # :nodoc:\n #: prints Benchmarker.platform().\n print Benchmarker.platform()\n end", "def process_and_build_components \n end", "def start_setup\n\t\tread_config()\n\n\t\tputs \"Initializing annotation for project: #{self.project_file_name} ...\"\n\t\tputs \"=================================\"\n\n\t\tif add_annotation_target()\n\t\t\tputs \"=================================\"\n\t\t\tputs \"Annotation initialization for project #{self.project_file_name} done.(●'◡'●)ノ♥\"\n\t\tend\n\tend", "def before_running(*args); end", "def before_setup(ant)\n end", "def prepare\n if not File.exists?(OBS_BUILD_DIR)\n FileUtils.mkdir_p OBS_BUILD_DIR\n end\n cleanup\n end", "def before_bootstrap\n end", "def setup\n self.setup! unless self.setup?\n end", "def setup\n debug 'No custom setup defined'\n end", "def prepare_for_installation; end", "def pre_execute_checks\n validate_terraform_installed\n ensure_output_directory\n Dir.chdir(@opts.get(:input_dir)) do\n puts '=> Fetching modules...'\n tf_get\n end\n end", "def setup\r\n end", "def pre_perform!\n return unless perform_hooks?\n unless hooks.pre_hooks.any?\n GitPusshuTen::Log.message \"No pre deploy hooks to perform.\"\n return\n end\n \n ##\n # Connect to the remote environment and perform the pre deploy hooks\n hooks.render_commands(hooks.pre_hooks).each do |name, commands|\n adjusted_name = name.sub(/^\\d+\\)\\s/, '')\n \n GitPusshuTen::Log.message(\"Performing pre deploy hook: #{y(adjusted_name)}\")\n standard environment.execute_as_user(\"cd '#{e.app_dir}'; #{commands}\")\n end\n end", "def process\n Rucola::Plugin.before_process(self)\n \n # load the environment config\n @configuration.load_environment_configuration!\n \n Rucola::Debugger.use! if @configuration.use_debugger\n use_reloader! if @configuration.use_reloader\n \n require_dependencies\n require_frameworks\n require_lib_source_files\n require_ruby_source_files\n \n Rucola::Plugin.after_process(self)\n end", "def precompile_assets; end", "def pre_init(&block)\n @hooks[:pre_init] = block\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def before_import ; end", "def before_bootstrap; end", "def do_setup; \"\" end", "def setup\n\t\tend", "def setup\n\t\tend", "def my_post_build_step\n puts 'post-build step!'\nend", "def pre_generation_hook(task)\n end", "def pre\n if phase.has_key?('pre')\n execute(\"pre\", phase['pre'])\n end\n end", "def application_before\n run_event(:application_before)\n end", "def startup_hook; end", "def start\n build_all_assets \"Building all assets\"\n end", "def post_install; end", "def before\n end", "def post_init\n\tend", "def precompile_assets=(_arg0); end", "def before_fork\n end", "def before_lint; end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup\n end", "def setup; end", "def setup; end", "def setup; end", "def setup; end", "def setup; end" ]
[ "0.75876105", "0.70303434", "0.7024104", "0.6919467", "0.68747675", "0.68747675", "0.68747675", "0.6644995", "0.6642181", "0.66390675", "0.66047144", "0.65400916", "0.6499688", "0.64914507", "0.6444174", "0.63720775", "0.63720775", "0.6365221", "0.6362908", "0.63565016", "0.63460535", "0.63370407", "0.6322556", "0.63101256", "0.62847024", "0.62847024", "0.6282631", "0.6281692", "0.6270316", "0.626421", "0.6260784", "0.6241761", "0.6238879", "0.61975974", "0.61892647", "0.6188357", "0.618639", "0.6168467", "0.6153911", "0.6153911", "0.6151337", "0.61454105", "0.61318475", "0.61070967", "0.60861015", "0.60779995", "0.6075656", "0.60709476", "0.6062898", "0.6055498", "0.6055208", "0.6054212", "0.6050036", "0.60498583", "0.60420614", "0.60398537", "0.603523", "0.6030975", "0.60260874", "0.6017953", "0.60126", "0.6004866", "0.6004866", "0.6004866", "0.6004866", "0.6004866", "0.60046405", "0.6002952", "0.5998878", "0.599522", "0.599522", "0.5993244", "0.59922826", "0.59761965", "0.5969645", "0.5965992", "0.59658533", "0.596304", "0.59611094", "0.5958794", "0.5957684", "0.5947853", "0.59225494", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.59085387", "0.5898551", "0.5898551", "0.5898551", "0.5898551", "0.5898551" ]
0.7666797
0
Runs the step over the given build and reports the progress to the listener.
def perform(build, launcher, listener) # actually perform the build step # (1) Get build url for AppSpider to scan listener.info "AppSpider Url: '#{@appspider_url}'" listener.info "Username: '#{@username}'" listener.info "Password: '#{@password}'" listener.info "Config name: '#{@config_name}'" listener.info "Start Scan: '#{@startscan}'" if @startscan listener.info "Starting AppSpider Scan" # builder = Appsider::Publisher::MessageBuilderFactory.create(build.native) # message = builder.build_message options = { url: @appspider_url, username: @username, password: @password, config_name: @config_name } Appspider::ApiExtended.run_scan_config options else listener.info "AppSpider was not enabled." end listener.info "Finished Scanning scan id: #{@config_name}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run\n Sparrow.logger.info(\"received a build\", build: build.data)\n end", "def completed(build, listener)\n end", "def run\n while @running\n step\n end\n end", "def test_run_completed(test_run)\n report_results test_run\n end", "def buildwise_run_sequential_build_target(build_id, task_name) \r\n begin\r\n FileUtils.rm_rf(\"spec/reports\") if File.exist?(\"spec/reports\")\r\n Rake::Task[task_name].invoke\r\n ensure\r\n puts \"Finished: Notify build status\"\r\n sleep 2 # wait a couple of seconds to finish writing last test results xml file out\r\n puts \"[Rake] finish the build\"\r\n buildwise_finish_build(build_id)\r\n end\r\nend", "def run!\n report_startup\n setup_stage\n stage_operations\n managed_copy\n remove_stage\n report_complete\n end", "def run\n if enabled?\n reset\n puts \"Running test: #{path}\"\n puts \"Follow Here: #{File.join(job_folder, 'all.log')}\"\n runner.run(command, job_folder)\n puts Formatter.status_line(self)\n status\n else\n puts \"Test disabled, skipping.\"\n end\n end", "def run\n FastlaneCore::PrintTable.print_values(config: WatchBuild.config,\n hide_keys: [],\n title: \"Summary for WatchBuild #{WatchBuild::VERSION}\")\n\n UI.message(\"Starting login with user '#{WatchBuild.config[:username]}'\")\n Spaceship::Tunes.login(WatchBuild.config[:username], nil)\n UI.message(\"Successfully logged in\")\n\n start = Time.now\n build = wait_for_build(start)\n minutes = ((Time.now - start) / 60).round\n notification(build, minutes)\n end", "def run_build(which_build='default', options={})\n formatter = options[:formatter] || Fudge::Formatters::Simple.new\n output_start(which_build, formatter)\n status = run(which_build, options)\n output_status(status, formatter)\n end", "def capture_build\n # limit is current HB total workflow\n #TODO dont need increased limit\n cmd = if ENV['CAPTURE_CURRENTLY_RUNNING']\n \"curl 'https://circleci.com/api/v1.1/project/github/#{ORG}/#{PROJECT}/tree/#{BRANCH}?circle-token=#{CIRCLE_TOKEN}&limit=20'\"\n else\n \"curl 'https://circleci.com/api/v1.1/project/github/#{ORG}/#{PROJECT}/tree/#{BRANCH}?circle-token=#{CIRCLE_TOKEN}&limit=9'\"\n end\n puts cmd\n data = `#{cmd}`\n data = JSON.parse(data)\n if ENV['CAPTURE_CURRENTLY_RUNNING']\n # ignore all builds that aren't the current git sha\n data.reject!{ |i| (i['all_commit_details'].first==nil || !i['all_commit_details'].last['commit'].starts_with?(ENV['CAPTURE_CURRENTLY_RUNNING'])) }\n else\n data.reject!{ |i| i['start_time'].nil? || Time.iso8601(i['start_time']).to_i < (@last_built_at + 10) }\n end\n\n tests_jobs = data.select{ |job| JOBS.include?(job['workflows']['job_name']) }\n metric_job = data.select{ |job| job['workflows']['job_name']==JOBS.first }.first\n raise \"one of the jobs isn't running yet\" unless tests_jobs.length == JOBS.length\n tests_jobs.each do |job|\n raise \"still running #{job}\" unless (job['outcome']=='success' || job['outcome']=='failed')\n end\n\n outcome = if JOBS_ALL_PASS\n tests_jobs.select { |job| job['outcome']=='success' }.length == JOBS.length ? 'success' : 'failed'\n else\n metric_job['outcome']\n end\n\n puts \"recording: #{outcome}\"\n @stats << outcome\n @times << Time.iso8601(metric_job['stop_time']) - Time.iso8601(metric_job['start_time'])\n rescue => err\n puts \"waiting, #{err}\"\n sleep(15)\n retry\n end", "def run(build)\n Runner.new(@url, build, adapter).run\n end", "def build_snapshot\n build_dependency\n puts '### dev build ###'\n puts `gulp 2>&1`\n puts '### dev build done ###'\n post_build\nend", "def my_post_build_step\n puts 'post-build step!'\nend", "def build\n Bob.logger.info \"Building #{buildable.commit} of the #{buildable.scm} repo at #{buildable.uri}\"\n\n in_background do\n buildable.start_building if buildable.respond_to?(:start_building)\n\n scm.with_commit(buildable.commit) { |commit_info|\n buildable.finish_building(commit_info, *run_build_script)\n }\n end\n end", "def go_run_one(test_case)\n @status = :running\n Thread.new do\n begin\n @test_suite.run_test(test_case) do |result|\n @test_results[result[:source]] = result[:result]\n end\n rescue => e\n puts e\n print e.bracktrace.join(\"\\n\")\n ensure\n @status = :ran\n end\n end\n end", "def generic_recipe_step\n puts \"On it!\"\n print_progress_bar\nend", "def generic_recipe_step\n puts \"On it!\"\n print_progress_bar\nend", "def generic_recipe_step\n puts \"On it!\"\n print_progress_bar\nend", "def run\n # send logs that get put on the output queue.\n # this needs to be on a separate thread since Queue is a threadsafe blocking queue.\n Thread.new do\n while state == \"running\"\n # pop is blocking, hence we need another check for the state.\n log_line = @output_queue.pop\n send_log(log_line) if state == \"running\"\n end\n end\n\n git_url = command_env(:GIT_URL)\n git_sha = command_env(:GIT_SHA)\n\n setup_repo(git_url, git_sha)\n\n @artifact_path = File.expand_path(\"artifacts\")\n FileUtils.mkdir_p(@artifact_path)\n\n # TODO: set this properly for the fastlane invocation\n ENV[\"FASTLANE_CI_ARTIFACTS\"] = @artifact_path\n\n # TODO: ensure we are able to satisfy the request\n # unless has_required_xcode_version?\n # reject(RuntimeError.new(\"Does not have required xcode version!. This is hardcode to be random.\"))\n # return\n # end\n\n if run_fastlane(@invocation_request.command)\n finish\n else\n # fail is a keyword, so we must call self.\n # rubocop:disable Style/RedundantSelf\n self.fail\n # rubocop:enable Style/RedundantSelf\n end\n end", "def perform(build, launcher, listener)\n context = BuildContext.new(build, launcher, listener)\n notes = BuildNotes.new(context).notes\n update_git_notes(notes, context)\n notify_sqs(notes, context)\n end", "def run\n start = Time.now\n log \"[0/3] Generating build\"\n generate_build\n\n log \"[1/3] Building\"\n filename = build\n\n log \"[2/3] Parsing\"\n\n @config[:parser].parse(filename)\n log \"[3/3] Complete\"\n\n Time.now - start\n end", "def run_work_unit\n begin\n result = nil\n @action = CloudCrowd.actions[@action_name].new(@status, @input, @options, @store)\n Dir.chdir(@action.work_directory) do\n result = case @status\n when PROCESSING then @action.process\n when SPLITTING then @action.split\n when MERGING then @action.merge\n else raise Error::StatusUnspecified, \"work units must specify their status\"\n end\n end\n complete_work_unit({'output' => result}.to_json)\n rescue Exception => e\n fail_work_unit(e)\n end\n end", "def test!\n in_test_dir do\n notify.start(\"Running tests on: #{proj_branch}\")\n test.run!\n notify.done(\"Test finished: #{test.status}\", test.passed?)\n end\n end", "def run\n return run_work_unit unless @options['benchmark']\n status = CloudCrowd.display_status(@status)\n log(\"ran #{@action_name}/#{status} in \" + Benchmark.measure { run_work_unit }.to_s)\n end", "def start\n start_thread\n wait(20) # This so that you wait until either the step is done or 20 seconds is up.\n # It doesn't have to wait the whole 20 seconds if the step finishes quickly.\n end", "def perform(build, launcher, listener)\n BuildContext.instance.set(build, launcher, listener) do\n git_updater = GitUpdater.new\n retries = Constants::CONCURRENT_UPDATE_RETRIES\n notes = BuildNotes.new.notes\n begin\n info \"updating git notes\"\n git_updater.update!(notes)\n rescue GitUpdater::ConcurrentUpdateError => e\n if retries > 0\n warn \"caught ConcurrentUpdateError while updating git notes, retrying (#{retries}x left)\"\n retries -= 1\n retry\n else\n raise e\n end\n end\n info \"updated git notes: #{notes}\"\n end\n end", "def run_suite\n Unit.run = true\n\n result = create_result\n finished_listener = result.add_listener(TestResult::FINISHED) do |*args|\n notify_listeners(TestResult::FINISHED, *args)\n end\n changed_listener = result.add_listener(TestResult::CHANGED) do |*args|\n notify_listeners(TestResult::CHANGED, *args)\n end\n pass_assertion_listener = result.add_listener(TestResult::PASS_ASSERTION) do |*args|\n notify_listeners(TestResult::PASS_ASSERTION, *args)\n end\n fault_listener = result.add_listener(TestResult::FAULT) do |*args|\n notify_listeners(TestResult::FAULT, *args)\n end\n\n start_time = Time.now\n begin\n notify_listeners(RESET, @suite.size)\n notify_listeners(STARTED, result)\n\n @suite.run(result) do |channel, value|\n notify_listeners(channel, value)\n end\n ensure\n elapsed_time = Time.now - start_time\n result.remove_listener(TestResult::FAULT, fault_listener)\n result.remove_listener(TestResult::CHANGED, changed_listener)\n result.remove_listener(TestResult::FINISHED, finished_listener)\n result.remove_listener(TestResult::PASS_ASSERTION,\n pass_assertion_listener)\n notify_listeners(FINISHED, elapsed_time)\n end\n\n result\n end", "def run_step_one\n puts \"Executing Step ONE\"\n end", "def communicate_complete\n File.open(\"#{@options[:output_directory]}/finished.job\", 'w') { |f| f << \"Finished Workflow #{::Time.now} #{@options}\" }\n raise 'Missing required options' unless @options[:url] && @options[:datapoint_id] && @options[:project_id]\n send_status('Complete')\n send_file(\"#{@options[:output_directory]}/run.log\")\n Dir.glob(\"#{@options[:output_directory]}/../reports/*\").each do |f|\n next if File.basename(f) == 'view_model_report.json'\n\n send_file(f)\n end\n end", "def started(build, listener)\n end", "def run\n while 1\n if step == 1 then break end\n end\n end", "def runTest(browser)\n puts \"Step 2: At step description here\"\n #Do shit here\n #....\n puts \"Step 3: ....\"\n #Do more shit here\n #....\n\n puts \"Expected Result:\"\n puts \"Result that we expect to happen.\"\n\n if true #Test passed condition here\n self.passed = true\n puts \"TEST PASSED. Add some description/details here\"\n else #Test failed condition here\n self.passed = false\n puts \"TEST FAILED. Show what we have screwed up\"\n end\n end", "def run\n FastlaneCore::PrintTable.print_values(config: WatchBuild.config,\n hide_keys: [],\n title: \"Summary for WatchBuild #{WatchBuild::VERSION}\")\n\n UI.message(\"Starting login with user '#{WatchBuild.config[:username]}'\")\n\n ENV['FASTLANE_ITC_TEAM_ID'] = WatchBuild.config[:itc_team_id] if WatchBuild.config[:itc_team_id]\n ENV['FASTLANE_ITC_TEAM_NAME'] = WatchBuild.config[:itc_team_name] if WatchBuild.config[:itc_team_name]\n ENV['SLACK_URL'] = WatchBuild.config[:slack_url]\n\n Spaceship::ConnectAPI.login(WatchBuild.config[:username], nil, use_portal: false, use_tunes: true)\n UI.message('Successfully logged in')\n\n start = Time.now\n build = wait_for_build(start)\n minutes = ((Time.now - start) / 60).round\n notification(build, minutes)\n end", "def run\n start_flowcell\n distributions = []\n\n unless @options[:no_distribute]\n distributions = @flowcell.external_data.distributions_for @flowcell.id\n end\n\n steps = @options[:steps]\n status \"running steps: #{steps.join(\", \")}\"\n\n if steps.include? \"unaligned\"\n # unaligned dir\n process_unaligned_reads distributions\n Emailer.email \"UNALIGNED step finished for #{@flowcell.paths.id}\" unless @options[:test]\n end\n\n if steps.include? \"undetermined\"\n process_undetermined_reads distributions\n Emailer.email \"UNDETERMINED step finished for #{@flowcell.paths.id}\" unless @options[:test]\n end\n\n if steps.include? \"fastqc\"\n unless @options[:only_distribute]\n run_fastqc @flowcell.paths.fastq_combine_dir\n end\n distribute_to_unique distributions, @flowcell.paths.fastqc_dir\n Emailer.email \"FASTQC step finished for #{@flowcell.paths.id}\" unless @options[:test]\n end\n\n if steps.include? \"aligned\"\n run_aligned distributions\n Emailer.email \"ALIGNED step finished for #{@flowcell.paths.id}\" unless @options[:test]\n end\n\n if steps.include? \"stats\"\n create_custom_stats_files\n distribute_custom_stats_files distributions\n end\n\n if steps.include? \"report\"\n create_sample_report\n distribute_sample_report distributions\n end\n\n if steps.include? \"qcdata\"\n distribute_to_qcdata\n end\n\n if steps.include? \"lims\"\n notify_lims\n end\n\n stop_flowcell\n end", "def get_next_build_step\n @build_step += 1\n end", "def go_run_tests\n @status = :running\n Thread.new do\n begin\n test_cases = @test_suite.sources\n\n @mutex.synchronize do\n @test_cases = test_cases\n @test_results = {}\n end\n\n @test_suite.run_tests do |result|\n @mutex.synchronize do\n @test_results[result[:source]] = result[:result]\n end\n end\n\n rescue => e\n puts e\n print e.bracktrace.join(\"\\n\")\n ensure\n @status = :ran\n end\n\n end\n end", "def get_build_progress\n total = get_total_pages\n complete = get_page_count('success')\n progress = (complete.to_f / total.to_f) * 100\n\n progress.ceil\n end", "def run\n process_queue\n RailsPipeline.logger.info \"Queue: '#{@queue}'. Processed: #{@processed}\"\n if Time.now - @failure_last_checked > @failure_check_interval\n @failure_last_checked = Time.now\n check_for_failures\n end\n end", "def runner\n\n add_breadcrumb \"SOGR Capital Project Analyzer\", builder_capital_projects_path\n add_breadcrumb \"Running...\"\n\n @builder_proxy = BuilderProxy.new(params[:builder_proxy])\n if @builder_proxy.valid?\n\n if @builder_proxy.organization_id.blank?\n org_id = @organization_list.first\n else\n org_id = @builder_proxy.organization_id\n end\n org = Organization.get_typed_organization(Organization.find(org_id))\n\n # set class names whether primary or components are selected\n class_names = FtaAssetClass.where(id: @builder_proxy.fta_asset_classes).distinct.pluck(:class_name)\n\n\n\n\n ['Facility', 'Infrastructure'].each do |klass|\n if params[\"#{klass.downcase}_primary\"].to_i == 1\n if params[\"#{klass.downcase}_component\"].to_i == 1\n class_names << \"#{klass}Component\"\n else\n # do nothing Facility class already added from FTA asset class\n end\n else\n if params[\"#{klass.downcase}_component\"].to_i == 1\n class_names << \"#{klass}Component\"\n class_names.delete(klass)\n else\n # this case can't happen but if it does\n class_names.delete(klass)\n end\n end\n end\n\n # save range of FYs for the org\n org.update(capital_projects_range_fys: @builder_proxy.range_fys.to_i)\n\n Delayed::Job.enqueue CapitalProjectBuilderJob.new(org, class_names, @builder_proxy.fta_asset_classes, @builder_proxy.start_fy, @builder_proxy.start_fy.to_i + @builder_proxy.range_fys.to_i, @builder_proxy.scenario_id, current_user), :priority => 0\n\n # Let the user know the results\n msg = \"SOGR Capital Project Analyzer is running. You will be notified when the process is complete.\"\n notify_user(:notice, msg)\n\n if Rails.application.config.try(:use_new_scenarios_tool)\n redirect_to scenarios_url\n else\n redirect_to capital_projects_url\n end\n\n return\n else\n respond_to do |format|\n format.html { render :action => \"builder\" }\n end\n end\n\n end", "def run\n puts \"Rubyist #{@rubyist.id} starting in #{@current_location.name}.\"\n (1..@turns).each { |current_turn| prospect_location(current_turn) }\n # Print Results of run\n finished\n end", "def run\n init\n\n printer = config.flamegraph? ? Printers::Flamegraph : Printers::Simple\n\n at_exit do\n File.write(build_path(), JSON.dump(result)) if config.json?\n printer.dump(result)\n end\n\n start\n end", "def running_test_step; end", "def generate\n Thread.new do\n process_repo\n end\n msg = { :success => true, :message => \"Please wait while we generate activity for the repository!\" }\n end", "def run\n @turn = Turn.new(game)\n while @turn.instance_variable_get(\"@status\") != 'completed'\n\n jobs_found = @turn.instance_variable_get(\"@jobs\").size\n print_turn_text(jobs_found)\n\n if (@turn.instance_variable_get(\"@current_turn\") % 25) == 0\n @machine.destroy\n @machine = Machine.new(game)\n end\n \n @turn.assign_jobs(machine) \n @turn.next_turn\n end\n\n @game = @game.reload\n print_game_text(@game)\n end", "def execute(step)\n end", "def progress(run_id)\r\n @result_count = self.get_results(run_id)[:result].length - 1\r\n run = Run.find(run_id)\r\n @result = ((@result_count.to_f / run.units.count.to_f) * 100).round(2)\r\n end", "def _work(context)\n # pre step hook\n ret = work(context)\n # post step hook\n ret\n end", "def show\n calculate_progress\n ##complete_goal\n end", "def run_step(step,\n target,\n param = '')\n # Log.log_debug('Into run_step(' + step.to_s + ', ' +\n # target + ', ' + param.to_s + ')')\n case step\n when :status\n returned = step_status(step, target, param)\n when :installFlrtvc\n returned = step_install_flrtvc(step)\n when :runFlrtvc\n returned = step_run_flrtvc(step, target)\n when :parseFlrtvc\n returned = step_parse_flrtvc(step, target, param)\n when :downloadFixes\n returned = step_perform_downloads(step, target, param)\n when :checkFixes\n returned = step_check_fixes(step, target, param)\n when :buildResource\n returned = step_build_nim_resource(step, target, param)\n when :installFixes\n returned = step_install_fixes(step, target, param)\n when :removeFixes\n returned = step_remove_fixes(step, target)\n else\n Log.log_err('Unknown step ' + step.to_s)\n returned = ''\n end\n returned\n end", "def run\n\n @startDate = Time.now.to_i * 1000\n @status = 'Started'\n start_test_run(create_test_objects(@tests, @runOptions, @id), @cmd)\n @status = 'Completed'\n @endDate = Time.now.to_i * 1000\n set_status\n @event_emitter.emit_event(test_run_completed: self)\n check_status_and_exit\n #add login for sending an exit code based on whether or not there were any failures.\n end", "def run\n until halted?\n step\n end\n end", "def run\n # UI.message(\"Starting login with user '#{WatchBuild.config[:username]}'\")\n\n ENV['FASTLANE_ITC_TEAM_ID'] = WatchBuild.config[:itc_team_id] if WatchBuild.config[:itc_team_id]\n ENV['FASTLANE_ITC_TEAM_NAME'] = WatchBuild.config[:itc_team_name] if WatchBuild.config[:itc_team_name]\n ENV['FASTLANE_PASSWORD'] = WatchBuild.config[:password] if WatchBuild.config[:password]\n\n build_number = WatchBuild.config[:build_number]\n\n Spaceship::ConnectAPI.login(WatchBuild.config[:username], WatchBuild.config[:password])\n Spaceship::ConnectAPI.select_team\n UI.message('Successfully logged in')\n\n start = Time.now\n build = wait_for_build(start, build_number)\n minutes = ((Time.now - start) / 60).round\n notification(build, minutes)\n end", "def step(step_increment = 1)\n @current_steps+= step_increment\n new_markers = @max_steps != 0 ? (@current_steps / @steps_per_marker).to_i : max_markers\n\n new_percentage = @max_steps != 0 ? @current_steps * 100 / @max_steps : 100\n if @use_ansi and new_percentage != @current_percentage\n # This part uses ANSI escape sequences to show a running percentage\n # to the left of the progress bar\n print \"\\e[1D\" * (@current_markers + 5) if @current_percentage != 0 # go left\n print \"#{new_percentage}%\".rjust(4) << \" \"\n print \"\\e[1C\" * @current_markers if @current_markers != 0 # go back right\n $stdout.flush rescue nil\n @current_percentage = new_percentage\n end\n\n if new_markers > @current_markers\n print '.' * (new_markers - @current_markers)\n @current_markers = new_markers\n $stdout.flush rescue nil\n end\n if @current_steps == @max_steps\n print '.' * (max_markers - @current_markers) + ' '\n $stdout.flush rescue nil\n end\n end", "def process_job job\n begin\n log.info \"Performing job #{job.id}\"\n jo = job.job_object\n jo.log = log\n jo.perform\n log.info \"Job #{job.id} completed\"\n job.complete\n Model::Worker.increment(id, {:'stats.done' => 1})\n rescue Exception => e\n log.error \"Job #{job.id} failed\"\n log.error e\n job.fail e\n Model::Worker.increment(id, {:'stats.failed' => 1})\n p e\n end\n end", "def progress(run)\n return unless run.started?\n\n progress = Progress.new(run)\n\n progress_bar = tag.progress(\n value: progress.value,\n max: progress.max,\n class: [\"progress\"] + STATUS_COLOURS.fetch(run.status)\n )\n progress_text = tag.p(tag.i(progress.text))\n tag.div(progress_bar + progress_text, class: \"block\")\n end", "def run_completed\n end", "def run\n start\n trace\n wrapup\n end", "def report_start_run\n @run_status = Moto::Reporting::RunStatus.new\n @run_status.initialize_run\n\n @listeners.each do |l|\n l.start_run\n end\n end", "def progress; end", "def progress; end", "def progress; end", "def progress; end", "def progress; end", "def run_with_progress(message, size, progr = nil, &block)\n if(progr_object = (progr || progressor))\n progr_object.run_with_progress(message, size, &block)\n else\n dummy_prog = Object.new\n class << dummy_prog\n def inc\n end\n end\n block.call(dummy_prog)\n end\n end", "def build\n if phase.has_key?('build')\n execute(\"build\", phase['build'])\n end\n end", "def step\n @queue << \"step\"\n end", "def send_run_completion(opts)\n # If run_status is nil we probably failed before the client triggered\n # the run_started callback. In this case we'll skip updating because\n # we have nothing to report.\n return unless run_status\n\n send_to_data_collector(\n Chef::DataCollector::Messages.run_end_message(\n run_status: run_status,\n expanded_run_list: expanded_run_list,\n resources: all_resource_reports,\n status: opts[:status],\n error_descriptions: error_descriptions,\n deprecations: deprecations.to_a\n )\n )\n end", "def begin_analysis\n Thread.new do\n if @type == 'full'\n full_analysis\n elsif @type == 'refresh'\n refresh_analysis\n end\n end\n msg = { :success => true, :message => \"Please wait while we process the repository!\" }\n end", "def perform(test_step_id, user_id)\n\n\t\tmethod = Methods.new\n\n\t\ttest_step = TestStep.find(test_step_id)\n\t\tuser = User.find(user_id)\n\n\t\tlogger.info(\"\\nStarting Test Step\")\n\t\n\t\tparam_url = SeleniumConfig.find_by_user_id(user.id).url.to_sym\n\n\t\tmethod.initialize_driver(param_url)\n\n\t\tif test_step.element_id \n\t\t\tweb_element = WebElement.find(test_step.element_id)\n\t\t\tlog, run_status = method.execute_test_step(web_element,test_step.function,test_step.value)\n\t\telse\n\t\t\tlog, run_status = method.assert(test_step.expected)\n\t\tend\n\t\t\n\t\tlogger.info(\"\\nFinal result: \" + run_status)\n\n\t\tmethod.close\n\n\t\ttest_step.update_attributes(status: run_status, last_run: DateTime.now)\n\n\t\texecution = ExecProgress.where(user_id: user.id, test_step_id: test_step.id).first\n\n\t\tif execution.queue_id\n\n\t\t\tQueueCart.delete(execution.queue_id)\n\n\t\t\tqid = execution.queue_id\n\n\t\t\tExecProgress.delete(execution.id)\n\n\t\t\tEM.run {\n\t\t\t\tclient = Faye::Client.new('http://192.168.10.54:9292/faye')\n\t\t\t\tpublication = client.publish(\"/users/#{user.id}\", \"\n\t\t\t\t\t$('#notification').replaceWith('<a id=\\\"notification\\\" href=\\\"#\\\" data-toggle=\\\"tooltip\\\" title=\\\"Job Completed\\\"><i class=\\\"icon-globe\\\"></i></a>');\n\t\t\t\t\t$('#notification').css(\\\"background-color\\\", \\\"#8A0707\\\");\n\t\t\t\t\t$('#status').replaceWith('<a id=\\\"status\\\" href=\\\"#\\\" data-toggle=\\\"tooltip\\\" title=\\\"No Jobs in Progress\\\"><i class=\\\"icon-bell\\\"></i></a>');\n\t\t\t\t\t$('#q_row_#{qid}').remove();\n\t\t\t\t\")\n\n\t\t\t\tpublication.callback do\n\t\t\t\t\tlogger.info(\"Message sent to channel '/users/#{user.id}'\")\n\t\t\t\tend\n\n\t\t\t\tpublication.errback do |error|\n\t\t\t\t\tlogger.info('There was a problem: ' + error.message)\n\t\t\t\tend\n\t\t\t}\n\t\telse\n\n\t\t\tExecProgress.delete(execution.id)\n\n\t\t\tEM.run {\n\t\t\t\tclient = Faye::Client.new('http://192.168.10.54:9292/faye')\n\t\t\t\tpublication = client.publish(\"/users/#{user.id}\", \"\n\t\t\t\t\t$('#notification').replaceWith('<a id=\\\"notification\\\" href=\\\"#\\\" data-toggle=\\\"tooltip\\\" title=\\\"Job Completed\\\"><i class=\\\"icon-globe\\\"></i></a>');\n\t\t\t\t\t$('#notification').css(\\\"background-color\\\", \\\"#8A0707\\\");\n\t\t\t\t\t$('#status').replaceWith('<a id=\\\"status\\\" href=\\\"#\\\" data-toggle=\\\"tooltip\\\" title=\\\"No Jobs in Progress\\\"><i class=\\\"icon-bell\\\"></i></a>');\n\t\t\t\t\t$(\\'#exec_st_#{test_step.id}\\').replaceWith(\\'<a id=\\\"exec_st_#{test_step.id}\\\" href=\\\"/exec_test_step?test_step_id=#{test_step.id}\\\" data-remote=\\\"true\\\" class=\\\"btn btn-small icon-wrench\\\"></a>\\');\n\t\t\t\t\")\n\n\t\t\t\tpublication.callback do\n\t\t\t\t\tlogger.info(\"Message sent to channel '/users/#{user.id}'\")\n\t\t\t\tend\n\n\t\t\t\tpublication.errback do |error|\n\t\t\t\t\tlogger.info('There was a problem: ' + error.message)\n\t\t\t\tend\n\t\t\t}\n\n\t\tend\n\n\tend", "def run_builder(builder)\n builder.build_step ||= get_next_build_step\n case result = builder.run({})\n when Array\n result.each do |waititem|\n @process_builder_waits[builder] ||= Set.new\n @process_builder_waits[builder] << waititem\n case waititem\n when Thread\n @threads[waititem] = builder\n when Command\n @process_commands_waiting_to_run << waititem\n when Builder\n # No action needed.\n else\n raise \"Unrecognized #{builder.name} builder return item: #{waititem.inspect}\"\n end\n end\n when false\n @process_failures << \"Failed to build #{builder.target}.\"\n when true\n # Register side-effect files as build targets so that a Cache\n # clean operation will remove them.\n builder.side_effects.each do |side_effect|\n Cache.instance.register_build(side_effect, nil, [], self, side_effect: true)\n @side_effects.delete(side_effect)\n end\n @build_hooks[:post].each do |build_hook_block|\n build_hook_block.call(builder)\n end\n process_remove_wait(builder)\n else\n raise \"Unrecognized #{builder.name} builder return value: #{result.inspect}\"\n end\n end", "def prebuild(build, listener)\n end", "def prebuild(build, listener)\n end", "def prebuild(build, listener)\n end", "def run_build(which_build='default', options={})\n output = options[:output] || $stdout\n output_start(which_build, output)\n status = run(which_build, options)\n output_status(status, output)\n end", "def series\n Thread.new do\n begin\n activity = get_activity\n analyzer = get_analyzer\n activity.process\n analyzer.process\n rescue => e\n Rails.logger.debug e.backtrace.to_s + \" ----- \" + e.to_s\n ensure\n # do something\n end\n end\n msg = { :success => true, :message => \"Please wait while we process the repository!\" }\n end", "def do_work(val)\n callback do\n puts \"did work #{val}\"\n end\n end", "def run_on_change(paths)\n if @options[:dry_run]\n paths.each { |path| UI.info \"Dry run: #{path}\" }\n return\n end\n\n total = 0\n failures = 0\n duration = 0\n run_command(\"mix test #{paths.join(' ')}\") do |line|\n puts line\n if /Finished in ([0-9.]+) seconds/.match(line)\n duration = Regexp::last_match[1]\n elsif /([0-9]+) tests, ([0-9]+) failures/.match(line)\n total = Regexp::last_match[1].to_i\n failures = Regexp::last_match[2].to_i\n end\n end\n\n Notifier.notify(\n guard_message(total, failures, duration),\n :title => \"Elixir results\",\n :image => guard_image(failures),\n :priority => guard_priority(failures)\n )\n end", "def communicate_started\n File.open(\"#{@options[:output_directory]}/started.job\", 'w') { |f| f << \"Started Workflow #{::Time.now} #{@options}\" }\n raise 'Missing required options' unless @options[:url] && @options[:datapoint_id] && @options[:project_id]\n send_status('Started')\n end", "def run()\r\n rounds.times do |i|\r\n round(i+1)\r\n end\r\n #$stderr.puts \"#{name} Finished!\\n\"\r\n #below codes is used to output report\r\n output()\r\n end", "def complete()\n if @status.status == 'running'\n @logger.info \"Workflow #{self.class.name} has completed successfully\"\n @status.finished\n end\n end", "def process(job)\n logger.info(\"Job found: #{job.message_body}\")\n\n pipe_to(:status_stream) do\n job.sitrep(content: 'workflowStarted', extraInfo: job.params)\n end\n\n until job.done?\n job.workflow.next!\n pipe_to(:status_stream) do\n job.sitrep(content: 'workflowInProgress', extraInfo: { state: job.state })\n end\n # TODO: Add the workflow back in right here.\n job.run\n @neuron_ids.concat(job.neuron_ids)\n end\n end", "def run!\n # Validate paths\n validate_paths!\n \n # Extract mockup\n copy_source_path_to_build_path!\n \n validate_stack!\n \n # Run stack\n run_stack!\n \n # Run finalizers\n run_finalizers!\n \n # Cleanup\n cleanup! if self.config[:cleanup_build]\n \n end", "def indicate_progress\n end", "def iterate\n fill_first_task\n step until status.finished?\n save_tree if @printing\n end", "def finish_building(commit_id, build_status, build_output)\n raise NotImplementedError\n end", "def completed(build, listener)\n sus_labels = get_label_config\n\n node = build.get_built_on\n node_labels = []\n node.get_assigned_labels.each do |label|\n node_labels << label.name\n end\n\n intersecting_labels = sus_labels & node_labels\n if not intersecting_labels.empty?\n computer = node.to_computer\n logger.info(\"Taking single use slave '#{computer.get_display_name}' offline \" +\n \"because of labels (\" + intersecting_labels.join(', ') + \")\")\n cause = OfflineCause::ByCLI.new('Offlined by Single Use Slave Plugin')\n\n computer.set_temporarily_offline(true, cause)\n end \n end", "def step_result; end", "def step(experiment, cv, num)\n if @mode == :normal\n if num > 1\n num = num / 100\n end\n inc(num)\n @cv_prog[experiment][cv] ||= 0\n @cv_prog[experiment][cv] += num\n else\n @mode.notify.step(experiment, cv, num)\n end\n end", "def run(vm)\n while step(vm); end\n end", "def run\n log.info(\"Running...\")\n result = run_internal()\n log.info(\"Success! #{result.message}\")\n return result\n end", "def report_progress(message)\n @progress_block.call(message) if @progress_block\n end", "def run_experiment\n test_fitness\n experiment_status\n while !concluded?\n new_generation\n test_fitness\n experiment_status\n end\n end", "def incrementStep\r\n if @openstudio_2\r\n super\r\n else\r\n # compute result\r\n current_result = result\r\n\r\n @workflow.incrementStep\r\n end\r\n end", "def run!\n TaskServerLogger.instance.error \"Executing job id #{self.id}, #{self.to_s}...\"\n begin\n self.last_run_at = Time.zone.now\n self.next_run_at = nil\n self.save\n eval(self.job.gsub(/#JOBID#/, self.id.to_s).gsub(/#RAILS_ROOT#/, RAILS_ROOT))\n self.last_run_result = \"OK\"\n TaskServerLogger.instance.info \"Job completed successfully\"\n rescue Exception\n err_string = \"'#{self.job}' could not run: #{$!.message}\\n#{$!.backtrace}\"\n TaskServerLogger.instance.error err_string\n puts err_string unless ENV['RAILS_ENV'] == \"test\"\n self.last_run_result = err_string.slice(1..500)\n begin\n Notifier.deliver_job_failure(self)\n rescue\n end\n end\n self.save\n\n # ...and persist the next run of this job if one exists\n set_next_job\n end", "def initiate_check_run\n logger.debug \"initiate_check_run\"\n token = get_installation_token\n installation_client = Octokit::Client.new(bearer_token: token)\n\n # This method is called in response to GitHub acknowledging our request to create a check run.\n # We'll first update the check run to \"in progress\"\n # Then we'll run our CI process\n # Then we'll update the check run to \"completed\" with the CI results.\n\n # Octokit doesn't yet support the Checks API, but it does provide generic HTTP methods we can use!\n # https://developer.github.com/v3/checks/runs/#update-a-check-run\n # notice the verb! PATCH!\n result = installation_client.patch(@payload['check_run']['url'], {\n accept: 'application/vnd.github.antiope-preview+json', # This header is necessary for beta access to Checks API\n name: 'Maximum lines of code',\n status: :in_progress\n })\n\n # ***** DO IT! *****\n # This is where we would kick off our CI process. Ideally this would be performed async, so we could\n # return immediately. But for now we'll do a simulated CI process syncronously, and update the check run right here..\n pull_requests = result['pull_requests']\n pr = pull_requests[0]\n logger.debug \"Pull Request #{pr}\"\n repo = pr['base']['repo']['id']\n pr_number = pr['number']\n logger.debug \"Repo: #{repo} PR: #{pr_number}\"\n\n pull = installation_client.pull_request(repo, pr_number)\n logger.debug \"=====================\"\n logger.debug pull\n logger.debug \"=====================\"\n additions = pull['additions']\n # Was this a success?\n result = additions < 400 ? :success : :failure # could also be :failure\n logger.debug \"RESULT IS: #{result}\"\n\n opts = {\n accept: 'application/vnd.github.antiope-preview+json', # This header is necessary for beta access to Checks API\n name: 'Maximum lines of code',\n status: :completed,\n conclusion: result,\n completed_at: Time.now.utc.iso8601,\n\n head_branch: @payload['check_suite'].nil? ? @payload['check_run']['check_suite']['head_branch'] : @payload['check_suite']['head_branch'],\n head_sha: @payload['check_suite'].nil? ? @payload['check_run']['head_sha'] : @payload['check_suite']['head_sha']\n\n }\n\n # If there were more details from a real CI, such as warning details, line numbers, and so forth, we could add them to\n # the opts object here, like this:\n # if result == :failure\n # output = {\n # title: 'Awesome CI Warnings',\n # summary: 'There were problems with the submitted code',\n # annotations: []\n # }\n # ci_output.warnings.each do |warning|\n # # we need to take the local relative path, and extract the repo-relative path\n # filename = warning.filename\n # annotation = {\n # path: filename,\n # blob_href: \"#{@payload['repository']['blobs_url']}/#{filename}\".sub('{/sha}', \"/#{sha}\"),\n # start_line: warning.line_number,\n # end_line: warning.line_number,\n # annotation_level: :warning, #or :failure\n # message: warning.message\n # }\n # output[:annotations].push annotation\n # end\n #\n # opts[:output] = output\n # end\n\n # Now, mark the check run as complete! And if there are warnings, share them\n result = installation_client.patch(@payload['check_run']['url'], opts)\n\n result.attrs\n end", "def run_completed(node)\n send_run_completion(status: \"success\")\n end", "def run_succeeded; end", "def get_build\n @progressIndicator.setIndeterminate(true)\n @progressIndicator.startAnimation(nil)\n @downloadLabel.stringValue = \"Getting build number...\"\n chrome_build = ChromeBuild.new\n chrome_build.delegate = lambda do |data|\n result = NSString.alloc.initWithData data, encoding:NSUTF8StringEncoding\n @buildLabel.stringValue = \"Build: #{result}\"\n get_zip(result)\n end\n chrome_build.buf = NSMutableData.new\n chrome_build.response = nil\n\n url = NSURL.URLWithString(\"http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST\")\n req = NSURLRequest.requestWithURL(url)\n chrome_build.conn = NSURLConnection.alloc.initWithRequest(req, delegate:chrome_build)\n end", "def run\n if @start.kind_of? String\n client = Restfulie.at(@start)\n client = client.follow if @follow\n client = client.accepts(@accepts) if @accepts\n @start = current = client.get\n else\n # probably configured thru the Rest Process Model class\n @start = current = @goal.class.get_restfulie.get\n end\n \n # load the steps and scenario\n @goal.steps \n @goal.scenario \n \n while(!@goal.completed?(current))\n current = @walker.move(@goal, current, self)\n end\n current\n end", "def run_template\n launched_job.update(status_message: \"Running TplDevTest job\")\n launched_job.job_log.info \"Logging within TplDevTest job\"\n\n sleep self.sleep_seconds\n\n launched_job.status\n end" ]
[ "0.6675924", "0.6064393", "0.6002176", "0.5923482", "0.5817822", "0.57595235", "0.5709222", "0.5706443", "0.5695791", "0.56374663", "0.56328315", "0.5628286", "0.559973", "0.55960625", "0.5591285", "0.55885094", "0.55885094", "0.55885094", "0.55805016", "0.55734", "0.5567311", "0.5552241", "0.5548521", "0.553791", "0.55245656", "0.55029", "0.54887927", "0.5483295", "0.54568034", "0.5433089", "0.5422049", "0.54193366", "0.5414398", "0.53965646", "0.5367315", "0.53611076", "0.5312068", "0.5285248", "0.52702767", "0.52623", "0.5261683", "0.5243911", "0.5236271", "0.52169764", "0.52059597", "0.5184429", "0.5178663", "0.51700574", "0.5156509", "0.5149296", "0.5147253", "0.5145005", "0.5137609", "0.5136813", "0.51218784", "0.51160854", "0.51088727", "0.5105915", "0.5103556", "0.5103556", "0.5103556", "0.5103556", "0.5103556", "0.5100361", "0.5092143", "0.5085138", "0.50788337", "0.5073278", "0.5066905", "0.5064875", "0.50562066", "0.50562066", "0.50562066", "0.50485605", "0.5047209", "0.5039125", "0.50362974", "0.50362176", "0.5016641", "0.5014387", "0.5010688", "0.50064254", "0.5003097", "0.49971938", "0.49952278", "0.4973189", "0.49724668", "0.49668136", "0.49436772", "0.49420604", "0.49401182", "0.49316987", "0.49308127", "0.4930019", "0.49162638", "0.4909954", "0.49065563", "0.48972666", "0.48947757", "0.48939723" ]
0.5813523
5
Generate a password if no password define. This password if generate by rangexp. A gem require by dmsweatshop. If password no send after by mail, the password is not getting another time.
def generate_password if new_record? self.password = self.password_confirmation = /\w{0,10}/.gen unless password end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate\n @password = (1..@length).map { (33 + rand(89)).chr }.join \n check_password_contents\n @password\n end", "def generate_password\n self.password = Digest::SHA1.hexdigest(\"--#{Time.now.to_s}--#{self.email}--#{self.id}\")\n end", "def generate_new_password\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'\n password = ''\n 10.times { password << chars[rand(chars.size)] }\n self.update_attributes(:encrypted_password => User.encrypt(password, self.salt))\n UserMailer.deliver_forgot_password_mail(self, password)\n password\n end", "def generate_password\n self.password = random_string(32)\n self.e_password = Digest::SHA256.hexdigest(self.password)\n end", "def generate_password( length_of_pass, special_char )\n chars = []\n (\"a\"..\"z\").each {|ele| chars << ele}\n (\"A\"..\"Z\").each {|ele| chars << ele}\n (\"0\"..\"9\").each {|ele| chars << ele}\n if(special_char)\n [\"@\", \"!\", \"_\",].each {|ele| chars << ele}\n end\n newpass = \"\"\n 1.upto(length_of_pass) { |i| newpass << chars[rand(chars.size-1)] }\n #self.password\n self.unencrypted_password = newpass\n self.password_confirmation = newpass\n @unencrypted = true\n end", "def generate_password!(model:, **)\n model.password = SecureRandom.urlsafe_base64(8)\n end", "def generate_password\n self.password = SecureRandom.urlsafe_base64(10)\n self.password_confirmation = self.password\n end", "def generate_password\r\n return rand(36 ** 20).to_s(36)\r\n end", "def make_up_password\n\to = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map { |i| i.to_a }.flatten\n\tpass = (0...12).map { o[rand(o.length)] }.join + \"@\"\n\tputs \"Using #{pass} for password\\n\"\n\treturn pass\nend", "def generate_and_send_new_password\n new_password = \"\"\n chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#,.;:?%&\".split(//)\n (0..8).each do |i|\n new_password += chars.at(rand(chars.length))\n end\n self.update_attributes(:password => new_password)\n save!\n AdminMailer.password_reset(self, new_password).deliver\n new_password\n end", "def generate_password\n password = [('a'..'z'), ('A'..'Z'),(0..9)].map { |i| i.to_a }.flatten\n (8...32).map { password[rand(password.length)] }.join\n end", "def generate_password\n charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z @ # $ & ! }\n (0...6).map{ charset.to_a[rand(charset.size)] }.join\n end", "def generate_password\n [*('a'..'z'), *('A'..'Z'), *('0'..'9')].sample(8).join\n end", "def auto_generate_password\n case @generate_option\n when :never_generate\n return nil\n when :generate_no_query\n # Normally, :generate_no_query goes hand-in-hand with skipping\n # the query. However, if the Item's value was pre-assigned\n # and invalid, @skip_query will be set to false. This is so we\n # give the user an opportunity to fix the problem via a query.\n if @skip_query\n return Simp::Cli::Utils.generate_password\n else\n auto_default = 'yes'\n end\n when :generate_as_default\n auto_default = 'yes'\n when :no_generate_as_default\n auto_default = 'no'\n end\n\n if @minimize_queries\n # skip the 'Auto-generate the password?' query\n if auto_default == 'no'\n # assume auto-generation is not appropriate\n return nil\n else\n # assume auto-generation is appropriate\n password = generate_and_print_password\n end\n else\n password = nil\n @password_name = @key if @password_name.nil? or @password_name.empty?\n if agree( \"Auto-generate the #{@password_name} password? \" ){ |q| q.default = auto_default }\n password = generate_and_print_password\n end\n end\n password\n end", "def generate_password\n self.password = \"1234\"\n end", "def generate_and_print_password\n password = Simp::Cli::Utils.generate_password\n logger.say ('~'*80).green + \"\\n\"\n logger.say 'NOTE: '.green.bold + \" The generated password is: \\n\\n\"\n logger.say ' ' + password.yellow.bold + \"\\n\\n\"\n logger.say ' >>>> Please remember this password! <<<<'.bold\n logger.say ' It will ' + '**NOT**'.bold + ' be written to the log or hieradata.'\n logger.say ('~'*80).green + \"\\n\"\n logger.say '*** Press enter to continue ***'.cyan.bold.blink\n ask ''\n password\n end", "def generate_password\n pass = \"\"\n 20.times { pass += (rand(74) + 48).chr }\n\n begin\n Puppet.settings.write(:capass) { |f| f.print pass }\n rescue Errno::EACCES => detail\n raise Puppet::Error, \"Could not write CA password: %s\" % detail.to_s\n end\n\n @password = pass\n\n return pass\n end", "def generatePassword\r\n logger.info(\"UserController::generatePassword::Params-----#{params}\")\r\n @activationCode =''\r\n if !params['id'].blank?\r\n @activationCode = params['id']\r\n end\r\n end", "def random_password\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n password = ''\n #40.times { |i| password << chars[rand(chars.size-1)] }\n 15.times { |i| password << chars[rand(chars.size-1)] }\n self.password = password\n self.password_confirmation = password\n self.pwd = password\n self\n end", "def create_new_password\n pass = generate_password\n set_password(pass)\n pass\n end", "def generate_password\n if password_confirmation.nil?\n self.password = Devise.friendly_token.first(8)\n end\n end", "def _my_mkpass()\n mymkpass = ''\n 9.to_i.times{ mymkpass << (65 + rand(25)).chr }\n return mymkpass\nend", "def generate_temporary_password\n\n pw = Algol.password_salt\n # puts \">> User: generating a temporary password '#{pw}' <<\"\n update!({ password: User.encrypt(pw), auto_password: true })\n\n # expire all current/old temp passwords that weren't used\n pending_notices.all({ type: 'password' }).each { |n| n.expire! }\n\n notices.create({ type: 'password', data: pw })\n end", "def generate_and_send_password\n self.reload\n update_attribute :password, ('a'..'z').to_a[rand(26)].to_s + (0...5).map{ [rand(10)] }.join\n post_data = Net::HTTP.post_form URI.parse('http://3001300.ru/create_client_from_bonus.php'),\n { \n 'email' => self.email,\n 'password' => self.password\n }\n mail = InformMail.create! client: self, body: \"#{MessageText.welcome.sms.encode} #{self.password}\".encode(\"cp1251\")\n end", "def random_password\n chars = (\"a\"..\"z\").to_a + (\"A\"..\"Z\").to_a + (\"0\"..\"9\").to_a\n password = ''\n 40.times { |i| password << chars[rand(chars.size-1)] }\n self.password = password\n self.password_confirmation = password\n self\n end", "def random_password\r\n chars = (\"a\"..\"z\").to_a + (\"1\"..\"9\").to_a \r\n newpass = Array.new(8, '').collect{chars[rand(chars.size)]}.join\r\n end", "def standard_password\n \"!@Cd5678\"\n end", "def generate(password)\n BCrypt::Password.create(secret + password).to_s\n end", "def generate_password(length=6)\n chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789'\n password = ''\n length.times { |i| password << chars[rand(chars.length)] }\n password\n end", "def generate_password\n ['test', 'guest'].sample\nend", "def get_password\n status = true\n while status == true\n @password = @@prompt.mask(\"Create a password with at least 5 character\") do |q|\n q.validate(/[a-z\\ ]{5,15}/)\n end\n @password_2 = @@prompt.mask(\"Retype your password\") do |q|\n q.validate(/[a-z\\ ]{5,15}/)\n end\n if @password == @password_2\n system(\"clear\")\n status = false \n break\n else @password != @password_2\n puts \"Wrong password, try again\".colorize(:red)\n status = true\n end\n end\n end", "def get_password\n\tpwd1 = Password.get(\"New Password: \")\n\tpwd2 = Password.get(\"Retype New Password: \")\n\n\tbegin\n\t\traise if pwd1 != pwd2\n\t\trescue\n\t\t\tprint \"ERROR: Password mismatch!\\n\"\n\t\t\texit\n\tend\n\n\tbegin\n\t\tpwd1.check # check password strength\n\t\trescue\n\t\t\tprint \"ERROR: Password strength check failed: \" + $! + \"\\n\"\n\t\t\texit\n\tend\n\n\tsalt = rand.to_s.gsub(/0\\./, '')\n\tpass = pwd1.to_s\n\thash = \"{SSHA}\"+Base64.encode64(Digest::SHA1.digest(\"#{pass}#{salt}\")+salt).chomp!\n\treturn hash\nend", "def send_new_password(template)\n\n pass = create_new_password\n set_password(pass)\n save\n\n\n mailer = Mailer.new\n\n user_name = @data_object.user_acc_name\n if user_name.nil? || user_name.empty?\n user_name = contact.con_email\n end\n\n values = { \n \"user_name\" => user_name,\n \"password\" => pass\n }\n\n mailer.send_from_template(contact.con_email,\n \"Your DION Registration Information\",\n values,\n template)\n end", "def password\n UserMailer.password\n end", "def generate_password(length = 8)\n chars = ('a'..'z').to_a + ('A'..'Z').to_a + ('1'..'9').to_a - ['o', 'O', 'i', 'I']\n Array.new(length) { chars[rand(chars.size)] }.join\n end", "def set_new_password \n new_passwd = generate_password()\n self.password = self.password_confirmation = new_passwd\n self.save!\n return new_passwd\n end", "def password(length=20)\n SecureRandom.base64(length+2).tr('=', '')\n end", "def generate_password\n require 'securerandom' unless defined?(SecureRandom)\n password = SecureRandom.hex(30)\n node.normal['mysql']['local_admins'][new_resource.user]['password'] = password\n password\n end", "def random_new_password\n if self.random_password_length == 0\n nil\n else\n new_password = String.new\n for i in 0 .. self.random_password_length\n new_password += self.random_password_contains_of.scan(/./).sort_by {rand}.first\n end\n new_password\n end\n end", "def gen_random_user_pass()\n if datastore['USERNAME'] == ''\n # Generate random username\n datastore['USERNAME'] = rand_text_alpha(8+rand(8))\n end\n\n if datastore['PASSWORD'] == ''\n # Generate random password\n datastore['PASSWORD'] = rand_text_alpha(8+rand(8))\n end\n return\n end", "def generate_password( len = 6 )\n charset = %w{ 2 3 4 6 7 9 A C D E F G H J K M N P Q R T V W X Y Z a c d e g h j k m n p q r v w x y z }\n (0...len).map{ charset.to_a[rand(charset.size)] }.join\nend", "def set_temp_password\n self.password = SecureRandom.urlsafe_base64(6)\n end", "def password\n @password = Password.new(password_hash) unless password_hash.blank?\n end", "def create_password(length)\n chars = ('a' .. 'z').to_a + ('1' .. '9').to_a + '%$?@!'.split(//)\n Array.new(length, '').collect { chars[rand(chars.size)] }.join\nend", "def crypt_password\n # EmailNotify.send_user_create_notification self\n self[:password] =\n password_hash(password(true))\n @password = nil\n end", "def reset_password\n o = [('a'..'z'),('A'..'Z'),('0'..'9')].map{|i| i.to_a}.flatten\n new_password = (0..6).map{ o[rand(o.length)] }.join\n self.password = new_password\n if self.save\n return new_password\n else\n return nil\n end\n end", "def check_password_contents\n if /[a-zA-Z]+/.match(@password) && /\\d+/.match(@password) && /[[:punct:]]/.match(@password)\n else\n generate\n end\n end", "def mutate_bcrypt_password(_)\n '400$8$2d$f6ed5a490c441958$67f59aa61bc617849a3280b5e80f78607e53b5aa5807a44ddbc53e804e2e2a99'\n end", "def send_password(clear_password) \n self.password = Digest::SHA1.hexdigest(self.password_salt.to_s + clear_password)\n self.save\n \n Mailer.deliver_message(\n {:recipients => self.email,\n :subject => \"Your Expertiza password has been reset\",\n :body => {\n :user => self,\n :password => clear_password,\n :first_name => ApplicationHelper::get_user_first_name(self),\n :partial_name => \"send_password\" \n }\n }\n )\n \n end", "def password; end", "def password; end", "def password; end", "def password; end", "def password; end", "def password; end", "def password\n Digest::MD5.hexdigest(uuid)[0..9]\n end", "def set_random_password\n if password.blank?\n password = password_confirmation = BCrypt::Engine.generate_salt\n end\n end", "def mail_password\n if @yaml[\"mail\"][\"password\"] != \"example\"\n @yaml[\"mail\"][\"password\"]\n end\n end", "def send_p\n pwreset_key_success = false\n until pwreset_key_success\n self.password_reset_key = self.class.make_key\n self.save\n pwreset_key_success = self.errors.on(:password_reset_key).nil? ? true : false\n end\n send_pwd\n end", "def password(config, email, name, password)\r\n\t\t@subject = \"Your new #{config[:application][:name][:value]} password\"\r\n\t\t@recipients = email\r\n\t\t@from = \"#{config[:application][:name][:value]} <#{config[:emails][:password_reset][:value]}>\"\r\n\t\t@sent_on = Time.now\r\n\t\t@body['name'] = name\r\n\t\t@body['password'] = password\r\n\t\t@body['team_name'] = config[:application][:team_name][:value]\r\n\tend", "def generate_password\n self.password = Devise.friendly_token.first(8)\n end", "def password_token\n rng = MT19937.new(Time.now.to_i)\n password = 16.times.map { rng.extract_byte }\n base64_encode_bytes(password)\nend", "def random_password(size=10)\n random_string(size, :chars, 'ABCDEFGHJKLMNPQRSTUVWXYabcdefghkmnpqrstuvwxyz23456789#%^&$*i-_+=')\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def password\n @password ||= Password.new(password_hash)\n end", "def send_password\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def password_field\n $tracer.trace(__method__)\n #unit_test_no_generate: password_field, input.id(\"Password\")\n return ToolTag.new(input.id(\"Password\"), __method__, self)\n end", "def password=(new_password); end", "def password_helper_password\n if defined?(@password_helper_password) && !@password_helper_password.nil?\n return @password_helper_password\n end\n\n @password_helper_password = if password_helper_command\n password_helper_call\n end\n end", "def get_password(password)\n password\n end", "def password\n @password ||= Password.new(password_digest)\n end", "def password\n\n end", "def forgot_password\n self.password_reset_code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )\n end", "def password_required?; end", "def generate_password_token\n unless self.encrypted_password && !self.encrypted_password.blank?\n pwd = Devise.friendly_token[0,20]\n self.password = pwd\n set_reset_password_token\n end\n end", "def forgot_password\n if request.post?\n @user=User.find(:first, :conditions => [\"email=? AND system_role=?\", params[:user][:email], User::SYSTEM_ROLE_USER])\n if @user.present?\n o = [('a'..'z'),('A'..'Z'),(0..9)].map{|i| i.to_a}.flatten;\n newpass = (0..6).map{ o[rand(o.length)] }.join;\n #newpass = (1..7).map{ (0..?z).map(&:chr).grep(/[a-z\\d]/i)[rand(62)]}.join\n @user.encrypted_password = newpass\n \n Notifier.send_password(@user, newpass).deliver if @user.save\n flash[:notice] = \"New password is sent to your email id.\"\n else\n flash[:forget_pw__error] = \"Error\"\n flash[:notice] = \"Email is not registered.\"\n end\n redirect_to :action => \"home\"\n end\n end", "def create_password\n self.uuid = TempPassword.get_uuid\n self.hashed_uuid = Digest::SHA1.hexdigest(uuid)\n end", "def postgres_password(new_resource)\n new_resource.password == 'generate' ? secure_random : new_resource.password\n end", "def password\n end", "def password\n end", "def password\n @password||=@options['password']\n end", "def postgres_password(new_resource)\n new_resource.password == 'generate' ? secure_random : new_resource.password\n end", "def password\n @password ||= match[4]\n end", "def cryptpass\n !self.password.nil? && self.password = self.password.crypt((rand*100).to_s)\n self.active = true\n end", "def password_generator(size)\n chars = ('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a\n (chars.sample(size)) * ''\nend", "def generate_reset_password_token!\n characters = ('a'..'z').to_a + ('A'..'Z').to_a \n self.reset_password_sent_at = Time.zone.now.utc\n self.reset_password_token = (1..12).map{characters.sample}.join # Generate a 12-length random string\n save(:validate => false)\n end", "def new_password; nil; end", "def make_password_reset_code\n self.password_reset_code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )\n end", "def forgot_password\n if request.post?\n @user=User.find(:first, :conditions => [\"email=? AND system_role=?\", params[:user][:email], User::SYSTEM_ROLE_USER])\n if @user.present?\n o = [('a'..'z'),('A'..'Z'),(0..9)].map{|i| i.to_a}.flatten;\n newpass = (0..6).map{ o[rand(o.length)] }.join;\n #newpass = (1..7).map{ (0..?z).map(&:chr).grep(/[a-z\\d]/i)[rand(62)]}.join\n @user.encrypted_password = newpass\n \n Notifier.delay.send_password(@user, newpass) if @user.save\n flash[:notice] = \"New password is sent to your email id.\"\n else\n flash[:forget_pw__error] = \"Error\"\n flash[:notice] = \"Email is not registered.\"\n end\n redirect_to :action => \"home\"\n end\n end" ]
[ "0.79126346", "0.76742905", "0.7668596", "0.7574189", "0.7570792", "0.7567037", "0.75636303", "0.75169516", "0.7503771", "0.7464348", "0.74511606", "0.7421255", "0.7279182", "0.72705656", "0.7221403", "0.7165341", "0.71633637", "0.7150701", "0.7140875", "0.7084795", "0.7080585", "0.703349", "0.7029086", "0.6998971", "0.69850874", "0.69812965", "0.6974891", "0.6910935", "0.69074404", "0.6888854", "0.686627", "0.68577886", "0.6843597", "0.68104595", "0.6800588", "0.6774424", "0.6751536", "0.67490155", "0.67393076", "0.67128557", "0.67117536", "0.67097795", "0.66729856", "0.6668769", "0.6665053", "0.6650318", "0.66444427", "0.6607744", "0.66043574", "0.6601944", "0.6601944", "0.6601944", "0.6601944", "0.6601944", "0.6601944", "0.6596469", "0.65863395", "0.6566587", "0.65663123", "0.65648746", "0.6545481", "0.65118843", "0.65002066", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6495975", "0.6489145", "0.6487542", "0.6486206", "0.6483158", "0.6481325", "0.6475158", "0.6469732", "0.6468889", "0.6465124", "0.64643896", "0.6457908", "0.6452212", "0.6451137", "0.6449438", "0.6449438", "0.6437971", "0.64377296", "0.64361155", "0.6433015", "0.6430203", "0.64296204", "0.642962", "0.64187413", "0.64068466" ]
0.7891413
1
String origin Fixnum offset Fixnum limit
def hours render json: Pings::Selector.new.hours(params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translate_offset(str, byte_offset)\n chunk = str[0..byte_offset]\n begin\n chunk.unpack(\"U*\").length - 1\n rescue ArgumentError # we damaged a character\n chunk = str[0..(byte_offset+=1)]\n retry\n end\n end", "def to_offset(text, position); end", "def get_str(offset, len)\n @buf[offset..offset+len-1]\n end", "def pincrement_string(str)\n chars = str.chars\n last = chars[-1]\n if last == last.to_i.to_s\n last = (last.to_i + 1).to_s\n end\n chars\nend", "def offset!(obj, len) #@todo V should be nil not ''\n [_offset_from_length(obj, len), (obj.slice!(0..len-1) || '')].reverse\n end", "def normalize_offset(offset); end", "def cutinfo(string)\n inf=/\\024/=~string1\n inf=inf+2\n trans=string1[inf..-1]\nend", "def dynamic_truncation(string)\n log 'string', string\n log 'string as hex', string.unpack('H*')\n\n bytes_in_string = string.bytes.length\n log 'bytes_in_string', bytes_in_string # RFC says this should be 20 bytes\n\n unless bytes_in_string == 20\n raise \"Incorrect string size. Should be 20 bytes but is #{bytes_in_string}.\"\n end\n\n # Let OffsetBits be the low-order 4 bits of String[19]\n last_byte = string.bytes.last\n least_significant_4_bits = last_byte & 0x0f\n offset = least_significant_4_bits\n\n # Offset = StToNum(OffsetBits) // 0 <= OffSet <= 15\n log 'offset byte', offset\n # Let P = String[OffSet]...String[OffSet+3]\n pee_bytes = string.bytes[offset..offset + 3]\n log 'pee_bytes', pee_bytes\n pee = pee_bytes.pack('CCCC')\n log 'offset range', \"#{offset}..#{offset + 3}\"\n log 'pee', pee\n log 'pee as hex', pee.unpack('H*')\n bytes_in_pee = pee.bytes.length\n log 'bytes_in_pee', bytes_in_pee\n\n # Return the Last 31 bits of P\n pee_in_binary = pee.bytes.map { |b| b.to_s(2).rjust(8, '0') }.join\n log 'pee_in_binary', pee_in_binary\n\n last_31_bits_of_pee = pee_in_binary[1..31]\n log 'last_31_bits_of_pee', last_31_bits_of_pee\n last_31_bits_of_pee\n end", "def copy_string(start_pos, end_pos)\n res = @str[start_pos...end_pos]\n res.gsub!(/\\000/, '')\n res\n end", "def new_string_offset\n last_string_index = @data[last_string_index_offset, 4].unpack1('V')\n offset = @offset + @string_start + last_string_index\n\n u16len, o16 = ResStringPool.utf16_len(@data[offset, 4])\n # To insert a new string at the end of the string section, we need to start at the current\n # last string entry, and add o16 (number of length bytes), u16len * 2(number of string bytes),\n # and 2 bytes for the terminating null-bytes.\n offset + o16 + u16len * 2 + 2\n end", "def char_offset(offset)\n raise \"Should not be called\"\n end", "def offset_range\n return nil unless original_text\n start_pos.offset...(start_pos.offset + original_text.bytesize)\n end", "def start_of_word(word, nbr)\n\treturn \"#{word}\".slice(0, nbr )####renvoie une sous-chaine de caractère (position, nbr caractere recupérés)\nend", "def prefix\n number[3..5]\n end", "def get_char_summery(string, count)\n string[0..count]\n end", "def position_string\n # Oddly, String#delete is non-destructive, unlike Array#delete\n @padded_board_string.delete('*').scan(/..../).reverse.join\n end", "def get_note_at_offset(note, offset)\n note = note.to_s\n # If the note ends with a number, increase it by offset and add it on again.\n if note.end_with?(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\")\n octave = note[note.length - 1].to_i + offset\n return note.chop + octave.to_s\n else\n # Otherwise, just use the number 4 (default)\n return note + (offset + 4).to_s\n end\n end", "def decode_str\n index_of_last_digit = @index + self[@index..self.length - 1].index(':')\n length_of_string = self[(@index)..(@index + index_of_last_digit - 1)].to_i\n\n # The string itself starts 1 past the index of the last digit (because of the colon)\n # and ends 2 more than the length of the string past the index.\n string = self[(index_of_last_digit + 1)..(index_of_last_digit + length_of_string)]\n\n # Increment index by the length of the string plus the length of the digits.\n @index += index_of_last_digit - @index + length_of_string\n string\n end", "def stringy(num, start = 1)\n return 'Positive integer only' unless num.is_a?(Integer) && num > 0\n return 'Invalid starting number' unless start == 1 || start == 0\n\n string = ''\n num.times do\n string << start.to_s\n start = 1 - start\n end\n string\nend", "def offset_lx\n size_l.blank? ? '' : size_l.split(/x|\\+/)[2].to_i\nend", "def _i(str)\n _n(str).gsub(/([\\d]+)(\\..*)/, '\\1')\n end", "def pos=(n)\n unless n._isFixnum\n n = Maglev::Type.coerce_to(n, Fixnum, :to_int)\n end\n raise RangeError, \"xxx\" if n > @string.size\n @pos = n\n end", "def fmtstr_stack_read(offset, extra = '')\n\n\t\t# cant read offset 0!\n\t\treturn nil if offset < 1\n\t\t \n\t\tfmt = ''\n\t\tfmt << extra\n\t\tif @use_dpa\n\t\t\tfmt << \"|%\" + offset.to_s + \"$x\"\n\t\telse\n\t\t\tx = offset\n\t\t\tif @use_fpu and x >= 2\n\t\t\t\tfmt << \"%g\" * (x/2)\n\t\t\t\tx %= 2;\n\t\t\tend\n\t\t\tfmt << \"%x\" * (x-1)\n\t\t\tfmt << \"|\"\n\t\t\tfmt << \"%x\"\n\t\tend\n\t\t\n\t\tres = trigger_fmt(fmt)\n\t\treturn res if not res\n\t\t\n\t\tnumstr = extract_fmt_output(res)\n\t\tdw = numstr.split('|')[1].to_i(16)\n\tend", "def read(offset, how_much)\n @str[offset, how_much]\n end", "def pe(i); str(nil, i, ')'); end", "def offset_ly\n size_l.blank? ? '' : size_l.split(/x|\\+/)[3].to_i\nend", "def offset; end", "def offset; end", "def offset; end", "def read(offset, how_much)\n @str[offset, how_much]\n end", "def ip_from_num(i)\n \"192.168.90.#{i+IP_OFFSET}\"\nend", "def char_offset(byte_offset)\n end", "def char_offset(byte_offset)\n string.byteslice(0, byte_offset).length\n end", "def start_of_word(word,nb)\n\tword[0...nb]\nend", "def char_length(offset, end_offset)\n end", "def weirdFixString(str)\n idx = str.index(\"\\000\\000\")\n idx.nil? ? str : str[0..idx]\n end", "def start_of_word (str, num)\n\n str[0, num]\n\nend", "def peek(len)\n unless len._isFixnum\n raise RangeError,'expected Fixnum'\n end\n raise ArgumentError if len < 0\n return \"\" if len.equal?(0)\n return @string[@pos, len]\n end", "def increment_value str\n str.concat str.next.slice(-1)\nend", "def line_offset(pos=pos())\n p = 0\n string.each_line do |line|\n len = line.length\n return (pos - p) if p + len >= pos\n p += len\n end\n 0\n end", "def offset(o)\n o = o.to_i if o.is_a?(String) && !o.is_a?(LiteralString)\n if o.is_a?(Integer)\n raise(Error, 'Offsets must be greater than or equal to 0') unless o >= 0\n end\n clone(:offset => o)\n end", "def zerofill2(n)\n n.to_s.rjust(2, '0')\n end", "def offset_on_line(offset)\n line_offset = line_index[line_for_offset(offset)-1]\n if multibyte?\n @string.byteslice(line_offset, offset-line_offset).length\n else\n offset - line_offset\n end\n end", "def maskify(cc)\n return cc.length <= 4 ? cc : ('#' * (cc.length-4)) + cc[cc.length-4..cc.length-1]\nend", "def partial(i)\n return false if i > 8\n return @pan.to_s.split('')[(i-1)..(i+1)].join().to_i\n end", "def b_offset\n @last_4[1].to_i\n end", "def start_of_word (string, number)\n number = number - 1\n string[0..number]\nend", "def expand(n)\r\n @string * n\r\n end", "def offset_str\n offset_info_data = self.offset_info\n return \"#{offset_info_data[:sign]}#{\"%02d\" % offset_info_data[:hours]}#{\"%02d\" % offset_info_data[:mins]}\"\n end", "def line_offset(pos=pos)\n p = 0\n string.each_line do |line|\n len = line.length\n return (pos - p) if p + len >= pos\n p += len\n end\n 0\n end", "def initialize str\n @origin = str\n end", "def fmtstr_target_short(value, num_printed)\n\t\tif value < num_printed\n\t\t\treturn (0x10000 - num_printed) + value\n\t\tend\n\t\treturn value - num_printed\n\tend", "def start_of_word(str, n = 1)\n str[0, n]\nend", "def start_of_word(str, number)\n\treturn str[0, number]\nend", "def get_string(offset)\n @contents.pos = offset\n return @contents.gets\n end", "def _rl_adjust_point(string, point)\r\n\r\n length = string.length\r\n return -1 if (point < 0)\r\n return -1 if (length < point)\r\n\r\n pos = 0\r\n\r\n case @encoding\r\n when 'E'\r\n x = string.scan(/./me)\r\n i, len = 0, x.length\r\n while (pos < point && i < len)\r\n pos += x[i].length\r\n i += 1\r\n end\r\n when 'S'\r\n x = string.scan(/./ms)\r\n i, len = 0, x.length\r\n while (pos < point && i < len)\r\n pos += x[i].length\r\n i += 1\r\n end\r\n when 'U'\r\n x = string.scan(/./mu)\r\n i, len = 0, x.length\r\n while (pos < point && i < len)\r\n pos += x[i].length\r\n i += 1\r\n end\r\n when 'X'\r\n enc = string.encoding\r\n str = string.force_encoding(@encoding_name)\r\n len = str.length\r\n if point <= length / 2\r\n # count byte size from head\r\n i = 0\r\n while (pos < point && i < len)\r\n pos += str[i].bytesize\r\n i += 1\r\n end\r\n else\r\n # count byte size from tail\r\n pos = str.bytesize\r\n i = len - 1\r\n while (pos > point && i >= 0)\r\n pos -= str[i].bytesize\r\n i -= 1\r\n end\r\n pos += str[i + 1].bytesize if pos < point\r\n end\r\n string.force_encoding(enc)\r\n else\r\n pos = point\r\n end\r\n pos - point\r\n end", "def start_of_word(word, number)\n word[0..number-1]\nend", "def unicode_slice(length)\n if size_for_print <= length\n self\n else\n result = unicode_slice_for_len(length - 2)\n if result != self\n result + '..'\n else\n result\n end\n end\n end", "def display_number\n # \n ('X' * (account_number.to_s.length - last_digits.size)) + last_digits\n # account_number.to_s[0..last_digits.size].to_s.size + \n # last_digits.to_s\n end", "def grab_sin(string)\n string.slice(SIN_NUMBER) \nend", "def left2(str)\n puts str[2..-1] + str[0..1] \nend", "def string\n io.pos = start_index unless io.pos == start_index\n io.read(num_bytes)\n end", "def chars_left; end", "def intToLocNum(num)\n\tlocNumStr = \"\"\n\twhile num > 0\n\t\tlocNum = Math.log(num, 2).floor\n\t\tnum -= 2**locNum\n\t\tlocNumStr += (97 + locNum).chr\n\tend\n\tlocNumStr.reverse\nend", "def magic_num(str)\t\n\tstr.bytes.reduce(0) {|sum, c_bytes| sum+=c_bytes-64}\nend", "def decode_string(raw, offset=0)\n if raw.bytesize < offset + 4\n raise DecodeError, \"data too short\"\n end\n\n size_s = raw.byteslice(offset, 4)\n\n size = size_s.unpack(\"L>\").first\n\n if raw.bytesize < offset + 4 + size\n raise DecodeError, \"data too short\"\n end\n\n string = raw.byteslice(offset + 4, size)\n\n [string, 4 + size]\n end", "def first_offset; end", "def first_offset; end", "def offset_on_line(offset)\n line_offset = line_index[ line_for_offset(offset)-1 ]\n @string.byteslice(line_offset, offset-line_offset).length\n end", "def slice(str, *args)\n if (args.size == 2 && args.first.is_a?(Range))\n raise TypeError, 'cannot convert Range into Integer' # Do as if we were native\n elsif (args.first.is_a?(Range) or args.size == 2)\n str.unpack(\"U*\").slice(*args).pack(\"U*\") rescue nil\n else\n str.slice(*args)\n end\n end", "def rest_size\n p = @pos\n ss = @string.size\n if p < ss\n ss - p\n else\n 0\n end\n end", "def strand; @data[8]; end", "def offset(*) end", "def without_end(str)\n str[1...str.length - 1]\n end", "def nextstring(opts={})\r\n off = opts[:offset] || 0\r\n sz = opts[:minimum] || 7\r\n u = opts[:unicode] || false\r\n l = size\r\n i = off\r\n while i < l\r\n if self[i].printable?\r\n start = i\r\n cnt = 1\r\n i += 1\r\n lastu = false\r\n while i < l\r\n if self[i].printable?\r\n lastu = false\r\n cnt += 1\r\n i += 1\r\n elsif u and self[i] == 0 and not lastu\r\n lastu = true\r\n i += 1\r\n else\r\n break\r\n end\r\n end\r\n\r\n return([start, i - start]) if cnt >= sz\r\n else\r\n i += 1\r\n end\r\n end\r\n\r\n return false, false\r\n end", "def maskify(cc)\n # your beautiful code goes here\n cc.length <= 4 ? cc : \"#\" * (cc.length-4) + cc[-4..-1]\nend", "def description_from_string(str)\n len = 12\n return str unless str.length > len\n \"#{str[0..len - 1]}...\" # Is this length correct?\n end", "def decode\n \"#{@width}%x#{@height}+#{offset_x}+#{offset_y}\"\n end", "def input_to_index(position)\nindex = position.strip.to_i - 1\nreturn index\nend", "def char_offset(offset)\n effective_line = @locator.line_for_offset(offset)\n locator.char_offset(offset) + (effective_line * @leading_line_offset) + @leading_offset\n end", "def get_data_offset(data_array)\n\t#This will be returned as an int indicating the byte the data starts at\n\tdata_array.reverse.map{|e| \"%08b\" % e}.join.to_i(2)\nend", "def to_s22\n \tinteger=self.to_i\n \trval=''\n 22.times do\n c=(integer & 0x3F)\n rval+=@@chars64[c]\n integer =integer >> 6\n end\n return rval.reverse\n end", "def line_char_to_offset(text, line, character); end", "def MidChar ( num )\n\n x = num.to_s.length()\n\n case x\n\n when 3\n\n return num.to_s[1,1]\n\n when 5\n\n return num.to_s[2,1]\n\n when 7\n\n return num.to_s[3,1]\n\n else\n\n return -1\n\n end\n\nend", "def guess_limit(str)\n @limit = @str.length.to_i * 2\n end", "def char_offset(byte_offset)\n if multibyte?\n @string.byteslice(0, byte_offset).length\n else\n byte_offset\n end\n end", "def strip_markers(str, size)\n first = (str.rindex(\"\\0\", -size) || -1) + 1\n last = str.index(\"\\0\", size) || str.size\n str[first...last]\n end", "def pad_string(str)\n str.scan(/..../).reverse.join.dup.insert(0,'*****').insert(9,'*').insert(18,'*').insert(27,'*').insert(36,'*').insert(41,'*****')\n end", "def decode s\n i = 0\n s.each_char { |c| i = i * @base + @sequence.index(c) }\n i\n end", "def shortened_string(string)\n string[0, 100] << \"...\" unless string.length < 100\n end", "def fixnum\n Util.from_bytes :fixnum, value\n end", "def tarjan_string_limit(n)\n tarjan.take(n).inject(\"\") {|s,i| s + \" \" + i.to_s }\n end", "def char_length(offset, end_offset)\n string.byteslice(offset, end_offset - offset).length\n end", "def decode_int\n # @index is at the position of the the 'i' so we just need everything between it\n # and the next appearance of 'e'.\n index_of_last_digit = self[@index..self.length - 1].index 'e'\n number_string = self[(@index + 1)..(@index + index_of_last_digit - 1)]\n @index += index_of_last_digit\n number_string.to_i\n end", "def cstr\n r = @data.unpack(\"@#{pos}Z*\")[0]\n @pos += r.bytesize + 1\n r\n end", "def n(num)\n num.to_s.reverse.gsub(/...(?=.)/,'\\&,').reverse\n end", "def shorten(len=20)\n self[0..len-1]\n end", "def limit_size(str, max)\n if str.length > max\n return str[0...max]\n end\n str\n end", "def limit_size(str, max)\n if str.length > max\n return str[0...max]\n end\n str\n end", "def shift_left(string)\n new_string = string[1..string.size]\n last_number = string[0]\n print new_string.insert(-1,last_number)\nend", "def abreviar( tamanho, string_final = ' ...' )\n return nil if self.nil?\n return self[0..tamanho] + ( self.size > tamanho ? string_final : '' )\n end" ]
[ "0.65438384", "0.6261865", "0.62605834", "0.5966196", "0.59470475", "0.59242624", "0.5922919", "0.58978355", "0.588022", "0.5859147", "0.5853865", "0.58457434", "0.5820027", "0.5808079", "0.5804861", "0.57925075", "0.57863146", "0.5774931", "0.5727166", "0.57192177", "0.57062274", "0.56344914", "0.56090605", "0.56066364", "0.55963755", "0.5573909", "0.55478793", "0.55478793", "0.55478793", "0.55455136", "0.5541374", "0.5529296", "0.55289274", "0.55214345", "0.55164844", "0.5515849", "0.5513855", "0.550851", "0.5500584", "0.5499077", "0.5485354", "0.5475469", "0.54679257", "0.54501826", "0.54460967", "0.5429085", "0.5428684", "0.5427435", "0.54232806", "0.5420348", "0.5413637", "0.54077667", "0.54059607", "0.5404386", "0.53993505", "0.53906393", "0.53748196", "0.5353217", "0.53475916", "0.5339875", "0.53370553", "0.53305435", "0.53156793", "0.531466", "0.53089595", "0.53059185", "0.52945673", "0.52945673", "0.52914846", "0.529043", "0.52902615", "0.5289761", "0.52865016", "0.5280483", "0.52748835", "0.52744955", "0.52732205", "0.5273", "0.5270409", "0.52703977", "0.52664095", "0.52659774", "0.52555925", "0.5246881", "0.52443063", "0.52383274", "0.52368295", "0.5233997", "0.5233607", "0.5225721", "0.52252126", "0.52166075", "0.521551", "0.5213704", "0.5213397", "0.52096397", "0.5208321", "0.52075076", "0.52075076", "0.52073455", "0.5206331" ]
0.0
-1
If the work includes our default processable terms
def perform debug_verbose = ::Hyrax::OrcidIntegrationService.hyrax_orcid_jobs_debug_verbose ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here, ::Deepblue::LoggingHelper.called_from, "Flipflop.hyrax_orcid?=#{Flipflop.hyrax_orcid?}", "@work.id=#{@work.id}", "" ] if debug_verbose return unless Flipflop.hyrax_orcid? orcids = Hyrax::Orcid::WorkOrcidExtractor.new(@work).extract ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here, ::Deepblue::LoggingHelper.called_from, "Flipflop.hyrax_orcid?=#{Flipflop.hyrax_orcid?}", "orcids=#{orcids}", "" ] if debug_verbose orcids.each { |orcid| perform_user_strategy(orcid) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def term_required?( term )\n #puts \"=====> GenericWork.term_required? #{term}\"\n return true if [:author_email, :author_first_name, :author_last_name, :author_institution, :title, :creator, :contributor, :description, :publisher, :rights, :identifier, :department, :degree, :license].include? term\n false\n end", "def term_multiple?( term )\n #puts \"=====> GenericWork.term_multiple? #{term}\"\n return true if [:keyword, :title, :contributor, :subject, :related_url, :sponsoring_agency, :admin_notes].include? term\n false\n end", "def has_additional_terms_of_use\n false\n end", "def read_terms\n object.tnc_last_accepted.present?\n end", "def term_readonly?( term )\n #puts \"=====> GenericWork.term_readonly? #{term}\"\n return true if [:author_email, :author_institution, :date_created, :identifier, :publisher, :department, :degree, :license].include? term\n return true if term == :title && is_sis_thesis?\n false\n end", "def processable?\n return true if self.user && !self.user.new_record?\n\n # clean error on accept_terms\n self.errors.delete(:accept_terms)\n \n # check if terms of use have been accepted\n self.errors.add(:accept_terms, :accepted) if self.accept_terms.to_i.zero?\n \n self.errors.blank?\n end", "def terms\n raise NotImplementedError\n end", "def terms\n end", "def has_terms?\n ! @data['terms'].nil?\n end", "def supports_term?\n term_config.present?\n end", "def primary_terms\n primary = required_fields + [:access_copy, :preservation_copy, :thumbnail_link]\n primary = (primary & terms)\n\n (required_fields - primary).each do |missing|\n Rails.logger.warn(\"The form field #{missing} is configured as a \" \\\n 'required field, but not as a term. This can lead ' \\\n 'to unexpected behavior. Did you forget to add it ' \\\n \"to `#{self.class}#terms`?\")\n end\n\n primary\n end", "def terms\n\tend", "def terms_accepted?\n true\n end", "def terms\n\n end", "def terms\n\n end", "def url_search_terms\n if openbis?\n []\n else\n super\n end\n end", "def term_replacements?\n term_replacement_count.positive?\n end", "def valid_processors\n [:kramdown] + third_party_processors\n end", "def completed_text_extraction\n @found_completed_text_extraction = true\n end", "def completed_text_extraction\n end", "def process()\n \n dict = DictionaryFactory::build(@data, @settings[:options])\n \n unless dict == false\n @data[:words] = dict\n return true\n else\n return false\n end\n \n end", "def add_work_type_filter\n return if options[:work_types].blank?\n body.filter(:terms, work_types: options[:work_types])\n end", "def text_search_terms\n @text_search_terms ||=\n [first_name_query, middle_name_query].flatten.compact_blank.uniq\n end", "def term; end", "def secondary_terms\n []\n end", "def parse_terms()\n\t\tif next_TokenGrabbed(\"*\")\n\t\t\tputs \"Multiplicand Hit.\"\n\t\t\tif parse_factor()\n\t\t\t\tif parse_terms()\n\t\t\t\t\ttrue\n\t\t\t\telse\n\t\t\t\t\ttrue\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tfalse\n\t\t\tend\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend", "def terms_of_use\n return @terms_of_use\n end", "def term?\n type.in?(%i[tag metatag wildcard all none])\n end", "def possible_words?(q)\n\tresults = $wordnik.search_words_new(q)[\"searchResults\"]\n\tresults.map { |w| w[\"word\"] }\nend", "def above_fold_terms\n [:maker,\n :date_original,\n :date_published,\n :resource_type,\n :genre_string,\n :identifier,\n :rights,\n ]\n end", "def primary_terms\n [:title, :description, :source, :rights_note]\n end", "def needed_if_relevant?\n false\n end", "def set_search_terms\n if relevent_dish\n self.search_terms = self.name_translations.collect do |key,value|\n next value\n end.join(\" \")\n if self.restaurant\n self.restaurant_name = self.restaurant.name\n end\n if img = self.image.first\n self.top_image = img.img_url_medium\n end\n else\n self.search_terms = nil\n end\n save\n end", "def terms_conditions\r\n\t@title = \"Terms & Conditions\"\r\n end", "def usage_terms\n if request.post?\n # OPTIMIZE check if really submitted the form (hidden variable?)\n current_user.usage_terms_accepted!\n redirect_to root_path\n else\n @usage_term = UsageTerm.current\n \n @title = \"Medienarchiv der Künste: #{@usage_term.title}\"\n @disable_user_bar = true\n @disable_search = true\n end\n end", "def has_accepted_submission_terms?\n SUBMITTED_STATUS.include?(aasm_state)\n end", "def terms_conditions\n @title = \"Terms and Conditions\"\n end", "def secondary_terms\n []\n end", "def secondary_terms\n []\n end", "def secondary_terms\n []\n end", "def process_solutions\n raise NotImplementedError, 'You must implement this'\n end", "def supported_terms\n term_help_messages.keys\n end", "def known(words)\n return words.find_all {true } #find all words for which condition is true,\n #you need to figure out this condition\n \n end", "def needed_if_relevant?\n false\n end", "def check_for_definitions\n @words.each do |word|\n @lemma ? lemma = \" - #{@lemmas[word]}\" : lemma = \"\"\n\n # Strip characters - mimics trimWordLowerCase in texts.js\n regex = /[\\u200B-\\u200D\\uFEFF\\u00A0]/\n word.gsub!(regex, \"\")\n regex = /^[.,!¡?¿:;\\/|\\\\'\"“”‘’‚„«»‹›()\\[\\]\\-_]+|[.,!¡?¿:;\\/|\\\\'\"“”‘’‚„«»‹›()\\[\\]\\-_]+$/\n word.gsub!(regex, \"\")\n \n next if word.length == 0\n \n # Convert to lowercase\n word = word.mb_chars.downcase.to_s\n current_word = word\n \n while word.length > 0 do\n if Match.find_by_word_and_text_id(word, @text)\n break\n else\n if word.length == 1\n @missing.push(\"#{current_word}#{lemma}\")\n break\n else\n if word.last == \"*\"\n word.chomp!(\"*\") # Remove wildcard character, if present\n word = word[0..-2] # Remove last character\n end\n word << \"*\" # Add wildcard character\n end\n end\n end\n end\n end", "def testing_search?\n processes.include?('searchd')\nend", "def characterization_terms(omdoc)\n h = {}\n omdoc.class.terminology.terms.each_pair do |key, target|\n # a key is a proxy if its target responds to proxied_term\n next unless target.respond_to? :proxied_term\n begin\n h[key] = omdoc.send(key)\n rescue NoMethodError\n next\n end\n end\n h.delete_if { |_k, v| v.empty? }\n end", "def has_accepted_medicaid_terms?\n SUBMITTED_STATUS.include?(aasm_state)\n end", "def complete_word?(term)\n term =~ /#{ArchiveConfig.autocomplete[:terminator]}$/\n end", "def clean_terms\n submission_keys = redis.lrange(SUBMISSIONS_KEY, 0, -1)\n submission_keys.each do |submission_key|\n redis.hdel(submission_key, \"terms\")\n end\n end", "def only_active_works(solr_parameters)\n return if user_has_active_workflow_role? || depositor?\n super\n end", "def pre_compute_n_0_0\n results = {}\n\n # Logger\n n = 1\n\n classes.each do |q_klass|\n results[q_klass] = {}\n\n uniq_terms.each do |term|\n n += 1\n count = 0.0\n\n @data.each_pair do |klass, documents|\n if klass != q_klass\n documents.each do |document|\n count += 1 if !document.include?(term)\n end\n end\n end\n\n results[q_klass][term] = count\n end\n end\n\n results\n end", "def primary_terms\n terms - self.class.hyrax_form_fields\n end", "def termsig(*) end", "def process_descs(descs)\n if $options[:readonly]\n branch_report descs\n else\n build_the_world descs\n end\nend", "def run_corpus # :nodoc:\n tokens = @processor.process\n tokens.each do |token|\n category = @db[token]\n @matches[category] << token if category # word's in corpus.\n end\n end", "def characterization_terms(doc)\n h = {}\n\n doc.class.terminology.terms.each_pair do |key, _target|\n h[key] = doc.public_send(key)\n rescue NoMethodError\n next\n end\n\n h.compact\n end", "def enter_terms(test_data)\n test_terms = test_data[Org::ORG_TERM_GRP.name]\n prep_fieldsets_for_test_data([fieldset(Org::ORG_TERM_GRP.name)], test_terms)\n scroll_to_top\n test_terms.each_with_index do |test_term, index|\n enter_org_display_name(test_term[Org::TERM_DISPLAY_NAME.name], index)\n wait_for_element_and_type(org_term_name_input(index), test_term[Org::TERM_NAME.name])\n wait_for_element_and_type(org_term_qualifier_input(index), test_term[Org::TERM_QUALIFIER.name])\n wait_for_options_and_select(org_term_status_input(index), org_term_status_options(index), test_term[Org::TERM_STATUS.name])\n wait_for_options_and_select(org_term_type_input(index), org_term_type_options(index), test_term[Org::TERM_TYPE.name])\n wait_for_options_and_select(org_term_flag_input(index), org_term_flag_options(index), test_term[Org::TERM_FLAG.name])\n wait_for_options_and_select(org_term_language_input(index), org_term_language_options(index), test_term[Org::TERM_LANGUAGE.name])\n wait_for_element_and_click org_term_pref_for_lang_input(index) if test_term[Org::TERM_PREF_FOR_LANGUAGE.name]\n wait_for_element_and_type(main_body_name_input(index), test_term[Org::MAIN_BODY_NAME.name])\n wait_for_element_and_type(addition_to_name_input(index), test_term[Org::ADDITIONS_TO_NAME.name])\n enter_auto_complete(org_term_source_name_input(index), org_term_source_name_options(index), test_term[Org::TERM_SOURCE.name], 'Local Citations')\n wait_for_element_and_type(org_term_source_detail_input(index), test_term[Org::TERM_SOURCE_DETAIL.name])\n wait_for_element_and_type(org_term_source_id_input(index), test_term[Org::TERM_SOURCE_ID.name])\n wait_for_element_and_type(org_term_source_note_input(index), test_term[Org::TERM_SOURCE_NOTE.name])\n end\n end", "def terms_of_use\n end", "def make_terms(text, lang)\n if !text\n return []\n end\n \n text = clean_text(text)\n\n # Turn non-breaking spaces into spaces. This is more complex than it should be, \n # due to Ruby version and platform character encoding differences\n # In particular Windows always seems to read as IBM437 encoding\n if RUBY_VERSION < \"1.9\"\n text.gsub!(/\\302\\240/,' ') \n else\n text.gsub!(\"\\u00A0\", \" \") # turn non-breaking spaces (UTF-8) into spaces \n end\n\n text = downcase_l(text,lang)\n\n # cleanups on Cable and Warlogs data\n text.gsub!(\"&amp;\",\"\") # data has some HTML apostrophe mess, clean it up\n text.gsub!(\"amp;\",\"\")\n text.gsub!(\"apos;\",\"'\")\n text.gsub!(\"''\",\"'\") # double '' to single '\n text.gsub!(/<[^>]*>/, '') # strip things inside HTML tags\n\n # allow only a small set of characters\n text.tr!('\"()[]:,',' ') # turn certain punctation into spaces\n text = strippunct_l(text, lang) # remove anything not in the language charset (helps with OCR junk)\n text.gsub!(/\\s\\s*/, ' ') # collapse runs of spaces into single spaces\n\n terms = text.split(' ')\n terms.map!{ |t| t.sub(/^[^a-z0-9]+/,'').sub(/[^a-z0-9]+$/,'') } # remove leading/trailing punctuation\n \n # Now scan through the term list and spit out ungrams, bigrams\n termsout = []\n \n while t = terms.shift\n \n # look for a bigram starting with t\n if terms.length && terms[0] != nil\n t2 = terms[0]\n bigram = t + \"_\" + t2\n if @bigrams.include?(bigram)\n termsout << bigram\n #puts bigram\n next\n end\n end\n \n # DISABLED stemming, for easier installation (stemmer gem not req'd) js 21/2/2012\n # no bigram here, stem the individual term, output if it's \"acceptable\"\n #if @stem_terms \n # t = t.stem\n #end\n \n if term_acceptable(t)\n termsout << t\n end\n \n end\n \n return termsout\n end", "def process_input_file\n\t\t\tinput_file = File.open(@params[:input_file], 'r')\n\t\t\tfile_terms = convert_contents_to_search_string(input_file.read)\n\t\t\tadd_terms(file_terms)\n\t\tend", "def multiple?(term)\n self.class.multiple?(term)\n end", "def default\n @lines.select! do |line|\n line.include?(\"complete! Resources:\") || # success: handles both apply and destroy output\n line.include?(\"Changes to Outputs\") ||\n line.include?(\"No changes\") ||\n line.include?(\"Error: \") # error\n end\n end", "def find_terms(doc)\n terms_match = @terms.select { |term| doc.join('').match(term.to_s) }\n\n terms_match.map do |term, definition|\n \"*[#{term}]: #{definition}\".delete(\"\\t\\r\\n\").squeeze(' ').strip\n end\nend", "def run\n searching if @nr_of_words >= @phrase_length\n end", "def submit_word(word)\n letters_present_for(word) && @dictionary.include?(word)\n end", "def search_terms_summary terms_and_scores \n return \"<span class='none_text'>No search queries during this period</span>\".html_safe if terms_and_scores.empty?\n words=terms_and_scores.collect{|ts| \"#{h(ts[0])}(#{ts[1]})\" }\n words.join(\", \").html_safe\n end", "def terms\n [self]\n end", "def tool_defined?(words)\n @tool_data.key?(words)\n end", "def can_be_bought_for_solr\n result = \"no\"\n result = \"yes\" if available_for_sale == true\n result\n end", "def by_no_approvals?\n includes_special_label?(IssuableFinder::Params::FILTER_NONE)\n end", "def potential_interpretations\n parsed_form && Sense.lookup_all_by_headword(parsed_form)\n end", "def initialize(support)\n @support = support\n @terms = {}\n end", "def is_root_term?\n return false\n end", "def valid_processors; end", "def term_name\n self.content\n end", "def all_empty?(words = [])\nend", "def executable_on?(ontology)\n translation_unnecessary?(ontology) || (translation_exists?(ontology) && unmatched_elements([ontology]).empty?)\n end", "def terms_and_conditions\n return @terms_and_conditions\n end", "def find_jobs_by_term\n\n print \"\\nEnter a search term to filter jobs by: \".blue\n search_term = gets.strip\n\n jobs = FreelancerFinder::Job.all.find_all do |job|\n job.title.include?(\"#{search_term}\") || job.short_description.include?(\"#{search_term}\") || !!job.tags.detect {|tag| tag.include?(\"#{search_term}\")}\n end\n\n jobs\n end", "def start_of_terms\n return 0 if normalized_page == 0\n total_terms - hits_requested\n end", "def use_fake_word?(word_index)\n return @fake_freq > 0 && word_index % @fake_freq == 0 && word_index != 0\n end", "def terms_with_values\n terms.select { |t| self[t].present? }\n end", "def prioritized?\n @prioritized ||= PRIORITIES.include?(language.to_s)\n end", "def _search_text\n [_concatenated_brand,\n _concatenated_description,\n _concatenated_sell_unit,\n classic_mbid\n ].compact.map { |w| w.hanize.split(' ') }.flatten.uniq.reject { |w| w.size < 3 || self.class.stop_words.include?(w) }.join(' ')\nend", "def terms\n @title = \"community terms\"\n end", "def known(words)\n #find all words for which condition is true,you need to figure out this condition\n known_words = words.find_all {|w| @dictionary.has_key?(w)} \n return known_words\n end", "def important?(word)\n\nend", "def show_works_or_works_that_contain_files(solr_parameters)\n return if blacklight_params[:q].blank? || blacklight_params[:search_field] != 'all_fields'\n solr_parameters[:user_query] = blacklight_params[:q]\n solr_parameters[:q] = new_query\n solr_parameters[:defType] = 'lucene'\n end", "def phrases_not_found\n @phrases_not_found ||= Set.new\n end", "def has_right_syntax?\n #check syntax\n if @searchwords.to_s.empty?\n return false\n end \n true\n end", "def set_default_task_data(task)\n @work_types = @work_subtypes = @complexities= []\n if task.work_subtype\n @work_subtype = task.work_subtype\n @work_type = @work_subtype.work_type\n @work_subtypes = @work_type.work_subtypes\n @complexities = @work_subtype.work_subtype_complexities\n category = @work_type.category\n @back_office_task = category.has_complexity\n categories = Category.find_with_complexity(category.has_complexity)\n for cat in categories\n @work_types += cat.work_types\n end\n else\n @back_office_task=false\n @work_types = WorkType.livian_work_types\n @work_subtypes = @work_types.first.work_subtypes\n end\n @work_types.uniq!\n end", "def third_party_processors\n self.class.constants - [:KramdownParser, :PRIORITIES]\n end", "def is_word_complete()\n !@current_state.include? \"_\"\n end", "def is_text_run? # rubocop:disable Naming/PredicateName\n defined?(@is_text_run) && @is_text_run && !contains_rich_text?\n end", "def look_up(term='')\n\n NSLog(\"Something just tried to look up the term #{term}\")\n false\n\n end", "def do_search(term = nil)\n @terms = term unless term.nil? #replace saved term with argument, if passed\n @attempts += 1\n @doc = Nokogiri::XML(open(build_call(@terms)))\n parse\n end", "def show_works_or_works_that_contain_files(solr_parameters)\n return if blacklight_params[:q].blank?\n\n solr_parameters[:user_query] = blacklight_params[:q]\n solr_parameters[:q] = new_query\n solr_parameters[:defType] = 'lucene'\n end", "def terms\n @terms ||= wayfinder.decorated_ephemera_terms.sort_by(&:label)\n end", "def primary_terms\n terms - [:visibility, :collection_type_gid]\n end", "def load_necessary_words\n necessary_words = []\n\n necessary_spellings.each do |spelling|\n if @table.key?(spelling)\n necessary_words << @table[spelling]\n else\n $stderr.puts \"Warning! #{spelling} is a necessary word but it is not in the corpus.\"\n end\n end\n\n necessary_words\n end" ]
[ "0.62416565", "0.6066064", "0.59441483", "0.5721702", "0.5719298", "0.56041795", "0.5555217", "0.553414", "0.549041", "0.5456885", "0.5447266", "0.5430971", "0.5410429", "0.5369382", "0.5369382", "0.53581196", "0.5350809", "0.53417367", "0.5331624", "0.5315956", "0.52638537", "0.5244262", "0.51694274", "0.513918", "0.5113522", "0.51107585", "0.50981516", "0.5091713", "0.508249", "0.50816315", "0.50756747", "0.5073645", "0.5072814", "0.5063335", "0.50523454", "0.50431377", "0.5039897", "0.5038606", "0.5038606", "0.5038606", "0.50223786", "0.50200593", "0.50188714", "0.50163126", "0.50156784", "0.501241", "0.49912867", "0.4984809", "0.49740887", "0.497382", "0.49616826", "0.49353406", "0.49351335", "0.49297088", "0.49233", "0.49204323", "0.4918272", "0.4916637", "0.4914668", "0.48986316", "0.48872992", "0.48870432", "0.48829025", "0.4878517", "0.48762184", "0.48726317", "0.48638943", "0.48458272", "0.48345548", "0.48315558", "0.48186013", "0.48118997", "0.48092413", "0.4808436", "0.48013228", "0.47929746", "0.479263", "0.4787299", "0.4779419", "0.47738302", "0.477326", "0.47725257", "0.47688287", "0.4768619", "0.47679576", "0.47676092", "0.476135", "0.47604993", "0.47602922", "0.47511056", "0.4742017", "0.4741911", "0.4739902", "0.47398376", "0.47364685", "0.47349247", "0.47343114", "0.4727706", "0.47226438", "0.47177297", "0.47150174" ]
0.0
-1
Find the identity and farm out the rest of the logic to a background worker
def perform_user_strategy(orcid_id) debug_verbose = ::Hyrax::OrcidIntegrationService.hyrax_orcid_jobs_debug_verbose ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here, ::Deepblue::LoggingHelper.called_from, "orcid_id=#{orcid_id}", "" ] if debug_verbose identity = OrcidIdentity.find_by(orcid_id: orcid_id) ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here, ::Deepblue::LoggingHelper.called_from, "identity=#{identity}", "" ] if debug_verbose return if identity.blank? # return if (identity = OrcidIdentity.find_by(orcid_id: orcid_id)).blank? Hyrax::Orcid::PerformIdentityStrategyJob.send(active_job_type, @work, identity) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_worker id\n self.workers.find{ |worker| worker[:id] == id } \n end", "def worker_id\n self.class.worker_id\n end", "def worker\n Worker.find_by_code worker_code\n end", "def check_worker_id(args)\n \n # Load params\n worker = args['worker'].to_s.strip\n word = args['word'].to_s.strip.downcase\n\n # Load hash of who has done what\n worker_words = YAML::Store.new(AMT_WORKER_WORD_LIST)\n previous_work = worker_words.transaction do (worker_words[worker] && worker_words[worker].include?(word)) end\n\n return compose_template('previous_work', binding) if previous_work\n return compose_template('no_previous_work', binding)\n end", "def claim_thread_runner\n while running?\n User.select(:id, :email, :connected_at, :archived).find_each do |user|\n if server_rhash.hash(user.id) == server_tag && !user.archived && user.connected_at\n schedule_work(:connect_user, :hash => user.id, :user_id => user.id)\n else\n schedule_work(:disconnect_user, :hash => user.id, :user_id => user.id)\n end\n\n # Try not to peg the processor.\n sleep 0.01\n end\n light_sleep 10\n end\n rescue Exception => e\n Log.exception(e)\n raise e\n ensure\n Log.info(\"Stopping claim thread.\")\n end", "def find_work\n\n end", "def unit_of_work_id\n Thread.current[:lumberjack_logger_unit_of_work_id] \n end", "def start_worker( exit_on_idle=false )\n\t\tpid = super\n\t\tself.log.info \"Start a new worker at pid %d\" % [ pid ]\n\n\t\treturn pid\n\tend", "def fetch_worker(id)\n BackgroundWorkerRepository.find(id).tap do |worker|\n unless worker\n error = UnknownWorkerError.new(id)\n Rollbar.warning(error)\n end\n end\n end", "def run_in_background\n InsertOpportunity.perform_async(\"#{self.id}\") \n end", "def worker_queue\n PingWorker.perform_async(self.id)\n end", "def job_key; Thread.current[:job_key]; end", "def worker\n read_attribute(:worker) || extract_worker || ''\n end", "def executor; end", "def executor; end", "def executor; end", "def job_id\n async && async.job_id\n end", "def worker id\n while 1 do\n # hackish way to quickly query in the case of lock contention.\n 5.times do\n begin\n task = self.getNext\n if !task.nil?\n @logger.debug \"Worker #{id} executing task #{task.id}\"\n task.run\n self.close task\n end\n rescue => e\n @logger.error \"Worker #{id} exited with error: #{e}\"\n end\n end\n sleep 5\n @logger.debug \"Worker #{id} waiting for tasks\"\n end\n end", "def do_work\n end", "def discover_runner\n return if user.present?\n\n DiscoverRunnerJob.perform_later(self)\n end", "def identify(identity)\n unless @session[:km_identity] == identity\n queue.delete_if { |e| e.first == 'identify' }\n queue << ['identify', identity]\n @session[:km_identity] = identity\n end\n end", "def worker_begin(worker)\n end", "def reserve_and_run_one_job; end", "def worker\n\n @services['s_worker']\n end", "def set_worker\n @worker = current_admin.workers.find(params[:id])\n end", "def worker_key; worker_options && worker_options[:worker_key]; end", "def perform\n debug_verbose = ::Hyrax::OrcidIntegrationService.hyrax_orcid_jobs_debug_verbose\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"Flipflop.hyrax_orcid?=#{Flipflop.hyrax_orcid?}\",\n \"@work.id=#{@work.id}\",\n \"\" ] if debug_verbose\n return unless Flipflop.hyrax_orcid?\n\n orcids = Hyrax::Orcid::WorkOrcidExtractor.new(@work).extract\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"Flipflop.hyrax_orcid?=#{Flipflop.hyrax_orcid?}\",\n \"orcids=#{orcids}\",\n \"\" ] if debug_verbose\n\n orcids.each { |orcid| perform_user_strategy(orcid) }\n end", "def job_identity(args)\n Digest::SHA1.hexdigest([ Time.now.to_f, rand, self, args ].join)\n end", "def run\n super\n \n #\n # Store the account name, depending on the object we passed in.\n #\n if @object.kind_of? User\n account_names = @object.usernames || [\"#{@object.first_name}_#{@object.last_name}\"]\n else\n account_names = [@object.name]\n end\n \n #\n # Iterate through all account names!\n #\n account_names.each do |account_name|\n\n @task_logger.log \"Looking for account name: #{account_name}\"\n \n ###\n ### Loop through services, creating a client & checking\n ###\n [\"Facebook\", \"FourSquare\", \"LinkedIn\", \"Google\", \"Myspace\", \n \"SoundCloud\", \"TwitPic\", \"Twitter\", \"YFrog\" ].each do |client_name|\n \n #\n # Create a client of the current type\n # \n client = eval(\"Ear::Client::#{client_name}::WebClient.new\")\n if client.check_account_exists(account_name)\n @task_logger.log \"Found an account at: #{client.check_account_uri_for(account_name)}\"\n \n #\n # Create an account w/ the correct parameters\n #\n obj = create_object Account, \n :account_name => account_name, \n :service_name => client.service_name, \n :check_uri => client.check_account_uri_for(account_name),\n :web_uri => client.web_account_uri_for(account_name)\n\n #\n # If we passed in a user, associate that with our new account object\n #\n if @object.kind_of? User\n obj.user_id = @object.id\n obj.save!\n end\n else \n @task_logger.log \"No #{client.service_name} account found at: #{client.check_account_uri_for(account_name)}\"\n end\n end\n \n end\nend", "def on_worker_fork(&block); end", "def dispatch_id\n local_ip + '/' + Process.pid.to_s\n end", "def execute_in_background(args); end", "def redis_identity\n self.class.redis_identity(identity)\n end", "def get_instance_id\n MUTEX.synchronize do\n @instance_index = 0 if @instance_index == 10000\n @instance_index += 1\n end\n end", "def identify\n Identity.new(self).create\n nil\n end", "def identify\n Identity.new(self).create\n nil\n end", "def worker_pool; end", "def worker_pool; end", "def working!\n disque.with {|cn| cn.call :working, job_id } if disque && job_id\n end", "def get_id\n id = Thread.current[:id] \n id = 1 if @java_flag\n id\n end", "def set_coworker\n @coworker = Coworker.find(params[:id])\n end", "def execute! &block\n task = block.call if block_given?\n return raise_no_workers if Server::workers.empty?\n task.service_id = id; self.tasks << task\n # Get worker and send task\n data = Task.send_with_worker(task)\n Logger.info 'Queued task ' + task.to_s + ' for worker: ' + data[:worker].to_s\n\n data\n end", "def execute_job_ext(worker, args)\n pool = Sidekiq.redis_pool\n item = { 'class' => worker.class, 'args' => args }\n normalized_item = Sidekiq::Client.new(pool).send(:normalize_item, item)\n queue = normalized_item['queue']\n server_middleware = SidekiqUniqueJobs::Middleware::Server::UniqueJobs.new\n\n server_middleware.call(worker, normalized_item, queue, pool) do\n execute_job_orig(worker, args)\n end\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def store\n Thread.current\n end", "def generate_ids(worker, owner_id, job_id, task_id)\n if job_id.nil?\n job_id = \"#{worker}-#{get_node_name}-#{Process.pid}-#{Time.now.to_i}\"\n end\n \n if task_id.nil?\n task_id = \"#{job_id}-#{Time.now.to_i}\"\n end\n \n [job_id, task_id]\n end", "def work_pool; end", "def run() end", "def work\n poll_interval = @config.get(PROVISIONER_WORKER_POLL_INTERVAL).to_i || 1\n poll_error_interval = @config.get(PROVISIONER_WORKER_POLL_ERROR_INTERVAL).to_i || 10\n server_uri = @config.get(PROVISIONER_SERVER_URI)\n\n $PROGRAM_NAME = \"#{$PROGRAM_NAME} (tenant: #{@tenant}, provisioner: #{@provisioner_id}, worker: #{@name})\"\n\n log.info \"Starting worker with id #{@worker_id}, connecting to server #{@config.get(PROVISIONER_SERVER_URI)}\"\n\n loop do\n result = nil\n\n # Poll Coopr Server until a task is retrieved\n task = _poll_server_and_retrieve_task\n\n # While running task, trap and queue TERM signal to prevent shutdown until task is complete\n sigterm = Coopr::Worker::SignalHandler.new('TERM')\n sigterm.dont_interupt do\n begin\n result = delegate_task(task)\n\n result = {} if result.nil? == true\n result['workerId'] = @worker_id\n result['taskId'] = task['taskId']\n result['provisionerId'] = @provisioner_id\n result['tenantId'] = @tenant\n\n log.debug \"Task <#{task['taskId']}> completed, updating results <#{result}>\"\n begin\n response = Coopr::RestHelper.post \"#{server_uri}/v2/tasks/finish\", result.to_json\n rescue StandardError => e\n log.error \"Caught exception posting back to coopr server #{server_uri}/v2/tasks/finish: #{e}\"\n end\n rescue StandardError => e\n result = {} if result.nil? == true\n result['status'] = '1'\n result['workerId'] = @worker_id\n result['taskId'] = task['taskId']\n result['provisionerId'] = @provisioner_id\n result['tenantId'] = @tenant\n if e.class.name == 'CommandExecutionError'\n log.error \"#{e.class.name}: #{e.to_json}\"\n result['stdout'] = e.stdout\n result['stderr'] = e.stderr\n else\n result['stdout'] = e.inspect\n result['stderr'] = \"#{e.inspect}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n log.error \"Task <#{task['taskId']}> failed, updating results <#{result}>\"\n begin\n response = Coopr::RestHelper.post \"#{server_uri}/v2/tasks/finish\", result.to_json\n rescue StandardError => e\n log.error \"Caught exception posting back to server #{server_uri}/v2/tasks/finish: #{e}\"\n end\n end\n end\n\n break if @once\n\n sleep 5\n end\n end", "def starting(worker)\n end", "def work\n memoized_info[:work]\n end", "def pid() end", "def pid() end", "def pid() end", "def background_job\n values.find { | job | job.is_background? } \n end", "def pid()\n #This is a stub, used for indexing\n end", "def new_worker(method, args, options={})\n # XXX need a better unique job id\n job_id = Time.now.usec\n \n MiddleMan.new_worker(\n :class => 'TargetWorker',\n :job_key => \"tw_#{job_id}\",\n :args => {\n :oncomplete => options[:oncomplete],\n :session_id => options[:session_id],\n :target_class => self.to_s, \n :method => method,\n :method_args => args\n }\n )\n return \"tw_#{job_id}\"\n end", "def run\n worker = fetch_worker(data[:background_worker_id])\n\n return unless worker\n return if worker.running?\n\n runner = runner_for(worker)\n supplier = runner.supplier\n broadcast = [worker.type, \".\", supplier.name].join\n\n running(broadcast, worker) do\n # gotcha: +Concierge::Announcer#trigger+ returns an array of the results of each\n # listener for the given event. Here, we take the first of them assuming\n # it will be the supplier implementation. That works since there has been no\n # need for a supplier implementation to provide more than one listener for the\n # same event. That is a good practice that allows arguments to be passed\n # from one run to the next.\n Concierge::Announcer.trigger(broadcast, *runner.args).first\n end\n end", "def schedule\n\t\tputs \"the self attributes in the background job are:\"\n\t\tputs self.attributes.to_s\n\t\tif self.uuid.blank?\n\t\t\tself.sign_up\n\t\tend\n\t\tif !self.otp.blank?\n\t\t\tif self.mobile_confirmed == 0\n\t\t\t\tself.confirm_otp\n\t\t\tend\n\t\tend\n\t\tif self.resend_otp == 1\n\t\t\t## should reset resend otp.\n\t\t\tself.do_resend_otp\n\t\tend\n\t\tif self.forgot_password == 1\n\t\t\t## should resent forgot_password.\n\t\t\tself.do_forgot_password\n\t\tend\n\t\t## and sign in, is done in the controller itself ?\n\t\t## or when ?\n\t\t## is that a save call ?\n\tend", "def thread_id()\n #This is a stub, used for indexing\n end", "def worker_init\n raise \"Invalid worker name\" if !worker_name\n Thread.abort_on_exception = true\n\n # stores the job key of currently running job\n Thread.current[:job_key] = nil\n initialize_logger\n\n @thread_pool = ThreadPool.new(self,pool_size || 20,@logger)\n t_worker_key = worker_options && worker_options[:worker_key]\n\n @cache = ResultStorage.new(worker_name,t_worker_key,BDRB_CONFIG[:backgroundrb][:result_storage])\n\n if(worker_options && worker_options[:schedule] && no_auto_load)\n load_schedule_from_args\n elsif(BDRB_CONFIG[:schedules] && BDRB_CONFIG[:schedules][worker_name.to_sym])\n @my_schedule = BDRB_CONFIG[:schedules][worker_name.to_sym]\n new_load_schedule if @my_schedule\n end\n if respond_to?(:create)\n invoke_user_method(:create,worker_options[:data])\n end\n if run_persistent_jobs?\n add_periodic_timer(persistent_delay.to_i) {\n begin\n check_for_enqueued_tasks\n rescue Object => e\n puts(\"Error while running persistent task : #{Time.now}\")\n log_exception(e.backtrace)\n end\n }\n end\n write_pid_file(t_worker_key)\n end", "def work_profile_block_cross_profile_caller_id\n return @work_profile_block_cross_profile_caller_id\n end", "def perform\n\n r = validate_and_sanitize\n return r unless r.success?\n\n r = set_registeration_params_in_db\n return r unless r.success?\n\n r = initiate_task_in_saas\n return r unless r.success?\n\n @critical_chain_interaction_log_id = r.data[:critical_chain_interaction_log_id]\n\n r = enqueue_verify_reg_status_job\n return r unless r.success?\n\n #NOTE: Returned this and not fetched from PendingCriticalInteractionIds to avoid extra query\n success_with_data(\n pending_critical_interactions: {\n @parent_tx_activity_type => @critical_chain_interaction_log_id\n }\n )\n\n end", "def run\n @managers = Proletariat.worker_classes.map do |worker_class|\n Manager.spawn!(name: \"manager_#{worker_class.to_s}_#{object_id}\",\n supervise: true,\n args: [worker_class])\n end\n\n managers.each { |manager| manager << :run }\n\n nil\n end", "def perform(id)\n mapp_integration_flag = Rails.application.secrets.mapp_integration[:flag] rescue nil\n if mapp_integration_flag == true\n user = Workarea::User.find(id)\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_user_creation(user)\n end\n end", "def send_identity\n Eventr.delegate_to_receivers(:identity, ident_id, to_identity)\n end", "def mint\n Mutex.new.synchronize do\n loop do\n pid = next_id\n return pid unless identifier_in_use?(pid)\n end\n end\n end", "def after_worker_fork(&block); end", "def thread_id\n check_connection\n @protocol.thread_id\n end", "def be_worker\n before_work\n super\n end", "def worker_number=(worker_num); end", "def extract_identity\n @identity = Identity.find_omniauth(omniauth) if omniauth\n end", "def worker_runner\n $daemon[:logger_msg_prefix] = 'TaskQueueWorker'\n\n worker_install_signal_handler\n daemon_log :msg => \"Start working...\"\n\n # Fetch pending task queues and start working\n while $worker[:work] do\n # Get next pending taskqueue\n $worker[:task_queue] = $daemon[:task_queue_model].get_next_pending\n\n if $worker[:task_queue]\n # Set Process Name and execute tasks\n $0 = \"#{$worker[:process_prefix]}_#{$worker[:task_queue].id}\"\n $worker[:task_queue].run!(:print_log => ! $daemon[:background], logger: @logger)\n else\n # Set Process Name and sleep\n $0 = \"#{$worker[:process_prefix]}_idle\"\n sleep 15\n end\n end\n\n daemon_log :msg => \"Ended!\"\nrescue => exception\n daemon_log :msg => \"Fatal error in method 'worker_runner': #{$!}\\n#{exception.backtrace}\", :sev => :error\nend", "def func_sub *args\n Worker::Sub.perform_async args[1], args[0].id\n end", "def process!\n Sync::Jenkins.job_by_name(payload[\"name\"])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def set_worker\n @worker = Worker.find(params[:id])\n end", "def starting_work(worker, work_unit)\n end", "def perform fiction_id\n fiction = Fiction.find( :id => fiction_id )\n fiction_name = fiction.name\n $logger.info \"Running Fetch #{fiction_name}\"\n\n # fetch and see if needs to send\n Send.perform_async fiction_id if fiction.fetch\n end", "def worker\n\t\t require \"drb/drb\"\n\t\t require File.dirname(__FILE__) + \"/base\"\n\t\t $: << \"./\"\n\t\t Experiment::Config::init @options.env\n\t\t loop do\n\t\t @server_uri=\"druby://#{@options.master}:8787\"\n \t\t connect\n \t\t Notify::init 0, STDOUT, false, @master\n while item = @master.new_item\n #puts item\n exp = @master.experiment item\n require \"./experiments/experiment\"\n require \"./experiments/#{exp}/#{exp}\"\n \t\t\t cla = eval(as_class_name(exp))\n \t\t\t\texperiment = cla.new :slave, exp, @options\n \t\t\t experiment.master = @master.instance item\n \t\t\t experiment.run! 0\n end\n end\n\t end", "def queue_job; end", "def thread_id\n\n\t\t::Pantheios::Core.thread_id\n\tend", "def worker_exists? id\n find_worker(id).present?\n end", "def cidr_worker (host)\n\t\tputs \"Starting tracking of known CIDR information for host: #{host}\" if @verbose\n\t\thost=host.strip.downcase\n\t\tip=host_2_ip(host)\n\t\tcidr=cidr_lookup(ip)\n\t\tref=get_cidr_ref(cidr)\n\t\tnetname=get_cidr_netname(cidr)\n\t\t# save the data\n\t\ttracker=Hash.new\n\t\ttracker['host']=host\n\t\ttracker['ip']=ip\n\t\ttracker['cidr']=cidr\n\t\ttracker['ref']=ref\n\t\ttracker['netname']=netname\n\t\treturn tracker\n\trescue => ee\n\t\tputs \"Exception on method #{__method__} for host #{host}: #{ee}\" # if @verbose\n\t\treturn nil\n\tend", "def run\n super\n \n #\n # Store the account name, depending on the entity we passed in.\n #\n usernames = [@entity.name]\n\n #\n # Iterate through all account names!\n #\n usernames.each do |username|\n\n @task_logger.log \"Looking for account name: #{username.name}\"\n \n #\n # Loop through services, creating a client & checking\n #\n [\"Facebook\", \"FourSquare\", \"LinkedIn\", \"Google\", \"Myspace\", \n \"SoundCloud\", \"TwitPic\", \"Twitter\", \"YFrog\" ].each do |client_name|\n \n #\n # Create a client of the current type\n # \n client = eval(\"Client::#{client_name}::WebClient.new\")\n if client.check_account_exists(username.name)\n @task_logger.log \"Found an account at: #{client.check_account_uri_for(username.name)}\"\n \n #\n # Create an account w/ the correct parameters\n #\n obj = create_entity Entities::Account, \n :account_name => username.name, \n :service_name => client.service_name, \n :check_uri => client.check_account_uri_for(username.name),\n :web_uri => client.web_account_uri_for(username.name)\n \n else \n @task_logger.log \"No #{client.service_name} account found at: #{client.check_account_uri_for(username.name)}\"\n end\n end\n \n end\nend", "def perform(email, job_id)\n if email.blank? or job_id.blank?\n puts(\"Either of job or email is blank. Email: #{email}, Job: #{job_id}\")\n return\n end\n\n email_invitations = EmailInvitation.where(:email => email)\n email_invitation = nil\n email_invitations.each do |invitation|\n unless invitation[:invitor_handle].blank?\n email_invitation = invitation\n end\n end\n\n if !email_invitations.blank? and email_invitation.blank?\n email_invitation = email_invitations[0]\n end\n\n if email_invitation.blank?\n email_invitation = create_email_invitation_for_email(email, nil)\n end\n\n if email_invitation.reminder_count >= 3\n puts(\"Reminder count exceeded for user: #{email}\")\n return\n end\n\n job = get_job_by_id(job_id)\n if job.blank? or !job.live\n puts(\"Either Job is blank or not live. live? #{job.live}\")\n return\n end\n\n email_variation_id = get_job_email_variation\n user = get_user_by_email(email)\n if user.blank?\n user = create_passive_user(email)\n elsif user[:active]\n puts(\"USER (#{user})is active returning from not sending invitation\")\n return\n end\n begin\n Notifier.email_job_invitation(user, '', job, email_variation_id).deliver\n rescue Exception => ex\n puts \"Exception: #{ex}\"\n end\n\n email_invitation.last_variation_used = email_variation_id\n email_invitation.time = Time.now\n email_invitation.reminder_count = email_invitation.reminder_count + 1\n email_invitation.save\n track_email_send(\"track_job_email_#{job_id}_#{email_variation_id}\")\n end", "def register_worker_for_job(job, worker)\n job = job.stringify_keys\n if job['id'].blank?\n debug(\"job id not found. delegating again the job #{job.inspect}\") if self.class.debug_enabled?\n delegate(job)\n else\n start_worker(job, worker)\n end\n end", "def swarm_join_workers(main_manager,wn_ip, modulepath)\n puts \"** Generating Token on #{main_manager} **\"\n puts \"***\"\n get_cmd = \"bolt task run simple_grid::swarm_token node_role=worker --targets #{main_manager} --modulepath #{modulepath}\" \n stdout, stderr, status = Open3.capture3(get_cmd)\n puts \"** Extracting Token **\"\n puts \"***\"\n puts get_cmd\n if status.success?\n token = stdout\n token = token.split(\"\\n\")[2].delete(' ')\n puts token\n puts \"***\"\n else\n raise \"Failed to get token for worker: #{stderr}\"\n end\n wn_ip.each do |wip|\n puts \"***\"\n puts \"** Join Manager:#{main_manager} Worker:#{wip} with token:#{token} **\"\n join_cmd = \"bolt task run simple_grid::swarm_join token=#{token} manager_ip=#{main_manager}:2377 --targets #{wip} --modulepath #{modulepath}\"\n puts join_cmd\n puts \"***\"\n stdout, stderr, status = Open3.capture3(join_cmd)\n if status.success?\n puts stdout\n else\n puts stderr\n end\n end\n end", "def concurrent_identifier(*args)\n end", "def get_id\n @task_count ||= 0\n @task_count += 1\n end", "def notify\n MemberMailerWorker.perform_async(member_id: self.employer.id.to_s, job_order_id: self.id.to_s, perform: :send_invoice_to_employer)\n TeamMailerWorker.perform_async(job_order_id: self.id.to_s, perform: :send_new_job_order)\n\n end", "def generate_sid\n loop do \n sid = super\n break sid unless sessions.find_one( { :_id => sid } )\n end\n end", "def work!\n loop do\n if inside_operating_window?\n fetch\n check_for_history_request\n else\n pause\n end\n log_activity\n end\n end" ]
[ "0.6033032", "0.58844507", "0.5846595", "0.56282604", "0.5616885", "0.55815035", "0.55813175", "0.5522891", "0.55054367", "0.5487688", "0.5465305", "0.54567885", "0.5413703", "0.54034543", "0.54034543", "0.54034543", "0.5399031", "0.53824276", "0.537892", "0.5378129", "0.5364165", "0.5355977", "0.5338721", "0.5328269", "0.53054667", "0.52862424", "0.5284407", "0.5277638", "0.5259543", "0.52517575", "0.5236528", "0.5232988", "0.52329874", "0.523198", "0.52220047", "0.52220047", "0.5201128", "0.5201128", "0.5193709", "0.51495385", "0.51489305", "0.513563", "0.5132261", "0.51075363", "0.5102663", "0.51004124", "0.5097003", "0.5095124", "0.50886315", "0.5084762", "0.50781673", "0.5074626", "0.5074626", "0.5074626", "0.50623924", "0.50601304", "0.5059377", "0.5049279", "0.50352925", "0.5035182", "0.50306344", "0.50248593", "0.50246346", "0.50146806", "0.5010845", "0.50105554", "0.5007465", "0.5001244", "0.49918842", "0.49856856", "0.49780512", "0.49761868", "0.4968967", "0.49672166", "0.4965578", "0.4964455", "0.4964455", "0.4964455", "0.4964455", "0.4964455", "0.4964455", "0.4964455", "0.4964455", "0.4964455", "0.49633655", "0.4961154", "0.4959053", "0.49564794", "0.49560264", "0.4952798", "0.4952028", "0.4940091", "0.49358046", "0.4923675", "0.4923644", "0.49219412", "0.4921933", "0.49143013", "0.4914269", "0.49093655" ]
0.52019155
36
GET /trip_routes GET /trip_routes.json
def index @trip_routes = TripRoute.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def routes\n routes = get('/gtfs/routes')\n routes.map do |route|\n Route.from_json(route)\n end\n end", "def trips\n get '/gtfs/trips'\n end", "def trips_by_route_id(route_id)\n get \"/gtfs/trips/routeid/#{route_id}\"\n end", "def index\n Rails.logger.info('👻 Disraptor: Showing available routes.')\n\n routes = Disraptor::Route.find_all()\n\n render json: { 'disraptor/routes': routes }\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def routes_list\n response = RestClient.get(\n BASE_URL,\n params: {command: 'routeList', a: AGENCY}\n )\n\n parse_routes_response(response.body)\n end", "def routes\n request :get, '/routes'\n end", "def get_route\n data = {\n visits: visits,\n fleet: fleet\n }\n\n data[:options] = options if options\n result = Util.send_request(\"POST\", \"vrp\", Routific.token, data)\n RoutificApi::Route.parse(result)\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def trips\n Trip.where(:route_id => self.route_id)\n end", "def trips\n Trip.where(:route_id => self.route_id)\n end", "def trips\n flight = Flight.where(\"id = ?\", params[:id]).take\n if flight.nil?\n render :json => {errors: \"404\"}, :status => 404\n else\n respond_with( flight.trips )\n end\n end", "def routes\n @logger.info \"#{__method__}\"\n fill_in \"JourneyPlanner$txtNumberOfPassengers\", with: \"1\"\n country_routes = list_countries.inject([]) do |country_result, country|\n @logger.info \"routes for #{country}\"\n select(country, :from => \"JourneyPlanner_ddlLeavingFromState\")\n sleep 3\n to_from = list_leaving_from.inject([]) do |from_result, from|\n @logger.info \"routes from #{from}\"\n sleep 2\n select(from, :from => \"JourneyPlanner$ddlLeavingFrom\")\n from_result << {from => list_travelling_to}\n from_result\n end\n country_result << {country => to_from}\n country_result\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def index\n trips = Trip.all\n respond_with trips\n end", "def index\n @routes = Route.all\n end", "def index\n @routes = Route.all\n end", "def index\n @routes = Route.all\n end", "def index\n @routes = Route.all\n end", "def show\n @tripJson = []\n @trip.segments.order(:order).each do |segment|\n locations = []\n segment.locations.order(:order).each do |location|\n locations << {:id => location.id, :lat => location.latitude, :lng => location.longitude }\n end\n @tripJson << {:id => segment.id, :transportation => segment.transportation, :locations => locations}\n end\n end", "def get_routes_by_athlete_id_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutesApi.get_routes_by_athlete_id ...\"\n end\n # resource path\n local_var_path = \"/athletes/{id}/routes\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['strava_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Route>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutesApi#get_routes_by_athlete_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n # raise\n authorize @trip\n @user = current_user\n @routes = @trip.routes\n add_markers_and_site_geoloc if !@routes.first.nil? # add the markers and the @site_loc. Reject routes without localisation.\n\n @trips = []\n @trips << @user.trips\n @trips << @user.joint_user_trips.map { |jut| jut.trip }\n @trips = @trips.flatten\n end", "def index\n @favorite_routes = FavoriteRoute.all\n render json: @favorite_routes\n end", "def get_routes\n @agency = params[:name]\n request_url = \"http://services.my511.org/Transit2.0/GetRoutesForAgency.aspx?token=#{@@token}&agencyName=#{@agency}\"\n request_url = request_url.gsub(/ /,\"%20\")\n @routes = search_for_key(parse_request(request_url), \"Route\")\n @routes = [@routes] unless @routes.kind_of?(Array)\n respond_to do |format|\n format.js {}\n end\n end", "def show\n render json: @trip\n end", "def show\n render json: @trip\n end", "def planner_output\n if current_user != nil\n @trip = Trip.find(params[:id])\n else\n redirect_to new_user_session_path\n end\n\n @trip.routes.each { |r| r.destroy }\n\n traveller_matching = TravellerMatching.new(@trip.to_object_container_no_routes)\n @trip.create_routes_from_trip_object(traveller_matching.trip)\n\n trip_json = traveller_matching.trip.to_json\n\n\n @trip.trip_json = trip_json\n @trip.save\n end", "def routes_map; end", "def index\n @rec_run_routes = RecRunRoute.all\n end", "def get_routes(params)\n graph_data = create_data(params)\n if graph_data.is_a?(Array)\n graph_data.each do |data|\n add_vertex(data[0][0], data[0][1])\n end\n path_array = shortest_path(params[:source], params[:destination])\n if path_array.is_a?(Array)\n get_path_description(path_array, params)\n else\n path_array\n end\n else\n graph_data\n end\n end", "def bus_api_getdirections(route)\n url_safe_route = URI.encode(route)\n apiKey = \"UPGw2J5PBxNnF967CAMyHygeB\"\n apiLink = \"http://www.ctabustracker.com/bustime/api/v1/getdirections?key=#{apiKey}&rt=#{url_safe_route}\"\n apiResults = open(apiLink).read\n return Hash.from_xml(apiResults)\n end", "def index\n @routes = Route.hottest\n end", "def index\n @routes = Route.get_active\n end", "def index\n @trip = Trip.find(params[:trip_id])\n end", "def routes\n desc 'shows all routes'\n task routes: :environment do\n print_routes api_routes\n end\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end", "def index\n @trips = Trip.order(params[:sort].to_s + \" \" + params[:direction].to_s)\n @tripLocation = Trip.pluck(:id)\n @markers = Marker.where(\"trip_id in (?)\", @tripLocation)\n @gmaps_options = @markers.to_gmaps4rails\n\n @polylines_json = {}\n polylines = []\n\n @trips.each_with_index do |trip, i|\n polylines[i] = []\n trip.markers.each do |marker|\n polylines[i] += [{:lng=>marker.longitude.to_f, :lat=>marker.latitude.to_f}]\n end\n end\n \n @polylines_json = polylines.to_json\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end", "def index\n @routes = Route.where(:verified => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @routes }\n end\n end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def fetchRoutes\n\t\t# Bus routes\n\t #http://api.wmata.com/Bus.svc/json/JRoutes?api_key=YOUR_API_KEY\n\t #\n\t # Bus route details...\n\t #\n\t logger.info \"Fetching, fetching...\"\n\t result = fetchUri(\"http://api.wmata.com/Bus.svc/json/JRoutes?api_key=#{@@apiKey}\")\n\n\t # if the hash has 'Error' as a key, we raise an error\n\t logger.info \"Got some data...\"\n\t if result.has_key? 'Error'\n\t \traise \"JSON error\"\n\t end\n\t logger.info \"No error...\"\n\t result['Routes'].each do |route|\n\t \trouteId=route['RouteID']\n\t \tlogger.info \"Processing route #{routeId}...\"\n\t \trouteData = fetchUri(\"http://api.wmata.com/Bus.svc/json/JRouteDetails?routeId=#{URI.escape(routeId)}&api_key=#{@@apiKey}\")\n\t \t#d.keys: [\"Direction0\", \"Direction1\", \"Name\", \"RouteID\"] \n\t \taddRouteData(routeData)\n \t\tend\n\tend", "def route_by_id(route_id)\n get \"/gtfs/routes/#{route_id}\"\n end", "def show\n @trip = Trip.find(params[:id])\n @places = @trip.places\n end", "def trips\n @trip_requests = current_user.trip_requests.trips.paginate(page:params[:page], per_page:20)\n json_response(@trip_requests)\n end", "def index\n @texi_routes = TexiRoute.all\n end", "def get_routes\n raise \"Method not implemented\"\n end", "def route_shape_by_trip_id(trip_id)\n get \"/gtfs/shapes/tripId/#{trip_id}\"\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def getRoutesTo(station)\n routeList = @toNodeMap[station]\n \n return routeList == nil ? [] : routeList\n end", "def index\n schedules = Schedule.where(trip_id: params[:trip_id])\n respond_with schedules\n end", "def show \n @route = Route.find(params[:id])\n \n respond_to do |format|\n format.html \n format.json { render json: @route }\n end\n end", "def getRoutes\n # [[\"MTA NYCT_B65\", \"B65\", \"Downtown Brooklyn - Crown Heights\", \"via Bergen St & Dean St\"]...]\n url = \"http://bustime.mta.info/api/where/routes-for-agency/MTA%20NYCT.xml?key=#{APIKEY}\"\n xml_str = Net::HTTP.get URI(url)\n xml = Nokogiri::XML(xml_str)\n xml.css(\"response data list route\").to_a.map{|rte| [rte.css('id').text, rte.css('shortName').text, rte.css('longName').text, rte.css('description').text]}\nend", "def create\n @trip_route = TripRoute.new(trip_route_params)\n\n respond_to do |format|\n if @trip_route.save\n format.html { redirect_to @trip_route, notice: 'Trip route was successfully created.' }\n format.json { render :show, status: :created, location: @trip_route }\n else\n format.html { render :new }\n format.json { render json: @trip_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n # @checkpoints = Checkpoint.all\n @route = Route.find(params[:route_id])\n @checkpoints = @route.checkpoints\n # render json: {\n # checkpoints: @checkpoints.to_a\n # }\n end", "def index\n @ways = Way.all\n end", "def index\n @trip_types = TripType.all\n end", "def route_geosearch\n get '/gtfs/routes/geosearch/'\n end", "def index\n @trip_schedules = TripSchedule.all\n end", "def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end", "def routes_list\n Route.all.each.with_index(1) do |(route), index|\n puts \"#{index}. Маршрут: #{route.stations.first.name} - #{route.stations.last.name}\"\n end\n end", "def index\n @ht_routes = HtRoute.all\n end", "def index\n @routes_title = I18n.t(\"interface.routes.titles.default\")\n @order = params[:order] || 'updated_at'\n @page = params[:page] || '1'\n @asc = params[:asc] || 'desc'\n conditions = params[:user_id] ? {:user_id => params[:user_id].split('-').first} : {}\n\n #FIXME intentar cargar solo los waypoints para el static path\n #FIXME se debería hacer como un has_many a nivel de modelo o en named_scope\n @routes = Route.paginate :include => [:waypoints, :user, :comments, :favoriters],\n :conditions => conditions, :per_page => '10',\n :page => @page,\n :order => @order + \" \" + @asc\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @routes }\n end\n end", "def set_trip_route\n @trip_route = TripRoute.find(params[:id])\n end", "def show\n @route = Route.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @route }\n end\n end", "def routes(context={})\n \n routes = [ \n ]\n \n end", "def routes(context={})\n \n routes = [ \n ]\n \n end", "def index\n @train_routes = TrainRoute.includes(:departure_station, :arrival_station).all\n byebug\n end", "def get_trip\n\t\t@trip = Trip.find_by(_id: trip_params[:trip_id])\n\t\tif @trip\n\t\t\t@user_requests = User.where(:_id.in => @trip.user_requests).map { |user|\n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name\n\t\t\t\t}\n\t\t\t}\n\t\t\t@accepted_users = User.where(:_id.in => @trip.accepted_users).map { |user| \n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name\n\t\t\t\t}\n\t\t\t}\n\t\t\t@trip._id = @trip._id.to_s\n\t\t\t@driver = User.find_by(_id: @trip.driver)\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\ttrip: @trip,\n\t\t\t\tdriver: {\n\t\t\t\t\tfirst_name: @driver.first_name,\n\t\t\t\t\tlast_name: @driver.last_name,\n\t\t\t\t\trating: @driver.driver_rating\n\t\t\t\t},\n\t\t\t\tuser_requests: @user_requests,\n\t\t\t\taccepted_users: @accepted_users\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'That trip could not be found!'\n\t\t\t}, status: 422\n\t\tend\n\tend", "def show\n @trip = Trips.find_trip(params[ :id ] )\n end", "def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end", "def trips_by_trip_id(trip_id)\n get \"/gtfs/trips/tripId/#{trip_id}\"\n end", "def show\n @route = Route.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @route }\n end\n end", "def show\n @routes = @mountain.routes.order(\"name\")\n end", "def index\n @way_points = WayPoint.all\n end", "def index\n @trips = Trip.all\n end", "def routes\n @routes ||= []\n end", "def routes\n @routes ||= []\n end", "def index\n @route_types = RouteType.all\n end", "def get_trip_listing \n\t\t@trip = Trip.find_by(_id: trip_params[:trip_id])\n\t\tif current_user.trips_driving.include?(trip_params[:trip_id]) || current_user.past_trips_driven.include?(trip_params[:trip_id])\n\t\t\t@user_requests = User.where(:_id.in => @trip.user_requests).map { |user|\n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name,\n\t\t\t\t\tfacebook_link: user.facebook_link,\n\t\t\t\t\temail: user.email,\n\t\t\t\t\tphone_number: user.phone_number\n\t\t\t\t}\n\t\t\t}\n\t\t\t@accepted_users = User.where(:_id.in => @trip.accepted_users).map { |user| \n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name,\n\t\t\t\t\tfacebook_link: user.facebook_link,\n\t\t\t\t\temail: user.email,\n\t\t\t\t\tphone_number: user.phone_number\n\t\t\t\t}\n\t\t\t}\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\ttrip: {\n\t\t\t\t\ttrip_details: @trip,\n\t\t\t\t\tuser_requests: @user_requests,\n\t\t\t\t\taccepted_users: @accepted_users\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'This user is not the driver for this trip'\n\t\t\t}\n\t\tend\n\tend", "def route\n #TODO\n end", "def index\n \t@trips = Trip.all\n end", "def trip(trip_id)\n connection.get(\"/trips/#{trip_id}\").body\n end" ]
[ "0.7030553", "0.7006096", "0.69626975", "0.6746778", "0.67030895", "0.65971345", "0.6565987", "0.65631354", "0.64541", "0.64541", "0.6431112", "0.6431112", "0.640581", "0.63941807", "0.638933", "0.6389246", "0.6334889", "0.6334889", "0.6334889", "0.6334889", "0.63313705", "0.6325613", "0.6321598", "0.63126594", "0.6312347", "0.6290406", "0.6290406", "0.62486964", "0.6232113", "0.6202732", "0.6200042", "0.61847156", "0.61691934", "0.6162894", "0.615729", "0.6125863", "0.6120128", "0.6120128", "0.61114836", "0.6106266", "0.6097256", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.60963845", "0.6089653", "0.60854435", "0.6076153", "0.6073184", "0.60579026", "0.6055425", "0.6044974", "0.6010367", "0.6010367", "0.6010367", "0.6010367", "0.6010367", "0.6010367", "0.6010367", "0.5993656", "0.5990786", "0.5989946", "0.598897", "0.59872013", "0.59787476", "0.5978594", "0.5978499", "0.59725547", "0.5971106", "0.59692174", "0.59673727", "0.5963973", "0.5951848", "0.59513295", "0.5935789", "0.5930918", "0.5930918", "0.5922554", "0.592155", "0.5915387", "0.59123474", "0.59062505", "0.59005314", "0.58985865", "0.5897865", "0.5897244", "0.5887794", "0.5887794", "0.58841556", "0.58786017", "0.587849", "0.58783585", "0.58749306" ]
0.7836891
0
GET /trip_routes/1 GET /trip_routes/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @trip_routes = TripRoute.all\n end", "def trips_by_route_id(route_id)\n get \"/gtfs/trips/routeid/#{route_id}\"\n end", "def trips\n get '/gtfs/trips'\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def trips\n flight = Flight.where(\"id = ?\", params[:id]).take\n if flight.nil?\n render :json => {errors: \"404\"}, :status => 404\n else\n respond_with( flight.trips )\n end\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n end", "def index\n @trip = Trip.find(params[:trip_id])\n end", "def get_route\n data = {\n visits: visits,\n fleet: fleet\n }\n\n data[:options] = options if options\n result = Util.send_request(\"POST\", \"vrp\", Routific.token, data)\n RoutificApi::Route.parse(result)\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def show\n render json: @trip\n end", "def show\n render json: @trip\n end", "def index\n Rails.logger.info('👻 Disraptor: Showing available routes.')\n\n routes = Disraptor::Route.find_all()\n\n render json: { 'disraptor/routes': routes }\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def route_by_id(route_id)\n get \"/gtfs/routes/#{route_id}\"\n end", "def routes\n request :get, '/routes'\n end", "def show \n @route = Route.find(params[:id])\n \n respond_to do |format|\n format.html \n format.json { render json: @route }\n end\n end", "def routes\n routes = get('/gtfs/routes')\n routes.map do |route|\n Route.from_json(route)\n end\n end", "def trips\n Trip.where(:route_id => self.route_id)\n end", "def trips\n Trip.where(:route_id => self.route_id)\n end", "def index\n trips = Trip.all\n respond_with trips\n end", "def show\n @route = Route.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @route }\n end\n end", "def show\n @trip = Trips.find_trip(params[ :id ] )\n end", "def trip(trip_id)\n connection.get(\"/trips/#{trip_id}\").body\n end", "def get_routes_by_athlete_id_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutesApi.get_routes_by_athlete_id ...\"\n end\n # resource path\n local_var_path = \"/athletes/{id}/routes\"\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['strava_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Route>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutesApi#get_routes_by_athlete_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @route = Route.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @route }\n end\n end", "def route_shape_by_trip_id(trip_id)\n get \"/gtfs/shapes/tripId/#{trip_id}\"\n end", "def index\n @trips = Trip.desc.all\n @latest_trip = @trips.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def planner_output\n if current_user != nil\n @trip = Trip.find(params[:id])\n else\n redirect_to new_user_session_path\n end\n\n @trip.routes.each { |r| r.destroy }\n\n traveller_matching = TravellerMatching.new(@trip.to_object_container_no_routes)\n @trip.create_routes_from_trip_object(traveller_matching.trip)\n\n trip_json = traveller_matching.trip.to_json\n\n\n @trip.trip_json = trip_json\n @trip.save\n end", "def trips_by_trip_id(trip_id)\n get \"/gtfs/trips/tripId/#{trip_id}\"\n end", "def set_trip_route\n @trip_route = TripRoute.find(params[:id])\n end", "def show\n @tripJson = []\n @trip.segments.order(:order).each do |segment|\n locations = []\n segment.locations.order(:order).each do |location|\n locations << {:id => location.id, :lat => location.latitude, :lng => location.longitude }\n end\n @tripJson << {:id => segment.id, :transportation => segment.transportation, :locations => locations}\n end\n end", "def show\n # raise\n authorize @trip\n @user = current_user\n @routes = @trip.routes\n add_markers_and_site_geoloc if !@routes.first.nil? # add the markers and the @site_loc. Reject routes without localisation.\n\n @trips = []\n @trips << @user.trips\n @trips << @user.joint_user_trips.map { |jut| jut.trip }\n @trips = @trips.flatten\n end", "def get_trip\n\t\t@trip = Trip.find_by(_id: trip_params[:trip_id])\n\t\tif @trip\n\t\t\t@user_requests = User.where(:_id.in => @trip.user_requests).map { |user|\n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name\n\t\t\t\t}\n\t\t\t}\n\t\t\t@accepted_users = User.where(:_id.in => @trip.accepted_users).map { |user| \n\t\t\t\tuser = {\n\t\t\t\t\t_id: user.id,\n\t\t\t\t\tfirst_name: user.first_name,\n\t\t\t\t\tlast_name: user.last_name\n\t\t\t\t}\n\t\t\t}\n\t\t\t@trip._id = @trip._id.to_s\n\t\t\t@driver = User.find_by(_id: @trip.driver)\n\t\t\trender json: {\n\t\t\t\tstatus: 'success',\n\t\t\t\ttrip: @trip,\n\t\t\t\tdriver: {\n\t\t\t\t\tfirst_name: @driver.first_name,\n\t\t\t\t\tlast_name: @driver.last_name,\n\t\t\t\t\trating: @driver.driver_rating\n\t\t\t\t},\n\t\t\t\tuser_requests: @user_requests,\n\t\t\t\taccepted_users: @accepted_users\n\t\t\t}, status: 200\n\t\telse\n\t\t\trender json: {\n\t\t\t\tstatus: 'error',\n\t\t\t\tmessage: 'That trip could not be found!'\n\t\t\t}, status: 422\n\t\tend\n\tend", "def index\n @favorite_routes = FavoriteRoute.all\n render json: @favorite_routes\n end", "def show\n @trip = Trip.find(params[:trip_id])\n end", "def show\n @trip = Trip.find(params[:id])\n @places = @trip.places\n end", "def index\n @routes = Route.all\n end", "def index\n @routes = Route.all\n end", "def index\n @routes = Route.all\n end", "def index\n @routes = Route.all\n end", "def show\n @trips_connect = TripsConnect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trips_connect }\n end\n end", "def get_trip_detail(id)\n server_response = handle_timeouts do\n get \"/1/trips/#{id}.json?locale=en\"\n end\n server_response['response']\n end", "def routes_list\n response = RestClient.get(\n BASE_URL,\n params: {command: 'routeList', a: AGENCY}\n )\n\n parse_routes_response(response.body)\n end", "def show\n @trip = Trip.find(params[:id])\nend", "def show\n\n set_no_cache\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip }\n end\n\n end", "def show\n route_id = params.require(:route_id)\n\n route = Disraptor::RouteStore.get_route(route_id)\n\n if route.nil?\n error_message = \"Couldn’t find route for the ID '#{route_id}'.\"\n Rails.logger.error('❌ Disraptor: Error: ' + error_message)\n\n return render json: { error: error_message }, status: 404\n end\n\n render json: { 'disraptor/route': route }\n end", "def show\n @trip_item = TripItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_item }\n end\n end", "def create\n @trip_route = TripRoute.new(trip_route_params)\n\n respond_to do |format|\n if @trip_route.save\n format.html { redirect_to @trip_route, notice: 'Trip route was successfully created.' }\n format.json { render :show, status: :created, location: @trip_route }\n else\n format.html { render :new }\n format.json { render json: @trip_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n schedules = Schedule.where(trip_id: params[:trip_id])\n respond_with schedules\n end", "def routes\n @logger.info \"#{__method__}\"\n fill_in \"JourneyPlanner$txtNumberOfPassengers\", with: \"1\"\n country_routes = list_countries.inject([]) do |country_result, country|\n @logger.info \"routes for #{country}\"\n select(country, :from => \"JourneyPlanner_ddlLeavingFromState\")\n sleep 3\n to_from = list_leaving_from.inject([]) do |from_result, from|\n @logger.info \"routes from #{from}\"\n sleep 2\n select(from, :from => \"JourneyPlanner$ddlLeavingFrom\")\n from_result << {from => list_travelling_to}\n from_result\n end\n country_result << {country => to_from}\n country_result\n end\n end", "def show\n @transport_route = TransportRoute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transport_route }\n end\n end", "def find_trip\n @trip = Trip.find(params[:id])\n end", "def index\n @routes = Route.where(:verified => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @routes }\n end\n end", "def get_routes\n @agency = params[:name]\n request_url = \"http://services.my511.org/Transit2.0/GetRoutesForAgency.aspx?token=#{@@token}&agencyName=#{@agency}\"\n request_url = request_url.gsub(/ /,\"%20\")\n @routes = search_for_key(parse_request(request_url), \"Route\")\n @routes = [@routes] unless @routes.kind_of?(Array)\n respond_to do |format|\n format.js {}\n end\n end", "def index\n # @checkpoints = Checkpoint.all\n @route = Route.find(params[:route_id])\n @checkpoints = @route.checkpoints\n # render json: {\n # checkpoints: @checkpoints.to_a\n # }\n end", "def route\n #TODO\n end", "def new\n @trip = Trip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trip }\n end\n end", "def new\n @trip = Trip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trip }\n end\n end", "def bus_api_getdirections(route)\n url_safe_route = URI.encode(route)\n apiKey = \"UPGw2J5PBxNnF967CAMyHygeB\"\n apiLink = \"http://www.ctabustracker.com/bustime/api/v1/getdirections?key=#{apiKey}&rt=#{url_safe_route}\"\n apiResults = open(apiLink).read\n return Hash.from_xml(apiResults)\n end", "def index\n @rec_run_routes = RecRunRoute.all\n end", "def show\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_driver }\n end\n end", "def index\n # @locations = Location.all.where(:trip_id => @trip)\n @locations = Location.all.where(trip_id: @trip)\n @trip = Trip.find(params[:trip_id])\n end", "def index\n @routes = Route.hottest\n end", "def index\n @trips = Trip.order(params[:sort].to_s + \" \" + params[:direction].to_s)\n @tripLocation = Trip.pluck(:id)\n @markers = Marker.where(\"trip_id in (?)\", @tripLocation)\n @gmaps_options = @markers.to_gmaps4rails\n\n @polylines_json = {}\n polylines = []\n\n @trips.each_with_index do |trip, i|\n polylines[i] = []\n trip.markers.each do |marker|\n polylines[i] += [{:lng=>marker.longitude.to_f, :lat=>marker.latitude.to_f}]\n end\n end\n \n @polylines_json = polylines.to_json\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trips }\n end\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def index\n @trips = Trip.all\n end", "def flights\n trip = Trip.where('id = ?', params[:id]).take\n if !trip.nil\n respond_with( trip.flights )\n else\n render :json => { error: 404 }, :status => 404\n end\n end", "def index\n @routes = Route.get_active\n end", "def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end", "def show\n\n trip = Trip.find(params[:id])\n\n departureOrder = LineStation.find_by_station_id(trip.departureStation_id).order\n arrivalOrder = LineStation.find_by_station_id(trip.arrivalStation_id).order\n\n lineStations = LineStation.where(:order => departureOrder..arrivalOrder)\n lineStations = lineStations.where(:line_id => trip.line_id)\n if departureOrder < arrivalOrder\n lineStations.order('order ASC')\n else\n lineStations.order('order DESC')\n end\n\n times = Array.new\n currentTime = trip.beginTime\n lineStations.each do |ls|\n \n station = Station.find(ls.station_id)\n train = Train.find(trip.train_id)\n\n times << { :station => station, :time => currentTime.strftime('%H:%M') }\n\n timeElapsed = ls.distance.to_f / train.velocity\n currentTime = currentTime + timeElapsed.hours\n end\n\n render :json => { :trip => trip, :times => times }\n\n end", "def index\n @trip_types = TripType.all\n end", "def index\n @routes = Route.where(:user_id => current_user.id)\n\n # if @routes.offer == true\n # @status = false\n # else\n # @status = true\n # end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @routes }\n end\n end", "def index\n search = TripSearch.new(search_params)\n trips = Trip.apply_scopes(\n search.start_location,\n search.driver_name,\n search.rider_name\n )\n\n render json: trips\n end", "def show\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @trip.to_json, :callback => params[:callback] }\n end\n end", "def index\n # Get trips for the trip type\n trips = Trip.all.where(trip_type: params[:trip_type] || 2)\n # (optional) if city_id params was provided\n trips = trips.joins(:city).where(\"cities.id = ?\", params[:city_id]) if params[:city_id]\n # (optional) if country_id params was provided\n trips = trips.joins(:city => :country).where(\"countries.id = ?\", params[:country_id]) if params[:country_id]\n # (optional) if sort params was provided\n if params[:sort]\n \n case params[:sort].downcase\n when 'popularity' # by number of bookings\n trips = trips.most_popular\n when 'rating' # by rating of reviews\n trips = trips.best_rated\n end\n\n end\n\n # Paginate\n trips = trips.page(params[:page] || 1).per(params[:per_page] || 20)\n\n render json: {\n trips: ActiveModelSerializers::SerializableResource.new(trips, each_serializer: TripSerializer),\n total: trips.total_count,\n page: trips.current_page,\n per_page: trips.limit_value\n }\n end", "def trips\n @trip_requests = current_user.trip_requests.trips.paginate(page:params[:page], per_page:20)\n json_response(@trip_requests)\n end", "def show\n @journey = Journey.find(params[:id])\n render json: @journey\n end", "def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end", "def route\n @route\n end", "def index\n @texi_routes = TexiRoute.all\n end", "def getRouteId\n @user_route_ids = []\n stop_routes_array = JSON.parse(File.read(STOP_ROUTES))\n for stop in stop_routes_array\n if stop[\"stop_id\"] == @user_stop_id\n @user_route_ids = stop[\"route_ids\"]\n end\n end\n\n for route in @user_route_ids\n @one_user_route = route\n puts \"user route is #{@one_user_route}\"\n return getAllTripIds(route)\n end\n end", "def show\n @route_connection = RouteConnection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @route_connection }\n end\n end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def index\n @ways = Way.all\n end" ]
[ "0.7561082", "0.70709825", "0.6723711", "0.66525227", "0.6535597", "0.6526628", "0.6526628", "0.64575624", "0.6442518", "0.6441559", "0.6441559", "0.64107764", "0.64107764", "0.6393423", "0.6385029", "0.6378023", "0.636311", "0.63177043", "0.62971497", "0.62921554", "0.62921554", "0.6285212", "0.625803", "0.62564445", "0.6245663", "0.6237699", "0.62087077", "0.62080276", "0.6194688", "0.6170422", "0.61606354", "0.6158153", "0.6136338", "0.6131313", "0.6113784", "0.6109335", "0.6107193", "0.6105151", "0.6084421", "0.6084421", "0.6084421", "0.6084421", "0.607834", "0.6066102", "0.6065918", "0.6065871", "0.6065346", "0.60296685", "0.60150385", "0.59967357", "0.5989408", "0.59791076", "0.5971977", "0.5964081", "0.5953309", "0.59489214", "0.5943708", "0.5939773", "0.59364647", "0.59364647", "0.59278506", "0.5925551", "0.5922314", "0.5918786", "0.59038365", "0.5890123", "0.5883824", "0.5883824", "0.5883824", "0.5883824", "0.5883824", "0.5883824", "0.5883824", "0.58701414", "0.58669734", "0.5856381", "0.5855751", "0.58537793", "0.58480906", "0.5844632", "0.58425105", "0.5841764", "0.5837237", "0.5834776", "0.5822003", "0.58218706", "0.58217084", "0.5819727", "0.58194804", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.580141", "0.5797732" ]
0.0
-1
POST /trip_routes POST /trip_routes.json
def create @trip_route = TripRoute.new(trip_route_params) respond_to do |format| if @trip_route.save format.html { redirect_to @trip_route, notice: 'Trip route was successfully created.' } format.json { render :show, status: :created, location: @trip_route } else format.html { render :new } format.json { render json: @trip_route.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_route(route, message)\n raise TypeError unless route.is_a? Route\n @changeset = @api.create_changeset(message, tags={'created_by'=>'ITCR'})\n ways_list = []\n nodes_list = create_node_list(route.path)\n\n until nodes_list.empty? # For node's maximum limit of a way\n way_nodes = nodes_list.take(MAX_NODES)\n nodes_list = nodes_list.drop(MAX_NODES)\n way_id = create_way(way_nodes)\n ways_list << way_id\n end\n\n relation = create_relation(ways_list) # Link ways to relation\n relation = add_stops(relation, route.stops) # Add bus stops to relation\n\n @api.save(relation, @changeset) # Save relation using the API\n puts 'Relation created succesfuly.'\n @api.close_changeset(@changeset)\n @changeset.id\n end", "def create\n # @route = Route.new(params[:route])\n \n waypoints = params[:waypoints]\n creator = params[:creator]\n updated_at = params[:updated_at]\n name = params[:name]\n\n @route = Route.new(waypoints: waypoints, creator: creator, updated_at: updated_at, name: name)\n \n @route.save\n\n render json: @route\n\n # @vote_creator = VoteCreator.new(vote_params)\n # @vote = @vote_creator.vote\n # if @vote_creator.save\n # render json: @vote, status: :created, location: @vote\n # else\n # render json: @vote.errors, status: :unprocessable_entity\n # end\n end", "def index\n @trip_routes = TripRoute.all\n end", "def add_route(route={})\n request :post, '/routes', route\n end", "def planner_output\n if current_user != nil\n @trip = Trip.find(params[:id])\n else\n redirect_to new_user_session_path\n end\n\n @trip.routes.each { |r| r.destroy }\n\n traveller_matching = TravellerMatching.new(@trip.to_object_container_no_routes)\n @trip.create_routes_from_trip_object(traveller_matching.trip)\n\n trip_json = traveller_matching.trip.to_json\n\n\n @trip.trip_json = trip_json\n @trip.save\n end", "def create\n @route = Route.create(route_args)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route = Route.new(route_params)\n if @route.valid?\n @route.save\n @user_route = UserRoute.create(user_id: @current_user.id, route_id: @route.id)\n render json: @user_route.serialize.to_json, status: :ok\n else\n render json: { errors: @route.errors.full_messages }, status: :unprocessable_entity\n end\n\n end", "def create\n @train_route = TrainRoute.new(train_route_params)\n \n respond_to do |format|\n if @train_route.save\n format.html { redirect_to @train_route, notice: 'TrainRoute was successfully created.' }\n format.json { render :show, status: :created, location: @train_route }\n else\n format.html { render :new }\n format.json { render json: @train_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if user_signed_in?\n user = Hitchhiker.where(:email => current_user.email)\n @route = Route.new(params[:route])\n routeInfo = JSON.parse(params[:route_map_points].gsub(\"jb\",\"latitude\").gsub(\"kb\",\"longitude\"))\n \n \n @route.route_points = routeInfo['overview_path']\n @route.starting_point = routeInfo['overview_path'].first\n @route.end_point = routeInfo['overview_path'].last\n @route.hitchhiker_id = user.first()[\"_id\"]\n \n \n respond_to do |format|\n if @route.save\n if @route.schedule.create( _route_id: @route._id,\n departure: params[:route_schedule_departure], \n arrival: params[:route_schedule_arrival])\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render json: @route, status: :created, location: @route }\n else\n format.html { render action: \"new\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end\n end\n end", "def post_route(payload)\n with_rescue do\n payload = payload.to_json if payload.is_a?(Hash)\n connection.post do |request|\n request.url routes_path\n request.body = payload\n request.headers['Content-Type'] = 'application/json'\n end\n end\n end", "def create\n @favorite_route = FavoriteRoute.new(favorite_route_params)\n if @favorite_route.save\n render json: @favorite_route, status: :created, location: @favorite_route\n else\n render json: @favorite_route.errors, status: :unprocessable_entity\n end \n end", "def create\n trip = Trip.create(trip_params)\n\n respond_with trip\n end", "def create\n @route = Route.new(params[:route])\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render json: @route, status: :created, location: @route }\n else\n format.html { render action: \"new\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n # Get the permission's type which represent an usual user and an admin one.\n permUser = Permission_type.find_by(permission: \"user\").id\n permAdmin = Permission_type.find_by(permission: \"admin\").id\n\n # Create current user's admin permission on the new created trip.\n adminPerm = Permission.new(:user_id => current_user.id, :trip_id => @trip.id, :permission_type_id => permAdmin, :accepted => 1)\n adminPerm.save\n # Create a \"user\" permission for each selected users.\n if params[\"users\"]\n params[\"users\"].each do |user|\n userId = user[2, user.length]\n\n # We don't add the current user, which is an admin.\n if userId != String(current_user.id)\n currentPermission = user[0] == \"1\" ? permAdmin : permUser\n\n perm = Permission.new(:user_id => userId, :trip_id => @trip.id, :permission_type_id => currentPermission, :accepted => 0)\n perm.save\n end\n end\n end\n\n # Create each waypoint of the trip.\n if params['waypoints']\n i = 0\n params['waypoints'].each do |waypoint|\n i += 1\n w = Stop.new(:title => @trip.title + \" - #{i}\", :loc_lat => waypoint[1][0], :loc_lon => waypoint[1][1], :trip_id => @trip.id, :etape_nb => i)\n w.save\n end\n\n # If the endpoint is also the startpoint, add an extra stop.\n if params['arrivalEqualsStart']\n w = Stop.new(:title => @trip.title + \" - #{i + 1}\", :loc_lat => params[\"waypoints\"][\"0\"][0], :loc_lon => params[\"waypoints\"][\"0\"][1], :trip_id => @trip.id, :etape_nb => (i + 1))\n w.save\n end\n end\n\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, :notice => 'Trip was successfully created.' }\n format.json { render :json => @trip, :status => :created, :location => @trip }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @trip_waypoint = TripWaypoint.new\n @trip_waypoint.place_id = params[:place_id]\n @trip_waypoint.trip_id = params[:trip_id]\n @trip_waypoint.save\n\n respond_to do |format|\n if @trip_waypoint.save\n format.html { redirect_to edit_partner_trip_path(params[:trip_id]), notice: \"Le lieu a été ajouté à l'itinéraire\" }\n # format.json { render :show, status: :created, location: @trip_waypoint }\n else\n format.html { render :new }\n # format.json { render json: @trip_waypoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def trips\n get '/gtfs/trips'\n end", "def create\n @route = Route.new(route_params)\n @route.save\n\n redirect_to '/routes/map/'+@route.map_id.to_s\n end", "def create\n @routing = Routing.new(params[:routing])\n if @routing.save\n redirect_to routings_path\n end\n end", "def create\n @route = Route.new(route_params)\n respond_to do |format|\n @route.validate\n if (@route.errors.keys - [:start_station_id, :end_station_id]).size == 0\n @route.save(validate: false)\n end\n if @route.save\n format.html { redirect_to @route, notice: 'Маршрут создан.' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route = Route.new(route_params)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def data_set_routes\n @trains[0].set_route(routes[0])\n @trains[2].set_route(routes[2])\n end", "def create\n @route = Route.new(route_params)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render action: 'show', status: :created, location: @route }\n else\n format.html { render action: 'new' }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route = Route.new(route_params)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render action: 'show', status: :created, location: @route }\n else\n format.html { render action: 'new' }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to trips_path, notice: 'Cesta byla vytvořena.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route = Route.new(params[:route])\n\n route_html = Nokogiri::HTML(open(@route.url))\n\n @activity_id = @route.url.split('/').last()\n @api_url = \"https://www.strava.com/api/v3/activities/\" + @activity_id + \"?access_token=9a3dd1938530a0db29fc42f4eedc4ff975e78190\"\n\n parsed_uri = URI.parse(@api_url)\n http = Net::HTTP.new(parsed_uri.host, parsed_uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(parsed_uri.request_uri)\n response = http.request(request)\n parsed_response = JSON.parse(response.body)\n\n @route.distance = ((parsed_response[\"distance\"].to_f * 0.000621371).round(2)).to_s #Convert meters to miles\n @route.elevation = ((parsed_response[\"total_elevation_gain\"] *3.28084).round(2)).to_s #Convert meters to feet\n @route.map_polyline = parsed_response[\"map\"][\"summary_polyline\"]\n\n if @route.name.empty?\n @route.name = parsed_response[\"name\"]\n end\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to routes_url, notice: 'Your route was submitted successfully, and will be verified by an officer shortly.' }\n format.json { render json: @route, status: :created, location: @route }\n else\n format.html { render action: \"new\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_trip_route\n @trip_route = TripRoute.find(params[:id])\n end", "def create\n err_objs=[]\n error=false\n user_id=MobileDevice.where(:access_token=>params[:access_token]).first.user_id\n if params.has_key?('trips')\n params[:trips].each do |trip|\n trip_id=trip[1][:trip_id] #save ref to trip id in case @trip.save fails (used in return response)\n if !create_trip(trip[1],user_id)\n error=true\n err_objs.push(trip_id)\n end\n end\n else\n error=true\n end\n respond_to do |format|\n if !error\n format.json { render json: {:msg => \"success\"}, status: :created }\n else\n format.json { render json: {:msg => \"Could not save the following trips. Please check that all required fields are filled out (license_plate, cargo, start_location, end_location, start_timestamp, end_timestamp)\", :err_ids => err_objs}, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(user_id: params[:user_id], trip_name: params[:trip_name], distance: params[:distance], walked_at: Time.now)\n @origin = Place.new(user_id: params[:user_id], place_name: params[:origin_name], latitude: params[:origin_lat], longitude: params[:origin_long])\n @destination = Place.new(user_id: params[:user_id], place_name: params[:dest_name], latitude: params[:dest_lat], longitude: params[:dest_long])\n if @trip.save && @origin.save && @destination.save\n @origin_point = TripPoint.new(trip_id: @trip.id, place_id: @origin.id, place_type: \"Origin\")\n @destination_point = TripPoint.new(trip_id: @trip.id, place_id: @destination.id, place_type: \"Destination\")\n @origin_point.save\n @destination_point.save\n else\n render :json => {:success => false, :errors => [\"Trip creation failed.\"]}\n end\n end", "def create\n\n # inflate a trip proxy object from the form params\n @trip_proxy = create_trip_proxy_from_form_params\n \n if @trip_proxy.valid?\n @trip = create_trip(@trip_proxy)\n end\n\n # Create makers for the map control\n @markers = create_markers(@trip_proxy)\n\n respond_to do |format|\n if @trip\n if @trip.save\n @trip.reload\n @planned_trip = @trip.planned_trips.first\n @planned_trip.create_itineraries\n format.html { redirect_to user_planned_trip_path(@traveler, @planned_trip) }\n format.json { render json: @planned_trip, status: :created, location: @planned_trip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip_proxy.errors, status: :unprocessable_entity }\n end\n else\n format.html { render action: \"new\", flash[:alert] => t(:correct_errors_to_create_a_trip) }\n end\n end\n end", "def create\n @route = Route.new(route_params)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Die Route wurde erfolgreich erstellt' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route = Route.new(params[:route])\n @route.user_id = current_user.id\n @route.active = true\n \n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render json: @route, status: :created, location: @route }\n else\n format.html { render action: \"new\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n trip = current_user.trips.new(trip_params)\n if trip.save\n render json: {\n status: :created,\n trip: trip\n }\n else\n render json: {\n status: 500,\n errors: trip.errors.full_messages\n }\n end\n end", "def create\n @transport_route = TransportRoute.new(params[:transport_route])\n\n respond_to do |format|\n if @transport_route.save\n format.html { redirect_to @transport_route, notice: 'Transport route was successfully created.' }\n format.json { render json: @transport_route, status: :created, location: @transport_route }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transport_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def trip_route_params\n params.require(:trip_route).permit(:pointlat, :pointlong, :DriverTrip_id)\n end", "def record_route(departure_time, arrival_time, from, to)\n from ||= \"\"\n to ||= \"\"\n @routes[@current_route] ||= {}\n @routes[@current_route][from] ||= {}\n @routes[@current_route][from][:departures] ||= []\n @routes[@current_route][from][:departures] << {:to => to, :time => departure_time, :days => @current_days}\n @routes[@current_route][to] ||= {}\n @routes[@current_route][to][:arrivals] ||= []\n @routes[@current_route][to][:arrivals] << {:from => from, :time => arrival_time, :days => @current_days}\n @routes\nend", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to current_user, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { redirect_to current_user, notice: \"Trip can't be created\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create_route\n return create_route_core unless Station.all.size < 2\n\n show_info_for_action('new Route')\n show_info_you_need_at_least('2 Stations', Station.all.count)\n\n create_station_advanced\n create_route\n end", "def create\n @origin = Origin.new(\n :latitude => trip_params[:origin][:latitude],\n :longitude => trip_params[:origin][:longitude]\n )\n @origin.save\n @destination = Destination.new(:address => trip_params[:destination][:address].concat(\" New York City\"))\n @destination.save\n @trip = Trip.new(:origin_id => @origin.id, :destination_id => @destination.id)\n @trip.save \n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip }\n format.json { render action: 'show', status: :created, location: @trip }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route = Route.new(route_params)\n @route.driver_id = @driver.id\n respond_to do |format|\n if @route.save\n format.html { redirect_to driver_path(@route.driver_id ), notice: 'Route was successfully created.' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @roadmap = Roadmap.find(params[:roadmap_id])\n @roadmap_step = @roadmap.roadmap_steps.create(roadmap_step_params)\n #@roadmap_step = RoadmapStep.new(roadmap_step_params)\n\n respond_to do |format|\n if @roadmap_step.save\n format.html { redirect_to @roadmap, notice: 'Roadmap step was successfully created.' }\n format.json { render :show, status: :created, location: @roadmap_step }\n else\n format.html { render :new }\n format.json { render json: @roadmap_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # We have to convert the two posted values for each time into a single string\n # If we don't Trip.new can't populate the Trips values based on the post hash\n @trip = Trip.new(parse_post params[:trip])\n\n respond_to do |format|\n if @trip.save\n flash[:notice] = 'Trip was successfully created.'\n format.html { redirect_to(@trip) }\n format.xml { render :xml => @trip, :status => :created, :location => @trip }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n # We have to convert the two posted values for each time into a single string\n # If we don't Trip.new can't populate the Trips values based on the post hash\n @trip = Trip.new(parse_post params[:trip])\n\n respond_to do |format|\n if @trip.save\n flash[:notice] = 'Trip was successfully created.'\n format.html { redirect_to(@trip) }\n format.xml { render :xml => @trip, :status => :created, :location => @trip }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @trip = current_user.trips.new(params[:trip].except(:places))\n params[:trip][:places] ||= []\n @trip.add_trip_places(params[:trip][:places])\n if @trip.save\n flash[:notice] = \"Trip succesfully created\"\n redirect_to @trip\n else\n flash.now[:error] = @trip.errors.full_messages\n @places = params[:trip][:places]\n render \"new\"\n end\n end", "def trips_by_route_id(route_id)\n get \"/gtfs/trips/routeid/#{route_id}\"\n end", "def create\n @trip = Trip.new({\"name\" => \"New Trip\",\n \"beginning\" => Time.now.strftime(\"%d/%m/%Y\"),\n \"duration\" => \"0\",\n \"user\" => current_user})\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render home_path }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rec_run_route = RecRunRoute.new(rec_run_route_params)\n\n respond_to do |format|\n if @rec_run_route.save\n flash[:success] = \"Recreational Run Route Created.\"\n format.html { redirect_to admin_rec_run_routes_path }\n format.json { render action: 'index', status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @rec_run_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :json => @trip.to_json, :callback => params[:callback], status: :created, location: @trip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n @trip.session_id = session.id\n @trip.user_id = current_user.id\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip.parent || @trip, notice: 'Trip was successfully created.', change: 'list' }\n format.json { render action: 'show', status: :created, location: @trip, day: 1 }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def route_params\n params.require(:route).permit(:title, :workout_id, :description, :estimated_duration, :distance, :elevation_gain, :polyline, :activity)\n end", "def get_route\n data = {\n visits: visits,\n fleet: fleet\n }\n\n data[:options] = options if options\n result = Util.send_request(\"POST\", \"vrp\", Routific.token, data)\n RoutificApi::Route.parse(result)\n end", "def create\n @trip = Trip.new(trip_params)\n\n respond_to do |format|\n if @trip.save\n\n @client = GooglePlaces::Client.new(\"AIzaSyDslRFZO4CcrhN9M9gchkS0VKLWrOB8J_Y\")\n\n # @attractions = JSON.parse(@trip.tag).join(' ')\n places = @client.spots_by_query(\"tourist landmark in #{@trip.location} \", :radius => @trip.location_radius, :exclude => 'lodging')\n\n # https://maps.googleapis.com/maps/api/place/textsearch/json?query=points+of+interest+for+tourists+in+aberdeen&radius=5000&key=AIzaSyCsJcCSDOx5fdOlmWagQZabLeAe6EGxNSI\n\n places.take(@trip.sightsnum).each do |place|\n if place.photos[0]\n photo_url = place.photos[0].fetch_url(800)\n end\n p = @trip.places.create :name => place.name, :google_id => place.place_id, :latitude => place.lat, :longitude => place.lng, :photo_url => photo_url\n end\n\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@route = Route.new(params[:route].merge(:user=>current_user))\n\t\t@route.geocode\n\t\t\n\t\trespond_to do |format|\n\t\t\tif @route.save\n\t\t\t\tformat.html { redirect_to(@route, :notice => 'Route was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @route, :status => :created, :location => @route }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @route.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n trip = Trip.new(trip_params)\n trip.rand_code = generate_code(6)\n\n # checks to see if photo was sent, and assigns default if none sent\n if params[:photo_base]\n trip.photo = params[:photo_base]\n else\n trip.photo = default_photo\n end\n\n trip.save!\n\n # creates a UserTrip object as a reference between Users and Trips\n tripid = Trip.last.id\n userid = params[:user_id]\n UserTrip.create(user_id: userid, trip_id: tripid)\n render json: trip\n end", "def create\n\n if (user_signed_in?)\n @route = Route.new(route_params)\n @route.user_id = current_user.id\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to trajets_path, notice: 'Votre trajet est bien enregistré!' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @texi_route = TexiRoute.new(texi_route_params)\n\n respond_to do |format|\n if @texi_route.save\n format.html { redirect_to @texi_route, notice: 'Texi route was successfully created.' }\n format.json { render :show, status: :created, location: @texi_route }\n else\n format.html { render :new }\n format.json { render json: @texi_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_fixed_route_itineraries\n tp = TripPlanner.new\n arrive_by = !is_depart\n from_place = trip.trip_places.first\n to_place = trip.trip_places.last\n result, response = tp.get_fixed_itineraries([from_place.location.first, from_place.location.last],[to_place.location.first, to_place.location.last], trip_datetime.in_time_zone, arrive_by.to_s)\n if result\n tp.convert_itineraries(response).each do |itinerary|\n itineraries << Itinerary.new(itinerary)\n end\n else\n itineraries << Itinerary.new('server_status'=>response['id'], 'server_status'=>response['msg'])\n end\n end", "def create\n @ht_route = HtRoute.new(ht_route_params)\n\n respond_to do |format|\n if @ht_route.save\n format.html { redirect_to @ht_route, notice: 'Ht route was successfully created.' }\n format.json { render :show, status: :created, location: @ht_route }\n else\n format.html { render :new }\n format.json { render json: @ht_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def route_params\n params.require(:route).permit(:name, railway_station_ids: [])\n end", "def create\n @trip = Trip.new(trip_params)\n @trip.user_id = current_user.id\n\n if @trip.roundtrip\n @trip2 = Trip.new()\n @trip2.start_date = @trip.end_date\n @trip2.start_time = @trip2.end_time\n\n @trip2.origin = @trip.destiny\n @trip2.destiny = @trip2.origin\n\n @trip2.passcities = @trip.passcities\n\n @trip2.save\n else\n end\n \n respond_to do |format|\n if @trip.save\n #format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.html { redirect_to :controller=>\"costs\", :action=> \"new\", :trip_id=>@trip.id}\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:traceroute].each do |tr|\n Traceroute.create(:server => tr[:server], :local_ip => tr[:local_ip], :stdout => tr[:stdout], :stderr => tr[:stderr], :exit_status => tr[:exit_status], :timestamp => tr[:timestamp])\n end\n\n\n\n #puts \"hello #{params}\"\n #@hello = params\n #@hello.map { |k,v| puts \"#{k} is #{v}\" }\n #traceroute_params.each do |v|\n # traceroute = Traceroute.create(v)\n #end\n\n respond_to do |format|\n format.all { render :nothing => true, :status => 200 }\n end\n #@traceroute = Traceroute.new(params)\n\n #respond_to do |format|\n # if @traceroute.save\n # format.html { redirect_to @traceroute, notice: 'Traceroute was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @traceroute }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def routes\n routes = get('/gtfs/routes')\n routes.map do |route|\n Route.from_json(route)\n end\n end", "def create\n @route = Route.new(route_params)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to admin_route_url(@route), notice: 'Route was successfully created.' }\n format.json { render :show, status: :created, location: admin_route_url(@route) }\n else\n format.html { render :new }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @traceroute = Traceroute.new(traceroute_params)\n\n respond_to do |format|\n if @traceroute.save\n flash[:notice] = 'traceroute was successfully created.'\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully created.' }\n format.json { render action: 'show', status: :created, location: @traceroute }\n else\n format.html { render action: 'new' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip_schedule = TripSchedule.new(trip_schedule_params)\n\n respond_to do |format|\n if @trip_schedule.save\n format.html { redirect_to @trip_schedule, notice: 'Trip schedule was successfully created.' }\n format.json { render :show, status: :created, location: @trip_schedule }\n else\n format.html { render :new }\n format.json { render json: @trip_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @road = Road.new(params[:road])\n\n respond_to do |format|\n if @road.save\n format.html { redirect_to @road, notice: 'Road was successfully created.' }\n format.json { render json: @road, status: :created, location: @road }\n else\n format.html { render action: \"new\" }\n format.json { render json: @road.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params)\n @trip.nomad_id = current_nomad.id\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = current_user.trips.build(params[:trip])\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render json: @trip, status: :created, location: @trip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bus_route = BusRoute.new(params[:bus_route])\n\n respond_to do |format|\n if @bus_route.save\n format.html { redirect_to @bus_route, notice: 'Bus route was successfully created.' }\n format.json { render json: @bus_route, status: :created, location: @bus_route }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bus_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @route_detail = RouteDetail.new(params[:route_detail])\r\n\r\n respond_to do |format|\r\n if @route_detail.save\r\n format.html { redirect_to @route_detail, notice: 'Route detail was successfully created.' }\r\n format.json { render json: @route_detail, status: :created, location: @route_detail }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @route_detail.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\r\n @route_detail = RouteDetail.new(params[:route_detail])\r\n\r\n respond_to do |format|\r\n if @route_detail.save\r\n format.html { redirect_to @route_detail, notice: 'Route detail was successfully created.' }\r\n format.json { render json: @route_detail, status: :created, location: @route_detail }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @route_detail.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def routes_map; end", "def create\n @rails_route = RailsRoute.new(rails_route_params)\n\n respond_to do |format|\n if @rails_route.save\n format.html { redirect_to @rails_route, notice: 'Rails route was successfully created.' }\n format.json { render :show, status: :created, location: @rails_route }\n else\n format.html { render :new }\n format.json { render json: @rails_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def route_params\n params.require(:route).permit(:title, :owner_id, :relation_ids, :author_id, :user_author_id, :trip_id, :guide_id)\n end", "def route_shape_by_trip_id(trip_id)\n get \"/gtfs/shapes/tripId/#{trip_id}\"\n end", "def create\n @trip_driver = TripDriver.new(trip_driver_params)\n\n respond_to do |format|\n if @trip_driver.save\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully created.' }\n format.json { render json: @trip_driver, status: :created, location: @trip_driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @trip = current_user.trips.build\n 5.times {@trip.places.build}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trip }\n end\n end", "def add_route\n type = OrderType.find_by_name('route')\n \n hwb = Order.find(params[:id])\n \n data = params[\"route\"]\n data[\"parent_id\"] = params[:id]\n \n data[\"created_by\"] = self.current_user.account # <-- hardcoded to Transmance compnay id\n data[\"order_type_id\"] = type.id\n data[\"bill_to_id\"] = 1 # <-- hacked to Transmanage company id\n data[\"billing_method_id\"] = 1 # <-- read this from db!!!!!!!!!!!!!!\n data[\"shipping_method_id\"] = 1 # <-- hardcoded.\n data[\"pieces\"] = 1\n data[\"declared_value\"] = 0\n data[\"purpose\"] = ''\n data[\"weight\"] = 0\n data[\"shipping_commodity_id\"] = 1\n\n res = {\n :success => false,\n :data => [],\n :msg => ''\n }\n\n Order.transaction do \n # super can handle it from here...\n order = Order.create(data)\n \n # get OrderTypeEntity list\n entities = order.type.entities(:include => [:domain])\n \n case params[\"pickup_mode\"]\n when \"shipper\" \n params[\"shipper\"] = {\"company_id\" => Order.find(params[:id]).find_entity_by_type(\"shipper\").company.id}\n when \"carrier\"\n params[\"shipper\"] = {\"company_id\" => params[\"carrier\"][\"company_id\"]} \n end\n \n case params[\"delivery_mode\"]\n when \"carrier\"\n params[\"consignee\"] = {\"company_id\" => params[\"carrier\"][\"company_id\"]}\n end\n entities.each do |e| \n data = params[e.name] \n case e.name\n when \"shipper\"\n location = CompanyLocation.find(:first, \n :conditions => \"airport_id = #{params['origin_airport_id']} AND company_id = #{params['shipper']['company_id']}\"\n ) || Company.create_anonymous_location(params[\"shipper\"][\"company_id\"], hwb.find_entity_by_type('shipper').location)\n data[:company_location_id] = location.id\n data[:date_in] = params[\"carrier\"][\"date_in\"] + ' ' + params[\"carrier\"][\"time_in\"]\n when \"consignee\"\n location = CompanyLocation.find(:first, \n :conditions => \"airport_id = #{params['destination_airport_id']} AND company_id = #{params['consignee']['company_id']}\"\n ) || Company.create_anonymous_location(params[\"consignee\"][\"company_id\"], hwb.find_entity_by_type('consignee').location) \n data[:company_location_id] = location.id\n data[:date_in] = params[\"carrier\"][\"date_out\"] + ' ' + params[\"carrier\"][\"time_out\"]\n when \"carrier\" \n data[:company_location_id] = Company.find(params[\"carrier\"][\"company_id\"], :include => [:head_office]).head_office.id \n end\n data[:order_id] = order.id\n data[:order_type_entity_id] = e.id \n oe = OrderEntity.create(data)\n end\n \n res[:success] = true\n res[:data] = {:route => Order.render_route(order)}\n res[:msg] = 'Added order route' \n end\n\n render :json => res.to_json, :layout => false\n\n end", "def create\n @trip = current_user.trips.build(trip_params)\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trip }\n else\n format.html { render action: 'new' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @railway = Railway.new(params[:railway])\n\n respond_to do |format|\n if @railway.save\n format.html { redirect_to @railway, notice: 'Railway was successfully created.' }\n format.json { render json: @railway, status: :created, location: @railway }\n else\n format.html { render action: \"new\" }\n format.json { render json: @railway.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @trip = Trip.new(trip_params.merge(user_id: current_user.id))\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render :show, status: :created, location: @trip }\n else\n format.html { render :new }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def route_params\n params.require(:route).permit(:user_id, :car_id, :title, :description, :from_lat, :from_lng, :to_lat, :to_lng, :waypoints, :departure, :cost, :users_in_route, :active, :spaces_available, :ratings, :userRating, :comments)\n end", "def trip_params\n params.require(:trip).permit(:location, :latitude, :longitude, :start_date, :end_date, :days, :notes, :name, clips_attributes: [:uri, :day_list, :date_list, :type_list, :day, :date, :external_reference])\n end", "def create\n @road = Road.new(road_params)\n\n respond_to do |format|\n if @road.save\n format.html { redirect_to @road, notice: 'Road was successfully created.' }\n format.json { render :show, status: :created, location: @road }\n else\n format.html { render :new }\n format.json { render json: @road.errors, status: :unprocessable_entity }\n end\n end\n end", "def routes\n @logger.info \"#{__method__}\"\n fill_in \"JourneyPlanner$txtNumberOfPassengers\", with: \"1\"\n country_routes = list_countries.inject([]) do |country_result, country|\n @logger.info \"routes for #{country}\"\n select(country, :from => \"JourneyPlanner_ddlLeavingFromState\")\n sleep 3\n to_from = list_leaving_from.inject([]) do |from_result, from|\n @logger.info \"routes from #{from}\"\n sleep 2\n select(from, :from => \"JourneyPlanner$ddlLeavingFrom\")\n from_result << {from => list_travelling_to}\n from_result\n end\n country_result << {country => to_from}\n country_result\n end\n end", "def trip_params\n params.require(:trip).permit(:starts_on, :ends_on, :name, :location, {:item_ids => []})\n end", "def route_params\n params.require(:route).permit(:route_code, :truck, :driver, :user_id, :badge, :issued_flag, :returned_flag)\n end", "def route_params\n params.require(:route).permit(:name, :zone_id, :town_id)\n end", "def create_route(itinerary)\n locations = []\n # puts itinerary\n itinerary.each do |item|\n if item[:error] == nil\n locations << item[:route_coords]\n end\n end\n get_route(locations)\nend", "def generate_routes\n\trequire 'csv'\n\tinclude HTTParty\n\trequire 'json'\n\tresponse = HTTParty.get('http://citppuc.cloudapp.net/api/lineas')\n\tbody = JSON.parse(response.body)\n\tCSV.open('csv/aplicacion/routes.csv', 'w') do |csv|\n\t\tbody.each do |item|\n\t\t\tputs \"Agragando ruta: \"+item[\"codigo_linea\"]\n\t\t\tcsv << [item[\"codigo_linea\"], 0, 'FFFFFF']\n\t\tend\n\tend\nend", "def create\n @route_connection = RouteConnection.new(params[:route_connection])\n\n respond_to do |format|\n if @route_connection.save\n format.html { redirect_to @route_connection, notice: 'Route connection was successfully created.' }\n format.json { render json: @route_connection, status: :created, location: @route_connection }\n else\n format.html { render action: \"new\" }\n format.json { render json: @route_connection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @route_type = RouteType.new(route_type_params)\n\n respond_to do |format|\n if @route_type.save\n format.html { redirect_to @route_type, notice: 'Route type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @route_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @route_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_trip\n # Only attempt to create trip if all the necessary pieces are there\n return false unless @itinerary && @trip && @service && @user\n \n label = request_label(:book, trip_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/create_trip\", \n :post,\n head: headers,\n body: body_for_booking(@booking_options).to_json\n ).response!(label)\n end", "def route_params\n params.require(:route).permit(:departure_point, :arrival_point, :departure_date, :departure_time, :estimated_arrival_time, :place_number, :price, \n :animal_permission, :smoker_permission, :luggage, :user_id , :passenger_or_conducter)\n end", "def create\n @trips_connect = TripsConnect.new(params[:trips_connect])\n\n respond_to do |format|\n if @trips_connect.save\n format.html { redirect_to @trips_connect, notice: 'Trips connect was successfully created.' }\n format.json { render json: @trips_connect, status: :created, location: @trips_connect }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trips_connect.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def submitNewRoute(routeId, edgeList)\n com = Sumo::Traci::Command_SetVariable.new(:route, :addRoute,\n routeId, edgeList) ;\n @traciClient.execCommands(com) ;\n end", "def create\n @trip = Trip.new(params[:trip])\n @trip.user = current_user\n\n respond_to do |format|\n if @trip.save\n format.html { redirect_to @trip, notice: 'Trip was successfully created.' }\n format.json { render json: @trip, status: :created, location: @trip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def route_params\n params.require(:route).permit(:from_id, :to_id, :calculation_basis, :distance, :status)\n end" ]
[ "0.7198111", "0.6731935", "0.66497546", "0.662146", "0.6363889", "0.62762296", "0.62604165", "0.6230909", "0.6227994", "0.62254465", "0.62159413", "0.62015706", "0.6197352", "0.6174321", "0.61385125", "0.612738", "0.6107465", "0.60945064", "0.6089672", "0.6085119", "0.6070074", "0.6049602", "0.604461", "0.604461", "0.6040607", "0.60395056", "0.5997505", "0.5994653", "0.5993355", "0.5991187", "0.59870756", "0.5983915", "0.59796643", "0.59604204", "0.59574455", "0.59425116", "0.59387934", "0.5938296", "0.59110326", "0.5902833", "0.5878654", "0.5866754", "0.5849549", "0.5849549", "0.5843763", "0.58328986", "0.5832165", "0.5819692", "0.58016306", "0.579513", "0.57904375", "0.57660216", "0.57644445", "0.5763572", "0.5762106", "0.57579964", "0.5755021", "0.5736037", "0.57346547", "0.57191235", "0.5717877", "0.57082236", "0.5695126", "0.5694223", "0.56933236", "0.56905115", "0.5686302", "0.56790227", "0.5678199", "0.56694114", "0.565457", "0.565457", "0.5652094", "0.56420034", "0.5638359", "0.56363356", "0.56363094", "0.56345457", "0.5626371", "0.5621402", "0.561977", "0.5618969", "0.5616692", "0.5616534", "0.56112754", "0.5608649", "0.5603651", "0.5600907", "0.55982894", "0.55956167", "0.5585796", "0.5584419", "0.5569945", "0.5565456", "0.5563426", "0.5563385", "0.55584764", "0.5556468", "0.5555949", "0.55459887" ]
0.69839543
1
PATCH/PUT /trip_routes/1 PATCH/PUT /trip_routes/1.json
def update respond_to do |format| if @trip_route.update(trip_route_params) format.html { redirect_to @trip_route, notice: 'Trip route was successfully updated.' } format.json { render :show, status: :ok, location: @trip_route } else format.html { render :edit } format.json { render json: @trip_route.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @route = Route.find(params[:id])\n if user_signed_in?\n routeInfo = JSON.parse(params[:route_map_points].gsub(\"jb\",\"latitude\").gsub(\"kb\",\"longitude\"))\n \n \n @route.route_points = routeInfo['overview_path']\n @route.starting_point = routeInfo['overview_path'].first\n @route.end_point = routeInfo['overview_path'].last\n\n\n respond_to do |format|\n if @route.save(params[:route])\n if @route.schedule.update_attributes(\n departure: params[:route_schedule_departure], \n arrival: params[:route_schedule_arrival]) \n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end\nend\n # DELETE /routes/1\n # DELETE /routes/1.json\n def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end\nend", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n last_clip(@trip, trip_params[:clips_attributes].present?)\n format.html { redirect_to @trip.parent || @trip, notice: 'Trip was successfully updated.', change: \"list\" }\n format.json { head :no_content }\n else\n format.html { redirect_to @trip.parent || @trip }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n if @trip.update(trip_params)\n render :json => {:success => true}\n else\n render :json => {:success => false, :errors => [\"Trip update failed.\"]}\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n Rails.logger.info('👻 Disraptor: Updating route.')\n\n route_id = params.require(:route_id)\n payload = params.require('disraptor/route')\n source_path = normalize_path(payload['sourcePath'])\n target_url = normalize_uri(payload['targetUrl'])\n request_method = normalize_request_method(payload['requestMethod'])\n\n if !@@allowed_methods.include?(request_method)\n error_message = \"Route request method was #{request_method} but expected one of these: #{@@allowed_methods.join(', ')}.\"\n Rails.logger.error('❌ Disraptor: Error: ' + error_message)\n\n return render json: { error: error_message }, status: 400\n end\n\n if source_path != '/' and source_path.end_with?('/')\n error_message = \"Route source path was #{source_path} but it must not end in a slash.\"\n Rails.logger.error('❌ Disraptor: Error: ' + error_message)\n\n return render json: { error: error_message }, status: 400\n end\n\n route = Disraptor::Route.edit(route_id, source_path, target_url, request_method)\n\n Rails.application.reload_routes!\n\n render json: { 'disraptor/route': route }\n end", "def update\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update number, routes\r\n # the base uri for api requests\r\n query_builder = Configuration.BASE_URI.dup\r\n\r\n # prepare query string for API call\r\n query_builder << \"/tns/{number}\"\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n \"number\" => number,\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n \"user-agent\" => \"Flowroute SDK 1.0\",\r\n \"content-type\" => \"application/json; charset=utf-8\"\r\n }\r\n\r\n response = CustomAuthUtility.append_custom_auth_params method:'PATCH',\r\n query_url:query_url,\r\n body:\"{\\\"routes\\\": #{routes.to_json}}\",\r\n headers:headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new \"NOT AUTHORIZED\", 401, response.raw_body\r\n elsif response.code == 500\r\n raise APIException.new \"APPLICATION/SERVER ERROR\", 500, response.raw_body\r\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "def update\n @route = Route.find(params[:id])\n\n respond_to do |format|\n if @route.update_attributes(params[:route])\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @route = Route.find(params[:id])\n\n respond_to do |format|\n if @route.update_attributes(params[:route])\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset_routes(routes=[])\n request :put, '/routes', routes\n end", "def update\n @transport_route = TransportRoute.find(params[:id])\n\n respond_to do |format|\n if @transport_route.update_attributes(params[:transport_route])\n format.html { redirect_to @transport_route, notice: 'Transport route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @transport_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @route = Route.find(params[:id])\n @tmp = @route.dup\n \n respond_to do |format|\n if @route.update_attributes(params[:route])\n \n if @tmp.fellow_id\n route = @tmp\n tmp_route = Route.find(@tmp.fellow_id)\n user = tmp_route.user\n UserMailer.deleted_route(user, route).deliver\n end\n \n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n if @trip.end_point = Station.find_by(uid: params[:station_id])\n render json: @trip.attributes.merge(station: @trip.end_point.attributes), location: @trip\n else\n render json: @trip.errors, status: :unprocessable_entity\n end\n end", "def update\n @route.set_processed\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to new_routes_path, notice: 'Die Route wurde aktualisiert und aktiv gesetzt' }\n format.json { render :show, status: :ok, location: @route }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_trip_route\n @trip_route = TripRoute.find(params[:id])\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n \n \n params[:trip][:category_ids] ||= []\n params[:trip][:type_ids] ||= []\n \n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to @trip, :notice => 'Trip was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n trip = Trip.find_by_id(params[:trip_id])\n trip.title = params[:title]\n trip.city = params[:city]\n trip.state = params[:state]\n trip.country = params[:country]\n trip.start_date = params[:start_date]\n trip.end_date = params[:end_date]\n trip.description = params[:description]\n trip.link = params[:link]\n if params[:photo_base]\n trip.photo = params[:photo_base]\n end\n trip.save!\n render json: trip\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to trips_path, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gtfs_trip = GtfsTrip.find(params[:id])\n\n respond_to do |format|\n if @gtfs_trip.update_attributes(params[:gtfs_trip])\n format.html { redirect_to(@gtfs_trip, :notice => 'Gtfs trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { render :show, status: :ok, location: @route }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { render :show, status: :ok, location: @route }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to @route, notice: 'Route was successfully updated.' }\n format.json { render :show, status: :ok, location: @route }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n trip = Trip.find(params[:id])\n if trip.update(trip_params)\n redirect_to trip_path\n else\n render :edit, status: :bad_request\n end\n end", "def update\n authorize @trip, :update?\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n params[:trip][:places] ||= []\n @trip.add_trip_places(params[:trip][:places])\n if @trip.update_attributes(params[:trip].except(:places))\n flash[:notice] = \"Trip succesfully updated\"\n redirect_to @trip\n else\n flash.now[:error] = @trip.errors.full_messages\n @places = params[:trip][:places]\n render \"edit\"\n end\n end", "def update\n respond_to do |format|\n if @train_route.update(train_route_params)\n format.html { redirect_to @train_route, notice: 'TrainRoute was successfully updated.' }\n format.json { render :show, status: :ok, location: @train_route }\n else\n format.html { render :edit }\n format.json { render json: @train_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find_by(id: params[:id])\n if @trip.nil?\n head :not_found\n return\n elsif @trip.update(trip_params)\n redirect_to trip_path\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to(@trip, :notice => 'Trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to oj_path, notice: 'Trip was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n @routing = Routing.find(params[:id])\n\n respond_to do |format|\n if @routing.update_attributes(params[:routing])\n format.html { redirect_to @routing, notice: 'Routing was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @routing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @route.attributes = route_params\n @route.validate\n if (@route.errors.keys - [:start_station_id, :end_station_id]).size == 0\n @route.save(validate: false)\n end\n if @route.save\n format.html { redirect_to @route, notice: 'Маршрут обновлён.' }\n format.json { render :show, status: :ok, location: @route }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @favorite_route.update(favorite_route_params)\n render json: @favorite_route, status: :ok, location: @favorite_route\n else\n render json: @favorite_route.errors, status: :unprocessable_entity\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if user_can_modify(@trip) and @trip.update_attributes(params[:trip])\n format.html { redirect_to(@trip, :notice => 'Trip was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n format.json { render :json => @trip.errors.full_messages, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @future_trip.update(future_trip_params)\n format.html { redirect_to @future_trip, notice: 'Future trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @future_trip }\n else\n format.html { render :edit }\n format.json { render json: @future_trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def apps_app_routes_route_patch_with_http_info(app, route, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutesApi.apps_app_routes_route_patch ...\"\n end\n # verify the required parameter 'app' is set\n if @api_client.config.client_side_validation && app.nil?\n fail ArgumentError, \"Missing the required parameter 'app' when calling RoutesApi.apps_app_routes_route_patch\"\n end\n # verify the required parameter 'route' is set\n if @api_client.config.client_side_validation && route.nil?\n fail ArgumentError, \"Missing the required parameter 'route' when calling RoutesApi.apps_app_routes_route_patch\"\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling RoutesApi.apps_app_routes_route_patch\"\n end\n # resource path\n local_var_path = \"/apps/{app}/routes/{route}\".sub('{' + 'app' + '}', app.to_s).sub('{' + 'route' + '}', route.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RouteWrapper')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutesApi#apps_app_routes_route_patch\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to driver_path(@driver.id), notice: 'Route was successfully updated.' }\n format.json { render :show, status: :ok, location: @route }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @texi_route.update(texi_route_params)\n format.html { redirect_to @texi_route, notice: 'Texi route was successfully updated.' }\n format.json { render :show, status: :ok, location: @texi_route }\n else\n format.html { render :edit }\n format.json { render json: @texi_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bus_route = BusRoute.find(params[:id])\n \n respond_to do |format|\n if @bus_route.update_attributes(params[:bus_route])\n format.html { redirect_to @bus_route, notice: 'Bus route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bus_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @trip\n\n\n @trip.estimated_expenses.each do |exp|\n exp.requests.each do |req|\n req.amount_from_total = req.percentrequested * exp.total\n req.destination = @trip.destination\n req.expense_type = 'estimated'\n end\n end\n\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @route.update(route_params)\n render :show\n end", "def update\n respond_to do |format|\n if @trip_waypoint.update(trip_waypoint_params)\n format.html { redirect_to @trip_waypoint, notice: 'Trip waypoint was successfully updated.' }\n # format.json { render :show, status: :ok, location: @trip_waypoint }\n else\n format.html { render :edit }\n # format.json { render json: @trip_waypoint.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @route_detail = RouteDetail.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @route_detail.update_attributes(params[:route_detail])\r\n format.html { redirect_to @route_detail, notice: 'Route detail was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @route_detail.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\r\n @route_detail = RouteDetail.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @route_detail.update_attributes(params[:route_detail])\r\n format.html { redirect_to @route_detail, notice: 'Route detail was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @route_detail.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def patch(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::PATCH, path, to, as, constraints, &blk)\n end", "def update\n respond_to do |format|\n if @trip_todo.update(trip_todo_params)\n format.html { redirect_to @trip_todo, notice: 'Trip todo was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_todo }\n else\n format.html { render :edit }\n format.json { render json: @trip_todo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route.update(route_params)\n format.html { redirect_to admin_route_url(@route), notice: 'Route was successfully updated.' }\n format.json { render :show, status: :ok, location: admin_route_url(@route) }\n else\n format.html { render :edit }\n format.json { render json: @route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip_schedule.update(trip_schedule_params)\n format.html { redirect_to @trip_schedule, notice: 'Trip schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_schedule }\n else\n format.html { render :edit }\n format.json { render json: @trip_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traceroute.update(traceroute_params)\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traceroute.update(traceroute_params)\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params.merge(user_id: current_user.id))\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @check_route.update(check_route_params)\n format.html { redirect_to @check_route, notice: 'Check Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @check_route.errors, status: :internal_server_error }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n else\n format.html { render :index }\n end\n end\n end", "def update\n #abort(params[\"users\"].inspect)\n\n respond_to do |format|\n if @trip.update(trip_params)\n # Get the permission's type which represent an usual user and an admin one.\n permUser = Permission_type.find_by(permission: \"user\").id\n permAdmin = Permission_type.find_by(permission: \"admin\").id\n\n # Remove each current permission.\n Permission.where(trip_id: @trip.id).each do |p|\n p.destroy\n end\n # Create current user's admin permission on the new created trip.\n adminPerm = Permission.new(:user_id => current_user.id, :trip_id => @trip.id, :permission_type_id => permAdmin, :accepted => 1)\n adminPerm.save\n # Create a \"user\" permission for each selected users.\n if params[\"users\"]\n params[\"users\"].each do |user|\n userId = user[2, user.length]\n\n # We don't add the current user, which is an admin.\n if userId != String(current_user.id)\n currentPermission = user[0] == \"1\" ? permAdmin : permUser\n\n perm = Permission.new(:user_id => userId, :trip_id => @trip.id, :permission_type_id => currentPermission, :accepted => 0)\n perm.save\n end\n end\n end\n\n # Remove each current waypoint.\n Stop.where(trip_id: @trip.id).each do |s|\n s.destroy\n end\n # Create each waypoint of the trip.\n if params['waypoints']\n i = 0\n params['waypoints'].each do |waypoint|\n i += 1\n w = Stop.new(:title => @trip.title + \" - #{i}\", :loc_lat => waypoint[1][0], :loc_lon => waypoint[1][1], :trip_id => @trip.id, :etape_nb => i)\n w.save\n end\n\n # If the endpoint is also the startpoint, add an extra stop.\n if params['arrivalEqualsStart']\n w = Stop.new(:title => @trip.title + \" - #{i + 1}\", :loc_lat => params[\"waypoints\"][\"0\"][0], :loc_lon => params[\"waypoints\"][\"0\"][1], :trip_id => @trip.id, :etape_nb => (i + 1))\n w.save\n end\n end\n\n format.html { redirect_to @trip, notice: 'Trip was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip }\n else\n format.html { render :edit }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n #params[:trip][:participations] ||=[]\n respond_to do |format|\n if @trip.owner_id == current_user.id && @trip.update_attributes(params[:trip])\n flash[:notice] = 'Trip was successfully updated.'\n format.html { redirect_to(@trip) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ht_route.update(ht_route_params)\n format.html { redirect_to @ht_route, notice: 'Ht route was successfully updated.' }\n format.json { render :show, status: :ok, location: @ht_route }\n else\n format.html { render :edit }\n format.json { render json: @ht_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(parse_post params[:trip])\n flash[:notice] = 'Trip was successfully updated.'\n format.html { redirect_to(@trip) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n\n respond_to do |format|\n if @trip.update_attributes(parse_post params[:trip])\n flash[:notice] = 'Trip was successfully updated.'\n format.html { redirect_to(@trip) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @route = Route.find(params[:id])\n\n respond_to do |format|\n if @route.update_attributes(params[:route])\n flash[:notice] = 'Route was successfully updated.'\n format.html { redirect_to routes_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @route.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @trip_item = TripItem.find(params[:id])\n\n respond_to do |format|\n if @trip_item.update_attributes(params[:trip_item])\n format.html { redirect_to @trip_item, notice: 'Trip item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trip_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n @trip.assign_attributes(trip_params)\n\n if @trip.save\n redirect_to passenger_trip_path(@trip.passenger_id, @trip.id)\n end\n end", "def update\r\n @route_schedule = RouteSchedule.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @route_schedule.update_attributes(params[:route_schedule])\r\n format.html { redirect_to @route_schedule, notice: 'Route schedule was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @route_schedule.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def put(path, &block)\n route 'PUT', path, &block\n end", "def update\n respond_to do |format|\n if @parcel_route.update(parcel_route_params)\n format.html { redirect_to @parcel_route, notice: 'Parcel route was successfully updated.' }\n format.json { render :show, status: :ok, location: @parcel_route }\n else\n format.html { render :edit }\n format.json { render json: @parcel_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n Trip.transaction do\n trip_params[:segments_attributes].each do |seg_params|\n segment = nil\n if !seg_params[:id].nil?\n segment = Segment.find(seg_params[:id])\n segment.update(:order => seg_params[:order],\n :transportation => seg_params[:transportation])\n else\n segment = Segment.new\n segment.order = seg_params[:order]\n segment.transportation = seg_params[:transportation]\n segment.trip = @trip\n segment.save!\n end\n seg_params[:locations_attributes].each do |loc_params|\n if !loc_params[:id].nil?\n location = Location.find(loc_params[:id])\n location.segment = segment\n location.update(loc_params)\n else\n location = Location.new(loc_params)\n location.segment = segment\n location.save!\n end\n end\n end\n if !trip_params[:destroyed].nil?\n trip_params[:destroyed].each do |id|\n segment = Segment.find(id)\n segment.destroy\n end\n end\n @trip.validated = true\n @trip.save!\n end\n flash[:notice] = 'Trip updated successfully.'\n flash.keep(:notice)\n render :status => 200, :json => { :success => true }\n rescue\n flash[:error] = 'Trip update failed. Please try again'\n flash.keep(:error)\n render :status => 400, :json => { :success => false }\n end", "def update\n respond_to do |format|\n if @trip_plan.update(trip_plan_params)\n format.html { redirect_to @trip_plan, notice: 'Trip plan was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_plan }\n else\n format.html { render :edit }\n format.json { render json: @trip_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @supported_routes = args[:supported_routes] if args.key?(:supported_routes)\n end", "def update\n @trip_feature = TripFeature.find(params[:id])\n\n respond_to do |format|\n if @trip_feature.update_attributes(params[:trip_feature])\n format.html { redirect_to(@trip_feature, :notice => 'TripFeature was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip_feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:id])\n if current_user.has_permission?(:trips)\n @trip.accessible = :all\n end\n\n respond_to do |format|\n if @trip.update_attributes(params[:trip])\n format.html { redirect_to [:admin, @trip], :notice => \"Trip was successfully updated.\" }\n else\n flash[:error] = \"Trip was not updated.\"\n format.html { render active_admin_template(:edit) }\n end\n end\n end", "def update\n @roadmap = Roadmap.find(@roadmap_step.roadmap_id)\n\n respond_to do |format|\n if @roadmap_step.update(roadmap_step_params)\n format.html { redirect_to @roadmap, notice: 'Roadmap step was successfully updated.' }\n format.json { render :show, status: :ok, location: @roadmap_step }\n else\n format.html { render :edit }\n format.json { render json: @roadmap_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @subway = Subway.find(params[:id])\n\n respond_to do |format|\n if @subway.update_attributes(params[:subway])\n format.html { redirect_to @subway, notice: 'Subway was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subway.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @road = Road.find(params[:id])\n\n respond_to do |format|\n if @road.update_attributes(params[:road])\n format.html { redirect_to @road, notice: 'Road was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @road.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit\n @trip = Trip.find(params[:id])\n end", "def update\n respond_to do |format|\n if @first_rip.update(first_rip_params)\n format.html { redirect_to @first_rip, notice: 'First rip was successfully updated.' }\n format.json { render :show, status: :ok, location: @first_rip }\n else\n format.html { render :edit }\n format.json { render json: @first_rip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @field_trip = FieldTrip.find(params[:id])\n\n respond_to do |format|\n if @field_trip.update_attributes(params[:field_trip])\n format.html { redirect_to(@field_trip, :notice => 'Field trip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @field_trip.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @guide_trip.update(guide_trip_params)\n format.html { redirect_to @guide_trip, notice: 'Guía turístico fue modificado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @guide_trip }\n else\n format.html { render :edit }\n format.json { render json: @guide_trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @climbing_route.update(climbing_route_params)\n format.html { redirect_to @climbing_route, notice: 'Climbing route was successfully updated.' }\n format.json { render :show, status: :ok, location: @climbing_route }\n else\n format.html { render :edit }\n format.json { render json: @climbing_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_route = Admin::Route.find(params[:id])\n\n respond_to do |format|\n if @admin_route.update_attributes(admin_route_params)\n format.html { redirect_to @admin_route, notice: 'Route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @trip = Trip.find(params[:trip_id])\n @location = Location.find(params[:location_id])\n @team.trip = @location\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to trip_location_path(@trip, @location), notice: 'Location was successfully updated.' }\n format.html { redirect_to trip_locations_path(@trip), notice: 'Location was successfully updated.2' }\n format.json { render :show, status: :ok, location: @location }\n else\n format.html { render :edit }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @route_type.update(route_type_params)\n format.html { redirect_to @route_type, notice: 'Route type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @route_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @select_route.update(select_route_params)\n format.html { redirect_to @select_route, notice: 'Select route was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @select_route.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user = User.find(params[:user_id])\n @trip.start = params[:trip][:start]\n @trip.end = params[:trip][:end]\n respond_to do |format|\n if @trip.update\n format.html { redirect_to [@user,@trip], notice: 'Trip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip_type.update(trip_type_params)\n format.html { redirect_to @trip_type, notice: 'Trip type was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_type }\n else\n format.html { render :edit }\n format.json { render json: @trip_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def apps_app_routes_route_put_with_http_info(app, route, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutesApi.apps_app_routes_route_put ...\"\n end\n # verify the required parameter 'app' is set\n if @api_client.config.client_side_validation && app.nil?\n fail ArgumentError, \"Missing the required parameter 'app' when calling RoutesApi.apps_app_routes_route_put\"\n end\n # verify the required parameter 'route' is set\n if @api_client.config.client_side_validation && route.nil?\n fail ArgumentError, \"Missing the required parameter 'route' when calling RoutesApi.apps_app_routes_route_put\"\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling RoutesApi.apps_app_routes_route_put\"\n end\n # resource path\n local_var_path = \"/apps/{app}/routes/{route}\".sub('{' + 'app' + '}', app.to_s).sub('{' + 'route' + '}', route.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RouteWrapper')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutesApi#apps_app_routes_route_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update\n if @trip.update_attributes(trip_params)\n flash[:success] = \"Trip updated for #{@trip.student.name}.\"\n redirect_to @trip\n else\n render 'edit'\n end\n end" ]
[ "0.67473924", "0.66796476", "0.6358128", "0.63258094", "0.63078284", "0.63078284", "0.63063705", "0.6288646", "0.6273215", "0.62713164", "0.62097603", "0.62097603", "0.6171023", "0.6149323", "0.6144342", "0.6134545", "0.61335737", "0.61186916", "0.6099913", "0.6099913", "0.6098168", "0.60922927", "0.60922927", "0.60922927", "0.60922927", "0.60922927", "0.60922927", "0.607882", "0.60768276", "0.60451865", "0.60451865", "0.60451865", "0.6014963", "0.6003909", "0.6003909", "0.60031176", "0.5999162", "0.59893024", "0.5975151", "0.5970187", "0.59662724", "0.5960438", "0.5957579", "0.59339166", "0.59245694", "0.5887575", "0.5882179", "0.58803076", "0.5851224", "0.5849358", "0.5844833", "0.583663", "0.5826785", "0.58210695", "0.581994", "0.5817961", "0.5817961", "0.5812102", "0.5811657", "0.58038855", "0.5796641", "0.57925445", "0.57924515", "0.57859606", "0.57798374", "0.57753265", "0.57687837", "0.5752897", "0.5750554", "0.5743094", "0.5743094", "0.5735617", "0.57086927", "0.57032114", "0.56959176", "0.5681831", "0.5672745", "0.56641734", "0.56584126", "0.5650823", "0.56478244", "0.5636833", "0.5630654", "0.5616977", "0.5613846", "0.5609308", "0.559759", "0.5597064", "0.55900717", "0.5588849", "0.5574217", "0.5569964", "0.55650467", "0.5564823", "0.556258", "0.55528766", "0.5548636", "0.5535405", "0.5534538", "0.55167437" ]
0.6914655
0
DELETE /trip_routes/1 DELETE /trip_routes/1.json
def destroy @trip_route.destroy respond_to do |format| format.html { redirect_to trip_routes_url, notice: 'Trip route was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n trip = Trip.find(params[:id])\n trip.destroy\n render json: {message: \"Successfully deleted trip\"}\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :ok }\n end\n end", "def destroy\n Rails.logger.info('👻 Disraptor: Destroying route.')\n\n if Disraptor::Route.remove(params[:route_id])\n Rails.application.reload_routes!\n\n render json: success_json\n else\n render json: failed_json\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def delete\n @trip = Trips.find_trip( params[ :id ])\n end", "def destroy\n authorize @trip, :destroy?\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to find_trips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @trip.destroy\n\n head :no_content\n end", "def destroy\n @route.delete\n respond_to do |format|\n format.html { redirect_to routes_url, notice: t(\"routes.deleted\") }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to @trip.parent || trips_url, change: 'trip' }\n format.json { head :no_content }\n end\n end", "def destroy\n @transport_route = TransportRoute.find(params[:id])\n @transport_route.destroy\n\n respond_to do |format|\n format.html { redirect_to transport_routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bus_route = BusRoute.find(params[:id])\n @bus_route.destroy\n\n respond_to do |format|\n format.html { redirect_to bus_routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\r\n @route_detail = RouteDetail.find(params[:id])\r\n @route_detail.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to route_details_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\r\n @route_detail = RouteDetail.find(params[:id])\r\n @route_detail.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to route_details_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def remove_route(route={})\n request :delete, '/routes', route\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, flash: {success: \"Trip was successfully deleted.\" } }\n format.json { head :no_content }\n end\n end", "def destroy\n @gtfs_trip = GtfsTrip.find(params[:id])\n @gtfs_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(gtfs_trips_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(trips_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @traceroute.destroy\n respond_to do |format|\n format.html { redirect_to traceroutes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @traceroute.destroy\n respond_to do |format|\n format.html { redirect_to traceroutes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip_item = TripItem.find(params[:id])\n @trip_item.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @road = Road.find(params[:id])\n @road.destroy\n\n respond_to do |format|\n format.html { redirect_to roads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def delete\n unless params[:route_id]\n render status: :bad_request, json: {error: 'route_id must be provided'}\n return\n end\n\n route = Route.where(id: params[:route_id]).first\n unless route.present?\n render status: :bad_request, json: {error: 'No route found with provided route_id'}\n return\n end\n\n unless route.user_id == current_user.id\n render status: :unauthorized, json: {error: 'Routes can only be deleted by the owner'}\n return\n end\n\n route.destroy\n\n render nothing:true\n end", "def destroy\n @trips_connect = TripsConnect.find(params[:id])\n @trips_connect.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_connects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if @trip.destroy\n render :json => {:success => true}\n else\n render :json => {:success => false, :errors => [\"Delete failed.\"]}\n end\n end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to @trip }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete_pathway\n pathway = Pathway.find(params[:pathway_par])\n current_user.pathways.delete(pathway)\n if current_user.pathways.size < 1\n respond_to do |format|\n format.html { redirect_to '/saved#pathways' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n authorize @trip\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find_by(id: params[:id])\n \n if @trip.nil?\n return\n end\n @trip.destroy\n redirect_to trips_path\n return\n end", "def destroy\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, alert: \"L'itinéraire a été supprimé.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @roadstop.destroy\n respond_to do |format|\n format.html { redirect_to roadstops_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ht_route.destroy\n respond_to do |format|\n format.html { redirect_to ht_routes_url, notice: 'Ht route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip_waypoint.destroy\n respond_to do |format|\n format.html { redirect_to edit_partner_trip_path(@trip), notice: \"L'étape a été supprimée.\" }\n #format.json { head :no_content }\n end\n end", "def destroy\n @subway = Subway.find(params[:id])\n @subway.destroy\n\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :ok }\n end\n end", "def destroy\n @railway = Railway.find(params[:id])\n @railway.destroy\n\n respond_to do |format|\n format.html { redirect_to railways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # First delete trip's permissions.\n @trip.permissions.each do |perm|\n perm.destroy\n end\n\n # Then delete the trip itself.\n @trip.destroy\n respond_to do |format|\n format.html { redirect_to trips_url, notice: 'Trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @field_trip = FieldTrip.find(params[:id])\n @field_trip.destroy\n\n respond_to do |format|\n format.html { redirect_to(field_trips_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url, :notice => t(\".destroyed\") }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def delete_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by_id(params[:pathway_id])\n suggested_pathway.destroy\n render json: suggested_pathway\n end", "def destroy\n @route = Route.find(params[:id]) \n \n if @route.fellow_id\n route = @route\n tmp_route = Route.find(@route.fellow_id)\n user = tmp_route.user\n UserMailer.deleted_route(user, route).deliver\n end\n \n @route.destroy\n \n respond_to do |format|\n format.html { redirect_to routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url, notice: 'Маршрут удалён.' }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url, notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url, notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url, notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to routes_url, notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\n # set the @traveler variable\n get_traveler\n # set the @trip variable\n get_trip\n \n if @trip\n @trip.planned_trips.each do |pt| \n pt.itineraries.each { |x| x.destroy }\n end\n @trip.planned_trips.each { |x| x.destroy }\n @trip.trip_places.each { |x| x.destroy}\n @trip.destroy\n message = t(:trip_was_successfully_removed)\n else\n render text: t(:error_404), status: 404\n return\n end\n\n respond_to do |format|\n format.html { redirect_to(user_planned_trips_path(@traveler), :flash => { :notice => message}) } \n format.json { head :no_content }\n end\n \n end", "def destroy\n @check_route.destroy\n respond_to do |format|\n format.html { redirect_to check_routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route_connection = RouteConnection.find(params[:id])\n @route_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to route_connections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_route = Admin::Route.find(params[:id])\n @admin_route.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_routes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @texi_route.destroy\n respond_to do |format|\n format.html { redirect_to texi_routes_url, notice: 'Texi route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @runway_ap = RunwayAp.find(params[:id])\n @runway_ap.destroy\n\n respond_to do |format|\n format.html { redirect_to runway_aps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mini_map_road = MiniMapRoad.find(params[:id])\n @mini_map_road.destroy\n\n respond_to do |format|\n format.html { redirect_to mini_map_roads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:trip])\n if current_user.trips.include?(@trip)\n @trip.destroy\n render json: {message: \"usunięto tripa\"}\n else\n @trip.errors.add(:permissions, 'brak uprawnień')\n render json: { errors: @trip.errors }, status: :unauthorized\n end\n end", "def destroy\n @trip_type.destroy\n respond_to do |format|\n format.html { redirect_to trip_types_url, notice: 'Trip type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @train_route.destroy\n respond_to do |format|\n format.html { redirect_to train_routes_url, notice: 'TrainRoute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to(routes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @route = Route.find(params[:id])\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to(routes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @rec_run_route.destroy\n flash[:danger] = \"Recreational Run Route Deleted.\"\n respond_to do |format|\n format.html { redirect_to admin_rec_run_routes_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip_driver = TripDriver.find(params[:id])\n @trip_driver.destroy\n\n respond_to do |format|\n format.html { redirect_to trip_drivers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @roadmap_step.destroy\n respond_to do |format|\n format.html { redirect_to roadmap_steps_url, notice: 'Roadmap step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to admin_routes_url, notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @clip.destroy\n respond_to do |format|\n format.html { redirect_to trip_path(@clip.trip.parent), change: 'list' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip_schedule.destroy\n respond_to do |format|\n format.html { redirect_to trip_schedules_url, notice: 'Trip schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @guide_trip.destroy\n respond_to do |format|\n format.html { redirect_to guide_trips_url, notice: 'Guía turístico fue eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @completed_route = CompletedRoute.find(params[:id])\n @completed_route.destroy\n\n respond_to do |format|\n format.html { redirect_to(completed_routes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @select_route.destroy\n respond_to do |format|\n format.html { redirect_to select_routes_url }\n format.json { head :no_content }\n end\n end", "def destroy_route\n @route.destroy\n\n respond_to do |format|\n format.html { redirect_to routes_url, :notice => t(\".destroyed\") }\n format.json { render :json => @route.as_json(json: 'wall') }\n end\n end", "def destroy\n @route.destroy\n respond_to do |format|\n format.html { redirect_to driver_path(@route.driver_id ), notice: 'Route was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trip = Trip.find(params[:id])\n @trip.destroy\n respond_to do |format|\n format.html {}\n format.js { render :layout => false }\n end\n end", "def destroy\n @trip_plan.destroy\n respond_to do |format|\n format.html { redirect_to trip_plans_url, notice: 'Trip plan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.7145841", "0.7142615", "0.7142615", "0.71369636", "0.71369636", "0.71369636", "0.7111704", "0.7103552", "0.70966786", "0.70966786", "0.70966786", "0.70195603", "0.69662875", "0.69591546", "0.6954721", "0.6954721", "0.6954721", "0.6954721", "0.6951944", "0.6938198", "0.693083", "0.69260496", "0.6915453", "0.6834532", "0.6828466", "0.6828466", "0.6828466", "0.6828466", "0.6828466", "0.6828466", "0.6828466", "0.6828466", "0.6820167", "0.6818472", "0.6813807", "0.6794834", "0.678337", "0.675308", "0.6740605", "0.6740605", "0.6740605", "0.67322075", "0.67322075", "0.67289436", "0.67258215", "0.6724205", "0.6724205", "0.6724205", "0.6706937", "0.6705241", "0.6701714", "0.66952384", "0.66779816", "0.6670914", "0.6663482", "0.6648388", "0.6648247", "0.6635523", "0.66304517", "0.660794", "0.66079146", "0.6600025", "0.65895474", "0.6574669", "0.65725803", "0.6569318", "0.6561168", "0.6560575", "0.6557886", "0.6554459", "0.65541816", "0.65541816", "0.65541816", "0.65541816", "0.6552725", "0.6546588", "0.6538293", "0.6535271", "0.6528164", "0.65270597", "0.65225303", "0.6521709", "0.6518477", "0.6513991", "0.6498609", "0.64970964", "0.64970964", "0.6486445", "0.64856267", "0.6470363", "0.64675754", "0.6465181", "0.6455772", "0.6455337", "0.64546335", "0.64545566", "0.6452681", "0.64517814", "0.6450312", "0.643748" ]
0.75354147
0
Use callbacks to share common setup or constraints between actions.
def set_trip_route @trip_route = TripRoute.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def trip_route_params params.require(:trip_route).permit(:pointlat, :pointlong, :DriverTrip_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
GET /ped_programs GET /ped_programs.json
def index @ped_programs = PedProgram.all respond_to do |format| format.html # index.html.erb format.json { render json: @ped_programs } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_programs\n uri = URI.parse(URL)\n response = Net::HTTP.get_response(uri)\n response.body\n end", "def show\n @ped_program = PedProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ped_program }\n end\n end", "def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end", "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @program }\n end\n end", "def index\n @ped_program_definitions = PedProgramDefinition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_program_definitions }\n end\n end", "def index\n @programs = Program.all\n end", "def index\n @programs = Program.all\n\n end", "def program(id)\n get(\"/catalog/titles/programs/#{id.to_s}\")\n end", "def index\n @programs = Program.all(:include => :category)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "def list_spray_programs\n\treturn if authorise_for_web(program_name?,'read_spray_program') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:spray_programs_page] = params['page']\n\n\t\t render_list_spray_programs\n\n\t\t return \n\telse\n\t\tsession[:spray_programs_page] = nil\n\tend\n\n\tlist_query = \"@spray_program_pages = Paginator.new self, SprayProgram.count, @@page_size,@current_page\n\t @spray_programs = SprayProgram.find(:all,\n\t\t\t\t :limit => @spray_program_pages.items_per_page,\n\t\t\t\t :offset => @spray_program_pages.current.offset)\"\n\tsession[:query] = list_query\n\trender_list_spray_programs\nend", "def index\n @programs = Program.find(:all, :order => 'name ASC')\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @programs.to_xml }\n end\n end", "def show\n @ped_program_definition = PedProgramDefinition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ped_program_definition }\n end\n end", "def index\n @programs = Program.all\n @upcoming_progs = Program.upcoming\n @in_progress = Program.current\n end", "def programs\n @organization = Organization.find(params[:id])\n end", "def index\n @programas = Programa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end", "def get_loyalty_programs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_programs ...'\n end\n # resource path\n local_var_path = '/v1/loyalty_programs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20011' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_loyalty_programs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @ped_program = PedProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program }\n end\n end", "def show\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa }\n end\n end", "def list_loyalty_programs\n warn 'Endpoint list_loyalty_programs in LoyaltyApi is deprecated'\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/programs'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def index\n @programas = Programa.all_active\n @programa = Programa.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end", "def index\n @programmes = Programme.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programmes }\n end\n end", "def get_loyalty_programs(opts = {})\n data, _status_code, _headers = get_loyalty_programs_with_http_info(opts)\n data\n end", "def show\n @programme = Programme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programme }\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def program_params\n params[:program]\n end", "def show\n @program = Program.find(params[:id])\n\n respond_with(:admin, current_account, @program)\n end", "def retrieve_loyalty_program(program_id:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/programs/{program_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'program_id' => { 'value' => program_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def new\n @event = Event.find(params[:event_id])\n @program = @event.programs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def show\n\tif user_signed_in?\n\t\t@program = Program.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.json { render json: @program }\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def programs\n Program.all(:creator_username => username)\n end", "def show\n @center_program = CenterProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @center_program }\n end\n end", "def create\n @program = Program.new(program_params)\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to programs_path, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ped_program = PedProgram.new(params[:ped_program])\n\n respond_to do |format|\n if @ped_program.save\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' }\n format.json { render json: @ped_program, status: :created, location: @ped_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @admin_pay_programs = Admin::PayProgram.all\n end", "def index\n @programs = Program.includes(:product, :user, cuts: [tracking: :product_line]).all.limit(20)\n end", "def index\n @program_exms = ProgramExm.all\n end", "def index\n @program_relationships = ProgramRelationship.all\n end", "def index\n @programaciones = Programacion.all\n end", "def index\n logger.error(\"@programs has #{@programs.count} entries\") if @programs\n basic_params = %i(function read_format platform name_cont)\n advanced_params = %i(summary_cont interface speciality write_format for_audience language display_function header_function network_function programming_function other_function author)\n qparams = params[:q] ? params[:q].permit(basic_params + advanced_params) : nil\n if qparams\n # You could use the :active and :imaging scopes in the query. Result is the same as the scopes are chained.\n # @q = Program.active.imaging.ransack(qparams)\n @q = Program.ransack(qparams.merge(active: true, imaging: true))\n @q.sorts = 'rating desc' if @q.sorts.empty?\n make_search_params(qparams)\n @programs = @q.result.includes(:languages, :platforms, :source_urls, :ratings).page(params[:page]).per(10)\n else\n @q = Program.none.ransack\n @programs = nil\n end\n end", "def new\n @ped_program_definition = PedProgramDefinition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program_definition }\n end\n end", "def ppos_list\n @department = Department.find(params[:department_id])\n @degree_programs = DegreeProgram.search(params[:search], params[:page],params[:department_id])\n\n respond_to do |format|\n format.html # ppos_list.html.erb\n format.xml { render :xml => @degree_programs }\n end\n end", "def get_program_ids(programs)\n program_ids = []\n if programs.nil? == false and programs.size > 0\n programs.each do |program|\n program_ids << DataUtility.get_program_id(program[:id])\n end\n end\n program_ids\n end", "def index\n @programaciones = Programacion.search(params[:search], params[:page])\n end", "def update\n logger.debug request.query_parameters\n respond_to do |format|\n if @program.update(program_params)\n flash[:notice] = 'Program was successfully updated.'\n format.html { redirect_to :controller => \"programs\", :action => \"index\", :params => request.query_parameters}\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def show\n @program_list= Programlist.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @program_list}\n end\n end", "def show\n @course_programme = CourseProgramme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_programme }\n end\n end", "def get_card_program_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.get_card_program_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/card_program'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageCardProgram')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#get_card_program_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @category_programs = CategoryProgram.all\n end", "def destroy\n @ped_program = PedProgram.find(params[:id])\n @ped_program.destroy\n\n respond_to do |format|\n format.html { redirect_to ped_programs_url }\n format.json { head :no_content }\n end\n end", "def index\n @oprograms = Oprogram.all\n end", "def update\n @ped_program = PedProgram.find(params[:id])\n\n respond_to do |format|\n if @ped_program.update_attributes(params[:ped_program])\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @programms = Programm.all.order(created_at: :asc)\n end", "def show\n @program = ProgramPrep.where(trainer_profile_id: current_user.trainer_profile.id, user_id: params[:id], status: \"stored\")\n @user = User.find_by()\n @programs = Program.where(trainer_profile_id: current_user.trainer_profile.id, user_id: params[:id])\n render \"show.html.erb\"\n end", "def ps(app_name)\n deprecate # 07/31/2012\n json_decode get(\"/apps/#{app_name}/ps\", :accept => 'application/json').to_s\n end", "def show\n @program = Program.find(params[:id])\n @entries = []\n @program.program_cost_length_maps.sort_by(&:length).each do |p|\n @entries << [(p.length / 604800).round, p.cost]\n end\n \n @results = Review.where(:program_id => @program.id).sort_by(&:created_at).reverse\n @overall = 0\n @results.each do |f|\n @overall = @overall + f.overall\n end\n if @results.count != 0\n @overall = @overall / @results.count\n else\n @overall = 0\n end\n @flag = Flag.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @program }\n end\n end", "def create\n @programm = Programm.new(programm_params)\n\n respond_to do |format|\n if @programm.save\n format.html { redirect_to action: :index, notice: 'Programm was successfully created.' }\n format.json { render :index, status: :created, location: @programm }\n else\n format.html { render :new }\n format.json { render json: @programm.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @education_programs = EducationProgram.all\n end", "def load_programs\n if session[:user_id]\n @programs = Program.where(user_id: session[:user_id]).order('reward ASC')\n elsif params[:username] && params[:password]\n user = User.find_by_username(params[:username])\n\n if user && user.authenticate(params[:password])\n @programs = Program.where(user_id: user.id).order('reward ASC')\n end\n end\n end", "def index\n @program_califications = ProgramCalification.all\n end", "def set_program\n @program = @current_site.programs.find(params[:id])\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, :notice => 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def show\n @program_employee = ProgramEmployee.find(params[:id])\n @employees = @program_employee.program_location.program_employees\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @app = @client.app(params[:id])\n @paas_providers = cached_providers\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :ok }\n end\n end", "def index\n @department = Department.find(params[:department_id])\n @degree_programs = DegreeProgram.search(params[:search], params[:page],params[:department_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @degree_programs }\n end\n end", "def programs\n @programs = @sheet_obj.programs\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save(:without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render json: @program, status: :created, location: @program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @programs = Program.where(completed: false)\n end", "def list_gym_programs\n system \"clear\"\n program = TTY::Prompt.new.select(\"Gym Program(s):\", self.programs.pluck(:name))\n found = (Program.find_by(name: program)).description\n puts found\n puts \"\"\n TTY::Prompt.new.select(\" \") do |menu|\n menu.choice \"Back to programs\", -> {self.list_gym_programs}\n menu.choice \"Main Menu\"\n end\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def show\n @programa_de_intere = ProgramaDeIntere.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa_de_intere }\n end\n end", "def index\n @after_school_programs = AfterSchoolProgram.all\n end", "def new\n if current_user.superadmin?\n @program = Program.new\n #@program.director = Member.new(:role => 'PROGRAM DIRECTOR')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n else\n respond_to do |format|\n flash[:error] = 'You have been denied access to this page because you do not have the right access to this page. If you believe that a mistake has been made, please contact <a href=\"mailto:h.samani@unsw.edu.au\">h.samani@unsw.edu.au</a>.'.html_safe\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def show\n @degree_program = DegreeProgram.find(params[:id])\n @department = Department.find(@degree_program.department.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree_program }\n end\n end", "def new\n @programa = Programa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programa }\n end\n end", "def program_params\n params.require(:program).permit(:name, :category, :url, :description, :location)\n end", "def programmes\n Programme.where(id: programme_id)\n end", "def programmes\n Programme.where(id: programme_id)\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = ::Education::Program.find(params[:id])\n end", "def create\n @program = Program.new(params[:program])\n\n ## setting @org_id to organization_account's org_id OR the org that was selected at programs/new\n # for use with creating program_subjects, program_sizes, program_cost_length_maps\n if current_organization_account.present?\n @org_id = current_organization_account.organization_id\n elsif (orgs = Organization.where(:name => params[:program][:organization_name])).present?\n @org_id = orgs.first.id\n end\n\n # creating program_subject, program_size, and program_cost_length_map objects\n # methods in helpers/program_helper.rb\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n if @program.save\n [@cost_lengths, @subjects, @sizes].each do |arr|\n arr.each do |inst|\n inst.program_id = @program.id\n inst.save\n inst.index! if arr == @cost_lengths\n end\n end\n end\n respond_with(@program)\n end" ]
[ "0.73311335", "0.6878419", "0.6875702", "0.68594396", "0.68486893", "0.68486893", "0.68138915", "0.6601128", "0.65932405", "0.6561959", "0.64414346", "0.63657534", "0.6334446", "0.63279384", "0.63015985", "0.6276734", "0.6264216", "0.62576157", "0.61734676", "0.6151699", "0.6117642", "0.60846436", "0.6056777", "0.60525066", "0.6044268", "0.6017679", "0.59914243", "0.59914243", "0.5976162", "0.5973431", "0.59670687", "0.59409827", "0.5940923", "0.58878565", "0.58696246", "0.57870823", "0.5750324", "0.5738409", "0.57374144", "0.5735629", "0.5708834", "0.56976783", "0.5672466", "0.56708163", "0.56662965", "0.5665989", "0.5656579", "0.5655998", "0.5644744", "0.56385577", "0.5632718", "0.5631176", "0.56127256", "0.56111175", "0.56034225", "0.56029594", "0.5602698", "0.5584944", "0.5581856", "0.5579692", "0.55648404", "0.5556491", "0.555359", "0.5545317", "0.5543378", "0.55371624", "0.5531777", "0.55223835", "0.5521051", "0.55091906", "0.5506667", "0.5506667", "0.5504988", "0.5504988", "0.54918665", "0.5474603", "0.5467808", "0.54481965", "0.542001", "0.5409652", "0.5409057", "0.5409057", "0.5409057", "0.5409057", "0.5409057", "0.5409057", "0.5409057", "0.54003125", "0.5397389", "0.53958935", "0.5389552", "0.53824997", "0.5379991", "0.5376734", "0.53741604", "0.5354115", "0.5354115", "0.5351375", "0.5348434", "0.53461" ]
0.7347414
0
GET /ped_programs/1 GET /ped_programs/1.json
def show @ped_program = PedProgram.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @ped_program } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @program_app = ProgramApp.find(params[:id])\n\n respond_to do |format|\n format.json do\n render json: @program_app\n end\n end\n end", "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @program }\n end\n end", "def index\n @ped_programs = PedProgram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_programs }\n end\n end", "def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "def get_programs\n uri = URI.parse(URL)\n response = Net::HTTP.get_response(uri)\n response.body\n end", "def program(id)\n get(\"/catalog/titles/programs/#{id.to_s}\")\n end", "def show\n @ped_program_definition = PedProgramDefinition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ped_program_definition }\n end\n end", "def show\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa }\n end\n end", "def show\n @programme = Programme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programme }\n end\n end", "def index\n @ped_program_definitions = PedProgramDefinition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_program_definitions }\n end\n end", "def new\n @ped_program = PedProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program }\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def index\n @programs = Program.all\n end", "def programs\n @organization = Organization.find(params[:id])\n end", "def index\n @programs = Program.all\n\n end", "def index\n @programas = Programa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end", "def index\n @programs = Program.all(:include => :category)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "def retrieve_loyalty_program(program_id:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/programs/{program_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'program_id' => { 'value' => program_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def show\n @program = Program.find(params[:id])\n\n respond_with(:admin, current_account, @program)\n end", "def show\n @center_program = CenterProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @center_program }\n end\n end", "def new\n @event = Event.find(params[:event_id])\n @program = @event.programs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def index\n @programas = Programa.all_active\n @programa = Programa.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end", "def index\n @programs = Program.find(:all, :order => 'name ASC')\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @programs.to_xml }\n end\n end", "def get_loyalty_programs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_programs ...'\n end\n # resource path\n local_var_path = '/v1/loyalty_programs'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20011' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_loyalty_programs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n\tif user_signed_in?\n\t\t@program = Program.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t format.html # show.html.erb\n\t\t format.json { render json: @program }\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def index\n @programmes = Programme.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programmes }\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params)\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to programs_path, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @programs = Program.all\n @upcoming_progs = Program.upcoming\n @in_progress = Program.current\n end", "def show\n @course_programme = CourseProgramme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_programme }\n end\n end", "def new\n @ped_program_definition = PedProgramDefinition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program_definition }\n end\n end", "def program_params\n params[:program]\n end", "def list_spray_programs\n\treturn if authorise_for_web(program_name?,'read_spray_program') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:spray_programs_page] = params['page']\n\n\t\t render_list_spray_programs\n\n\t\t return \n\telse\n\t\tsession[:spray_programs_page] = nil\n\tend\n\n\tlist_query = \"@spray_program_pages = Paginator.new self, SprayProgram.count, @@page_size,@current_page\n\t @spray_programs = SprayProgram.find(:all,\n\t\t\t\t :limit => @spray_program_pages.items_per_page,\n\t\t\t\t :offset => @spray_program_pages.current.offset)\"\n\tsession[:query] = list_query\n\trender_list_spray_programs\nend", "def programs\n Program.all(:creator_username => username)\n end", "def new\n @programa = Programa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programa }\n end\n end", "def show\n @programa_de_intere = ProgramaDeIntere.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa_de_intere }\n end\n end", "def show\n @program_list= Programlist.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @program_list}\n end\n end", "def create\n @ped_program = PedProgram.new(params[:ped_program])\n\n respond_to do |format|\n if @ped_program.save\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' }\n format.json { render json: @ped_program, status: :created, location: @ped_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = @current_site.programs.find(params[:id])\n end", "def new\n @interaction_program = InteractionProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interaction_program }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :ok }\n end\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, :notice => 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def destroy\n @ped_program = PedProgram.find(params[:id])\n @ped_program.destroy\n\n respond_to do |format|\n format.html { redirect_to ped_programs_url }\n format.json { head :no_content }\n end\n end", "def show\n @app = @client.app(params[:id])\n @paas_providers = cached_providers\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @app }\n end\n end", "def show\n @program = ProgramPrep.where(trainer_profile_id: current_user.trainer_profile.id, user_id: params[:id], status: \"stored\")\n @user = User.find_by()\n @programs = Program.where(trainer_profile_id: current_user.trainer_profile.id, user_id: params[:id])\n render \"show.html.erb\"\n end", "def create\n @programm = Programm.new(programm_params)\n\n respond_to do |format|\n if @programm.save\n format.html { redirect_to action: :index, notice: 'Programm was successfully created.' }\n format.json { render :index, status: :created, location: @programm }\n else\n format.html { render :new }\n format.json { render json: @programm.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_new\n @program = Program.new\n @department = Department.find(params[:id])\n end", "def show\n # presenter found in presenters/programs/show_presenter.rb\n @presenter = Programs::ShowPresenter.new(params[:id])\n @flag = Flag.new # for the flagging a review form\n respond_with(@presenter.this_program)\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def new\n if current_user.superadmin?\n @program = Program.new\n #@program.director = Member.new(:role => 'PROGRAM DIRECTOR')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n else\n respond_to do |format|\n flash[:error] = 'You have been denied access to this page because you do not have the right access to this page. If you believe that a mistake has been made, please contact <a href=\"mailto:h.samani@unsw.edu.au\">h.samani@unsw.edu.au</a>.'.html_safe\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end\n end", "def set_program\n @program = ::Education::Program.find(params[:id])\n end", "def update\n @ped_program = PedProgram.find(params[:id])\n\n respond_to do |format|\n if @ped_program.update_attributes(params[:ped_program])\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_loyalty_programs\n warn 'Endpoint list_loyalty_programs in LoyaltyApi is deprecated'\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/loyalty/programs'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = Program.find(params[:program_id])\n end", "def update\n logger.debug request.query_parameters\n respond_to do |format|\n if @program.update(program_params)\n flash[:notice] = 'Program was successfully updated.'\n format.html { redirect_to :controller => \"programs\", :action => \"index\", :params => request.query_parameters}\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @program = Program.new\n @costs = []\n @small = false unless !@small.nil? \n @individual = false unless !@individual.nil? \n @medium = false unless !@medium.nil? \n @large = false unless !@large.nil? \n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n end", "def show\n @program = Program.find(params[:id])\n @entries = []\n @program.program_cost_length_maps.sort_by(&:length).each do |p|\n @entries << [(p.length / 604800).round, p.cost]\n end\n \n @results = Review.where(:program_id => @program.id).sort_by(&:created_at).reverse\n @overall = 0\n @results.each do |f|\n @overall = @overall + f.overall\n end\n if @results.count != 0\n @overall = @overall / @results.count\n else\n @overall = 0\n end\n @flag = Flag.new\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @program }\n end\n end", "def show\n @reprogramacion = Reprogramacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reprogramacion }\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save(:without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render json: @program, status: :created, location: @program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @program_attendance = ProgramAttendance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program_attendance }\n end\n end", "def show\n @program_classification = ProgramClassification.find params[:id]\n end", "def show\n @newapp = Newapp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @newapp }\n end\n end", "def new\n @center_program = CenterProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @center_program }\n end\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def create\n @program = Program.new(params[:program])\n\n ## setting @org_id to organization_account's org_id OR the org that was selected at programs/new\n # for use with creating program_subjects, program_sizes, program_cost_length_maps\n if current_organization_account.present?\n @org_id = current_organization_account.organization_id\n elsif (orgs = Organization.where(:name => params[:program][:organization_name])).present?\n @org_id = orgs.first.id\n end\n\n # creating program_subject, program_size, and program_cost_length_map objects\n # methods in helpers/program_helper.rb\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n if @program.save\n [@cost_lengths, @subjects, @sizes].each do |arr|\n arr.each do |inst|\n inst.program_id = @program.id\n inst.save\n inst.index! if arr == @cost_lengths\n end\n end\n end\n respond_with(@program)\n end", "def get_card_program_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.get_card_program_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/card_program'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageCardProgram')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#get_card_program_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @volunteer_program = VolunteerProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @volunteer_program }\n end\n end", "def index\n @program_relationships = ProgramRelationship.all\n end", "def show\n @program_employee = ProgramEmployee.find(params[:id])\n @employees = @program_employee.program_location.program_employees\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @program = Program.new\n\n respond_with(:admin, current_account, @program)\n end", "def show\n @program_type = ProgramType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @program_type }\n end\n end", "def ps(app_name)\n deprecate # 07/31/2012\n json_decode get(\"/apps/#{app_name}/ps\", :accept => 'application/json').to_s\n end", "def get_loyalty_program_with_http_info(loyalty_program_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_program ...'\n end\n # verify the required parameter 'loyalty_program_id' is set\n if @api_client.config.client_side_validation && loyalty_program_id.nil?\n fail ArgumentError, \"Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_program\"\n end\n # resource path\n local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'LoyaltyProgram' \n\n # auth_names\n auth_names = opts[:auth_names] || ['management_key', 'manager_auth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementApi#get_loyalty_program\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @programaciones = Programacion.all\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url, notice: 'Program was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def index\n @programs = Program.includes(:product, :user, cuts: [tracking: :product_line]).all.limit(20)\n end", "def index\n @admin_pay_programs = Admin::PayProgram.all\n end", "def index\n @program_califications = ProgramCalification.all\n end", "def show\n @degree_program = DegreeProgram.find(params[:id])\n @department = Department.find(@degree_program.department.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree_program }\n end\n end", "def show\n @program_genre = ProgramGenre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program_genre }\n end\n end", "def new\n\tif user_signed_in?\n\t\t@program = Program.new\n\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render json: @program }\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def index\n @program_exms = ProgramExm.all\n end", "def get_loyalty_programs(opts = {})\n data, _status_code, _headers = get_loyalty_programs_with_http_info(opts)\n data\n end" ]
[ "0.7406592", "0.73802394", "0.73802394", "0.7340742", "0.72754884", "0.69640154", "0.6950823", "0.69468045", "0.67080843", "0.6681949", "0.6600035", "0.6582392", "0.6547388", "0.65361536", "0.65361536", "0.6526064", "0.65259045", "0.65111274", "0.6464885", "0.6443576", "0.64035976", "0.6374906", "0.6360961", "0.6320962", "0.6298065", "0.6293705", "0.6246928", "0.62065053", "0.61876434", "0.61510664", "0.614294", "0.6121062", "0.61090475", "0.6081206", "0.601905", "0.59849", "0.598161", "0.5970614", "0.5951798", "0.594046", "0.59349644", "0.5929622", "0.5926483", "0.5923124", "0.5905426", "0.5905426", "0.59012556", "0.58994555", "0.5897559", "0.5886807", "0.5886807", "0.5886807", "0.5886807", "0.5886807", "0.5886807", "0.5886807", "0.5876319", "0.5873107", "0.5868502", "0.58409834", "0.58239055", "0.5800457", "0.57999444", "0.5794827", "0.5794669", "0.5792033", "0.57819295", "0.57695", "0.57695", "0.5758373", "0.5750212", "0.57498944", "0.5748535", "0.57424223", "0.57378083", "0.5730918", "0.57296973", "0.5729602", "0.56901586", "0.568533", "0.5679005", "0.5674995", "0.56710535", "0.5655216", "0.5654458", "0.5652353", "0.56464803", "0.56407577", "0.5635817", "0.5632783", "0.5621387", "0.56180066", "0.5614038", "0.5610565", "0.56102246", "0.5596915", "0.55920225", "0.5588907", "0.558162", "0.55749035" ]
0.72405416
5
GET /ped_programs/new GET /ped_programs/new.json
def new @ped_program = PedProgram.new respond_to do |format| format.html # new.html.erb format.json { render json: @ped_program } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def new\n @event = Event.find(params[:event_id])\n @program = @event.programs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @ped_program = PedProgram.new(params[:ped_program])\n\n respond_to do |format|\n if @ped_program.save\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' }\n format.json { render json: @ped_program, status: :created, location: @ped_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params)\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to programs_path, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @programa = Programa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programa }\n end\n end", "def program_new\n @program = Program.new\n @department = Department.find(params[:id])\n end", "def new\n @ped_program_definition = PedProgramDefinition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program_definition }\n end\n end", "def new\n if current_user.superadmin?\n @program = Program.new\n #@program.director = Member.new(:role => 'PROGRAM DIRECTOR')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n else\n respond_to do |format|\n flash[:error] = 'You have been denied access to this page because you do not have the right access to this page. If you believe that a mistake has been made, please contact <a href=\"mailto:h.samani@unsw.edu.au\">h.samani@unsw.edu.au</a>.'.html_safe\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end\n end", "def new\n @interaction_program = InteractionProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interaction_program }\n end\n end", "def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save(:without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render json: @program, status: :created, location: @program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @program = Program.new\n @costs = []\n @small = false unless !@small.nil? \n @individual = false unless !@individual.nil? \n @medium = false unless !@medium.nil? \n @large = false unless !@large.nil? \n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @program }\n end\n end", "def create\n @programm = Programm.new(programm_params)\n\n respond_to do |format|\n if @programm.save\n format.html { redirect_to action: :index, notice: 'Programm was successfully created.' }\n format.json { render :index, status: :created, location: @programm }\n else\n format.html { render :new }\n format.json { render json: @programm.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @center_program = CenterProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @center_program }\n end\n end", "def new\n @program = Program.new\n\n respond_with(:admin, current_account, @program)\n end", "def new\n\tif user_signed_in?\n\t\t@program = Program.new\n\n\t\trespond_to do |format|\n\t\t format.html # new.html.erb\n\t\t format.json { render json: @program }\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def create\n\n new_program = program_params[:new_program]\n\n Service::CreateProgramAndPerformCuts.new(new_program, current_user).run\n\n flash[:notice] = 'Program ok!'\n\n rescue StandardError => e\n puts e.backtrace\n error_response(e)\n\n rescue Exception => e\n unexpected_response(e)\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n flash[:notice] = 'Program was successfully created.'\n format.html { redirect_to(@program) }\n format.xml { render :xml => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @event = Event.find(params[:event_id])\n @program = @event.programs.build(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html {\n redirect_to @event,\n notice: 'Program was successfully created.'\n }\n format.json {\n render json: @program,\n status: :created,\n location: @program\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @program.errors, status: :unprocessable_entity\n }\n end\n end\n end", "def create\n @programa = Programa.new(params[:programa])\n\n respond_to do |format|\n if @programa.save\n format.html { redirect_to programas_path }\n format.json { render json: @programa, status: :created, location: @programa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tif user_signed_in?\n\t\t@program = Program.new(params[:program])\n\t\t@program.status = \"not approved\"\n\t\trespond_to do |format|\n\t\t if @program.save\n\t\t\tformat.html { redirect_to @program, notice: 'Program was successfully created.' }\n\t\t\tformat.json { render json: @program, status: :created, location: @program }\n\t\t else\n\t\t\tformat.html { render action: \"new\" }\n\t\t\tformat.json { render json: @program.errors, status: :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def new\n @program = Program.new\n @costs = []\n respond_with(@program)\n end", "def create\n @programa = Programa.new(params[:programa])\n\n respond_to do |format|\n if @programa.save\n format.html { redirect_to @programa, notice: 'Programa was successfully created.' }\n format.json { render json: @programa, status: :created, location: @programa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params).tap(&:save)\n redirect_to @program\n rescue => _e\n render 'new'\n end", "def create\n @prog = Prog.new(prog_params)\n\n respond_to do |format|\n if @prog.save\n format.html { redirect_to @prog, notice: 'Prog was successfully created.' }\n format.json { render :show, status: :created, location: @prog }\n else\n format.html { render :new }\n format.json { render json: @prog.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @newapp = Newapp.new(params[:newapp])\n\n respond_to do |format|\n if @newapp.save\n format.html { redirect_to @newapp, notice: 'Newapp was successfully created.' }\n format.json { render json: @newapp, status: :created, location: @newapp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @newapp.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @program_type = ProgramType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program_type }\n end\n end", "def create\n @program = Program.new(params[:program])\n\n ## setting @org_id to organization_account's org_id OR the org that was selected at programs/new\n # for use with creating program_subjects, program_sizes, program_cost_length_maps\n if current_organization_account.present?\n @org_id = current_organization_account.organization_id\n elsif (orgs = Organization.where(:name => params[:program][:organization_name])).present?\n @org_id = orgs.first.id\n end\n\n # creating program_subject, program_size, and program_cost_length_map objects\n # methods in helpers/program_helper.rb\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n if @program.save\n [@cost_lengths, @subjects, @sizes].each do |arr|\n arr.each do |inst|\n inst.program_id = @program.id\n inst.save\n inst.index! if arr == @cost_lengths\n end\n end\n end\n respond_with(@program)\n end", "def create\n @program = Program.new(program_params)\n UserMailer.notify_approver(@program).deliver\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to brand_programs_path(@program.brand), notice: 'Program was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program }\n else\n format.html { render action: 'new' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n if @program.save\n flash[:notice] = \"Program successfully saved.\"\n format.html { redirect_to program_path(@program) }\n format.xml { head :ok }\n else\n flash[:error] = \"An error occurred.\"\n format.html { render :action => 'new' }\n format.xml { render :xml => @program.errors.to_xml }\n end\n end\n end", "def create\n @category_program = CategoryProgram.new(category_program_params)\n\n respond_to do |format|\n if @category_program.save\n format.html { redirect_to @category_program, notice: 'Category program was successfully created.' }\n format.json { render :show, status: :created, location: @category_program }\n else\n format.html { render :new }\n format.json { render json: @category_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @interaction_program = InteractionProgram.new(params[:interaction_program])\n\n respond_to do |format|\n if @interaction_program.save\n format.html { redirect_to \"/interaction_registered/#{@interaction_program.id}\" }\n format.json { render json: @interaction_program, status: :created, location: @interaction_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interaction_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @programacion = Programacion.new(programacion_params)\n\n respond_to do |format|\n if @programacion.save\n format.html { redirect_to @programacion, notice: 'Programacion was successfully created.' }\n format.json { render :show, status: :created, location: @programacion }\n else\n format.html { render :new }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @course_programme = CourseProgramme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_programme }\n end\n end", "def create\n @programme = Programme.new(params[:programme])\n\n respond_to do |format|\n if @programme.save\n format.html { redirect_to @programme, notice: 'Programme was successfully created.' }\n format.json { render json: @programme, status: :created, location: @programme }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programme.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_pay_program = Admin::PayProgram.new(admin_pay_program_params)\n\n respond_to do |format|\n if @admin_pay_program.save\n format.html { redirect_to @admin_pay_program, notice: 'Pay program was successfully created.' }\n format.json { render :show, status: :created, location: @admin_pay_program }\n else\n format.html { render :new }\n format.json { render json: @admin_pay_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @program = Program.new\n\t@program.program_exercises.build\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program }\n end\n end", "def new\n @program_list= Programlist.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program_list}\n end\n end", "def new\n @planning_application = PlanningApplication.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @planning_application }\n end\n end", "def create\n puts('Relationships: ' + program_relationship_params)\n @program_relationship = ProgramRelationship.new(program_relationship_params)\n\n respond_to do |format|\n if @program_relationship.save\n format.html { redirect_to @program_relationship, notice: 'Program relationship was successfully created.' }\n format.json { render :show, status: :created, location: @program_relationship }\n else\n format.html { render :new }\n format.json { render json: @program_relationship.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @app = App.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @app }\n end\n end", "def new\n @app = App.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @app }\n end\n end", "def new\n @app = App.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @app }\n end\n end", "def new\n @app = App.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @app }\n end\n end", "def new\n @project = Project.new\n @services = Service.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "def new\n @program_attendance = ProgramAttendance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program_attendance }\n end\n end", "def program_params\n params.require(:program).permit(:new_program)\n end", "def new\n @uniprot = Uniprot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @uniprot }\n end\n end", "def create\n @education_program = EducationProgram.new(education_program_params)\n\n respond_to do |format|\n if @education_program.save\n format.html { redirect_to @education_program, notice: 'Education program was successfully created.' }\n format.json { render :show, status: :created, location: @education_program }\n else\n format.html { render :new }\n format.json { render json: @education_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n @program.sport_class_name = params[:program][:sport_class_name]\n @program.account = current_account\n\n flash[:notice] = 'Program was successfully created.' if @program.save\n respond_with(:admin, current_account, @program)\n end", "def create\n @program_exm = ProgramExm.new(program_exm_params)\n\n respond_to do |format|\n if @program_exm.save\n format.html { redirect_to @program_exm, notice: 'Program exm was successfully created.' }\n format.json { render :show, status: :created, location: @program_exm }\n else\n format.html { render :new }\n format.json { render json: @program_exm.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @programa_de_intere = ProgramaDeIntere.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programa_de_intere }\n end\n end", "def create\n @program_state = ProgramState.new(program_state_params)\n\n respond_to do |format|\n if @program_state.save\n format.html { redirect_to @program_state, notice: 'Program state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @program_state.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ped_program_definition = PedProgramDefinition.new(params[:ped_program_definition])\n\n respond_to do |format|\n if @ped_program_definition.save\n format.html { redirect_to @ped_program_definition, notice: 'Ped program definition was successfully created.' }\n format.json { render json: @ped_program_definition, status: :created, location: @ped_program_definition }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program_definition.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @protein = Protein.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @protein }\n end\n end", "def create\n @programacion = Programacion.new(programacion_params)\n\n respond_to do |format|\n if @programacion.save\n format.html { redirect_to programaciones_path, notice: 'Se ha Creado un Registro.' }\n format.json { render :show, status: :created, location: @programacion }\n else\n format.html { render :new }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @volunteer_program = VolunteerProgram.new\n @program = Program.find(params[:id])\n @volunteers = Volunteer.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @volunteer_program }\n end\n end", "def create\n program = Program.find(params[:program][:id])\n respond_to do |format| \n if VolunteerProgram.add_volunteers(params)\n flash[:notice] = 'Volunteers were successfully added to program.'\n #format.html {render \"programs/:id\", :controller => \"programs\", :action => \"show\", :id => program_id}\n format.html {redirect_to(program, :controller => \"programs\")}\n #format.html {redirect_to(show_program_path({\"id\"=>program_id})) }\n #format.xml { render :xml => @volunteer_program, :status => :created, :location => @volunteer_program }\n else\n format.html { render :action => \"new\" }\n # format.xml { render :xml => @volunteer_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @prod = Prod.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @prod }\n end\n end", "def new\n @routine = Routine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routine }\n end\n end", "def create\n @center_program = CenterProgram.new(params[:center_program])\n\n respond_to do |format|\n if @center_program.save\n format.html { redirect_to @center_program, notice: 'Center program was successfully created.' }\n format.json { render json: @center_program, status: :created, location: @center_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @center_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @protocol = Protocol.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @protocol }\n end\n end", "def new\n @serviceorg = Serviceorg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @serviceorg }\n end\n end", "def new\n @pto = Pto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pto }\n end\n end", "def new\n @new_pro = NewPro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_pro }\n end\n #ejecutar el shell de wapp\n\n \n\n end", "def new\n @tool = Tool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tool }\n end\n end", "def new\n @program_genre = ProgramGenre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program_genre }\n end\n end", "def new\n @pdb = Pdb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pdb }\n end\n end", "def new\n @pst = Pst.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @pst }\n end\n end", "def new\n @reprogramacion = Reprogramacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reprogramacion }\n end\n end", "def new\n @patch = Patch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patch }\n end\n end", "def new\n @proyect = Proyect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proyect }\n end\n end", "def new\n @organism = Organism.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organism }\n end\n end", "def create\n @program_calification = ProgramCalification.new(program_calification_params)\n respond_to do |format|\n if @program_calification.save\n format.html { redirect_to @program_calification, notice: '¡Gracias por calificar el programa!' }\n format.json { render :show, status: :created, location: @program_calification }\n else\n format.html { render :new }\n format.json { render json: @program_calification.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end", "def new\n @programa = Programa.new\n end", "def create\n @course_programme = CourseProgramme.new(params[:course_programme])\n\n respond_to do |format|\n if @course_programme.save\n format.html { redirect_to @course_programme, notice: 'Course programme was successfully created.' }\n format.json { render json: @course_programme, status: :created, location: @course_programme }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course_programme.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @pinglun = Pinglun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pinglun }\n end\n end", "def new\n @portion = Portion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @portion }\n end\n end", "def new\n @projecct = Projecct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projecct }\n end\n end", "def new\n @ped = Ped.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped }\n end\n end", "def new\n @proef = Proef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proef }\n end\n end", "def create\n @after_school_program = AfterSchoolProgram.new(after_school_program_params)\n\n respond_to do |format|\n if @after_school_program.save\n format.html { redirect_to @after_school_program, notice: 'After school program was successfully created.' }\n format.json { render :show, status: :created, location: @after_school_program }\n else\n format.html { render :new }\n format.json { render json: @after_school_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @prob = Prob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prob }\n end\n end", "def new\n @project = Project.new(user_id: current_user.id)\n find_people_list\n fetch_clients\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "def new\n @new_policy = NewPolicy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_policy }\n end\n end", "def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end", "def new\n @comp = Comp.new\n\t@games = Game.find_all_by_comp_id(nil)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comp }\n end\n end", "def create\n @programacion = Programacion.new(params[:programacion])\n\n respond_to do |format|\n if @programacion.save\n flash[:notice] = 'La Programación se creó correctamente.'\n format.html { redirect_to(@programacion) }\n format.xml { render :xml => @programacion, :status => :created, :location => @programacion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @programacion.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @papel = Papel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @papel }\n end\n end", "def new\n @pony = Pony.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pony }\n end\n end", "def new\n @psa = Psa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @psa }\n end\n end", "def new\n @program_session = ProgramSession.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @program_session }\n end\n end", "def new\n @primer = Primer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @primer }\n end\n end", "def new\n @packing_process = PackingProcess.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @packing_process }\n end\n end", "def new\n @projectresource = Projectresource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projectresource }\n end\n end", "def new\n @enquiry = Enquiry.find(params[:id])\n @enquiry.programmes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programme }\n end\n end", "def new\n @tooling_specification = ToolingSpecification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tooling_specification }\n end\n end" ]
[ "0.7818672", "0.7818672", "0.7524971", "0.7400569", "0.7267751", "0.72644407", "0.72306544", "0.72296077", "0.719304", "0.7162572", "0.70703703", "0.70597124", "0.70255417", "0.696877", "0.69405913", "0.68864995", "0.68658566", "0.68197685", "0.6761808", "0.67614615", "0.67598677", "0.6758892", "0.6737578", "0.67298007", "0.66846466", "0.6683007", "0.66428894", "0.6617588", "0.6609548", "0.6608734", "0.6556124", "0.6551621", "0.65273464", "0.6520981", "0.6517465", "0.6510734", "0.6500917", "0.6491697", "0.6483976", "0.6459428", "0.64520085", "0.64486253", "0.6446321", "0.6446321", "0.6446321", "0.6446321", "0.64461213", "0.6423813", "0.64179033", "0.6406733", "0.6398986", "0.6375489", "0.6368123", "0.6362327", "0.6357874", "0.6350084", "0.63426477", "0.63406533", "0.6337076", "0.63340044", "0.63236916", "0.6321634", "0.63166606", "0.6310551", "0.63086236", "0.63084847", "0.62938607", "0.6287279", "0.6286547", "0.6278022", "0.62755305", "0.62744826", "0.62709755", "0.6265932", "0.6261843", "0.6257038", "0.6249972", "0.6249871", "0.6248526", "0.62447363", "0.62436855", "0.62422174", "0.62258035", "0.6203522", "0.6202649", "0.6202075", "0.6200103", "0.6189246", "0.61814797", "0.6178479", "0.61754966", "0.6168468", "0.61643595", "0.6161461", "0.615872", "0.61519545", "0.6151525", "0.6147923", "0.61411774", "0.61405706" ]
0.77364576
2
POST /ped_programs POST /ped_programs.json
def create @ped_program = PedProgram.new(params[:ped_program]) respond_to do |format| if @ped_program.save format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' } format.json { render json: @ped_program, status: :created, location: @ped_program } else format.html { render action: "new" } format.json { render json: @ped_program.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params)\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to programs_path, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @event = Event.find(params[:event_id])\n @program = @event.programs.build(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html {\n redirect_to @event,\n notice: 'Program was successfully created.'\n }\n format.json {\n render json: @program,\n status: :created,\n location: @program\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @program.errors, status: :unprocessable_entity\n }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save(:without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render json: @program, status: :created, location: @program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:new_program)\n end", "def create\n @programm = Programm.new(programm_params)\n\n respond_to do |format|\n if @programm.save\n format.html { redirect_to action: :index, notice: 'Programm was successfully created.' }\n format.json { render :index, status: :created, location: @programm }\n else\n format.html { render :new }\n format.json { render json: @programm.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_program_params\n params.require(:program).permit(:name)\n end", "def program_params\n params.require(:program).permit(:name, :color, :notes, :is_paid, :approval)\n end", "def create\n @program = Program.new(params[:program])\n\n ## setting @org_id to organization_account's org_id OR the org that was selected at programs/new\n # for use with creating program_subjects, program_sizes, program_cost_length_maps\n if current_organization_account.present?\n @org_id = current_organization_account.organization_id\n elsif (orgs = Organization.where(:name => params[:program][:organization_name])).present?\n @org_id = orgs.first.id\n end\n\n # creating program_subject, program_size, and program_cost_length_map objects\n # methods in helpers/program_helper.rb\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n if @program.save\n [@cost_lengths, @subjects, @sizes].each do |arr|\n arr.each do |inst|\n inst.program_id = @program.id\n inst.save\n inst.index! if arr == @cost_lengths\n end\n end\n end\n respond_with(@program)\n end", "def create\n @ped_program_definition = PedProgramDefinition.new(params[:ped_program_definition])\n\n respond_to do |format|\n if @ped_program_definition.save\n format.html { redirect_to @ped_program_definition, notice: 'Ped program definition was successfully created.' }\n format.json { render json: @ped_program_definition, status: :created, location: @ped_program_definition }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program_definition.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n new_program = program_params[:new_program]\n\n Service::CreateProgramAndPerformCuts.new(new_program, current_user).run\n\n flash[:notice] = 'Program ok!'\n\n rescue StandardError => e\n puts e.backtrace\n error_response(e)\n\n rescue Exception => e\n unexpected_response(e)\n end", "def create\n @admin_pay_program = Admin::PayProgram.new(admin_pay_program_params)\n\n respond_to do |format|\n if @admin_pay_program.save\n format.html { redirect_to @admin_pay_program, notice: 'Pay program was successfully created.' }\n format.json { render :show, status: :created, location: @admin_pay_program }\n else\n format.html { render :new }\n format.json { render json: @admin_pay_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n flash[:notice] = 'Program was successfully created.'\n format.html { redirect_to(@program) }\n format.xml { render :xml => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:name, :description, :start_date, :end_date, :cmu_facilities, :off_campus_facilities, :num_minors, :num_adults_supervising, :irb_approval, :contact_id, affiliations_attributes: [:id, :organization_id, :program_id, :description, :followed_process, :_destroy])\n end", "def create\n @program = Program.new(program_params)\n UserMailer.notify_approver(@program).deliver\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to brand_programs_path(@program.brand), notice: 'Program was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program }\n else\n format.html { render action: 'new' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @programa = Programa.new(params[:programa])\n\n respond_to do |format|\n if @programa.save\n format.html { redirect_to programas_path }\n format.json { render json: @programa, status: :created, location: @programa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\tif user_signed_in?\n\t\t@program = Program.new(params[:program])\n\t\t@program.status = \"not approved\"\n\t\trespond_to do |format|\n\t\t if @program.save\n\t\t\tformat.html { redirect_to @program, notice: 'Program was successfully created.' }\n\t\t\tformat.json { render json: @program, status: :created, location: @program }\n\t\t else\n\t\t\tformat.html { render action: \"new\" }\n\t\t\tformat.json { render json: @program.errors, status: :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def create\n @programacion = Programacion.new(programacion_params)\n\n respond_to do |format|\n if @programacion.save\n format.html { redirect_to @programacion, notice: 'Programacion was successfully created.' }\n format.json { render :show, status: :created, location: @programacion }\n else\n format.html { render :new }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program_exm = ProgramExm.new(program_exm_params)\n\n respond_to do |format|\n if @program_exm.save\n format.html { redirect_to @program_exm, notice: 'Program exm was successfully created.' }\n format.json { render :show, status: :created, location: @program_exm }\n else\n format.html { render :new }\n format.json { render json: @program_exm.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:name, :category, :url, :description, :location)\n end", "def create\n @interaction_program = InteractionProgram.new(params[:interaction_program])\n\n respond_to do |format|\n if @interaction_program.save\n format.html { redirect_to \"/interaction_registered/#{@interaction_program.id}\" }\n format.json { render json: @interaction_program, status: :created, location: @interaction_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interaction_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @programa = Programa.new(params[:programa])\n\n respond_to do |format|\n if @programa.save\n format.html { redirect_to @programa, notice: 'Programa was successfully created.' }\n format.json { render json: @programa, status: :created, location: @programa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:education_program).permit(:name,\n levels_attributes: [:id, :name, :sequence, :program_ids]\n )\n end", "def create\n @category_program = CategoryProgram.new(category_program_params)\n\n respond_to do |format|\n if @category_program.save\n format.html { redirect_to @category_program, notice: 'Category program was successfully created.' }\n format.json { render :show, status: :created, location: @category_program }\n else\n format.html { render :new }\n format.json { render json: @category_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n @program.sport_class_name = params[:program][:sport_class_name]\n @program.account = current_account\n\n flash[:notice] = 'Program was successfully created.' if @program.save\n respond_with(:admin, current_account, @program)\n end", "def create\n @education_program = EducationProgram.new(education_program_params)\n\n respond_to do |format|\n if @education_program.save\n format.html { redirect_to @education_program, notice: 'Education program was successfully created.' }\n format.json { render :show, status: :created, location: @education_program }\n else\n format.html { render :new }\n format.json { render json: @education_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n if !(current_organization_account.nil?)\n @org_id = current_organization_account.organization_id\n else\n @org_id = Organization.where(:name => params[:program][:organization_name]).first.id\n end\n \n @subjects = []\n params[:program][:program_subjects].split(\", \").each do |f|\n @p = ProgramSubject.new(:program_id => params[:program][:id], :subject => f, :organization_id => @org_id)\n @subjects << @p\n end\n params[:program][:program_subjects] = @subjects\n \n @sizes = []\n params[:program][:program_sizes].each do |f|\n @p = ProgramSize.new(:program_id => params[:program][:id], :size => f, :organization_id => @org_id)\n @sizes << @p\n end\n params[:program][:program_sizes] = @sizes\n \n @cost_lengths = []\n params[:costs].each do |f|\n @p = ProgramCostLengthMap.new(:program_id => params[:program][:id], :cost => f.to_f, :organization_id => @org_id)\n @cost_lengths << @p\n end\n \n count = 0\n params[:lengths].each do |f|\n @p = @cost_lengths[count]\n @length = f.split(\" \")\n @p.length = @length[0].to_i.send(@length[1]).to_f\n @p.length_name = @length[1]\n @p.length_number = @length[0]\n @cost_lengths[count] = @p\n count = count + 1\n end\n \n params[:program][:program_cost_length_maps] = @cost_lengths\n \n @program = Program.new(params[:program])\n @program.location_name = THECOUNTRIES[@program.location]\n @program.organization_id = @org_id\n @program.truncated_description100 = RedCloth.new( ActionController::Base.helpers.sanitize(truncate @program.description, :length => 100), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.description = RedCloth.new( ActionController::Base.helpers.sanitize( @program.description ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.program_cost_breakdown = RedCloth.new( ActionController::Base.helpers.sanitize( @program.program_cost_breakdown ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html \n @program.cost_includes = RedCloth.new( ActionController::Base.helpers.sanitize( @program.cost_includes ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.cost_doesnt_include = RedCloth.new( ActionController::Base.helpers.sanitize( @program.cost_doesnt_include ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n @program.accommodations = RedCloth.new( ActionController::Base.helpers.sanitize( @program.accommodations ), [:filter_html, :filter_styles, :filter_classes, :filter_ids] ).to_html\n \n \n if (@program.overall.nil?) \n @program.overall= 0;\n end\n \n if @program.check_it_out[0..3] != \"http\"\n @program.check_it_out = \"http://\"+@program.check_it_out\n end\n\n if (user_signed_in? && current_user.admin?) || organization_account_signed_in?\n if @program.save\n @cost_lengths.each do |f|\n f.program_id = @program.id\n f.save!\n f.index!\n end\n @subjects.each do |s|\n s.program_id = @program.id\n s.save!\n end\n @sizes.each do |a|\n a.program_id = @program.id\n a.save!\n end\n redirect_to @program\n else\n @program.description = @program.description.gsub(%r{</?[^>]+?>}, '')\n @program.program_cost_breakdown = @program.program_cost_breakdown.gsub(%r{</?[^>]+?>}, '')\n @program.cost_includes = @program.cost_includes.gsub(%r{</?[^>]+?>}, '')\n @program.cost_doesnt_include = @program.cost_doesnt_include.gsub(%r{</?[^>]+?>}, '')\n @program.accommodations = @program.accommodations.gsub(%r{</?[^>]+?>}, '')\n \n flash[:notice] = flash[:notice].to_a.concat @program.errors.full_messages\n render :action => \"new\" \n end\n else\n redirect_to root_path\n end\nend", "def create\n @center_program = CenterProgram.new(params[:center_program])\n\n respond_to do |format|\n if @center_program.save\n format.html { redirect_to @center_program, notice: 'Center program was successfully created.' }\n format.json { render json: @center_program, status: :created, location: @center_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @center_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @oprogram = Oprogram.new(oprogram_params)\n\n respond_to do |format|\n if @oprogram.save\n format.html { redirect_to @oprogram, notice: 'Oprogram was successfully created.' }\n format.json { render :show, status: :created, location: @oprogram }\n else\n format.html { render :new }\n format.json { render json: @oprogram.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params).tap(&:save)\n redirect_to @program\n rescue => _e\n render 'new'\n end", "def new\n @ped_program = PedProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program }\n end\n end", "def post_fundingsources_program(opts = {})\n data, _status_code, _headers = post_fundingsources_program_with_http_info(opts)\n data\n end", "def new\n @event = Event.find(params[:event_id])\n @program = @event.programs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def create\n @pc = Pc.new(pc_params)\n @programs = Program.all\n @t = pc_params\n \n respond_to do |format|\n if @pc.save\n installs = @pc.installs\n installs.each do |i|\n if i.program.blank?\n i.destroy\n end\n end\n format.html { redirect_to @pc, notice: 'Pc was successfully created.' }\n format.json { render :show, status: :created, location: @pc }\n else\n format.html { render :new }\n format.json { render json: @pc.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:name, :slug, :price, :content)\n end", "def employee_program_params\n params.require(:employee_program).permit(:employee_id, :program_id)\n end", "def create\n @programacion = Programacion.new(programacion_params)\n\n respond_to do |format|\n if @programacion.save\n format.html { redirect_to programaciones_path, notice: 'Se ha Creado un Registro.' }\n format.json { render :show, status: :created, location: @programacion }\n else\n format.html { render :new }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "def create\n respond_to do |format|\n if @program.save\n flash[:notice] = \"Program successfully saved.\"\n format.html { redirect_to program_path(@program) }\n format.xml { head :ok }\n else\n flash[:error] = \"An error occurred.\"\n format.html { render :action => 'new' }\n format.xml { render :xml => @program.errors.to_xml }\n end\n end\n end", "def create\n @after_school_program = AfterSchoolProgram.new(after_school_program_params)\n\n respond_to do |format|\n if @after_school_program.save\n format.html { redirect_to @after_school_program, notice: 'After school program was successfully created.' }\n format.json { render :show, status: :created, location: @after_school_program }\n else\n format.html { render :new }\n format.json { render json: @after_school_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @ped_programs = PedProgram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_programs }\n end\n end", "def create\n puts('Relationships: ' + program_relationship_params)\n @program_relationship = ProgramRelationship.new(program_relationship_params)\n\n respond_to do |format|\n if @program_relationship.save\n format.html { redirect_to @program_relationship, notice: 'Program relationship was successfully created.' }\n format.json { render :show, status: :created, location: @program_relationship }\n else\n format.html { render :new }\n format.json { render json: @program_relationship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program_state = ProgramState.new(program_state_params)\n\n respond_to do |format|\n if @program_state.save\n format.html { redirect_to @program_state, notice: 'Program state was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program_state }\n else\n format.html { render action: 'new' }\n format.json { render json: @program_state.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prog = Prog.new(prog_params)\n\n respond_to do |format|\n if @prog.save\n format.html { redirect_to @prog, notice: 'Prog was successfully created.' }\n format.json { render :show, status: :created, location: @prog }\n else\n format.html { render :new }\n format.json { render json: @prog.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:title, :user_id, :short_description, :description, :location, :image, :starts_at, :ends_at, :published, :active, :upcoming, :goal, )\n end", "def program_new\n @program = Program.new\n @department = Department.find(params[:id])\n end", "def program_params\n params.require(:program).permit(:title, :episode_title, :duration, :black_flag, :keyword_id, :sport_prediction, :sport_prediction_completed_at, :sport_prediction_started_at)\n end", "def program_params\n params.require(:program).permit(:name,\n :brand_id,\n :overview,\n comments_attributes: [:id, :comment_id, :program_favorite])\n end", "def create\n @programme = Programme.new(params[:programme])\n\n respond_to do |format|\n if @programme.save\n format.html { redirect_to @programme, notice: 'Programme was successfully created.' }\n format.json { render json: @programme, status: :created, location: @programme }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programme.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program_of_study = ProgramOfStudy.new(program_of_study_params)\n\n respond_to do |format|\n if @program_of_study.save\n format.html { redirect_to @program_of_study, notice: 'Program of study was successfully created.' }\n format.json { render :show, status: :created, location: @program_of_study }\n else\n format.html { render :new }\n format.json { render json: @program_of_study.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n @program.user_id = current_user.id\n token = current_user.access_token\n\n respond_to do |format|\n if @program.save\n payload = JSON.generate(\n {\n :activity => {\n :actor => {\n :name => current_user.full_name,\n :email => current_user.email\n },\n :action => 'create',\n :object => {\n :url => 'http://localhost:3000/programs/' + @program.id.to_s,\n :type => 'page',\n :title => @program.name + \" signup form\"\n }\n }\n })\n\n connection = Net::HTTP.new(\"www.yammer.com\", 443) # Create the connection to Yammer API\n connection.use_ssl = true # Enable SSL\n\n raw_response = connection.post(\"https://www.yammer.com/api/v1/activity.json?access_token=#{token}\", payload, {\n \"Content-Type\" => \"application/json\",\n \"Content-Length\" => payload.length.to_s\n })\n\n format.html { redirect_to \"/programs\", notice: 'Program was successfully created.' }\n format.json { render json: \"/programs\", status: :created, location: @programs }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @ped_program_definition = PedProgramDefinition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ped_program_definition }\n end\n end", "def programacion_params\n params.require(:programacion).permit(:pedido_id, :f_entrega, :prenda, :pieza, :talla, :telas_id, :cantidad)\n end", "def program_params\n params[:program]\n end", "def insert_program\n name = params[:name]\n duration = params[:duration]\n #start_time = params[:starttime]\n description = params[:description]\n short_description = params[:shortdescription]\n channel_name = params[:channel_name]\n theChannel = Channel.where(:name => channel_name)\n\n theProgram = Program.new\n theProgram.name = name\n # Changes the '.' to ':'. Otherwise the Time.parse thinks the time is a date.\n for i in 0..duration.length\n if duration[i] == '.'\n duration[i] = ':'\n end\n end\n theProgram.duration = (duration)\n theProgram.starttime = DateTime.parse(start_time)\n theProgram.description = description\n theProgram.shortdescription = short_description\n\n theProgram.channel = theChannel[0]\n # render :json => theProgram.save\n end", "def create\n program = Program.find(params[:program][:id])\n respond_to do |format| \n if VolunteerProgram.add_volunteers(params)\n flash[:notice] = 'Volunteers were successfully added to program.'\n #format.html {render \"programs/:id\", :controller => \"programs\", :action => \"show\", :id => program_id}\n format.html {redirect_to(program, :controller => \"programs\")}\n #format.html {redirect_to(show_program_path({\"id\"=>program_id})) }\n #format.xml { render :xml => @volunteer_program, :status => :created, :location => @volunteer_program }\n else\n format.html { render :action => \"new\" }\n # format.xml { render :xml => @volunteer_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post_fundingsources_program_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FundingSourcesApi.post_fundingsources_program ...'\n end\n # resource path\n local_var_path = '/fundingsources/program'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'ProgramFundingSourceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"FundingSourcesApi.post_fundingsources_program\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FundingSourcesApi#post_fundingsources_program\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def category_program_params\n params.require(:category_program).permit(:code, :descrip)\n end", "def create\n @programacion = Programacion.new(params[:programacion])\n\n respond_to do |format|\n if @programacion.save\n flash[:notice] = 'La Programación se creó correctamente.'\n format.html { redirect_to(@programacion) }\n format.xml { render :xml => @programacion, :status => :created, :location => @programacion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @programacion.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @program_calification = ProgramCalification.new(program_calification_params)\n respond_to do |format|\n if @program_calification.save\n format.html { redirect_to @program_calification, notice: '¡Gracias por calificar el programa!' }\n format.json { render :show, status: :created, location: @program_calification }\n else\n format.html { render :new }\n format.json { render json: @program_calification.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params)\n @contact = Contact.new(contact_params)\n @contact.save!\n @program.contact_id = @contact.id\n respond_to do |format|\n if @program.save \n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program }\n else\n @contact.delete\n format.html { render action: 'new' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.permit(:name, :created_at)\n end", "def programm_params\n params.require(:programm).permit(:name, :desc, :cat, :visible )\n end", "def create\n @degree_program = DegreeProgram.new(params[:degree_program])\n \n respond_to do |format|\n if @degree_program.save\n \n # Create PPoS\n @ppos_template = PposTemplate.new\n @ppos_template.degree_program_id = @degree_program.id\n @ppos_template.concentrations = 0\n @ppos_template.save\n \n flash[:notice] = 'Degree Program was successfully created.'\n format.html { redirect_to department_degree_programs_path(@degree_program.department_id) }\n format.xml { render :xml => @degree_program, :status => :created, :location => @degree_program }\n else\n @department = Department.find(params[:department_id])\n flash[:department_id] = @department.id\n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @degree_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_program_params\n params.require(:program).permit(:name, :description, :url, :visible)\n end", "def create\n @programa_de_intere = ProgramaDeIntere.new(params[:programa_de_intere])\n\n respond_to do |format|\n if @programa_de_intere.save\n format.html { redirect_to @programa_de_intere, notice: 'Programa de intere was successfully created.' }\n format.json { render json: @programa_de_intere, status: :created, location: @programa_de_intere }\n else\n format.html { render action: \"new\" }\n format.json { render json: @programa_de_intere.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ped_program = PedProgram.find(params[:id])\n\n respond_to do |format|\n if @ped_program.update_attributes(params[:ped_program])\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_programs_for_education_organization(ed_org_type, sponsor)\n programs = []\n avg = @scenarioYAML[\"AVERAGE_NUM_PROGRAMS\"][ed_org_type]\n min = (avg * (1 - @scenarioYAML[\"AVERAGE_NUM_PROGRAMS_THRESHOLD\"])).round\n max = (avg * (1 + @scenarioYAML[\"AVERAGE_NUM_PROGRAMS_THRESHOLD\"])).round\n num = DataUtility.select_random_from_options(@prng, (min..max).to_a)\n (1..num).each do\n @unique_program_id += 1\n programs << {:id => @unique_program_id, :type => get_random_program_type, :sponsor => sponsor}\n end\n programs\n end", "def create\n \t\n @program_list= Programlist.create(params[:programlist])\n\n respond_to do |format|\n if @program_list.save\n format.html { redirect_to(program_list_path(@program_list.id), :notice => 'Programlist was successfully created.') }\n format.xml { render :xml => @program_list, :status => :created, :location => @program_list}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @program_list.errors, :status => :unprocessable_entity }\n end\n end\n end", "def program_role_params\n params.require(:program_role).permit(:program_id, :name, :description)\n end", "def program_calification_params\n params.require(:program_calification).permit(:id_user, :id_program, :comment, :calification)\n end", "def programme_params\n params.require(:programme).permit(:description, :due_date, :user_id, :client, :programme_status, specs_attributes:[:programme_id, :exercise_id, :weight, :time, :serie, :rep, :tempo, :_destroy])\n end", "def create\n @program_employee = ProgramEmployee.new(program_employee_params)\n\n respond_to do |format|\n if @program_employee.save\n format.html { redirect_to @program_employee, notice: 'Program employee was successfully created.' }\n format.json { render action: 'show', status: :created, location: @program_employee }\n else\n format.html { render action: 'new' }\n format.json { render json: @program_employee.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @programme_session = ProgrammeSession.new(programme_session_params)\n @programme_session.modules << ProgrammeModule.all\n respond_to do |format|\n if @programme_session.save\n format.html { redirect_to @programme_session, notice: 'Programme session was successfully created.' }\n format.json { render :show, status: :created, location: @programme_session }\n else\n format.html { render :new }\n format.json { render json: @programme_session.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_card_program_using_post_with_http_info(card_program_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.create_card_program_using_post ...'\n end\n # verify the required parameter 'card_program_request' is set\n if @api_client.config.client_side_validation && card_program_request.nil?\n fail ArgumentError, \"Missing the required parameter 'card_program_request' when calling CardApi.create_card_program_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/card_program'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(card_program_request)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CardProgram')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#create_card_program_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @radio_program = RadioProgram.new(params[:radio_program])\n\n respond_to do |format|\n if @radio_program.save\n format.html { redirect_to(@radio_program, :notice => 'Radio program was successfully created.') }\n format.xml { render :xml => @radio_program, :status => :created, :location => @radio_program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @radio_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n #@program_chef = ProgramChef.new(program_chef_params)\n @program = Program.find(params[:program_id])\n priority = 0\n if !@program.chef_resources.where(status: \"install\").last.nil?\n priority = @program.chef_resources.where(status: \"install\").last.priority\n end\n @chef_resource = ChefResource.new(resource_type: params[:chef_resource_type], priority: priority + 1)\n\n respond_to do |format|\n if @program.program_chefs.create(chef_resource: @chef_resource)\n ProgramsSubject.where(:program_id => @program.id).update_all(:was_updated => true)\n ProgramsSubject.where(:program_id => @program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_program_path(@program), :flash => { :success => \"Action was successfully created.\" } }\n format.json { render :show, status: :created, location: edit_program_path(@program) }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def exercise_program_params\n params.require(:exercise_program).permit(:name, :description, :user_id)\n end", "def create\n @programme = Programme.new(programme_params)\n @programme.user = current_user\n @programme.programme_status = 'draft'\n\n\n respond_to do |format|\n if @programme.save\n format.html { redirect_to new_spec_path(programme: @programme.id), notice: 'Programme was successfully created.' }\n format.json { render :show, status: :created, location: @programme }\n else\n format.html { render :new }\n format.json { render json: @programme.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tour_program = TourProgram.new(params[:tour_program])\n\n respond_to do |format|\n if @tour_program.save\n format.html { redirect_to(@tour_program, :notice => 'Tour program was successfully created.') }\n format.xml { render :xml => @tour_program, :status => :created, :location => @tour_program }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tour_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post_fundingsources_programgateway(opts = {})\n data, _status_code, _headers = post_fundingsources_programgateway_with_http_info(opts)\n data\n end", "def programacion_params\n params.require(:programacion).permit(:fecha, :num_progr, :cliente, :fecha_entrega, :empleado, :cant, :prenda, :pieza, :talla, :val_uni, :total, :subtotal, :iva, :total)\n end", "def education_program_params\n params.require(:education_program).permit(:title, :academic_degree, course_ids: [], courses_attributes: [:name, :code, :credits, :description])\n end", "def create\n megam_rest.post_appdefn(to_hash)\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, :notice => 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_program_work_orders(programs)\n if programs.nil? == false and programs.size > 0\n programs.each do |program|\n @queue.push_work_order({:type => Program, :id => DataUtility.get_program_id(program[:id]), :program_type => program[:type], :sponsor => program[:sponsor]})\n end\n end\n end", "def create\n @program_educational_objective = ProgramEducationalObjective.new(program_educational_objective_params)\n\n respond_to do |format|\n if @program_educational_objective.save\n format.html { redirect_to @program_educational_objective, notice: 'Program educational objective was successfully created.' }\n format.json { render :show, status: :created, location: @program_educational_objective }\n else\n format.html { render :new }\n format.json { render json: @program_educational_objective.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @programme_unit = ProgrammeUnit.new(programme_unit_params)\n\n respond_to do |format|\n if @programme_unit.save\n format.html { redirect_to @programme_unit, notice: 'Programme unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @programme_unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @programme_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def installandlaunch(token, rid, filename , grant_all_permissions )\nuri = URI.parse(\"https://device.pcloudy.com/api/install_app\")\n@toSend = {\n \"token\"=>token, \"rid\"=>rid, \"filename\"=>filename, \"grant_all_permissions\"=>grant_all_permissions\n}.to_json\n\nhttps = Net::HTTP.new(uri.host,uri.port)\nhttps.use_ssl = true\nreq = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})\nreq.body = \"#{@toSend}\"\nres = https.request(req)\nputs \"Response #{res.code} #{res.message}: #{res.body}\"\ninstallresp = JSON.parse(res.body)\noutput = installresp[\"result\"][\"msg\"]\nputs output\nend", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_card_program_using_post(card_program_request, opts = {})\n data, _status_code, _headers = create_card_program_using_post_with_http_info(card_program_request, opts)\n data\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = Program.find(params[:program_id])\n end", "def update\n @program = Program.find(params[:id])\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n # union of current {object}s and new {object}s\n [:program_subjects, :program_sizes, :program_cost_length_maps].each do |attrib|\n params[:program][attrib] = params[:program][attrib] | @program.send(attrib.to_s)\n end\n \n @program.update_attributes(params[:program])\n respond_with(@program)\n end", "def program_of_study_params\n params.require(:program_of_study).permit(:program, :section_id)\n end", "def create\n @program_roster = ProgramRoster.new(program_roster_params)\n\n respond_to do |format|\n if @program_roster.save\n format.html { redirect_to @program_roster, notice: 'Program roster was successfully created.' }\n format.json { render :show, status: :created, location: @program_roster }\n else\n format.html { render :new }\n format.json { render json: @program_roster.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @interaction_program = InteractionProgram.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interaction_program }\n end\n end", "def index\n @ped_program_definitions = PedProgramDefinition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_program_definitions }\n end\n end" ]
[ "0.6897134", "0.68759775", "0.65981025", "0.6593094", "0.6563242", "0.64376944", "0.63941115", "0.63401514", "0.6332472", "0.62788737", "0.62684083", "0.6233224", "0.62068486", "0.61877185", "0.6179231", "0.61584264", "0.61286414", "0.612771", "0.6104234", "0.60931903", "0.608048", "0.60789984", "0.6026249", "0.6022098", "0.601951", "0.60104215", "0.5988431", "0.59411955", "0.59384996", "0.5932291", "0.59279084", "0.58796525", "0.587131", "0.587043", "0.5870383", "0.5868048", "0.5859603", "0.58541626", "0.58541626", "0.5846695", "0.5827617", "0.582325", "0.5811337", "0.5805124", "0.58038926", "0.5775511", "0.57580566", "0.5727214", "0.5723339", "0.5716919", "0.56934345", "0.5656808", "0.56415015", "0.5636676", "0.5630998", "0.5628436", "0.5619078", "0.5618177", "0.56133735", "0.56124175", "0.56087327", "0.5579216", "0.5565015", "0.5538893", "0.5537209", "0.5533639", "0.5512926", "0.54840505", "0.5478259", "0.5473887", "0.5470659", "0.5459594", "0.5459053", "0.54565495", "0.544064", "0.5439688", "0.5436424", "0.5416502", "0.53976226", "0.5388955", "0.53857523", "0.53800076", "0.5369157", "0.53674614", "0.5360038", "0.5354415", "0.53534216", "0.534387", "0.534298", "0.5340014", "0.53367823", "0.53367823", "0.5334485", "0.5332879", "0.531601", "0.53081244", "0.5304555", "0.52999353", "0.52913535", "0.5285302" ]
0.699054
0
PUT /ped_programs/1 PUT /ped_programs/1.json
def update @ped_program = PedProgram.find(params[:id]) respond_to do |format| if @ped_program.update_attributes(params[:ped_program]) format.html { redirect_to @ped_program, notice: 'Ped program was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @ped_program.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, :notice => 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program], :without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @program = Program.find(params[:id])\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n # union of current {object}s and new {object}s\n [:program_subjects, :program_sizes, :program_cost_length_maps].each do |attrib|\n params[:program][attrib] = params[:program][attrib] | @program.send(attrib.to_s)\n end\n \n @program.update_attributes(params[:program])\n respond_with(@program)\n end", "def update\n logger.debug request.query_parameters\n respond_to do |format|\n if @program.update(program_params)\n flash[:notice] = 'Program was successfully updated.'\n format.html { redirect_to :controller => \"programs\", :action => \"index\", :params => request.query_parameters}\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interaction_program = InteractionProgram.find(params[:id])\n\n respond_to do |format|\n if @interaction_program.update_attributes(params[:interaction_program])\n format.html { redirect_to @interaction_program, notice: 'Interaction program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interaction_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n if @programa.update_attributes(params[:programa])\n format.html { redirect_to @programa, notice: 'Programa was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @exercise_program.update(exercise_program_params)\n format.html { redirect_to @exercise_program, notice: 'Exercise program was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise_program }\n else\n format.html { render :edit }\n format.json { render json: @exercise_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ped_program_definition = PedProgramDefinition.find(params[:id])\n\n respond_to do |format|\n if @ped_program_definition.update_attributes(params[:ped_program_definition])\n format.html { redirect_to @ped_program_definition, notice: 'Ped program definition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ped_program_definition.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @program = Program.find(params[:id])\n\n respond_to do |format|\n if @program.update_attributes(params[:program])\n flash[:notice] = 'Program was successfully updated.'\n format.html { redirect_to(@program) }\n #\t\tformat.html { render :action => \"edit\" }\n \n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @center_program = CenterProgram.find(params[:id])\n\n respond_to do |format|\n if @center_program.update_attributes(params[:center_program])\n format.html { redirect_to @center_program, notice: 'Center program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @center_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update \n respond_to do |format|\n if @program.update_attributes(params[:program])\n flash[:notice] = \"Program was succesfully updated.\"\n format.html { redirect_to program_path(@program) }\n format.xml { head :ok }\n else\n flash[:error] = \"An error occurred.\"\n format.html { render :action => 'edit' }\n format.xml { render :xml => @program.errors.to_xml }\n end\n end\n \n end", "def update\n respond_to do |format|\n if @programm.update(programm_params)\n format.html { redirect_to action: :index, notice: 'Programm was successfully updated.' }\n format.json { render :index, status: :ok, location: @programm }\n else\n format.html { render :edit }\n format.json { render json: @programm.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n if @programa.update_attributes(params[:programa])\n format.html { redirect_to session.delete(:return_to) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @programa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prog.update(prog_params)\n format.html { redirect_to @prog, notice: 'Prog was successfully updated.' }\n format.json { render :show, status: :ok, location: @prog }\n else\n format.html { render :edit }\n format.json { render json: @prog.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_program_params\n params.require(:program).permit(:name, :description, :url, :visible)\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def update\n respond_to do |format|\n if @category_program.update(category_program_params)\n format.html { redirect_to @category_program, notice: 'Category program was successfully updated.' }\n format.json { render :show, status: :ok, location: @category_program }\n else\n format.html { render :edit }\n format.json { render json: @category_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_program.update(education_program_params)\n format.html { redirect_to @education_program, notice: 'Education program was successfully updated.' }\n format.json { render :show, status: :ok, location: @education_program }\n else\n format.html { render :edit }\n format.json { render json: @education_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n @program.update_attribute('approved', false)\n UserMailer.notify_approver(@program).deliver\n format.html { redirect_to brand_programs_path(@program.brand), notice: 'Program was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = Program.find(params[:program_id])\n end", "def update\n @program = Program.find(params[:id])\n @program.sport_class_name = params[:program][:sport_class_name]\n\n flash[:notice] = 'Program was successfully updated.' if @program.update_attributes(params[:program])\n respond_with(:admin, current_account, @program)\n end", "def update\n\tif user_signed_in?\n\t\tif current_user.role_id == 1 || current_user.role_id == 2\n\t\t\t@program = Program.find(params[:id])\n\n\t\t\trespond_to do |format|\n\t\t\t if @program.update_attributes(params[:program])\n\t\t\t\tformat.html { redirect_to @program, notice: 'Program was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\t else\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @program.errors, status: :unprocessable_entity }\n\t\t\t end\n\t\t\tend\n\t\telse\n\t\t\tredirect_to :controller=>'programs', :action => 'index'\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'home', :action => 'index'\n\tend\n end", "def program_params\n params.require(:program).permit(:new_program)\n end", "def update\n @volunteer_program = VolunteerProgram.find(params[:id])\n\n respond_to do |format|\n if @volunteer_program.update_attributes(params[:volunteer_program])\n flash[:notice] = 'VolunteerProgram was successfully updated.'\n format.html { redirect_to(@volunteer_program) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @volunteer_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def set_program\n @program = Program.find(params[:id])\n end", "def update\n @programacion = Programacion.find(params[:id])\n\n respond_to do |format|\n if @programacion.update_attributes(params[:programacion])\n flash[:notice] = 'La Programación se modificó correctamente.'\n format.html { redirect_to(@programacion) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @programacion.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @admin_pay_program.update(admin_pay_program_params)\n format.html { redirect_to @admin_pay_program, notice: 'Pay program was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_pay_program }\n else\n format.html { render :edit }\n format.json { render json: @admin_pay_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @programacion.update(programacion_params)\n format.html { redirect_to @programacion, notice: 'Programacion was successfully updated.' }\n format.json { render :show, status: :ok, location: @programacion }\n else\n format.html { render :edit }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cohort_program.update(cohort_program_params)\n format.html { redirect_to @cohort_program}\n format.json { render :show, status: :ok, location: @cohort_program }\n else\n format.html { render :edit }\n format.json { render json: @cohort_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @programme.update(programme_params)\n format.html { redirect_to @programme, notice: 'Programme was successfully updated.' }\n format.json { render :show, status: :ok, location: @programme }\n else\n format.html { render :edit }\n format.json { render json: @programme.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = ::Education::Program.find(params[:id])\n end", "def update\n respond_to do |format|\n if @program_exm.update(program_exm_params)\n format.html { redirect_to @program_exm, notice: 'Program exm was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_exm }\n else\n format.html { render :edit }\n format.json { render json: @program_exm.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_app data={}\n put '/app', data\n end", "def update\n respond_to do |format|\n if @program_relationship.update(program_relationship_params)\n format.html { redirect_to @program_relationship, notice: 'Program relationship was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_relationship }\n else\n format.html { render :edit }\n format.json { render json: @program_relationship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @programacion.update(programacion_params)\n format.html { redirect_to programaciones_path, notice: 'Se ha Modificado el Registro.' }\n format.json { render :show, status: :ok, location: @programacion }\n else\n format.html { render :edit }\n format.json { render json: @programacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @program = Program.find(params[:id])\n \n \n if (user_signed_in? && current_user.admin?) || organization_account_signed_in?\n @program.program_subjects.each do |f|\n f.destroy\n end\n @program.program_sizes.each do |f|\n f.destroy\n end\n @program.program_cost_length_maps.each do |f|\n f.destroy\n end\n \n @subjects = []\n params[:program][:program_subjects].split(\", \").each do |f|\n @p = ProgramSubject.new(:program_id => params[:id], :subject => f, :organization_id => @program.organization_id)\n @subjects << @p\n end\n params[:program][:program_subjects] = @subjects\n\n @sizes = []\n params[:program][:program_sizes].each do |f|\n @p = ProgramSize.new(:program_id => params[:id], :size => f, :organization_id => @program.organization_id)\n @sizes << @p\n end\n params[:program][:program_sizes] = @sizes\n \n @cost_lengths = []\n params[:costs].each do |f|\n if !(f.nil? || f.empty?)\n @p = ProgramCostLengthMap.new(:program_id => params[:id], :cost => f.to_f, :organization_id => @program.organization_id)\n @cost_lengths << @p\n end\n end\n\n count = 0\n params[:lengths].each do |f|\n @p = @cost_lengths[count]\n @length = f.split(\" \")\n @p.length = @length[0].to_i.send(@length[1]).to_f\n @p.length_name = @length[1]\n @p.length_number = @length[0]\n @cost_lengths[count] = @p\n count = count + 1\n end\n\n params[:program][:program_cost_length_maps] = @cost_lengths\n \n \n if @program.update_attributes(params[:program])\n @cost_lengths.each do |f|\n f.program_id = @program.id\n f.save!\n f.index!\n end\n @subjects.each do |s|\n s.program_id = @program.id\n s.save!\n end\n @sizes.each do |a|\n a.program_id = @program.id\n a.save!\n end\n respond_to do |format|\n format.html { redirect_to \"/programs/#{@program.id}\" }\n format.json { head :no_content }\n end\n else\n flash[:notice] = flash[:notice].to_a.concat @program.errors.full_messages\n flash.now[:notice]\n respond_to do |format|\n format.html { render :action => \"edit\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end \n end\n else\n redirect_to root_path\n end\n end", "def update\n respond_to do |format|\n if @program_of_study.update(program_of_study_params)\n format.html { redirect_to @program_of_study, notice: 'Program of study was successfully updated.' }\n format.json { render :show, status: :ok, location: @program_of_study }\n else\n format.html { render :edit }\n format.json { render json: @program_of_study.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @program_type = ProgramType.find(params[:id])\n\n respond_to do |format|\n if @program_type.update_attributes(params[:program_type])\n format.html { redirect_to(@program_type, :notice => 'Program type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @course_programme = CourseProgramme.find(params[:id])\n\n respond_to do |format|\n if @course_programme.update_attributes(params[:course_programme])\n format.html { redirect_to @course_programme, notice: 'Course programme was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_programme.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to @program, :notice => 'Program was successfully created.' }\n format.json { render :json => @program, :status => :created, :location => @program }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @program = Program.new(program_params)\n\n respond_to do |format|\n if @program.save\n format.html { redirect_to programs_path, notice: 'Program was successfully created.' }\n format.json { render :show, status: :created, location: @program }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program_state.update(program_state_params)\n format.html { redirect_to @program_state, notice: 'Program state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program_state.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_program\n @program = @current_site.programs.find(params[:id])\n end", "def update\n respond_to do |format|\n if @program.update(program_params)\n CampaignMailer.with(campaign: @program).notify_user_update.deliver_later\n CampaignMailer.with(campaign: @program).notify_super_admin_update.deliver_later\n format.html { redirect_to @program, notice: 'Program was successfully updated.' }\n format.json { render :show, status: :ok, location: @program }\n else\n format.html { render :edit }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @programa_de_intere = ProgramaDeIntere.find(params[:id])\n\n respond_to do |format|\n if @programa_de_intere.update_attributes(params[:programa_de_intere])\n format.html { redirect_to @programa_de_intere, notice: 'Programa de intere was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @programa_de_intere.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = @client.app(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app]) # FIXME\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sponsor = Program.find(params[:id])\n respond_to do |format|\n if is_admin?(@sponsor) and @sponsor.update_attributes(params[:program])\n flash[:notice] = 'Sponsor was successfully updated.'\n format.html { redirect_to(sponsor_path(@sponsor)) }\n format.xml { head :ok }\n else\n format.html { render :action => :index }\n format.xml { render :xml => @sponsor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @undergraduateprogram = UndergraduateProgram.find(params[:id])\n @undergraduateprogram.update_attributes(params[:undergraduateprogram])\n end", "def program_params\n params.require(:program).permit(:name, :color, :notes, :is_paid, :approval)\n end", "def update\r\n respond_to do |format|\r\n if @sepi_programa.update(sepi_programa_params)\r\n format.html { redirect_to @sepi_programa, notice: 'La actualización del programa de SEPI se realizó correctamente.' }\r\n format.json { render :show, status: :ok, location: @sepi_programa }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @sepi_programa.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @ped_program = PedProgram.new(params[:ped_program])\n\n respond_to do |format|\n if @ped_program.save\n format.html { redirect_to @ped_program, notice: 'Ped program was successfully created.' }\n format.json { render json: @ped_program, status: :created, location: @ped_program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ped_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @program_list= Programlist.find(params[:id])\n\n respond_to do |format|\n if @program_list.update_attributes(params[:programlist])\n format.html { redirect_to(@program_list, :notice => 'Programlist was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @program_list.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @program_employee.update(program_employee_params)\n format.html { redirect_to @program_employee, notice: 'Program employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @program_employee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @newapp = Newapp.find(params[:id])\n\n respond_to do |format|\n if @newapp.update_attributes(params[:newapp])\n format.html { redirect_to @newapp, notice: 'Newapp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @newapp.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = App.find(params[:id])\n\n if @app.update(app_params)\n head :no_content\n else\n render json: @app.errors, status: :unprocessable_entity\n end\n end", "def create\n @program = Program.new(params[:program])\n\n ## setting @org_id to organization_account's org_id OR the org that was selected at programs/new\n # for use with creating program_subjects, program_sizes, program_cost_length_maps\n if current_organization_account.present?\n @org_id = current_organization_account.organization_id\n elsif (orgs = Organization.where(:name => params[:program][:organization_name])).present?\n @org_id = orgs.first.id\n end\n\n # creating program_subject, program_size, and program_cost_length_map objects\n # methods in helpers/program_helper.rb\n [:program_subjects, :program_sizes].each do |attrib|\n params[:program][attrib] = ApplicationHelper.send(\"make_#{attrib.to_s}\", params[:program][attrib], @org_id, @progr)\n end\n params[:program][:program_cost_length_maps] = make_program_cost_length_maps(params[:costs], params[:lengths], @org_id, @program.id)\n \n if @program.save\n [@cost_lengths, @subjects, @sizes].each do |arr|\n arr.each do |inst|\n inst.program_id = @program.id\n inst.save\n inst.index! if arr == @cost_lengths\n end\n end\n end\n respond_with(@program)\n end", "def update\n @tour_program = TourProgram.find(params[:id])\n\n respond_to do |format|\n if @tour_program.update_attributes(params[:tour_program])\n format.html { redirect_to(@tour_program, :notice => 'Tour program was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tour_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @after_school_program.update(after_school_program_params)\n format.html { redirect_to @after_school_program, notice: 'After school program was successfully updated.' }\n format.json { render :show, status: :ok, location: @after_school_program }\n else\n format.html { render :edit }\n format.json { render json: @after_school_program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if @app.update_attributes(params[:app])\n respond_to do |format|\n format.html {\n redirect_to app_path(@app), notice: 'app was successfully updated.'\n }\n format.json { render :nothing => true}\n end\n else\n respond_to do |format|\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_card_program_using_put_with_http_info(card_program, card_program_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CardApi.update_card_program_using_put ...'\n end\n # verify the required parameter 'card_program' is set\n if @api_client.config.client_side_validation && card_program.nil?\n fail ArgumentError, \"Missing the required parameter 'card_program' when calling CardApi.update_card_program_using_put\"\n end\n # verify the required parameter 'card_program_id' is set\n if @api_client.config.client_side_validation && card_program_id.nil?\n fail ArgumentError, \"Missing the required parameter 'card_program_id' when calling CardApi.update_card_program_using_put\"\n end\n # resource path\n local_var_path = '/nucleus/v1/card_program/{card_program_id}'.sub('{' + 'card_program_id' + '}', card_program_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(card_program)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CardProgram')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CardApi#update_card_program_using_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @program = Program.new(params[:program])\n\n respond_to do |format|\n if @program.save(:without_protection => true)\n format.html { redirect_to @program, notice: 'Program was successfully created.' }\n format.json { render json: @program, status: :created, location: @program }\n else\n format.html { render action: \"new\" }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:name, :description, :start_date, :end_date, :cmu_facilities, :off_campus_facilities, :num_minors, :num_adults_supervising, :irb_approval, :contact_id, affiliations_attributes: [:id, :organization_id, :program_id, :description, :followed_process, :_destroy])\n end", "def program_update\n program_id = params[:program][:id] rescue nil\n if !program_id.nil?\n if program_id == \"\"\n session[:program_id] = nil\n else\n session[:program_id] = program_id\n end\n end\n # TODO restore page state (e.g. drilldown)\n render :js => \"window.location.reload()\"\n end", "def program_params\n params.require(:program).permit(:name, :category, :url, :description, :location)\n end", "def update\n respond_to do |format|\n if @programme_type.update(programme_type_params)\n format.html { redirect_to @programme_type, notice: 'Programme type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @programme_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @radio_program = RadioProgram.find(params[:id])\n\n respond_to do |format|\n if @radio_program.update_attributes(params[:radio_program])\n format.html { redirect_to(@radio_program, :notice => 'Radio program was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @radio_program.errors, :status => :unprocessable_entity }\n end\n end\n end", "def employee_program_params\n params.require(:employee_program).permit(:employee_id, :program_id)\n end", "def update\n respond_to do |format|\n if @programme_unit.update(programme_unit_params)\n format.html { redirect_to @programme_unit, notice: 'Programme unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @programme_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend", "def update(name, attributes)\n\t\tput(\"/apps/#{name}\", :app => attributes)\n\tend", "def create\n #@program_chef = ProgramChef.new(program_chef_params)\n @program = Program.find(params[:program_id])\n priority = 0\n if !@program.chef_resources.where(status: \"install\").last.nil?\n priority = @program.chef_resources.where(status: \"install\").last.priority\n end\n @chef_resource = ChefResource.new(resource_type: params[:chef_resource_type], priority: priority + 1)\n\n respond_to do |format|\n if @program.program_chefs.create(chef_resource: @chef_resource)\n ProgramsSubject.where(:program_id => @program.id).update_all(:was_updated => true)\n ProgramsSubject.where(:program_id => @program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_program_path(@program), :flash => { :success => \"Action was successfully created.\" } }\n format.json { render :show, status: :created, location: edit_program_path(@program) }\n else\n format.html { render :new }\n format.json { render json: @program.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @app = App.find(params[:id])\n\n respond_to do |format|\n if @app.update_attributes(params[:app])\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_program_ids!(prog_ids)\n self.program_ids = []\n save!\n\n reload\n\n prog_ids.map do |pid|\n begin\n Program.find(pid)\n rescue Mongoid::Errors::DocumentNotFound => e\n nil\n end\n end.compact.each do |prog|\n self.programs << prog unless self.programs.include?(prog)\n end\n\n reload if save!\n end", "def programs\n @organization = Organization.find(params[:id])\n end", "def update\n respond_to do |format|\n if @programme_exercise.update(programme_exercise_params)\n format.html { redirect_to @programme_exercise, notice: 'Programme exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @programme_exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "def program_params\n params.require(:program).permit(:name, :slug, :price, :content)\n end", "def update\n @reprogramacion = Reprogramacion.find(params[:id])\n\n respond_to do |format|\n if @reprogramacion.update_attributes(params[:reprogramacion])\n format.html { redirect_to @reprogramacion, notice: 'Reprogramacion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reprogramacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_programm\n @programm = Programm.find(params[:id])\n end", "def create_program_params\n params.require(:program).permit(:name)\n end", "def update\n respond_to do |format|\n if @oprogram.update(oprogram_params)\n format.html { redirect_to @oprogram, notice: 'Oprogram was successfully updated.' }\n format.json { render :show, status: :ok, location: @oprogram }\n else\n format.html { render :edit }\n format.json { render json: @oprogram.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(name, attributes)\n put(\"/apps/#{name}\", :app => attributes).to_s\n end", "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @app.update(app_params)\n format.html { redirect_to @app, notice: 'App was successfully updated.' }\n format.json { render :show, status: :ok, location: @app }\n else\n format.html { render :edit }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7207248", "0.72069585", "0.7000489", "0.7000489", "0.6974762", "0.696703", "0.6813224", "0.6782424", "0.67741454", "0.66492826", "0.6613973", "0.66127384", "0.6587482", "0.6574013", "0.65543246", "0.65495664", "0.64871085", "0.6467312", "0.64556366", "0.6417795", "0.63919336", "0.63882166", "0.6382418", "0.6378024", "0.63722414", "0.63718796", "0.6369705", "0.635153", "0.6348983", "0.6348983", "0.6348983", "0.6348983", "0.6348983", "0.6348983", "0.6348983", "0.63267195", "0.62638485", "0.6263768", "0.6233333", "0.61999774", "0.61855793", "0.61758757", "0.61664087", "0.6161261", "0.6157451", "0.61399555", "0.61334014", "0.6129887", "0.6122227", "0.6095179", "0.60939306", "0.60885996", "0.60840166", "0.6070557", "0.6069929", "0.6056154", "0.6055627", "0.6037732", "0.6021232", "0.6019227", "0.6018821", "0.60172844", "0.6015109", "0.6003422", "0.6002237", "0.5987036", "0.59702235", "0.5970152", "0.59696484", "0.5963592", "0.5963259", "0.59549093", "0.59282076", "0.59236985", "0.5921807", "0.5911621", "0.59058934", "0.5891724", "0.589152", "0.589152", "0.58801514", "0.5864052", "0.5864052", "0.5864052", "0.5859511", "0.5859511", "0.5835672", "0.58351606", "0.58201903", "0.5816886", "0.581678", "0.581287", "0.58091325", "0.5794997", "0.57587844", "0.57568836", "0.57568836", "0.57568836", "0.57568836", "0.57568836" ]
0.7176295
2
DELETE /ped_programs/1 DELETE /ped_programs/1.json
def destroy @ped_program = PedProgram.find(params[:id]) @ped_program.destroy respond_to do |format| format.html { redirect_to ped_programs_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to programs_url }\n format.json { head :ok }\n end\n end", "def delete_program_by_name(name)\n item = getProgramByName(name)\n item.destroy\nend", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url, notice: 'Program was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url, notice: 'Program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url, notice: 'Program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url, notice: 'Program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program.destroy\n respond_to do |format|\n format.html { redirect_to programs_url, notice: 'Program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n\n respond_to do |format|\n format.html { redirect_to(programs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ped_program_definition = PedProgramDefinition.find(params[:id])\n @ped_program_definition.destroy\n\n respond_to do |format|\n format.html { redirect_to ped_program_definitions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n @program.destroy\n respond_with(:admin, current_account, @program, :location => admin_account_path(current_account))\n end", "def destroy\n @interaction_program = InteractionProgram.find(params[:id])\n @interaction_program.destroy\n\n respond_to do |format|\n format.html { redirect_to interaction_record_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_pay_program.destroy\n respond_to do |format|\n format.html { redirect_to admin_pay_programs_url, notice: 'Pay program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @center_program = CenterProgram.find(params[:id])\n @center_program.destroy\n\n respond_to do |format|\n format.html { redirect_to center_programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @programm.destroy\n respond_to do |format|\n format.html { redirect_to programms_url, notice: 'Programm was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @exercise_program.destroy\n respond_to do |format|\n format.html { redirect_to exercise_programs_url, notice: 'Exercise program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program.destroy\n \n respond_to do |format|\n flash[:notice] = \"Program was removed\"\n format.html { redirect_to programs_path }\n format.xml { head :ok }\n end\n end", "def delete_program_by_id(item_id)\n item = get_program_by_id(item_id)\n item.destroy\n end", "def destroy\n @program_exm.destroy\n respond_to do |format|\n format.html { redirect_to program_exms_url, notice: 'Program exm was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @brand = @program.brand\n @program.destroy\n respond_to do |format|\n format.html { redirect_to brand_programs_path(@brand) }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_program.destroy\n respond_to do |format|\n format.html { redirect_to education_programs_url, notice: 'Education program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @programacion = Programacion.find(params[:id])\n @programacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(programaciones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @prog.destroy\n respond_to do |format|\n format.html { redirect_to progs_url, notice: 'Prog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category_program.destroy\n respond_to do |format|\n format.html { redirect_to category_programs_url, notice: 'Category program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cohort_program.destroy\n respond_to do |format|\n format.html { redirect_to cohort_programs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @volunteer_program = VolunteerProgram.find(params[:id])\n @volunteer_program.destroy\n\n respond_to do |format|\n format.html { redirect_to(volunteer_programs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @program_list= Programlist.find(params[:id])\n @program_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(programlists_url) }\n format.xml { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @programacion.destroy\n respond_to do |format|\n format.html { redirect_to programaciones_url, notice: 'Programacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @reprogramacion = Reprogramacion.find(params[:id])\n @reprogramacion.destroy\n\n respond_to do |format|\n format.html { redirect_to reprogramaciones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program_state.destroy\n respond_to do |format|\n format.html { redirect_to program_states_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program_employee.destroy\n respond_to do |format|\n format.html { redirect_to program_employees_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program_of_study.destroy\n respond_to do |format|\n format.html { redirect_to program_of_studies_url, notice: 'Program of study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @programme_unit.destroy\n respond_to do |format|\n format.html { redirect_to programme_units_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @programa = Programa.find(params[:id])\n @programa.cursos.each do |curso|\n curso.destroy\n end\n @programa.destroy\n\n respond_to do |format|\n format.html { redirect_to programas_url }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @programme_type.destroy\n respond_to do |format|\n format.html { redirect_to programme_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program_calification.destroy\n respond_to do |format|\n format.html { redirect_to program_califications_url, notice: 'Program calification was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program_type = ProgramType.find(params[:id])\n @program_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(program_types_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @programme.destroy\n respond_to do |format|\n format.html { redirect_to programmes_url, notice: 'Programme was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @programme = Programme.find(params[:id])\n @programme.destroy\n\n respond_to do |format|\n format.html { redirect_to @programme.registration }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @program = Program.find(params[:program_id])\n @chef_resource = ChefResource.find(params[:chef_id])\n #add_remove_resource\n #@program.program_chefs.find_by(chef_resource_id: @chef_resource.id).destroy\n #@program_chef.destroy\n UserError.where(:chef_resource_id => @chef_resource.id).destroy_all\n respond_to do |format|\n if @chef_resource.destroy\n ProgramsSubject.where(:program_id => @program.id).update_all(:was_updated => true)\n ProgramsSubject.where(:program_id => @program.id, :state => \"none\").update_all(:state => \"update\")\n format.html { redirect_to edit_program_path(@program), :flash => { :success => \"Action was successfully destroy.\" } }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_program_path(@program), :flash => { :danger => \"Action was error when destroy.\" } }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @client.app_destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @course_programme = CourseProgramme.find(params[:id])\n @course_programme.destroy\n\n respond_to do |format|\n format.html { redirect_to course_programmes_url }\n format.json { head :no_content }\n end\n end", "def delete_program_application(program_id, adspace_id)#TODO test\n resource = ['programs', 'program', program_id.to_s, 'adspace', adspace_id.to_s]\n \n @rest_action = 'DELETE'\n enable_api_security\n\n if send_request(resource)\n return true\n end\n\n return false\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @program_relationship.destroy\n respond_to do |format|\n format.html { redirect_to program_relationships_url, notice: 'Program relationship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @programacion.destroy\n respond_to do |format|\n format.html { redirect_to programaciones_url, notice: 'Se ha Borrado el Registro.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @programme_exercise.destroy\n respond_to do |format|\n format.html { redirect_to programme_exercises_url }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @tour_program = TourProgram.find(params[:id])\n @tour_program.destroy\n\n respond_to do |format|\n format.html { redirect_to(tour_programs_url) }\n format.xml { head :ok }\n end\n end", "def deleteExecution(execution_id)\n uri = URI(RUNDECKSERVER + ':' + RUNDECKPORT + '/api/12/execution/' + execution_id)\n http = Net::HTTP.new(uri.host, uri.port)\n headers = {'Content-Type'=> 'application/jsonr','X-RunDeck-Auth-Token'=> API_KEY }\n r = http.delete(uri.path, headers) \n return r\nend", "def destroy\n @radio_program = RadioProgram.find(params[:id])\n @radio_program.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_programs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @program = Program.find(params[:id]) \n @program.destroy\n\n respond_with(@program) do\n if current_organization_account.nil?\n redirect_to organizations_path\n else\n redirect_to \"/organization_accounts/profile\"\n end\n end\n end", "def destroy\n @data_list.destroy\n respond_to do |format|\n if params[:program_id] != nil\n format.html { redirect_to program_analytes_url(@program), notice: 'Mode list was successfully destroyed.' }\n format.json { head :no_content }\n else\n format.html { redirect_to data_lists_url, notice: 'Data list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @program_role.destroy\n respond_to do |format|\n format.html { redirect_to program_roles_url, notice: 'Program role was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program = Program.find(params[:id])\n if (user_signed_in? && current_user.admin?) || (!current_organization_account.nil?)\n @program.destroy\n\n respond_to do |format|\n if user_signed_in? && current_user.admin?\n format.html { redirect_to \"/organizations\" }\n else\n format.html { redirect_to \"/organization_accounts/profile\" }\n end\n format.json { head :no_content }\n end\n else\n redirect_to root_path\n end\n end", "def destroy\n @reagent_list.destroy\n respond_to do |format|\n if params[:program_id] != nil\n format.html { redirect_to program_analytes_url(@program), notice: 'Mode list was successfully destroyed.' }\n format.json { head :no_content }\n else\n format.html { redirect_to reagent_lists_path, notice: 'Reagent list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @program_subject.destroy\n respond_to do |format|\n format.html { redirect_to program_subjects_url }\n format.json { head :no_content }\n end\n end", "def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend", "def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend", "def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend", "def destroy\n @after_school_program.destroy\n respond_to do |format|\n format.html { redirect_to after_school_programs_url, notice: 'After school program was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prod_cli.destroy\n respond_to do |format|\n format.html { redirect_to prod_clis_url, notice: 'produto excluido com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sepi_programa.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sepi_programas_url, notice: 'El programa de SEPI se eliminó corrctamente.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @opt10075.destroy\n respond_to do |format|\n format.html { redirect_to opt10075s_url, notice: 'Opt10075 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @program.destroy\n end", "def destroy\n @newapp = Newapp.find(params[:id])\n @newapp.destroy\n\n respond_to do |format|\n format.html { redirect_to newapps_url }\n format.json { head :no_content }\n end\n end", "def delete_course_template(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/#{org_unit_id}\"\n _delete(path)\n puts '[+] Course template data deleted successfully'.green\nend", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy(name)\n delete(\"/apps/#{name}\").to_s\n end", "def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end", "def destroy\r\n @baja_programa.destroy\r\n respond_to do |format|\r\n format.html { redirect_to baja_programas_url, notice: 'Su petición para darse de baja de un programa fue eliminada.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def delete(query)\n\n connect if @persevere.nil?\n\n deleted = 0\n\n if ! query.is_a?(DataMapper::Query)\n resources = [query].flatten\n else\n resources = read_many(query)\n end\n\n resources.each do |resource|\n tblname = resource.model.storage_name\n id = resource.attributes(:field)['id']\n \n # Retrieve the ID from persever if the resource doesn't have an ID field\n if id.nil?\n query = Persevere.enhance(resource.query)\n path = \"/#{tblname}/#{query.to_json_query_filter}[={'id':id}]\"\n response = @persevere.retrieve(path, {})\n id = JSON.parse(response.body)[0]['id'].match(/(\\w+\\/)*(\\d+)/)[2]\n end\n \n path = \"/#{tblname}/#{id}\"\n # path = \"/#{tblname}/#{resource.key.first}\"\n \n DataMapper.logger.debug(\"(Delete) PATH/QUERY: #{path}\")\n\n result = @persevere.delete(path)\n\n if result.code == \"204\" # ok\n deleted += 1\n end\n end\n return deleted\n end", "def destroy\n @degree_program = DegreeProgram.find(params[:id])\n @department = Department.find(@degree_program.department.id)\n @degree_program.destroy\n\n respond_to do |format|\n flash[:notice] = 'Degree Program was successfully removed.'\n format.html { redirect_to department_degree_programs_path(@department) }\n format.xml { head :ok }\n end\n end", "def destroy\n @program_attendance = ProgramAttendance.find(params[:id])\n @program_attendance.destroy\n\n respond_to do |format|\n format.html { redirect_to program_attendances_url }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @program_educational_objective.destroy\n respond_to do |format|\n format.html { redirect_to program_educational_objectives_url, notice: 'Program educational objective was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @oprogram.destroy\n respond_to do |format|\n format.html { redirect_to oprograms_url, notice: 'Operačný program bol úspešne zmazaný.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end", "def delete(*rest) end", "def delete\n @exists = apps.include?(params[:app])\n @app = params[:app] unless @exists == false\n\n if @exists\n `rm #{File.expand_path(\"~/.pow/#{@app}\")}`\n redirect_to root_path, :notice => \"Pow app deleted\"\n else\n render :text => \"Given app is not a Pow app\"\n end\n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def destroy\n @app_list.app_resouces.destroy\n @app_list.destroy\n respond_to do |format|\n format.html { redirect_to app_lists_url }\n format.json { head :no_content }\n end\n end", "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend" ]
[ "0.7274469", "0.7268227", "0.7268227", "0.726555", "0.7105637", "0.70289755", "0.7012836", "0.7012836", "0.7012836", "0.7012836", "0.6980171", "0.68485576", "0.68390507", "0.67973566", "0.67736775", "0.67310476", "0.6715477", "0.66977954", "0.66870177", "0.6643717", "0.6592562", "0.65700984", "0.6567263", "0.6556693", "0.6533905", "0.6521256", "0.65119225", "0.64793843", "0.6474764", "0.6471121", "0.6464999", "0.6460884", "0.64418846", "0.6433815", "0.64274055", "0.64242786", "0.64234334", "0.6420328", "0.641597", "0.641072", "0.64101636", "0.64071614", "0.639425", "0.63793856", "0.6354858", "0.6352043", "0.63458526", "0.6345564", "0.6340521", "0.6336698", "0.6333419", "0.63208187", "0.6315303", "0.6305291", "0.6296274", "0.62771636", "0.6267032", "0.6266397", "0.62481654", "0.6242288", "0.62298125", "0.6227854", "0.62263656", "0.6225006", "0.6225006", "0.62111676", "0.6210939", "0.6204981", "0.6191512", "0.61646485", "0.61565155", "0.6147716", "0.6138633", "0.6132848", "0.6112833", "0.6105086", "0.61040395", "0.6103253", "0.61021894", "0.6094262", "0.6089357", "0.6087454", "0.6085252", "0.6075515", "0.6070478", "0.6069367", "0.6069367", "0.6069367", "0.6069367", "0.6067697", "0.6066672", "0.6062805", "0.6061608", "0.6061608", "0.6061608", "0.60600007", "0.60522974", "0.6051851", "0.60507077", "0.6043502" ]
0.72272885
4
Calculates the row / column of an adjoining tile, based on the side 'sides' are numbered 0 through 5, with 0 being upper left, and moving clockwise. Returns a tuple of [row, column] for the resulting tile.
def adjoiningTile(row, column, side) if( row.is_a?(Integer) && column.is_a?(Integer) && side.is_a?(Integer) ) case side when 0 return [row - 1, column - 1] when 1 return [row - 1, column] when 2 return [row, column + 1] when 3 return [row + 1, column] when 4 return [row + 1, column - 1] when 5 return [row, column - 1] else raise "Invalid side (" + side.to_s + ")!" end else raise "Expected a (row, column, side) as (int, int, int)" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjacent_tiles(row, col)\n adj_tiles = []\n\n if row.positive?\n adj_tiles << tile_at(row - 1, col)\n adj_tiles << tile_at(row - 1, col - 1) unless col.zero?\n adj_tiles << tile_at(row - 1, col + 1) unless col == @size - 1\n end\n\n adj_tiles << tile_at(row, col - 1) unless col.zero?\n adj_tiles << tile_at(row, col + 1) unless col == @size - 1\n\n if row < @size - 1\n adj_tiles << tile_at(row + 1, col - 1) unless col.zero?\n adj_tiles << tile_at(row + 1, col)\n adj_tiles << tile_at(row + 1, col + 1) unless col == @size - 1\n end\n\n adj_tiles\n end", "def rowcol #:nodoc:\n return @row+@row_offset, @col+@col_offset\n end", "def piece_from(row_index, column_index)\n case direction\n when 'up'\n [row_index, column_index + 1]\n when 'down'\n [row_index, column_index - 1]\n when 'left'\n [row_index - 1, column_index]\n when 'right'\n [row_index + 1, column_index]\n when 'up-right'\n [row_index + 1, column_index + 1]\n when 'up-left'\n [row_index - 1, column_index + 1]\n when 'down-right'\n [row_index + 1, column_index - 1]\n when 'down-left'\n [row_index - 1, column_index - 1]\n when 'double-up'\n [row_index, column_index + 2]\n end\n end", "def coord_to_pos(row,col)\n return nil if row.even? && col.even? || row.odd? && col.odd? #these are always empty squares in checkers!\n return row*4+(col/2).floor+1\n end", "def rowcol\n return self.row+@row_offset, self.col+@col_offset\n end", "def compute_dungeon_corners\n @d_top_left_x = @d_top_left_y = @d_bottom_right_x = @d_bottom_right_y = 0\n @rooms.each do |room|\n top_left_x, top_left_y, bottom_right_x, bottom_right_y = room.room_corners\n\n @d_top_left_x = top_left_x if top_left_x < @d_top_left_x\n @d_top_left_y = top_left_y if top_left_y < @d_top_left_y\n\n @d_bottom_right_x = bottom_right_x if bottom_right_x > @d_bottom_right_x\n @d_bottom_right_y = bottom_right_y if bottom_right_y > @d_bottom_right_y\n end\n end", "def inner_up\n # looking up at the bottom of the inner grid\n return 0 if inner.nil?\n # sum bottom edge\n (0..@size-1).map { |x| inner.get_loc(x, @size - 1) ? 1 : 0 }.sum\n end", "def to_row_col(pos)\n\t row = (pos - 1) / @cols\n\t row = ((0...@rows).include? row) ? row : nil \n\t col = (pos - 1) % @cols\n\t col = ((0...@cols).include? col) ? col : nil\n\t [row, col]\n\tend", "def get_surrounding_tiles(row, column, cell)\n surrounding_tiles = []\n index = GAME_BOARD[column-1].index(cell)\n if column == 1 \n if index == 0\n surrounding_tiles << GAME_BOARD[column-1][index+1]\n surrounding_tiles << GAME_BOARD[column][index]\n elsif index == 8\n surrounding_tiles << GAME_BOARD[column-1][index-1]\n surrounding_tiles << GAME_BOARD[column][index]\n else\n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column][index]\n end\n elsif column == 12\n if index == 0\n surrounding_tiles << GAME_BOARD[column-1][index+1]\n surrounding_tiles << GAME_BOARD[column-2][index] \n elsif index == 8\n surrounding_tiles << GAME_BOARD[column-1][index-1]\n surrounding_tiles << GAME_BOARD[column-2][index] \n else\n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column-2][index]\n end\n elsif index == 0\n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column][index]\n surrounding_tiles << GAME_BOARD[column-2][index]\n elsif index == 8\n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column][index]\n surrounding_tiles << GAME_BOARD[column-2][index]\n else\n surrounding_tiles << GAME_BOARD[column-1][index+1] \n surrounding_tiles << GAME_BOARD[column-1][index-1] \n surrounding_tiles << GAME_BOARD[column][index]\n surrounding_tiles << GAME_BOARD[column-2][index]\n end\n\n surrounding_tiles\n end", "def straight_check_col\n @in_a_col_counter = 0\n @row_up_iterater = 1\n @row_down_iterater = 1\n\n 3.times do #check for wins in that column\n if (0 <= (@row - @row_up_iterater) && (@row - @row_up_iterater) <= 5) && ((0 <= @col) and (@col <= 6))\n if @board[@row][@col] == board[@row - @row_up_iterater][@col] #checks up that column\n @row_up_iterater += 1 #if that cell is the same then increments the @row iterater so next loop will check the one even farther out\n @in_a_col_counter += 1 #increments column counter if it is the same\n end\n end\n if (0 <= (@row + @row_down_iterater) && (@row + @row_down_iterater) <= 5) && ((0 <= @col) and (@col <= 6))\n if @board[@row][@col] == board[@row + @row_down_iterater][@col] #checks down that column\n @row_down_iterater += 1\n @in_a_col_counter += 1\n end\n end\n end\n if @in_a_col_counter >= 3 \n puts \"#{@piece} won with that vert column of #{piece}'s!\"\n return true\n else\n \treturn false\n end\n end", "def main_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][i] }\n end", "def calculateAdjacent\r\n #Loops through every tile in the grid.\r\n (0..@rows-1).each do |row|\r\n (0..@columns-1).each do |col|\r\n count = getTier(col+1, row+1) + getTier(col+1, row) + getTier(col+1, row-1)\r\n count += getTier(col, row+1) + getTier(col, row-1) + getTier(col-1, row+1)\r\n count += getTier(col-1, row) + getTier(col-1, row-1)\r\n @tile[col][row].adjacent = count #Totals the tier number in the adjacent tiles.\r\n end\r\n end\r\nend", "def adjacent_ladder\n $app.ladders.find { |_|\n _.pieces.find { |piece| (piece[0]-20..(piece[0]+height-10)).include?(left) && (top <= piece[3] && top >= piece[1]) }\n }\n end", "def diagonal_left_right\n func = lambda do |arr, mark|\n return mark if arr.all? { |el| el == mark } end\n\n left = []; len = @grid.length\n (0...len).each { |i| left << @grid[i][i] }\n\n right = []; len = @grid.length - 1\n (0...@grid.length).each { |i| right << @grid[i][len-i] }\n\n return :X if (func.call(left, :X) == :X) || (func.call(right, :X) == :X)\n return :O if (func.call(left, :O) == :O) || (func.call(right, :O) == :O)\n end", "def gen_diagonal_up(row,col)\n array_diagonals =[]\n 0.upto(5).each do |num|\n if ( row - num < 0 || col + num > 6)\n break\n end\n\n array_diagonals << [row-num, col+num] \n end\n array_diagonals.map{|coordinates| @grid[coordinates[1]][coordinates[0]]}\n end", "def row_col\n f = lambda do |board ,mark|\n board.any? { |row| row.all? {|cell| cell == mark } } end\n\n return :X if (f.call(@grid ,:X) || f.call(@grid.transpose,:X))\n return :O if (f.call(@grid ,:O) || f.call(@grid.transpose,:O))\n end", "def diagonals\n [board.map.with_index { |row, i| row[i] },\n board.map.with_index { |row, i| row[row.size - i - 1] }]\n end", "def diagonal_slide(row, col) # oh cool try the .downto here instead of the reverse always nice to try new things even though it doesn't make for the most sensical code as per https://stackoverflow.com/questions/2070574/is-there-a-reason-that-we-cannot-iterate-on-reverse-range-in-ruby love it the last time you did reverse just because you didn't think about it until later now knowing this you can do it this way love it ah nevermind no need but would have been great to write smaller.downto(0).map oh well lol remember that for some other time love Ruby what a great language\n (row <= col) ? (smaller, larger = row, col) : (smaller, larger = col, row) # establish which number is the smaller of the two and the larger love it you have some crazy short code lol. For the nw and se diagonals\n nw = check_blocking_pieces((1..smaller).map { |offset| [row-offset, col-offset] }) # go by smaller because that's which one will hit 0 first\n ne = check_blocking_pieces((1..(7-row)).map { |offset| [row+offset, col-offset] if ((col-offset) >= 0) }.compact) # Need to use .compact to remove all the nil elements that were returned by .map since can't quite use select or reject since you *do* want to return the evaluation of the array but ah well code smells http://ruby-doc.org/core-1.9.3/Array.html#method-i-compact if you don't get rid of these nils then in the check_blocking_pieces() you'll run into an error since it'll be trying to get an index of a nil value in moves lol amaizng that even the most misleading errors you can debug with debugger and a good eye fuck byebug is so powerful # go by larger but check that the thing doesn't go out of bounds, the only bounds that it could go out if you have the row correct is col-offset being less than 0 # ahh these return nil for everything it doesn't return for so that's the error love it great catch # don't know what you would do without byebug it's literally god mode\n sw = check_blocking_pieces((1..(7-col)).map { |offset| [row-offset, col+offset] if ((row-offset) >= 0) }.compact) # go up until col == 7 as long as row is above or equal to 0, could do it the other way too, as long as col <= 7 go until row hits 0, but same thing\n se = check_blocking_pieces((1..(7-larger)).map { |offset| [row+offset, col+offset] }) # increase up until the largest one equals 7 basically there might be some nil issues with this but this should work can't wait to check it if you add them all up and there are some nils they might not add let's see, ah nope thankfully map returns an empty array fucking love it Ruby is the best\n (nw + ne + sw + se)\nend", "def part_of_col_down(starting, ending)\n col(starting[0])[(ending[1] + 1)..(starting[1] - 1)]\n end", "def adjacent_cell(x,y)\n if has_adjacent_cell?(x,y)\n [x+1, y]\n else\n nil\n end\n end", "def next_tile(col)\n result = nil\n (HEIGHT-1).downto(0) { |i|\n if self.board[i][col] == nil\n result = [i,col]\n break\n end\n }\n if result != nil \n r, c = result\n if not r.between?(0,HEIGHT-1) then raise PostconditionError, \"Row outside of range.\" end\n if not c.between?(0,WIDTH-1) then raise PostconditionError, \"Col outside of range.\" end\n end\n result\n end", "def adjacent_rooms(map, y, x)\n \n north = map[y-1][x]\n south = map[y+1][x]\n west = map[y][x-1]\n east = map[y][x+1]\n\n [north, south, west, east]\nend", "def col(p, r)\n x = p * (p - 1)\n r = p - r - 1 if p.odd?\n cell(x - r)\n end", "def minor_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][-i - 1] }\n end", "def part_of_col_up(starting, ending)\n col(starting[0])[(starting[1] + 1)..(ending[1] - 1)]\n end", "def secondary_diag(pos)\n row, col = pos\n arr = []\n\n until row == 0 || col == @board.length - 1\n row -= 1\n col += 1\n end\n\n while valid_idx?([row, col])\n arr << @board[row][col]\n row += 1\n col -= 1\n end\n\n arr\n end", "def part_of_diag_l_down(starting, ending)\n result = []\n x = starting[0] + 1\n y = starting[1] - 1\n while x < ending[0] && y > ending[1]\n result << @boxes[x][y]\n x += 1\n y -= 1\n end\n result\n end", "def sides(board)\n side_move = nil\n until !board.taken?(side_move)\n side_move = [2, 4, 6, 8].sample\n end\n side_move\n end", "def adjacent_tiles(dx, dy)\n tiles = []\n @tiles.size.times do |x|\n @tiles.size.times do |y|\n if ((x+1 == dx || x-1 == dx) && y == dy) || \n ((y+1 == dy || y-1 == dy) && x == dx)\n tiles << [x, y]\n end\n end\n end\n tiles\n end", "def right\n row, col = @position\n return [row, col + 1] unless col + 1 > 7\n []\n end", "def next_tile(col)\n result = nil\n (HEIGHT-1).downto(0) { |i|\n if @board[i][col] == nil\n result = [i,col]\n break\n end\n }\n if result != nil \n r, c = result\n if not r.between?(0,HEIGHT-1) then raise PostconditionError, \"Row outside of range.\" end\n if not c.between?(0,WIDTH-1) then raise PostconditionError, \"Col outside of range.\" end\n end\n result\n end", "def triangle_pixels(tile_x, tile_y, side)\n quad_size = tile_size / 2\n\n case side\n when :top\n p1 = [tile_x, tile_y]\n p2 = [tile_x + tile_size, tile_y + quad_size]\n when :left\n p1 = [tile_x, tile_y]\n p2 = [tile_x + quad_size, tile_y + tile_size]\n when :bottom\n p1 = [tile_x, tile_y + quad_size]\n p2 = [tile_x + tile_size, tile_y + tile_size]\n when :right\n p1 = [tile_x + quad_size, tile_y]\n p2 = [tile_x + tile_size, tile_y + tile_size]\n end\n\n p1 = ChunkyPNG.Point(p1)\n p2 = ChunkyPNG.Point(p2)\n\n [].tap do |pixels|\n (p1.x...p2.x).each do |x|\n (p1.y...p2.y).each do |y|\n pixels << image.get_pixel(x, y)\n end\n end\n end\n end", "def topLeftToBottomRight(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-right half of the grid, including the longest diagonal\n for x in 1..width do\n\n string = \"\"\n\n for y in 0..x-1 do\n\n letter = grid[[width-x + y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-left half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x-y, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n\n end\n\n return strings\n\nend", "def upper_left_box(i, j)\n x = (i / @box_height).floor * @box_height\n y = (j / @box_width).floor * @box_width\n\n return x, y\n end", "def right_cell_x_at(x); (x + WIDTH - 1) / WIDTH; end", "def part_of_diag_r_down(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] - 1\n while x > ending[0]\n result << @boxes[x][y]\n x -= 1\n y -= 1\n end\n result\n end", "def cell(col, row)\n return nil if out_of_bound?(row, 0, Grid::MaxRow - 1)\n return nil if out_of_bound?(col, 0, Grid::MaxCol - 1)\n return (Grid::MaxCol * row) + col\n end", "def to_padded_coordinates\n w = @direction == :across ? @length : 1\n h = @direction == :across ? 1 : @length\n\n all = (@x - 1..@x + w + 1).map {|i| [i, @y - 1] } + # top\n (@x - 1..@x + w + 1).map {|i| [i, @y + 1] } + # bottom\n (@y - 1..@y + h + 1).map {|i| [@x - 1, i] } + # left\n (@y - 1..@y + h + 1).map {|i| [@x + 1, i] } # right\n\n all.select { |c|\n c[0] >= 0 && c[0] < Board::SIZE &&\n c[1] >= 0 && c[1] < Board::SIZE\n } + to_coordinates\n end", "def find_center(side)\n position = side / 2\n position = position - 1 if side.even?\n [position, position]\nend", "def part_of_diag_l_up(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] + 1\n while x > ending[0] && y < ending[1]\n result << @boxes[x][y]\n x -= 1\n y += 1\n end\n result\n end", "def find_next_coords(row_coord, column_coord)\n if column_coord + 1 < canvas.size && !canvas[row_coord][column_coord + 1] && !missing_up?(row_coord, column_coord)\n [row_coord, column_coord + 1]\n elsif row_coord + 1 < canvas.size && !canvas[row_coord + 1][column_coord]\n [row_coord + 1, column_coord]\n elsif column_coord - 1 >= 0 && !canvas[row_coord][column_coord - 1]\n [row_coord, column_coord - 1]\n elsif row_coord - 1 >= 0 && !canvas[row_coord - 1][column_coord]\n [row_coord - 1, column_coord]\n end\n end", "def connect_cells\n @grid.each_with_index do |columns, col_i|\n columns.each_with_index do |cell, cell_i|\n cell.left = @grid[col_i-1][cell_i] if col_i != 0 \n cell.up = @grid[col_i][cell_i+1] if cell_i + 1 < columns.length\n cell.right = @grid[col_i+1][cell_i] if col_i + 1 < @grid.length\n cell.down = @grid[col_i][cell_i-1] if cell_i != 0\n cell.lu = @grid[col_i-1][cell_i+1] if col_i != 0 && cell_i + 1 < columns.length\n cell.ld = @grid[col_i-1][cell_i-1] if col_i != 0 && cell_i != 0\n cell.ru = @grid[col_i+1][cell_i+1] if col_i + 1 < @grid.length && cell_i + 1 < columns.length\n cell.rd = @grid[col_i+1][cell_i-1] if col_i + 1 < @grid.length && cell_i != 0\n end\n end\n end", "def make_other_rows \n left = 2\n right = @n - 1\n\n (0..t-1).each do |c|\n (1..m-1).each do |r|\n @rounds[c][r] = \"#{left}-#{right}\"\n right = right_decrement(right)\n if r < m-1\n left = left_increment(left)\n elsif r == m-1\n left = left_increment_for_the_last_column(left)\n end\n end\n end\n end", "def get_adjacent_floors tile\n floors = Array.new\n @maze.get_adjacent_tiles(tile).each do |tile|\n floors.push tile if tile.is_floor\n end\n floors\n end", "def bottom_right\n row, col = @position\n return [row + 1, col + 1] unless row + 1 > 7 || col + 1 > 7\n []\n end", "def get_adjacent_squares(coords)\n\t\tx, y, adj_squares = coords[0], coords[1], []\n\t\t# Loop through the columns\n\t\t(x-1).upto(x+1) do |column|\n\t\t\t# Loop through the rows\n\t\t\t(y-1).upto(y+1) do |row|\n\t\t\t\t(adj_squares << [column, row]) if (row >= 1 && row <= @size) && (column >= 1 && column <= @size) && !(column == x && row == y)\n\t\t\tend\n\t\tend\n\t\tadj_squares\n\tend", "def topRightToBottomLeft(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-left half of the grid, including the longest diagonal\n for x in 0..width-1 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x - y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-right half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[width - x + y - 1, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n end\n\n return strings\nend", "def midright; return self.right, self.centery; end", "def setup\n @matrix = Array.new(bordered_image.height) { Array.new(bordered_image.width, 0) }\n\n max_row_index = (bordered_image.height - invader.height)\n max_column_index = (bordered_image.width - invader.width)\n\n return max_row_index, max_column_index\n end", "def columns\n left...(left + bordered_width)\n end", "def possible_neighbors(y,x)\n # (-1..1).to_a.map do |row_offset|\n # (-1..1).to_a.map do |col_offset|\n # return y - row_offset, x - col_offset\n # end\n # end\n up = y-1\n down = y + 1\n my_row = y\n left = x - 1\n right = x + 1\n my_column = x\n\n [\n [my_row,x-1],[y,x+1], # sides\n [up,x-1], [y-1,x], [y-1,x+1], # top\n [down,x-1], [y+1,x], [y+1,x+1] # bottom\n ]\n end", "def get_diagonal_moves\n northwest_moves = []\n northeast_moves = []\n southwest_moves = []\n southeast_moves = []\n (1...ChessBoardConstants::BOARD_DIMENSIONS).each do |step|\n northwest_moves << { row: @row + step, col: @col - step }\n northeast_moves << { row: @row + step, col: @col + step }\n southwest_moves << { row: @row - step, col: @col - step }\n southeast_moves << { row: @row - step, col: @col + step }\n end\n return select_legal_moves(northwest_moves) +\n select_legal_moves(northeast_moves) +\n select_legal_moves(southwest_moves) +\n select_legal_moves(southeast_moves)\n end", "def adjacent_mines(row, col)\n 0\n end", "def adjacent_mines(row, col)\n 0\n end", "def adjacent_mines(row, col)\n 0\n end", "def diagonals\n vals = [[], []]\n (0...size).each do |i|\n vals[0].push(get_square({:column => i, :row => i}))\n vals[1].push(get_square({:column => i, :row => size - i - 1}))\n end\n vals.map {|v| Row.new(size, {:vals => v}) }\n end", "def adj(heightmap, row, col)\n [[0, -1], [-1, 0], [1, 0], [0, 1]].reduce([]) do |acc, offset|\n x_offset, y_offset = offset\n x = row + x_offset\n y = col + y_offset\n\n if x < 0 || x >= heightmap.width ||\n y < 0 || y >= heightmap.height\n acc\n else\n acc.push(heightmap[x][y])\n end\n end\nend", "def neighbor_cell_coordinates\n NEIGHBOR_OFFSETS.map { |coordinates| [row + coordinates[0], col + coordinates[1]] }\n end", "def cols\n directions.count('r') + 1\n end", "def side_attacks\n forward = forward_dir\n row, col = pos\n attacks = []\n\n next_row = row + forward # sets next_row to the following row\n unless next_row > 7 || next_row < 0\n left_col = col - 1\n right_col = col + 1\n\n left_attack = [next_row, left_col]\n right_attack = [next_row, right_col]\n \n attacks << right_attack if valid_pos?(right_attack) && board[right_attack].color != self.color\n attacks << left_attack if valid_pos?(left_attack) && board[left_attack].color != self.color\n end\n\n attacks\n end", "def occupied_cells(x = @x, y = @y)\n x_array = (left_cell_x(x) .. right_cell_x(x)).to_a\n y_array = (top_cell_y(y) .. bottom_cell_y(y)).to_a\n x_array.product(y_array)\n end", "def occupied_cells(x = @x, y = @y)\n x_array = (left_cell_x(x) .. right_cell_x(x)).to_a\n y_array = (top_cell_y(y) .. bottom_cell_y(y)).to_a\n x_array.product(y_array)\n end", "def connect_four_helper(last_played_column_index, column_indices, heights)\n last_played_height = @columns[last_played_column_index].length\n if column_indices.length != heights.length then raise \"Invalid input\" end\n\n matches = 0\n column_indices.each_with_index do |column_index, heights_array_index|\n break if not pieces_match?(last_played_column_index, last_played_height, \n column_index, heights[heights_array_index])\n matches += 1\n end\n return matches\n end", "def take(current_position)\n if direction == 1\n diagonals(current_position, 1)[0..1]\n elsif direction == 2\n diagonals(current_position, 1)[1...-1]\n end\n end", "def get_col(board,col)\n\tboard.map { |row| row[col] }\nend", "def adjacent_mines(row, col)\n count = 0\n if col < @column_count-1\n count+=1 unless @grid[row][col+1].fill.nil?\n end\n if col > 0\n count +=1 unless @grid[row][col-1].fill.nil?\n end\n if row < @row_count-1\n count+=1 unless @grid[row+1][col].fill.nil?\n end\n if row > 0\n count+=1 unless @grid[row-1][col].fill.nil?\n end\n if row < @row_count-1 && col < @column_count-1\n count+=1 unless @grid[row+1][col+1].fill.nil?\n end\n if row > 0 && col > 0\n count+=1 unless @grid[row-1][col-1].fill.nil?\n end\n if row > 0 && col < @column_count-1\n count +=1 unless @grid[row-1][col+1].fill.nil?\n end\n if row < @row_count-1 && col > 0\n count +=1 unless @grid[row+1][col-1].fill.nil?\n end\n count\n end", "def part_of_row_right(starting, ending)\n row(starting[1])[(starting[0] + 1)..(ending[0] - 1)]\n end", "def diagonals\n down_diag = []\n up_diag = []\n \n # push sets of coordinates that make up both diagonals\n 0.upto(@size - 1) do |idx|\n down_diag << [idx, idx]\n up_diag << [idx, @size - 1 - idx]\n end\n\n [down_diag, up_diag].map do |diag|\n diag.map { |pos| self[pos] }\n end\n end", "def right(r, sc, ec, array, final_array) #r for row, sc start column, end column\n (sc..ec).each do |num|\n final_array << array[r][num]\n end\nend", "def reveal_adjacent_cells(coords)\n self[coords].flip\n return if self[coords].value.is_a?(Integer)\n left = [coords[0], coords[1]-1]\n reveal_adjacent_cells(left) if within_boundaries?(left[0], left[1]) && self[left].flippable?\n right = [coords[0], coords[1]+1]\n reveal_adjacent_cells(right) if within_boundaries?(right[0], right[1]) && self[right].flippable?\n up = [coords[0]+1, coords[1]]\n reveal_adjacent_cells(up) if within_boundaries?(up[0], up[1]) && self[up].flippable?\n down = [coords[0]-1, coords[1]]\n reveal_adjacent_cells(down) if within_boundaries?(down[0], down[1]) && self[down].flippable?\n end", "def get_col(board, col)\n board.transpose[col]\nend", "def pixels_to_tile(px, py)\n tx = (px / @tile_size.to_f).ceil.to_i - 1\n ty = (py / @tile_size.to_f).ceil.to_i - 1\n [tx, ty]\n end", "def get_rowcol_from_index(index)\n letter = get_col_from_index(index)\n number = get_row_from_index(index)\n \"#{letter}#{number}\"\n end", "def lh_cell\n v1.cells[(clockwise_directions.index(direction) + 3) % 4]\n end", "def adjacent_row(x,y)\n if has_adjacent_row?(x,y)\n [x, y+1]\n else\n nil\n end\n end", "def get_col(col)\n boggle_board = [\n\t \t\t\t\t[\"b\", \"r\", \"a\", \"e\"],\n\t [\"i\", \"o\", \"d\", \"t\"],\n\t [\"e\", \"c\", \"l\", \"r\"],\n\t [\"t\", \"a\", \"k\", \"e\"]\n\t \t\t\t\t\t\t\t]\ncol_arr = []\nrow_num = boggle_board.length\nrow_num.times do |row| \n\tcol_arr << boggle_board[row][col-1]\n\trow+=1\n end\ncol_arr\nend", "def get_move\n\t\tif(row_winning_move)\n\t\t\treturn row_winning_move\n\t\tend\n\t\tif(column_winning_move)\n\t\t\treturn column_winning_move\n\t\tend\n\t\tif(left_diag_winning_move)\n\t\t\treturn left_diag_winning_move\n\t\tend\n\t\tif(right_diag_winning_move)\n\t\t\treturn right_diag_winning_move\n\t\tend\n\n\t\t[rand(3), rand(3)]\n\tend", "def adjacent_tile_coords(coords)\n tile_offsets = {\n :nw => [-2, 1, 1], :w => [-1, 2, -1],\n :sw => [1, 1, -2], :se => [2, -1, -1],\n :e => [1, -2, 1], :ne => [-1, -1, 2]\n }\n result = coords.clone\n coords.each_value do | coord |\n tile_offsets.each_value do | offsets |\n new_coord = [coord[0] + offsets[0], coord[1] + offsets[1], coord[2] + offsets[2]]\n result[Board.key(*new_coord)] = new_coord\n end\n end\n result\n end", "def sum_of_interior_angles\n 180 * (@number_of_sides - 2)\n end", "def board_value(s, rw)\n value = 0\n for i in 1..8\n for j in 1..8\n if s[[i, j]] == rw + 1\n # regular pieces worh 1 point\n value = value + 1\n elsif s[[i, j]] == rw + 2\n value = value - 1\n elsif s[[i, j]] == rw + 3\n # kings worth 2 points\n value = value + 2\n elsif s[[i, j]] == rw + 4\n value = value - 2\n end\n end\n end\n value \nend", "def diagonalize floor = 0\n raise 'err: not 2d' unless self[0].class == Array\n size = self.length + self[0].length - 1\n array = Array.new(size) {Array.new}\n # acquire top and main diagonal\n self.length.times do |row|\n (0 .. row).each do |col|\n array[row] << self[row-col][col]\n end\n end\n # now cover the additional bottom diagonals\n sides_difference = self.length[0] - self.length\n if sides_difference == 0\n (1 .. self.length - 1).reverse_each do |row|\n offset_value = 0\n temp_arr = []\n while row + offset_value < self.length\n temp_arr << self[self.length - 1 - offset_value][row + offset_value]\n offset_value += 1\n end\n array[self.length - 1 + row] = temp_arr\n end\n else\n (1 .. self[0].length - 1).reverse_each do |row|\n offset_value = 0\n temp_arr = []\n while row + offset_value < self[0].length\n temp_arr << self[self.length - 1 - offset_value][row + offset_value]\n offset_value += 1\n end\n array[self[0].length - 2 + row] = temp_arr\n end\n end\n\n # phew... now to trim and format\n unless floor == 0\n index = 0\n while index < size\n if array[index].length < floor\n array.slice! index\n size -= 1\n index -= 1\n end\n index += 1\n end\n end\n\n (0..size-1).each do |index|\n while array[index].length < self.length\n array[index] << nil\n end\n end\n array\n end", "def delta_right_mid\n\t\t# cl is the current location\n\t\t[right_mid, @map.grid[cl] - @map.grid[ right_mid ]]\n\tend", "def get_disc(row, col)\n @board[row * @size + col]\n end", "def right_edge\n x = width-1\n @image.get(x,0,x,height).pixels\n end", "def left_to_diagonal_right_approach\n largest_prod = 0\n for each_row in (0..15)\n for each_col in (0..15)\n a = $grid_of_numbers[each_row][each_col]\n b = $grid_of_numbers[each_row+1][each_col+1]\n c = $grid_of_numbers[each_row+2][each_col+2]\n d = $grid_of_numbers[each_row+3][each_col+3]\n\n curr_prod = a*b*c*d\n if curr_prod > largest_prod\n largest_prod = curr_prod\n end\n end\n end\n \n return largest_prod\nend", "def find_hole\n @tiles.size.times do |x|\n @tiles.size.times do |y|\n return [x,y] if @tiles[y][x].nil?\n end\n end\n end", "def empty_on_odd_row_from_bottom\n empty = get_position_of_empty_tile\n row = @@rows - empty / @@columns\n return row % 2 == 1 ? true : false \n end", "def right(side, num)\n return num % side == 0 ? num : num + 1\nend", "def get_moves_2(piece, board)\n valid_col = case piece.name\n when ?A then 3\n when ?B then 5\n when ?C then 7\n when ?D then 9\n else 11\n end\n moves = []\n\n # If in hallway\n if piece.row == 1\n cols = valid_col < piece.col ? (valid_col...piece.col).to_a : (piece.col+1..valid_col).to_a\n if cols.count{|c| board[[1, c]] == ?.} == cols.length\n if board[[2, valid_col]] == ?. && board[[3, valid_col]] == piece.name && board[[4, valid_col]] == piece.name && board[[5, valid_col]] == piece.name\n moves << [[2, valid_col], (cols.count + 1) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == piece.name && board[[5, valid_col]] == piece.name\n moves << [[3, valid_col], (cols.count + 2) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == ?. && board[[5, valid_col]] == piece.name\n moves << [[4, valid_col], (cols.count + 3) * piece.cost]\n elsif board[[2, valid_col]] == ?. && board[[3, valid_col]] == ?. && board[[4, valid_col]] == ?. && board[[5, valid_col]] == ?.\n moves << [[5, valid_col], (cols.count + 4) * piece.cost]\n end\n end\n # If right column and something is underneath and nothing above\n # If in wrong column completely and nothing above\n elsif piece.row >= 2\n below = (piece.row+1..5).to_a\n above = (2..piece.row-1).to_a\n if ((piece.col == valid_col && below.count{|c| board[[c, piece.col]] != piece.name} != 0 && below.length != 0) || (piece.col != valid_col)) && (above.count{|c| board[[c, piece.col]] == ?.} == above.length)\n 2.times do |t|\n dir = t == 0 ? -1 : 1\n curr = piece.col\n steps = 1 + above.length\n while board[[1, curr]] == ?.\n moves << [[1, curr], steps * piece.cost] if ![3, 5, 7, 9].include?(curr)\n steps += 1\n curr += dir\n end\n end\n end\n end\n moves\nend", "def neighbor direction\r\n\t\tdirection=direction.to_s.upcase.to_sym # canonical: :N, :E, :S, :W\r\n\t\r\n\t\tcase direction\r\n\t\twhen :N\r\n\t\t\trow, col = @ai.normalize @row-1, @col\r\n\t\twhen :E\r\n\t\t\trow, col = @ai.normalize @row, @col+1\r\n\t\twhen :S\r\n\t\t\trow, col = @ai.normalize @row+1, @col\r\n\t\twhen :W\r\n\t\t\trow, col = @ai.normalize @row, @col-1\r\n\t\telse\r\n\t\t\traise 'incorrect direction'\r\n\t\tend\r\n\t\t\r\n\t\treturn @ai.map[row][col]\r\n\tend", "def bottom_left\n row, col = @position\n return [row + 1, col - 1] unless row + 1 > 7 || col - 1 < 0\n []\n end", "def right_to_diagonal_left_approach\n largest_prod = 0\n\n for each_row in (0..15)\n for col in (0..19)\n each_col = 19 - col\n a = $grid_of_numbers[each_row][each_col]\n b = $grid_of_numbers[each_row+1][each_col-1]\n c = $grid_of_numbers[each_row+2][each_col-2]\n d = $grid_of_numbers[each_row+3][each_col-3]\n #puts \"#{a} #{b} #{c} #{d}\"\n curr_prod = a*b*c*d\n if curr_prod > largest_prod\n largest_prod = curr_prod\n end\n end\n end\n \n return largest_prod\nend", "def available_moves\n adjacent_tiles(*@hole)\n end", "def pieces_at(x, y)\n @board[x][y]\n end", "def right()\n return @left + @width\n end", "def get_columns\n column_lines = []\n 0.upto(@@width - 1) do |column|\n column_line = \"\"\n 0.upto(@@height - 1) do |row|\n column_line << @board[row][column]\n end\n column_lines << column_line\n end\n column_lines\n end", "def rectangle_finder(arr)\n # Find the upper left coordinates\n ul_row = arr.index { |row| row.include?(1) }\n ul_col = arr[ul_row].index(1)\n\n # Find the bottom right coordinates from this\n br = bottom_right(arr, [ul_row, ul_col])\n\n # Return the two together\n [[ul_row, ul_col], br]\nend", "def diagonal(row, col, n)\n possible_moves = []\n (-n..n).each do |delta_right_diag|\n possible_moves << [row + delta_right_diag, col + delta_right_diag]\n end\n (-n..n).each do |delta_left_diag|\n possible_moves << [row - delta_left_diag, col + delta_left_diag]\n end\n possible_moves\n end", "def diagonals\n down_diag = [[0, 0], [1, 1], [2, 2]]\n up_diag = [[0, 2], [1, 1], [2, 0]]\n \n [down_diag, up_diag].map do |diag|\n diag.map { |row, col| @rows[row][col] }\n end\n end", "def legal_column(coords)\n # of columns moved from start position to end position\n distance_col = (@column - coords[1]).abs\n # if @column == coords[1] #same column\n # return true\n puts distance_col\n if distance_col <= 1\n #checks if its occupied\n return occupied?(coords)\n else\n return false\n end\n end" ]
[ "0.6080967", "0.583671", "0.5737862", "0.5715071", "0.5705014", "0.5667341", "0.5632189", "0.5615154", "0.5582474", "0.55503035", "0.5535825", "0.5484313", "0.5461644", "0.54614824", "0.54484874", "0.5445892", "0.54359275", "0.5403869", "0.5376977", "0.536974", "0.5360599", "0.5356196", "0.5354993", "0.5351225", "0.5345509", "0.53427273", "0.5339677", "0.53390896", "0.53367597", "0.5320641", "0.53132653", "0.528255", "0.52625585", "0.52617633", "0.5260448", "0.52551484", "0.52537423", "0.52317226", "0.52239835", "0.52175283", "0.520859", "0.51971954", "0.5195161", "0.5194944", "0.5177592", "0.5168874", "0.5161889", "0.51541406", "0.51531017", "0.51397914", "0.5136744", "0.5133526", "0.5131752", "0.5131752", "0.5131752", "0.5127116", "0.5116491", "0.5113041", "0.51081526", "0.5098819", "0.50937074", "0.50937074", "0.5075798", "0.50747144", "0.50716203", "0.5067618", "0.50542253", "0.5051359", "0.5048822", "0.50437576", "0.5032079", "0.50228965", "0.5021326", "0.50204015", "0.5008879", "0.499891", "0.49967852", "0.49937886", "0.499123", "0.4987824", "0.49796852", "0.49679908", "0.49630815", "0.4963058", "0.49621445", "0.49512947", "0.49481425", "0.49454463", "0.49382457", "0.49376923", "0.49369633", "0.49349564", "0.49338374", "0.493291", "0.4919638", "0.4916831", "0.49095145", "0.49094644", "0.48916313", "0.48813125" ]
0.775937
0
Returns the PublicEarth::Db::Collection, rather than an Atlas::Collection. TODO: Finish conversion of PublicEarth::Db::Collection to Atlas::Collection.
def collection @collection ||= PublicEarth::Db::Collection.find_by_id!(collection_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collection\n @collection ||= self.db.collection(self.collection_name)\n end", "def collection\n @collection ||= database.collection Crocoduck::Store.server_collection\n end", "def collection\n Jrodb::Collection::Basic.new(self)\n end", "def collection\n @collection ||= Collection.load(self.collection_url)\n end", "def collection\n return nil if embedded?\n @collection_name = self.to_s.demodulize.tableize\n @collection ||= Mongoid.database.collection(@collection_name)\n end", "def getCollection\n return @coll\n end", "def collection\n return nil unless collection_member?\n @collection ||= SolrDocument.new(\n Blacklight.solr.select(\n :params => {\n :fq => \"#{SolrDocument.unique_key}:\\\"#{self[blacklight_config.collection_member_identifying_field].first}\\\"\"\n }\n )[\"response\"][\"docs\"].first\n )\n end", "def collection\n database[collection_name]\n end", "def collection\n @collection ||= load_collection\n end", "def collection\n @collection ||= mongo.collection(Boom.config.attributes[\"mongodb\"][\"collection\"])\n end", "def collection\n if @collection.kind_of? Proc\n @collection = @collection.call\n ensure_indices if @collection.kind_of? Mongo::Collection\n end\n return @collection\n end", "def collections_coll\n settings.db['collections']\n end", "def collection(name = EM::Mongo::DEFAULT_NS)\n @collections[name] ||= EM::Mongo::Collection.new(@db_name, name, @em_connection)\n end", "def _collection(name)\n @collections[name] ||= Dynamodb::Collection.new(\n @client,\n Lotus::Model::Adapters::Dynamodb::Coercer.new(_mapped_collection(name)),\n name,\n _identity(name),\n )\n end", "def collection\n connection.db[table_name]\n end", "def collection\n klass.collection\n end", "def [](name)\n name = \"#{self.name}.#{name}\"\n return Collection.new(name, db) if !db.strict? ||\n db.collection_names.include?(name.to_s)\n raise \"Collection #{name} doesn't exist. Currently in strict mode.\"\n end", "def collection\n self.class.collection\n end", "def collection\n self.class.collection\n end", "def collection(collection_name)\n Collection.new(@backend, @bucket_name, @name, collection_name)\n end", "def collection\n Rails.logger.info \"XXXXX COLLECTION NAME #{collection_hash['collection name']}\"\n\n @collection ||= CollectionCreator.find_or_create_collection(\n collection_hash['collection name'],\n collection_hash['unit name'],\n collection_hash['collection description'],\n submitter_user_key\n )\n end", "def db\n collection.db\n end", "def db\n collection.db\n end", "def db\n collection.db\n end", "def collection\n klass.collection\n end", "def collection(name=nil)\n if name\n @collection = db.collection(name: name)\n else\n @collection || raise('Please give a collection name for this model')\n end\n end", "def [](collection_name)\n Collection.new(self, collection_name)\n end", "def build_collection\n bucket = cluster.bucket(@couchbase_options[:bucket])\n if @couchbase_options[:scope] && @couchbase_options[:collection]\n bucket.scope(@couchbase_options[:scope]).collection(@couchbase_options[:collection])\n else\n bucket.default_collection\n end\n end", "def new_collection\n Models::Collection.new\n end", "def collection\n document._root.collection\n end", "def existing_collections\n query = \"select $object $title from <#ri> \" +\n \"where $object <fedora-model:label> $title \" +\n \"and $object <fedora-model:hasModel> <info:fedora/islandora:collectionCModel>\"\n\n @repository.itql(query).map{ |row| row[0] }\n end", "def initialize\n @coll = self.class.collection\n end", "def get_parent_collection()\n return XMLDBApi::RedCollection.new(@db_id, @coll_service.get_collection_id, @coll_service.get_collection_name)\n end", "def collection\n instance_variable_get(collection_name) || set_collection(find_collection)\n end", "def collection\n get_collection_ivar || begin\n set_collection_ivar class_name.all\n end\n end", "def collection\n @collection ||= collection_values\n end", "def select_collection(name)\n\t\t@collection = @userdb.collection(name)\n\tend", "def collection\n return @client.api_helper.collection(\"projects\")\n end", "def collection\n @collector.collection\n end", "def initialize\n @coll=self.class.collection\n end", "def default_collection\n Collection.new(@backend, @name, \"_default\", \"_default\")\n end", "def _collection(name)\n @collections[name] ||= Memory::Collection.new(name, _identity(name))\n end", "def get_collection(database_id:, collection_id:)\n path = '/databases/{databaseId}/collections/{collectionId}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'GET',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Collection\n )\n end", "def collection\n return @client.api_helper.collection(\"items\")\n end", "def collection(slug, options)\n _get(\"v1/collections/\" + slug, options)\n end", "def collections\n Collection.find(:all, :find_through => [N::DCT.hasPart, self])\n end", "def set_collection\n self._collection = Mongoid::Collection.new(self, self.collection_name)\n end", "def collections\n with_caching({}, 'collections') do\n sibling_nodes_for('collection').map {|n| Collection.new(n, authentication_options) }\n end\n end", "def [](collection_name)\n collection(collection_name)\n end", "def collections\n collection_names.map do |name|\n Collection.new(name, self)\n end\n end", "def collection\n mongo_session[collection_name]\n end", "def collection_by_name(collection_name)\n if is_db_selected?\n @razor_database.collection(collection_name.to_s)\n else\n raise \"DB appears to be down\"\n end\n end", "def collection\n unless @collection\n @collection = @connection.use(@database_name)[\"sunspot_index_queue_entries\"]\n\n @collection.indexes.create_one(:record_class_name => 1, :record_id => 1)\n @collection.indexes.create_one(:priority => -1, :record_class_name => 1, :run_at => 1, :lock => 1)\n end\n\n @collection\n end", "def get_flexi_collection\n _find_or_update_or_build_collection!\n\n self._flexi_collection\n end", "def collection\n raise(NotImplementedError, '#collection must be defined in the TypicalSituation implementation.')\n end", "def collection_details(db, coll_name)\n if (result = db.collection('__METADATA__').find_one('_id' => coll_name)) == nil\n raise \"collection does not exist\"\n end\n return result\n end", "def get_collection(name)\n @data[name]\n end", "def collection(name)\n Kernel.const_get(\"#{name}Collection\").new(@browser)\n end", "def col\n volatile[:collection] ||= Collection.find(collection_id)\n end", "def collections\n return self.root_collection.subcollections\n end", "def make_collection\n raise NotImplementedError\n end", "def collection\n mongo_session[collection_name]\n end", "def getParentCollection() \n return XMLDB::Base::Collection.getInstance(@obj.getParentCollection())\n end", "def collection; end", "def collection; end", "def collections_info(coll_name=nil)\n selector = {}\n selector[:name] = full_collection_name(coll_name) if coll_name\n Cursor.new(Collection.new(SYSTEM_NAMESPACE_COLLECTION, self), :selector => selector)\n end", "def collections_info(coll_name=nil)\n selector = {}\n selector[:name] = full_collection_name(coll_name) if coll_name\n Cursor.new(EM::Mongo::Collection.new(@db_name, SYSTEM_NAMESPACE_COLLECTION, @em_connection), :selector => selector)\n end", "def collection(collection_name)\n default_scope.collection(collection_name)\n end", "def all_collections\n @all_collections ||= Blacklight.solr.select(\n :params => {\n :fq => \"#{blacklight_config.collection_identifying_field}:\\\"#{blacklight_config.collection_identifying_value}\\\"\",\n :rows => \"10\"\n }\n )[\"response\"][\"docs\"].map do |document|\n SolrDocument.new(document)\n end\n end", "def collection_type\n Deprecation.warn(\"'##{__method__}' will be removed in Hyrax 4.0. \" \\\n \"Instead, use Hyrax::CollectionType.for(collection: collection).\")\n @collection_type ||= Hyrax::CollectionType.find_by_gid!(collection_type_gid)\n end", "def getEdgeCollections\r\n result = request(\"GET\", \"edge\", key: :collections)\r\n return result if @database.server.async != false\r\n return result if return_directly?(result)\r\n result.map{|r| Arango::Collection.new(database: @database, name: r, type: :edge)}\r\n end", "def collections; end", "def collection\n @options[:collection] if @options.key?(:collection)\n end", "def getCollections\n Community.getCollections(dso)\n end", "def fetch(options = {})\n validate_collection_options(options)\n\n collection_class.new(client.get(base_uri, options).body, client)\n end", "def make_collection\n @resource.make_collection\n end", "def collection_base_class\n File.exists?(Rails.root.join('app/assets/javascripts/shared/core_extentions/collections_extentions.coffee')) ? 'Backbone.ExtendedCollection' : 'Backbone.Collection'\n end", "def ocollection\n @@_collection[self.class.name].name\n end", "def member_collections\n collections\n end", "def collections(what)\n list = []\n collections = what == 'all' ? all_collections() : local_collections()\n collections.each do |collection|\n model = collection.classify.constantize rescue nil\n next if model.nil?\n next unless model.respond_to?(:mongo_client)\n record = {'id' => collection, 'description' => I18n.t(\"helpers.label.#{collection}.tabletitle\") } \n list << [record, model_fields(collection)]\n end\n list\nend", "def collections\n @collections ||= collection_names.each_with_object({}) do |name, hsh|\n hsh[name] = Jekyll::Collection.new(self, name)\n end\n end", "def collection_class\n OneToMany::Collection\n end", "def collection_class\n OneToMany::Collection\n end", "def collection_name; end", "def collection_name; end", "def collection_name; end", "def collection(objectName)\n Hirsute::Collection.new(objectName)\nend", "def collection\n @collection.is_a?(Proc) ? @collection.call : @collection\n end", "def get_collection_id()\r\n return @coll_id\r\n end", "def all\n @collection ||= Collection.new model_name\n end", "def select_collection(name)\n\t\t@collection = @recommend_datadb.collection(name)\n\tend", "def collection\n @collection ||= google_session.collection_by_title('riskcovry_uploads')\n end", "def list_collections(db)\n return db.collection('__METADATA__').find({'_id' => {'$ne'=> '__METADATA__'}}, {:fields => '_id'}).map {|c| c['_id']}\n end", "def collection\n if @collection.empty? && @loaded == false\n @collection = forward( :\"#{@key}_fetch!\" ) || @collection || []\n @loaded = true\n end\n\n @collection\n end", "def orchestrate_collection_name\n ocollection\n end", "def orchestrate_collection_name\n ocollection\n end", "def collection(options={})\n response = client.get(api_path, options)\n\n if response.success?\n collection = []\n\n response.body.each do |json|\n collection << new(json)\n end\n\n collection\n else\n []\n end\n end", "def collection\n components.values.last[:collection]\n end", "def collection_members\n return nil unless collection?\n @collection_members ||= CollectionMembers.new(\n Blacklight.solr.select(\n :params => {\n :fq => \"#{blacklight_config.collection_member_identifying_field}:\\\"#{self[SolrDocument.unique_key]}\\\"\",\n :rows => blacklight_config.collection_member_grid_items.to_s\n }\n )\n )\n end", "def [](collection_name, options = {})\n database[collection_name, options]\n end" ]
[ "0.77548736", "0.75899637", "0.7507125", "0.7496576", "0.7479419", "0.73512304", "0.7310169", "0.72744805", "0.726776", "0.7264631", "0.7139148", "0.7103905", "0.7050674", "0.702575", "0.6961634", "0.6953748", "0.69424254", "0.68506646", "0.68506646", "0.6803446", "0.6801915", "0.6763358", "0.6763358", "0.6763358", "0.676181", "0.6749267", "0.6722487", "0.6692927", "0.6653632", "0.65662354", "0.6563211", "0.65099835", "0.6507071", "0.64989525", "0.6404201", "0.6378108", "0.6353045", "0.6339095", "0.63358194", "0.632382", "0.631802", "0.62947416", "0.6291397", "0.62604505", "0.6257333", "0.6256676", "0.62501043", "0.62488794", "0.62322366", "0.6226868", "0.62241304", "0.6216776", "0.6193428", "0.6191162", "0.6180683", "0.61622745", "0.61606824", "0.61346525", "0.61151475", "0.61051", "0.609765", "0.6088893", "0.60805094", "0.60533726", "0.60533726", "0.6039384", "0.60355276", "0.60291827", "0.6024298", "0.6022276", "0.60163045", "0.60125744", "0.60036033", "0.5993939", "0.5973201", "0.5958223", "0.5940219", "0.59350187", "0.5925958", "0.589996", "0.5880975", "0.58788", "0.58788", "0.5874239", "0.5874239", "0.5874239", "0.58712775", "0.5869319", "0.5868069", "0.5859754", "0.58583397", "0.58575255", "0.585057", "0.5828966", "0.5811049", "0.5811049", "0.58103645", "0.5810362", "0.58079475", "0.5807473" ]
0.82306665
0
We rewrite the provided canvas ids to: ensure it exists in the manifest (if they don't, mirador puts the user into a weird initial state) rewrite precocina canvas ids to postcocina canvas ids as appropriate (to avoid breaking embeds that used to work) rubocop:disable Metrics/AbcSize
def canvas_id return if request.canvas_id.blank? if canvases.any? { |canvas| canvas['@id'] == request.canvas_id } request.canvas_id elsif cocinafied_canvases? && request.canvas_id.exclude?('cocina-fileSet') cocinafied_canvas_id else Honeybadger.notify( "Unable to find requested canvas id '#{request.canvas_id}' in manifest for #{purl_object.druid}" ) nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMultipleCanvas\n # @annotationIn['canvas'] = '|'\n # @annotationIn['on'].each do |on|\n # @annotationIn['canvas'] += on['full'] + '|'\n # end\n # return @annotationIn['canvas']\n\n @annotationIn['on'][0]['full']\n end", "def configureCanvasProvider(config_hash)\n logger.error \"@@@@@@@@@@@@@ must specify one canvas data provider\" unless verifyExactlyOneProvider(config_hash, [:data_provider_file_directory, :canvas_esb_application_name, :canvas_http_application_name])\n configureCanvasFileProvider(config_hash) unless (config_hash[:data_provider_file_directory].nil?)\n configureCanvasESBProvider(config_hash) unless (config_hash[:canvas_esb_application_name].nil?)\n configureCanvasHTTPProvider(config_hash) unless (config_hash[:canvas_http_application_name].nil?)\n end", "def set_canvas_frame(canvasFrame_wnd)\r\n canvasFrame = FXVerticalFrame.new(canvasFrame_wnd, FRAME_THICK|LAYOUT_FILL_Y|LAYOUT_TOP|LAYOUT_LEFT)\r\n canvasFrame.create\r\n \r\n #p \"**** set frame...\"\r\n if @game_cmd_bt_list.size > 0 \r\n # send canvas size changed\r\n @app_owner.activate_canvas_frame\r\n return\r\n end\r\n \r\n label_wnd = FXLabel.new(canvasFrame, \"Comandi gioco \", nil, JUSTIFY_LEFT|LAYOUT_FILL_X)\r\n label_wnd.create\r\n \r\n bt_wnd_list = []\r\n bt_wnd_list << FXButton.new(canvasFrame, \"uno\", @app_owner.icons_app[:numero_uno], nil, 0,FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_BOTTOM|LAYOUT_LEFT,0, 0, 0, 0, 10, 10, 5, 5)\r\n bt_wnd_list << FXButton.new(canvasFrame, \"due\", @app_owner.icons_app[:numero_due], nil, 0,FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_BOTTOM|LAYOUT_LEFT,0, 0, 0, 0, 10, 10, 5, 5)\r\n bt_wnd_list << FXButton.new(canvasFrame, \"tre\", @app_owner.icons_app[:numero_tre], nil, 0,FRAME_THICK|FRAME_RAISED|LAYOUT_FILL_X|LAYOUT_BOTTOM|LAYOUT_LEFT,0, 0, 0, 0, 10, 10, 5, 5)\r\n \r\n bt_wnd_list.each do |bt_wnd|\r\n bt_wnd.iconPosition = (bt_wnd.iconPosition|ICON_BEFORE_TEXT) & ~ICON_AFTER_TEXT\r\n bt_hash = {:bt_wnd => bt_wnd, :status => :not_used}\r\n @game_cmd_bt_list << bt_hash\r\n bt_wnd.create\r\n end\r\n free_all_btcmd # hide all commands buttons\r\n \r\n # send canvas size changed\r\n @app_owner.activate_canvas_frame\r\n end", "def getAnnoWOriginalCanvas inputAnno\n return if inputAnno.nil?\n p \"in getAnnoWOriginalCanvas: current anno_id: #{inputAnno.annotation_id} and current canvas: #{inputAnno.canvas}\"\n return(inputAnno) if (inputAnno.canvas.to_s.include?('/canvas/'))\n\n #targetAnnotation = Annotation.where(canvas:inputAnno.canvas).first\n targetAnnotation = Annotation.where(annotation_id:inputAnno.canvas).first\n\n getAnnoWOriginalCanvas targetAnnotation\n end", "def canvas_builder\n IIIFManifest::ManifestServiceLocator::InjectedFactory.new(\n ::ManifestBuilder::CanvasBuilder,\n iiif_canvas_factory: iiif_canvas_factory,\n image_builder: image_builder\n )\n end", "def _prepare_canvas(t, canvas)\n canvas.xc @color[t].to_imagemagick\n end", "def setCanvasSize\n if @intTargetX.to_s.to_i > 20 and @intTargetY.to_s.to_i > 20\n puts('setting new dimetions')\n @canvasRefrance.resizeCanvas(@intTargetY.to_s.to_i,@intTargetX.to_s.to_i)\n else \n puts('setting defult dimentions')\n @canvasRefrance.resizeCanvas(@minDimensions,@minDimensions)\n end\n end", "def image_ids_labels_from_manifest_as_hash(manifest)\n ids_labels = []\n page_number = 0\n manifest.sequences.first.canvases.each do |canvas|\n page_number += 1\n id = canvas.images.first.resource.service['@id']\n label = if canvas['label'].nil?\n \"Page #{page_number}\"\n else\n canvas['label']\n end\n ids_labels << { 'id' => strip_iiif_server_base_from_id(id), 'label' => label }\n end\n ids_labels\n end", "def choose_canvas_id(sir_trevor_block)\n sir_trevor_block&.items&.dig(0, 'iiif_canvas_id') if sir_trevor_block.respond_to? :items\n end", "def in_canvas?\n !!env['facebook.in_canvas']\n end", "def getTargetingAnnosCanvas inputAnno\n return if inputAnno.nil?\n p \"in getTargetingAnnosCanvas: current anno_id: #{inputAnno.annotation_id} and current canvas: #{inputAnno.canvas}\"\n return(inputAnno.canvas) if (inputAnno.canvas.to_s.include?('/canvas/'))\n\n #targetAnnotation = Annotation.where(canvas:inputAnno.canvas).first\n targetAnnotation = Annotation.where(annotation_id:inputAnno.canvas).first\n\n getTargetingAnnosCanvas targetAnnotation\n end", "def sanitize_question_ids\n # question_id is something only we should be able to change.\n # It is included in params so that we can set question_id\n # as part of updating nested attributes.\n # We check for 'empty' to prevent errors, in case no questions\n # (and thus no answers) are added to the system yet.\n unless @questions.empty? || params[\"user_key\"][\"express_app_attributes\"]\n params[:user_key][:answers_attributes].each{|k,v| v[:question_id] = nil}\n # The index of the answer is used to check which question the answer goes to.\n @questions.each_with_index{|q,i| params[:user_key][:answers_attributes][i.to_s][:question_id] = q.id}\n end\n # Any extra answers that the user hacked in will error out due to missing a question_id.\n end", "def make_canvas_interop_user(email, canvas_user_id = nil)\n # The canvas user id ought not be nil since the user does exist,\n # but the exact ID isn't important on staging since this is just\n # for sign on which is based on matching email addresses instead of\n # canvas API actions which would need the ID.\n #\n # So since we don't need it and staging is subject to change frequently,\n # it isn't worth the maintenance hassle to actually sync those up.\n #\n # But zero instead of nil at least tells the system that they *are*\n # users in canvas, and thus it is safe to redirect them there upon logging in.\n canvas_user = User.new(email: email, password: 'test1234', first_name: email, last_name: 'Canvas', canvas_user_id: canvas_user_id)\n canvas_user.skip_confirmation!\n canvas_user.save!\nend", "def make_canvas_interop_user(email, canvas_user_id = nil)\n # The canvas user id ought not be nil since the user does exist,\n # but the exact ID isn't important on staging since this is just\n # for sign on which is based on matching email addresses instead of\n # canvas API actions which would need the ID.\n #\n # So since we don't need it and staging is subject to change frequently,\n # it isn't worth the maintenance hassle to actually sync those up.\n #\n # But zero instead of nil at least tells the system that they *are*\n # users in canvas, and thus it is safe to redirect them there upon logging in.\n canvas_user = User.new(email: email, password: 'test1234', first_name: email, last_name: 'Canvas', canvas_user_id: canvas_user_id)\n canvas_user.skip_confirmation!\n canvas_user.save!\nend", "def sanitize_nccic_ids?\n return false if User.current_user.nil?\n if AppUtilities.is_ciap_dms_1b_or_1c_arch?\n # In the DMS 1b+ architecture, CIAP performs all sanitization. To\n # determine if a file came from an AIS provider, the\n # Ingest.is_ais_provider_user? method is used to check if the current\n # username for this session matches one of the comma-separated usernames\n # in the AIS_PROVIDER setting.\n Ingest.is_ais_provider_user?(User.current_user)\n elsif AppUtilities.is_ecis_legacy_arch?\n # In the legacy architecture, ECIS performs all sanitization. To\n # determine if a file came from an AIS provider, the\n # Ingest.is_ais_provider_user? method is used to check if the current\n # username for this session matches one of the comma-separated usernames\n # in the AIS_PROVIDER setting if this setting is defined as a\n # performance enhancement. If that test fails, it will check if the\n # current user's api key matches the the api key of the\n # user for replications of the \"stix_forward\" repl_type.\n Ingest.is_ais_provider_user?(User.current_user) ||\n Replication.where(repl_type: 'stix_forward',\n api_key: User.current_user.api_key).first.present?\n else\n # Sanitization does not occur on CIAP in the legacy architecture or on\n # ECIS in the DMS 1b+ architecture so return false.\n false\n end\n end", "def check_custom_assign_ids\n skill_to_pose_hash = bat.cust_skill_pose\n if skill_to_pose_hash != nil\n pose = skill_to_pose_hash[@character.animation_id]\n if pose != nil\n @character.set_pose(pose-1)\n @character.animation_id = 0 #clear animation id since we have handled it\n end\n end\n end", "def canvas(suffix)\n \"http://apps.facebook.com/\" + ENV['FACEBOOKER_RELATIVE_URL_ROOT'] + suffix\n end", "def root_canvas=(cvs)\n @overlay_pod.children.remove @cur_canvas.ui if @cur_canvas\n @overlay_pod.children.add 0, cvs.ui\n raise \"overlay pod has #{@overlay_pod.children.length} children instead of expected 5\" unless @overlay_pod.children.length == 5\n @cur_canvas = cvs\n cvs.ui.min_width_property.bind(@spain.width_property.subtract(2.0))\n cvs.ui.min_height_property.bind(@spain.height_property.subtract(2.0))\n cvs.ui.pref_width = -1 # autosize\n cvs.ui.pref_height = -1 # autosize\n @overlay_pod.pref_width_property.bind cvs.ui.width_property\n @overlay_pod.pref_height_property.bind cvs.ui.height_property\n @layout_managers[cvs.pane] = cvs.layout_manager\n @layout_managers[cvs.ui] = cvs.layout_manager\n cvs.ui.setOnDragDropped &method(:drag_drop)\n cvs.ui.setOnDragOver &method(:drag_over)\n cvs.ui.setOnMouseReleased &method(:canvas_click)\n end", "def find_image_ids(doc)\n if doc.namespaces.include? 'xmlns:w' and doc.xpath(\"//w:drawing\").any?\n @images.each do |image|\n\n doc.xpath(\"//w:drawing//wp:docPr[@title='#{image.name}']/following-sibling::*\").xpath(\".//a:blip\", {'a' => \"http://schemas.openxmlformats.org/drawingml/2006/main\"}).each do |img|\n image.id = img.attributes['embed'].value\n end\n end # existing_images loop\n end\n end", "def responsive_embed_code_css\n <<~END\n #fulcrum-embed-outer-#{id} {\n width:auto;\n page-break-inside:avoid;\n -webkit-column-break-inside:avoid;\n break-inside:avoid;\n max-width:#{embed_width}px;\n margin:auto;\n background-color:#000;\n }\n #fulcrum-embed-inner-#{id} {\n overflow:hidden;\n padding-bottom:#{padding_bottom}%;\n position:relative; height:0;\n }\n iframe#fulcrum-embed-iframe-#{id} {\n overflow:hidden;\n border-width:0;\n left:0; top:0;\n width:100%;\n height:100%;\n position:absolute;\n }\n END\n end", "def embed_code_css\n if video? || image? || interactive_map?\n responsive_embed_code_css\n elsif audio?\n audio_embed_code_css\n end\n end", "def assigned_theme_ids(is_preview = false)\n if @theme_ids.nil?\n @theme_ids = []\n @theme_ids << find_theme_id(is_preview)\n @theme_ids << find_theme_id(is_preview, is_detail = true)\n end\n @theme_ids\n end", "def canvas_api(\n application_instance: current_application_instance,\n user: current_user,\n canvas_course: current_canvas_course,\n prefer_user: false\n )\n Integrations::CanvasApiSupport.new(user, canvas_course, application_instance, prefer_user).api\n end", "def canvas_environments!(params = {})\n set_canvas_ext_param(:environments, params)\n end", "def update!(**args)\n @frame_blob_refs = args[:frame_blob_refs] if args.key?(:frame_blob_refs)\n @frame_file_list = args[:frame_file_list] if args.key?(:frame_file_list)\n @frame_type_generated = args[:frame_type_generated] if args.key?(:frame_type_generated)\n @generated_from_drishti_thumbnailer = args[:generated_from_drishti_thumbnailer] if args.key?(:generated_from_drishti_thumbnailer)\n @high_res_preview_thumbnail_generated = args[:high_res_preview_thumbnail_generated] if args.key?(:high_res_preview_thumbnail_generated)\n @hq720_generated = args[:hq720_generated] if args.key?(:hq720_generated)\n @hqdefault_generated = args[:hqdefault_generated] if args.key?(:hqdefault_generated)\n @hvc_backup_generated = args[:hvc_backup_generated] if args.key?(:hvc_backup_generated)\n @improved_vertical_generated = args[:improved_vertical_generated] if args.key?(:improved_vertical_generated)\n @maxresdefault_generated = args[:maxresdefault_generated] if args.key?(:maxresdefault_generated)\n @maxresdefault_height = args[:maxresdefault_height] if args.key?(:maxresdefault_height)\n @maxresdefault_width = args[:maxresdefault_width] if args.key?(:maxresdefault_width)\n @moving_thumbnail_generated = args[:moving_thumbnail_generated] if args.key?(:moving_thumbnail_generated)\n @private_thumbnails_generated = args[:private_thumbnails_generated] if args.key?(:private_thumbnails_generated)\n @public_thumbnails_generated = args[:public_thumbnails_generated] if args.key?(:public_thumbnails_generated)\n @rerun_status = args[:rerun_status] if args.key?(:rerun_status)\n @sddefault_generated = args[:sddefault_generated] if args.key?(:sddefault_generated)\n @storyboard_generated = args[:storyboard_generated] if args.key?(:storyboard_generated)\n @storyboard_num_levels = args[:storyboard_num_levels] if args.key?(:storyboard_num_levels)\n @storyboard_policy = args[:storyboard_policy] if args.key?(:storyboard_policy)\n @storyboard_version = args[:storyboard_version] if args.key?(:storyboard_version)\n @storyboard_video_duration_ms = args[:storyboard_video_duration_ms] if args.key?(:storyboard_video_duration_ms)\n @storyboard_video_height = args[:storyboard_video_height] if args.key?(:storyboard_video_height)\n @storyboard_video_width = args[:storyboard_video_width] if args.key?(:storyboard_video_width)\n @webp_generated = args[:webp_generated] if args.key?(:webp_generated)\n end", "def handle_asset_gatekeeper_ids\n handle_admin_role_ids Seek::Roles::ASSET_GATEKEEPER\n end", "def handle_asset_gatekeeper_ids\n handle_admin_role_ids Seek::Roles::ASSET_GATEKEEPER\n end", "def updateCanvas\n canvas.update\n end", "def remove_pre_mongified_ids\n self.copy_tables.each do |t|\n Mongify::Status.publish('remove_pre_mongified', :size => 1, :name => \"Removing pre_mongified_id #{t.name}\", :action => 'add')\n no_sql_connection.remove_pre_mongified_ids(t.name)\n Mongify::Status.publish('remove_pre_mongified', :action => 'finish')\n end\n end", "def attach_mode_icons itineraries\n modes = []\n #Which mode icons should we attach logos for?\n itineraries.each do |itin|\n modes << itin.mode_array\n end\n modes.flatten!.uniq!\n \n modes.each do |mode|\n path = ActionController::Base.helpers.asset_path(\"#{mode.downcase}.png\").to_s\n attachments.inline[\"#{mode.downcase}.png\"] = open(\"#{Setting.host}#{path}\", 'rb').read\n end\n end", "def precompile_assets=(_arg0); end", "def add_axis_ids(params) # :nodoc:\n chart_id = 1 + @id\n axis_count = 1 + @axis2_ids.size + @axis_ids.size\n\n id1 = sprintf('5%03d%04d', chart_id, axis_count)\n id2 = sprintf('5%03d%04d', chart_id, axis_count + 1)\n\n if ptrue?(params[:primary_axes])\n @axis_ids << id1 << id2\n else\n @axis2_ids << id1 << id2\n end\n end", "def manifest\n anno = IIIF::Presentation::Annotation.new('on' => path)\n anno.resource = create_resource\n canvas.images << anno\n canvas.other_content = [annotations]\n manifest = IIIF::Presentation::Manifest.new(\n '@id' => path,\n 'label' => \"Histonets - Collection Template #{id}\"\n )\n sequence.canvases << canvas\n manifest.sequences << sequence\n manifest\n end", "def example_canvas (options={}, &block)\n\t\t\tbase_options = DefaultOptions.merge(options)\n\t\t\t\n\t\t\t# ensure equal randomness\n\t\t\tbase_seed = srand()\n\t\t\t['.png','.pdf'].each do |ext|\n\t\t\t\texample_canvas_internal({:base_seed => base_seed, :extension => ext, :canvas_options => base_options}, &block).save\n\t\t\tend\n\t\t\t%x[open \"#{ExampleHelper.output_dir}\"]\n\t\tend", "def doPreprocess(followersIds)\n end", "def switch_to_canvas_iframe(driver)\n hide_canvas_footer\n wait_until { driver.find_element(id: 'tool_content') }\n driver.switch_to.frame driver.find_element(id: 'tool_content')\n end", "def init_canvas(spawn_factor)\n $canvas = Array.new($height) { Array.new($width) { Random.new.rand(1...100) < spawn_factor ? 1 : 0 } }\nend", "def call(attachments)\n Attachment.where({canvas_user_id: attachment_conf[:canvas_user_id], submission_id: attachment_conf[:submission_id]}).\n delete_all\n attachments.each do |attachment|\n Attachment.create(attachment_conf.merge({date: Time.parse(attachment['updated_at']),\n attachment_id: attachment['id'], image_url: attachment['url'], content_type: attachment['content-type']})\n )\n end\n end", "def attachment_ids=(new_ids)\n super Attachment.where(:id => new_ids).where(post_id: nil).pluck(:id)\n end", "def update!(**args)\n @kids_mode_enabled = args[:kids_mode_enabled] if args.key?(:kids_mode_enabled)\n @obfuscated_gaia_id = args[:obfuscated_gaia_id] if args.key?(:obfuscated_gaia_id)\n end", "def api_v1_canvas_params\n params.permit(:name, :diagram_id)\n end", "def make_plots(pars,cov_matrix)\n PWA::Dataset.each{|dataset|\n\tnext unless dataset.type == :evt\n\tcind = @canvases.length\n @canvases.push ::TCanvas.new(\"dsigma_canvas_#{cind}\",'',25 + 50*cind,\n 25,500,500)\n\t@canvases.last.cd\n\tgPad.SetLogy if @log\n\tname = \"#{dataset.name}_#{@kv}\"\n\t#\n\t# data histo\n\t#\n\ttitle,num_bins,min,max,bins,bin_errors = dataset.histo_bins([@kv],pars,\n\t\t\t\t\t\t\t\t :unwtd,\n\t\t\t\t\t\t\t\t :data)\n\th_data = TH1F.new(\"h_#{name}_data\",name,num_bins,min,max)\n\th_data.Sumw2\n\tbins.each_index{|b| \n\t h_data.SetBinContent(b+1,bins[b])\n\t h_data.SetBinError(b+1,bin_errors[b])\n\t}\n\th_data.GetXaxis.SetTitle title\n\th_dsigma = TH1F.new(\"h_#{name}_dsigma\",name,num_bins,min,max)\n\th_dsigma.Sumw2\n\tbins.each_index{|b| \n\t h_dsigma.SetBinContent(b+1,bins[b])\n\t h_dsigma.SetBinError(b+1,bin_errors[b])\n\t}\n\th_dsigma.GetXaxis.SetTitle title\n\t#\n\t# acc histo\n\t#\n\tdataset.read_in_amps(PWA::ParIDs.max_id,:acc)\n\tdataset.read_in_norm(:acc)\n\tacc_yield = dataset.calc_yield(pars,'.',:acc)\n\ttitle,num_bins,min,max,bins,bin_errors = dataset.histo_bins([@kv],pars,'.',:acc)\n\th_acc = TH1F.new(\"h_#{name}_acc\",name,num_bins,min,max)\n\th_acc.Sumw2\n\tbins.each_index{|b| \n\t h_acc.SetBinContent(b+1,bins[b])\n\t h_acc.SetBinError(b+1,bin_errors[b])\n\t}\n\th_acc.GetXaxis.SetTitle title\n\tintegral = h_acc.Integral\n\th_acc.Scale(acc_yield/integral) if(integral > 0)\n\t#\n\t# raw histo\n\t#\n\tdataset.read_in_amps(PWA::ParIDs.max_id,:raw)\n\tdataset.read_in_norm(:raw)\n\traw_yield = dataset.calc_yield(pars,'.',:raw)\n\ttitle,num_bins,min,max,bins,bin_errors = dataset.histo_bins([@kv],pars,'.',:raw)\n\th_raw = TH1F.new(\"h_#{name}_raw\",name,num_bins,min,max)\n\th_raw.Sumw2\n\tbins.each_index{|b| \n\t h_raw.SetBinContent(b+1,bins[b])\n\t h_raw.SetBinError(b+1,bin_errors[b])\n\t}\n\th_raw.GetXaxis.SetTitle title\n\tintegral = h_raw.Integral\n\th_raw.Scale(raw_yield/integral) if(integral > 0)\n @histos.push h_acc\n @histos.push h_raw\n #\n\t# get dsigma\n\t#\n\th_dsigma.Divide(h_acc) \n\th_dsigma.Multiply(h_raw)\n\trange = max - min\n\th_dsigma.Scale(num_bins/range)\n #\n # get normalization error\n #\n rel_err_norm = dataset.get_norm_rel_err\n\t#\n\t# make the graph\n\t#\n\tx,y,xerr,yerr = [],[],[],[]\n\tnum_bins = h_dsigma.GetNbinsX\n\tnum_pts = num_bins\n\tnum_pts = @num_pts unless @num_pts.nil?\n\tnum_pts.times{|p|\n\t dsigma,error2,non_zero_bins,centroid = 0,0,0,0\n\t (num_bins/num_pts).times{|b|\n\t bin = (num_bins/num_pts)*p + b + 1\n\t bin_content = h_dsigma.GetBinContent(bin)\n\t bin_error = h_dsigma.GetBinError(bin)\n\t next unless bin_content > 0\n\t non_zero_bins += 1\n\t dsigma += bin_content\n\t error2 += bin_error**2\n\t centroid += h_dsigma.GetBinCenter(bin)\n\t }\n\t next if(non_zero_bins == 0)\n\t x.push centroid/non_zero_bins.to_f\n\t xerr.push 0.5*non_zero_bins*(range/num_bins.to_f)\n\t y.push dsigma/non_zero_bins.to_f\n err2 = error2 + (rel_err_norm*dsigma)**2\n\t yerr.push Math.sqrt(err2)/non_zero_bins.to_f\t \n\t}\n\tgr_sigma = TGraphErrors.new(x.length,x,y,xerr,yerr)\n\twbin = *(dataset.name.match(/Wbin\\d+-\\d+/))\n\tgr_sigma.SetName \"gr_#{name}_#{wbin}\"\n\ttitle = wbin\n\tgr_sigma.SetTitle title\n\tgr_sigma.SetMarkerStyle 20\n\tgr_sigma.Draw 'ap'\n\t@graphs.push gr_sigma\n\tgPad.Update\n }\n end", "def invalid_pixels_canvas_dimension\n invalid_canvas = []\n 600.times do\n invalid_row = []\n 600.times do\n invalid_row.push \n {\n r: 100,\n g: 150,\n b: 200,\n a: 1\n }\n end\n invalid_canvas.push invalid_row\n end\n return invalid_canvas\nend", "def pbSelectAnim(canvas,animwin)\r\n animfiles=[]\r\n pbRgssChdir(File.join(\"Graphics\", \"Animations\")) {\r\n animfiles.concat(Dir.glob(\"*.png\"))\r\n }\r\n cmdwin=pbListWindow(animfiles,320)\r\n cmdwin.opacity=200\r\n cmdwin.height=512\r\n bmpwin=BitmapDisplayWindow.new(320,0,320,448)\r\n ctlwin=ControlWindow.new(320,448,320,64)\r\n cmdwin.viewport=canvas.viewport\r\n bmpwin.viewport=canvas.viewport\r\n ctlwin.viewport=canvas.viewport\r\n ctlwin.addSlider(_INTL(\"Hue:\"),0,359,0)\r\n loop do\r\n bmpwin.bitmapname=cmdwin.commands[cmdwin.index]\r\n Graphics.update\r\n Input.update\r\n cmdwin.update\r\n bmpwin.update\r\n ctlwin.update\r\n bmpwin.hue=ctlwin.value(0) if ctlwin.changed?(0)\r\n if Input.trigger?(Input::USE) && animfiles.length>0\r\n bitmap=AnimatedBitmap.new(\"Graphics/Animations/\"+cmdwin.commands[cmdwin.index],ctlwin.value(0)).deanimate\r\n canvas.animation.graphic=cmdwin.commands[cmdwin.index]\r\n canvas.animation.hue=ctlwin.value(0)\r\n canvas.animbitmap=bitmap\r\n animwin.animbitmap=bitmap\r\n break\r\n end\r\n if Input.trigger?(Input::BACK)\r\n break\r\n end\r\n end\r\n bmpwin.dispose\r\n cmdwin.dispose\r\n ctlwin.dispose\r\n return\r\nend", "def names_to_ids\n config['image_id'] = retrieve_image_id\n config['flavor_id'] = retrieve_flavor_id\n config['kernel_id'] = retrieve_kernel_id\n config['data_center_id'] = retrieve_data_center_id\n unless config['image_id'].nil? \\\n || config['flavor_id'].nil? \\\n || config['kernel_id'].nil? \\\n || config['data_center_id'].nil?\n\n self.save\n end\n end", "def create_ygo_embed(embed, card)\n embed.title = \"Card Info:\"\n embed.timestamp = Time.now\n\n embed.footer = Discordrb::Webhooks::EmbedFooter.new(\n text: \"YGOPRODECK\",\n icon_url: \"http://pluspng.com/img-png/yugioh-png-file-official-yu-gi-oh-logo-png-500.png\"\n )\n\n idx = get_card_idx(card)\n data = $card_catalog[0][idx]\n\n if [\"Spell Card\", \"Trap Card\"].include?(data[\"type\"])\n embed.add_field(\n name: \"Name:\",\n value: \"```#{data[\"name\"]}```\",\n inline: true\n )\n\n embed.add_field(\n name: \"Card Type:\",\n value: \"```#{data[\"type\"]}```\",\n inline: true\n )\n\n embed.add_field(\n name: \"#{data[\"type\"].split(' ')[0]} Type:\",\n value: \"```#{data[\"race\"]}```\",\n inline: true\n )\n\n if data[\"archetype\"] != nil\n embed.add_field(\n name: \"Archetype:\",\n value: \"```#{data[\"archetype\"]}```\",\n inline: true\n )\n end\n\n embed.add_field(\n name: \"Description:\",\n value: \"```#{data[\"desc\"]}```\",\n inline: true\n )\n else\n embed.add_field(\n name: \"Name:\",\n value: \"```#{data[\"name\"]}```\",\n inline: true\n )\n\n embed.add_field(\n name: \"Card Type:\",\n value: \"```#{data[\"type\"]}```\",\n inline: true\n )\n\n attribute = data[\"attribute\"].chars\n attribute = [attribute[0]] << attribute[1..-1].map(&:downcase)\n\n embed.add_field(\n name: \"Attribute:\",\n value: \"```#{attribute.join(\"\")}```\",\n inline: true\n )\n\n embed.add_field(\n name: \"Monster Type:\",\n value: \"```#{data[\"race\"]}```\",\n inline: true\n )\n\n if data[\"archetype\"] != nil\n embed.add_field(\n name: \"Archetype:\",\n value: \"```#{data[\"archetype\"]}```\",\n inline: true\n )\n else\n embed.add_field(\n name: \"Archetype:\",\n value: \"```-----```\",\n inline: true\n )\n end\n\n embed.add_field(\n name: \"Attack:\",\n value: \"```#{data[\"atk\"]}```\",\n inline: true\n )\n embed.add_field(\n name: \"Defense:\",\n value: \"```#{data[\"def\"]}```\",\n inline: true\n )\n embed.add_field(\n name: \"Level:\",\n value: \"```#{data[\"level\"]}```\",\n inline: true\n )\n\n embed.add_field(\n name: \"Description:\",\n value: \"```#{data[\"desc\"]}```\",\n inline: true\n )\n end\nend", "def signed_context\n signed_context = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), ENV['CANVAS_KEY'], @context)\nend", "def setCanvasDimensions(width, height)\n setCanvasWidth(width)\n setCanvasHeight(height)\n self\n end", "def build_canvas(lines_of_text_blocks)\n # Grab the greatest values for each line\n line_baseline = []\n line_height = []\n line_width = []\n lines_of_text_blocks.each_index do |i|\n baselines = (lines_of_text_blocks[i].sort { |a,b| a.baseline <=> b.baseline })\n heights = (lines_of_text_blocks[i].sort { |a,b| a.height <=> b.height })\n line_baseline << baselines.last.baseline\n line_height << heights.last.height - heights.last.line_spacing\n width = 0\n lines_of_text_blocks[i].each { |l| width += l.width }\n line_width << width\n end\n \n # set up canvas height and width\n @width = line_width.sort.last\n height = 0\n line_spacing_height = 0\n line_height.each { |h| height += h ; line_spacing_height += (h * (@options[:line_spacing] || 0)) }\n line_spacing_height -= (line_height.last * (@options[:line_spacing] || 0))\n @height = height + line_spacing_height\n \n options = nil\n if @options[:matte]\n options = @options.dup\n options[:bgcolor] = 'transparent'\n else\n options = @options\n end\n \n @canvas = IQ::Image::Canvas.new(@width, @height, options)\n \n # actually go through the lines and do stuff with them to make the canvas\n # for each line align each text block with the baseline\n top = 0\n lines_of_text_blocks.each_index do |i|\n left = 0\n lines_of_text_blocks[i].each do |text_block|\n offset = (line_baseline[i] - text_block.baseline)\n @canvas.overlay!(text_block.to_canvas, :dest_x => left, :dest_y => top + offset)\n left += text_block.width\n end\n top += line_height[i] + ((@options[:line_spacing] || 0) * line_height[i])\n end\n @canvas\n end", "def update_custo_in_teacher_matter(ids)\n puts \"=============ids=#{ids}\"\n unless ids.nil?\n ids.each do |id|\n unless id.blank?\n objrel=TeacherMatter.where(\"matter_id=#{self.id} and teacher_id=#{id}\").to_a[0]\n objrel.destroy!\n objrel=TeacherMatter.create!({matter_id: self.id, teacher_id: id, custo: SYLR::V_APP_CUSTO}) \n end\n end\n end\n end", "def precompile\n str = \"picture \" + @name + \";\\n\"\n @draw_commands.each do |d| \n str = str + d.compile + \"\\n\"\n end\n str = str + @name + \" := currentpicture; currentpicture := \" + @@org_picture + \";\\n\"\n end", "def pbSelectAnim(canvas,animwin)\n animfiles=[]\n pbRgssChdir(\".\\\\Graphics\\\\Animations\\\\\") {\n animfiles.concat(Dir.glob(\"*.png\"))\n }\n cmdwin=pbListWindow(animfiles,320)\n cmdwin.opacity=200\n cmdwin.height=512\n bmpwin=BitmapDisplayWindow.new(320,0,320,448)\n ctlwin=ControlWindow.new(320,448,320,64)\n cmdwin.viewport=canvas.viewport\n bmpwin.viewport=canvas.viewport\n ctlwin.viewport=canvas.viewport\n ctlwin.addSlider(_INTL(\"Hue:\"),0,359,0)\n loop do\n bmpwin.bitmapname=cmdwin.commands[cmdwin.index]\n Graphics.update\n Input.update\n cmdwin.update\n bmpwin.update\n ctlwin.update\n if ctlwin.changed?(0)\n bmpwin.hue=ctlwin.value(0)\n end\n if (Input.trigger?(Input::C) || (cmdwin.doubleclick? rescue false)) && animfiles.length>0\n bitmap=AnimatedBitmap.new(\"Graphics/Animations/\"+cmdwin.commands[cmdwin.index],ctlwin.value(0)).deanimate\n canvas.animation.graphic=cmdwin.commands[cmdwin.index]\n canvas.animation.hue=ctlwin.value(0)\n canvas.animbitmap=bitmap\n animwin.animbitmap=bitmap\n break\n end\n if Input.trigger?(Input::B)\n break\n end\n end\n bmpwin.dispose\n cmdwin.dispose\n ctlwin.dispose\n return\nend", "def handle_asset_housekeeper_ids\n handle_admin_role_ids Seek::Roles::ASSET_HOUSEKEEPER\n end", "def handle_asset_housekeeper_ids\n handle_admin_role_ids Seek::Roles::ASSET_HOUSEKEEPER\n end", "def add_axis_ids(params) # :nodoc:\n if ptrue?(params[:primary_axes])\n @axis_ids += ids\n else\n @axis2_ids += ids\n end\n end", "def update_custo_in_teacher_matter(ids)\n #puts \"=============ids=#{ids}\"\n unless ids.nil?\n ids.each do |id|\n unless id.blank?\n objrel=TeacherMatter.where(\"matter_id=#{id} and teacher_id=#{self.id}\").to_a[0]\n objrel.destroy!\n objrel=TeacherMatter.create!({matter_id: id, teacher_id: self.id, custo: SYLR::V_APP_CUSTO}) \n end\n end\n end\n end", "def save_server_ids_in_context(servers, overwrite=true)\n ids = servers.map {|s| s.identity}\n set_field(\"#{provider}_ids\", ids.concat(get_field(\"#{provider}_ids\") || []))\n set_field(\"cloud_ids\", ids.concat(get_field(\"cloud_ids\") || []))\n end", "def getTargetingAnnosCanvas inputAnno\n return if inputAnno.nil?\n return(inputAnno.canvas) if (inputAnno.canvas.to_s.include?('/canvas/'))\n targetAnnotation = Annotation.where(\"annotation_id like ? \", \"%#{inputAnno.canvas}%\").first\n\n\n if targetAnnotation.nil?\n return\n else\n getTargetingAnnosCanvas targetAnnotation\n end\n end", "def re_run\n\n # scrpt will have the javascript specification\n scrpt = String.new\n\n # add bootstrap container if it wasn't specified by the user\n @scene.create_grid((keys = @charts.keys).size, keys) if !@scene.specified?\n scrpt << @scene.bootstrap\n\n # add charts\n @charts.each do |name, chart|\n # add the chart specification\n scrpt << chart.js_spec if !chart.nil?\n end\n \n # render all charts\n scrpt += \"dc.renderAll();\"\n\n # sends a message to the gui to execute the given script\n @bridge.send(:gui, :executeScript, scrpt)\n \n end", "def multi_manifest\n\nidentifier = params[:iiifidentifier]\nrspaceid = params[:rspaceid]\n\nif File.file?(\"/manifests/multi/#{identifier}.json\")\n\nmanifest = File.read(\"/manifests/multi/#{identifier}.json\")\nrender :json => manifest\n\nelse\n\nmanifest = \"https://rspace.library.cofc.edu/iiif/#{identifier}/manifest\"\n\n# Actually fetch the contents of the remote URL as a String.\nbuffer = open(manifest).read\n\n# Convert the JSON response to hash\nmulti = JSON.parse(buffer)\n\n# Clear out empty metadata fields that RS includes for some reason\nmulti[\"metadata\"].delete_if { |h| h[\"value\"] == \"\" }\nmulti[\"metadata\"].delete_if { |h| h[\"value\"] == [] }\n\n#get values for each filestore alt file url\nsolr_alt_query = \"http://10.7.130.237:8983/solr/rspace/pages?fl=alternative-files&q=rspace-id:#{rspaceid}&rows=1\"\nalt_buffer = open(solr_alt_query).read\nalt_document = JSON.parse(alt_buffer)\n\n #add otherContent for annotation list\n other_content = []\n inner_content = {}\n inner_content[\"@context\"] = \"//iiif.io/api/presentation/2/context.json\"\n inner_content[\"@id\"] = \"https://lcdl.library.cofc.edu/lcdl/collections/annotation?iiif_identifier=#{identifier}\"\n inner_content[\"@type\"] = \"sc:AnnotationList\"\n other_content.push(inner_content)\n multi[\"sequences\"][0][\"canvases\"][0][\"otherContent\"] = other_content\n\nunless alt_document[\"response\"][\"docs\"][0][\"alternative-files\"].nil?\n\naltFiles = alt_document[\"response\"][\"docs\"][0][\"alternative-files\"]\n\nbase_canvas = multi[\"sequences\"][0][\"canvases\"][0]\n\naltFiles.each.with_index(1) do |canvas,i|\nc = Marshal.load(Marshal.dump(base_canvas))\n\ncanvas = canvas[31..-1]\ncanvas = CGI.escape(canvas)\n\naltInfo = \"https://iiif.library.cofc.edu/iiif/2/#{canvas}/info.json\"\nbuffer = open(altInfo).read\nalt = JSON.parse(buffer)\nheight = 85\nwidth = alt[\"width\"]\n\nc[\"height\"] = height\nc[\"width\"] = width\nc[\"@id\"] = \"https://rspace.library.cofc.edu/iiif/#{identifier}/canvas/#{i}\"\nc[\"label\"] = \"#{i}\"\nc[\"images\"][0][\"@id\"] = \"https://rspace.library.cofc.edu/iiif/#{identifier}/annotation/#{i}\"\nc[\"images\"][0][\"on\"] = \"https://rspace.library.cofc.edu/iiif/#{identifier}/canvas/#{i}\"\nc[\"images\"][0][\"height\"] = height\nc[\"images\"][0][\"width\"] = width\nc[\"images\"][0][\"resource\"][\"@id\"] = \"https://iiif.library.cofc.edu/iiif/2/#{canvas}/full/full/0/default.jpg\"\nc[\"images\"][0][\"resource\"][\"service\"][\"@id\"] = \"https://iiif.library.cofc.edu/iiif/2/#{canvas}\"\n\n #add otherContent for annotation list\n other_content = []\n inner_content = {}\n inner_content[\"@context\"] = \"//iiif.io/api/presentation/2/context.json\"\n inner_content[\"@id\"] = \"https://lcdl.library.cofc.edu/lcdl/collections/annotation?iiif_identifier=#{identifier}\"\n inner_content[\"@type\"] = \"sc:AnnotationList\"\n other_content.push(inner_content)\n c[\"otherContent\"] = other_content\n\nmulti[\"sequences\"][0][\"canvases\"] << c\n\nend\n\n\nend\n\nFile.open(\"manifests/multi/#{identifier}.json\",\"w\") do |f|\n f.write(JSON.pretty_generate(multi))\nend\n\nrender json: multi\n\nend #end else\nend", "def build_id_offsets\n {\n i386: [0x174],\n arm: [0x174],\n thumb: [0x174],\n aarch64: [0x238],\n amd64: [0x270, 0x174],\n powerpc: [0x174],\n powerpc64: [0x238],\n sparc: [0x174],\n sparc64: [0x270]\n }[context.arch.to_sym] || []\n end", "def set_assets\n\n @custom_csses = []\n @custom_javascripts = []\n\n\n action_hash = {\"create\" => \"new\", \"update\" => \"edit\"}\n file_name = action_hash[action_name] ? action_hash[action_name] : action_name\n root = Rails.root.to_s\n\n @custom_csses << \"compiled/application.css\" # always include the layout css\n @custom_csses << \"compiled/#{controller_name}/#{file_name}.css\" if File.exist?(\"#{root}/public/stylesheets/compiled/#{controller_name}/#{file_name}.css\")\n @custom_csses << \"compiled/#{controller_name}/all.css\" if File.exist?(\"#{root}/public/stylesheets/compiled/#{controller_name}/all.css\")\n\n\n @custom_javascripts << \"#{controller_name}/#{file_name}.js\" if File.exist?(\"#{root}/public/javascripts/#{controller_name}/#{file_name}.js\") # && !(\"#{file_name}.js\" == \"consumer_index.js\")\n @custom_javascripts << \"#{controller_name}/all.js\" if File.exist?(\"#{root}/public/javascripts/#{controller_name}/all.js\")\n\n # a trick to include facebox in the (devise-owned) registrations controller\n include_facebox if controller_name == 'registrations' && action_name == 'edit'\n\n end", "def fix_resources_file_paths\n Project.all.each do |p|\n if p.uuid.nil?\n p.create_uuid\n p.save!\n end\n\n p.resources.each do |r|\n if !r.file_path.nil?\n source = Rails.root.join('app/assets/images', r.file_path)\n dest = Rails.root.join('public/assets/images', r.project.uuid.downcase.parameterize(\"_\"), r.file_path)\n #debugger\n FileUtils.mkdir_p(Rails.root.join('public/assets/images', r.project.uuid.downcase.parameterize(\"_\")))\n FileUtils.mv(source, dest, :force => true) if File.exist?(source)\n r.file_path = File.basename(r.file_path)\n r.save!\n end\n\n end\n end\n \nend", "def skml_set_srcids(skml)\n verse = 0\n chapter = ''\n html = skml.dup || ''\n html.gsub!(/data-srcid\\s?=\\s?['\"](.*\\.)(x)['\"]/) do |match|\n if chapter != $1\n chapter = $1\n verse = 0\n end\n verse += 1\n \"data-srcid=\\\"#{chapter}#{verse}\\\"\"\n end\n return html\n end", "def collage_canvas_styles\n styles = []\n styles << 'height: 0px'\n styles << \"padding-bottom: #{collage_height_ratio}%\"\n styles.join('; ')\n end", "def test03()\n sourceMovie = File.join($directory, \"images/604_sd_clip.mov\") # 576x360\n width = 576\n height = 360\n movieLength = 300.0 # seconds.\n borderWidth = 32\n bitmapWidth = (3.0 * width.to_f * 0.5 + (3+1) * borderWidth).to_i\n bitmapHeight = (4.0 * height.to_f * 0.5 + (4+1) * borderWidth).to_i\n bitmapSize = MIShapes.make_size(bitmapWidth, bitmapHeight)\n baseFileName = \"coversheet\"\n begin\n # 1. Create the list of commands object, ready to have commands added to it.\n theCommands = SmigCommands.new\n theCommands.saveresultstype = :lastcommandresult\n\n # 2. Create movie importer and assign to list of commands.\n # Basically after the first block of commands is run, the movie importer\n # is closed automatically in the cleanup commands.\n movieImporterName = SecureRandom.uuid\n movieObject = theCommands.make_createmovieimporter(sourceMovie,\n name: movieImporterName)\n \n # 3. Create the process movie frames command and configure.\n imageIdentifier = SecureRandom.uuid\n\n processFramesCommand = ProcessFramesCommand.new(movieObject)\n processFramesCommand.create_localcontext = false\n processFramesCommand.imageidentifier = imageIdentifier\n\n track_id = MovieTrackIdentifier.make_movietrackid_from_mediatype(\n mediatype: :vide, trackindex: 0)\n \n processFramesCommand.videotracks = [ track_id ]\n\n # 4. Make a pre-process command list.\n preProcessCommands = []\n \n # 5. Make a create a bitmap context command.\n bitmapName = SecureRandom.uuid\n createBitmapCommand = CommandModule.make_createbitmapcontext(\n name: bitmapName, size: bitmapSize)\n\n bitmapObject = SmigIDHash.make_objectid(objecttype: :bitmapcontext,\n objectname: bitmapName)\n\n # 6. Add the create bitmap context object command to the pre-process list.\n preProcessCommands.push(createBitmapCommand.commandhash)\n\n # 7. Make a create exporter object command and add it to the pre-process list\n exporterName = SecureRandom.uuid\n createExporterCommand = CommandModule.make_createexporter(\n \"~/placeholder.jpg\", export_type: 'public.jpeg', name: exporterName)\n preProcessCommands.push(createExporterCommand.commandhash)\n exporterObject = SmigIDHash.make_objectid(objecttype: :imageexporter,\n objectname: exporterName)\n\n # 8. Assign the pre-process commands to the process movie frames command.\n processFramesCommand.preprocesscommands = preProcessCommands\n \n # 9. Add a close bitmap object command to cleanup commands.\n processFramesCommand.add_tocleanupcommands_closeobject(bitmapObject)\n \n # 10. Add a close exporter object command to cleanup commands.\n processFramesCommand.add_tocleanupcommands_closeobject(exporterObject)\n\n # 11. Add a remove image from collection command to cleanup commands.\n processFramesCommand.add_tocleanupcommands_removeimage(imageIdentifier)\n\n # 12. Prepare and start looping for creating process frame instrutions.\n numFrames = 24\n framesPerPage = 12 # 3 x 4\n frameDuration = movieLength / (numFrames - 1)\n pageNumber = 0\n x = 0\n y = 0\n halfWidth = width / 2\n halfHeight = height / 2\n drawnFrameSize = MIShapes.make_size(halfWidth, halfHeight)\n textBoxSize = MIShapes.make_size(halfWidth, borderWidth * 3 / 4)\n filesToCompare = []\n numFrames.times do |i|\n # 13. Create a ProcessMovieFrameInstruction object\n frameInstructions = ProcessMovieFrameInstructions.new\n \n # 14. Calculate the frame time and assign it.\n time = i.to_f * frameDuration\n frameTime = MovieTime.make_movietime_fromseconds(time)\n frameInstructions.frametime = frameTime\n \n # 15. Determine the frame number on the page & destination rectangle.\n frameNumber = i % framesPerPage\n x = frameNumber % 3\n y = 3 - (frameNumber / 3)\n xloc = x * halfWidth + (x + 1) * borderWidth\n yloc = y * halfHeight + (y + 1) * borderWidth\n origin = MIShapes.make_point(xloc, yloc)\n drawnFrameRect = MIShapes.make_rectangle(size: drawnFrameSize,\n origin: origin)\n \n # 16. Create the draw image element to draw the frame onto the bitmap.\n drawImageElement = MIDrawImageElement.new()\n drawImageElement.destinationrectangle = drawnFrameRect\n drawImageElement.set_imagecollection_imagesource(identifier: imageIdentifier)\n \n # 17. Create the draw image command and add it to the frame instructions.\n drawImageCommand = CommandModule.make_drawelement(bitmapObject,\n drawinstructions: drawImageElement, createimage: false)\n frameInstructions.add_command(drawImageCommand)\n \n # 18. Prepare drawing the text with the time.\n timeString = \"Frame time: %.3f secs\" % time\n drawStringElement = MIDrawBasicStringElement.new()\n drawStringElement.stringtext = timeString\n drawStringElement.userinterfacefont = \"kCTFontUIFontLabel\"\n drawStringElement.textalignment = \"kCTTextAlignmentCenter\"\n drawStringElement.fillcolor = MIColor.make_rgbacolor(0.0, 0.0, 0.0)\n boxOrigin = MIShapes.make_point(xloc, yloc - borderWidth)\n boundingBox = MIShapes.make_rectangle(size: textBoxSize, origin: boxOrigin)\n drawStringElement.boundingbox = boundingBox\n drawTextCommand = CommandModule.make_drawelement(bitmapObject,\n drawinstructions: drawStringElement, createimage: false)\n frameInstructions.add_command(drawTextCommand)\n\n # 19. If this was the last frame to be drawn then export the page.\n if (frameNumber == framesPerPage - 1) || i == numFrames - 1\n addImageCommand = CommandModule.make_addimage(exporterObject, bitmapObject)\n frameInstructions.add_command(addImageCommand)\n pageNum = (i / 12).to_s.rjust(3, '0')\n fileName = baseFileName + pageNum + \".jpg\"\n filesToCompare.push(fileName)\n# filePath = File.join($compareImageDir, fileName)\n filePath = File.join(Dir.tmpdir(), fileName)\n setExportPathCommand = CommandModule.make_set_objectproperty(\n exporterObject,\n propertykey: :file,\n propertyvalue: filePath)\n frameInstructions.add_command(setExportPathCommand)\n exportCommand = CommandModule.make_export(exporterObject)\n frameInstructions.add_command(exportCommand)\n # 20. Now redraw the bitmap context with a white rectangle.\n redrawBitmapElement = MIDrawElement.new(:fillrectangle)\n redrawBitmapElement.fillcolor = MIColor.make_rgbacolor(1.0, 1.0, 1.0)\n redrawBitmapElement.rectangle = MIShapes.make_rectangle(size: bitmapSize)\n redrawCommand = CommandModule.make_drawelement(bitmapObject,\n drawinstructions: redrawBitmapElement)\n frameInstructions.add_command(redrawCommand)\n end\n # 21. Set the frame processing intructions to the process frames command.\n processFramesCommand.add_processinstruction(frameInstructions)\n end\n \n # 22. Add the process frames command to the list of commands.\n theCommands.add_command(processFramesCommand)\n Smig.perform_commands(theCommands)\n\n filesToCompare.each do |fileName|\n origFile = File.join($compareImageDir, fileName)\n tempFile = File.join(Dir.tmpdir(), fileName)\n# tempFile = File.join($compareImageDir, fileName)\n compareResult = AreImageFilesSame(origFile, tempFile, 0)\n FileUtils.rm_f(tempFile)\n # FileUtils.mv(tempFile, origFile)\n unless compareResult\n # 2. Report if different.\n raise \"Different image files: \" + origFile + \" and \" + tempFile\n end\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: \" + Smig.exitstring\n puts \" Exit status: \" + $errorcode.to_s\n end\n puts e.message\n puts e.backtrace.to_s\n end\nend", "def resize_gfx_points(players)\r\n left_align_off = 20\r\n offlbl_y = 20\r\n start_toty = 110\r\n #label for scopa\r\n players.each do |pl_match|\r\n player_label = pl_match.name.to_sym\r\n lbl_gfx_scopa = @points_status[player_label][:widg_scopa]\r\n lbl_gfx_tot = @points_status[player_label][:widg_tot] \r\n \r\n lbl_gfx_scopa.pos_x = left_align_off\r\n lbl_gfx_tot.pos_x = left_align_off\r\n \r\n if pl_match.type == :human_local\r\n human_start_toty = start_toty - 30\r\n #lbl_gfx_scopa.pos_y = @curr_canvas_info[:height] - ( human_start_toty + 2 * offlbl_y)\r\n #lbl_gfx_tot.pos_y = @curr_canvas_info[:height] - ( human_start_toty + 3 * offlbl_y) \r\n lbl_gfx_scopa.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 2 * offlbl_y)\r\n lbl_gfx_tot.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 3 * offlbl_y) \r\n else\r\n lbl_gfx_scopa.pos_y = start_toty + offlbl_y\r\n lbl_gfx_tot.pos_y = start_toty\r\n end\r\n end\r\n end", "def generate_evasive_source(evasion_stack)\n source = \"tmp/bin\"+self.uuid+\".c\"\n specified_techniques = evasion_stack.split(\";\")\n\n # Create EvasionTechnique objects for each specified technique.\n techniques = Array.new(specified_techniques.count)\n specified_techniques.each_index do |i|\n techniques[i] = EvasionTechnique.new(specified_techniques[i])\n end\n\n\n\n # Initialize initial program stub on on which to build the generated source.\n stub_impl = \"\n void translate(char* k){\n dbuf = malloc(BUFFER_LENGTH);\n\n int i, n;\n i = 0; n = 0;\n\n for(i = 0; i < BUFFER_LENGTH; i++)\n dbuf[i] = buf[i];\n\n for(n = 0; n < strlen(k); n++){\n for(i = 0; i < BUFFER_LENGTH; i++){\n dbuf[i] = dbuf[i] ^ k[(n+k[n]+i) % strlen(k)];\n }\n }\n }\n\n void run(){\n int (*func)();\n func = (int (*)()) dbuf;\n (int)(*func)();\n free(dbuf);\n }\n\n \"\n\n # Initialize program component lists/queues/stacks\n includes_list = [\"stdio.h\", \"stdlib.h\", \"string.h\", \"Windows.h\"]\n dyn_definitions = []\n # Queue of code execution prefix stubs\n dyn_exec_prefixes = ['int main(int argc, char** argv){\n HANDLE t_file;\n DWORD t_temporary;\n\n LPCVOID t_content = \"Status: tag log created\";\n\n t_file = CreateFile(\"C:/Documents and Settings/honey/My Documents/ids_taglog.txt\", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);\n WriteFile(t_file, t_content, strlen((const char*) t_content), &t_temporary, NULL);\n ']\n dyn_exec =\n ' \n translate(ivk);\n run();\n '\n # Stack of code execution postfix stubs\n dyn_exec_postfixes = [\" }\"]\n\n # Populate program component lists/queues/stacks\n techniques.each do |t|\n t.includes().each do |i|\n if includes_list.include?(i) == false\n includes_list.concat([i])\n end\n end\n dyn_definitions.concat([t.definitions()])\n dyn_exec_prefixes.concat([t.exec_prefix()])\n dyn_exec_postfixes.unshift t.exec_postfix()\n end\n\n # Flesh out program stub using the populated program components.\n includes = \"\"\n includes_list.each do |i|\n includes << '#include <'+i+ \">\\n\"\n end\n includes << \"\\n\"\n\n dyn_definitions.each do |d|\n stub_impl << d\n end\n stub_impl << \"\\n\"\n\n dyn_exec_prefixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n stub_impl << dyn_exec\n dyn_exec_postfixes.each do |p|\n stub_impl << p\n end\n stub_impl << \"\\n\"\n\n # Copy and parse hex dump from msfvenom-generated C file\n buf_found = false\n hex_string = \"\"\n\n file = File.open(source, \"r\")\n\n file.each do |line|\n # Dump will start with 'unsigned char buf[] ='\n if not buf_found\n if line.index(\"unsigned char buf[]\") == 0\n buf_found = true\n end\n else\n # Strip quotes, newlines, etc\n line.delete! '\"'\n line.delete! '\\n'\n line.delete! \"\\n\"\n line.delete! '\\\\'\n line.delete! 'x'\n # Stop once a semicolon is reached\n if line.index(\";\") != nil\n line.delete! ';'\n hex_string += line\n break\n else\n hex_string += line\n end\n end\n end\n\n file.close\n\n # Convert to binary string\n payload_code = hex_to_bin(hex_string)\n\n # Generate random string to use as the key\n key = rand(36**rand(10...25)).to_s(36)\n\n # Encrypt binary string with key\n encrypted_code = cipher(payload_code.bytes.to_a, key.bytes.to_a)\n encrypted_code_hex = bin_to_hex(encrypted_code.pack(\"c*\"))\n\n # Format C String\n encrypted_code_hex = encrypted_code_hex.gsub(/(.{2})/, '\\\\x\\1')\n # Split formatted C String into lines.\n lines = encrypted_code_hex.scan(/.{1,#{60}}/)\n\n # Write evasive source to file\n file = File.open(\"tmp/evasive\"+self.uuid+\".c\", 'w')\n \n file.puts includes\n file.puts '#define BUFFER_LENGTH '+\"#{encrypted_code.count}\"\n file.puts \"unsigned char ivk[] = \\\"\"+key+\"\\\";\"\n file.puts \"unsigned char buf[] = \"\n lines.each_index do |i|\n if i < lines.count - 1\n file.puts '\"'+lines[i]+'\"'\n else\n file.puts '\"'+lines[i]+'\";'\n end\n end\n file.puts \"unsigned char* dbuf;\";\n file.puts stub_impl\n \n file.close\n\n print_status(\"Evasive source successfully generated.\")\n\n end", "def test04()\n begin\n origModes = \"kCGBlendModeNormal kCGBlendModeMultiply kCGBlendModeScreen \"+\n \"kCGBlendModeOverlay kCGBlendModeDarken kCGBlendModeLighten \" + \n \"kCGBlendModeColorDodge kCGBlendModeColorBurn kCGBlendModeSoftLight \" +\n \"kCGBlendModeHardLight kCGBlendModeDifference kCGBlendModeExclusion \" +\n \"kCGBlendModeHue kCGBlendModeSaturation kCGBlendModeColor \" +\n \"kCGBlendModeLuminosity kCGBlendModeClear kCGBlendModeCopy \" +\n \"kCGBlendModeSourceIn kCGBlendModeSourceOut kCGBlendModeSourceAtop \" +\n \"kCGBlendModeDestinationOver kCGBlendModeDestinationIn \" +\n \"kCGBlendModeDestinationOut kCGBlendModeDestinationAtop kCGBlendModeXOR \" +\n \"kCGBlendModePlusDarker kCGBlendModePlusLighter\"\n blendModes = MIMeta.listcgblendmodes\n unless origModes.eql? blendModes\n raise \"Blend modes are different, new:\" + blendModes\n end\n\n origPresets = \"AlphaOnly8bpcInt Gray8bpcInt Gray16bpcInt Gray32bpcFloat \" +\n \"AlphaSkipFirstRGB8bpcInt AlphaSkipLastRGB8bpcInt \"+\n \"AlphaPreMulFirstRGB8bpcInt AlphaPreMulBGRA8bpcInt AlphaPreMulLastRGB8bpcInt \" +\n \"AlphaPreMulLastRGB16bpcInt AlphaSkipLastRGB16bpcInt \" +\n \"AlphaSkipLastRGB32bpcFloat AlphaPreMulLastRGB32bpcFloat \" +\n \"CMYK8bpcInt CMYK16bpcInt CMYK32bpcFloat PlatformDefaultBitmapContext\"\n presets = MIMeta.listpresets\n unless origPresets.eql? presets\n raise \"Presets are different, new:\" + presets\n end\n\n origCommands = [:getproperty, :setproperty, :getproperties, :setproperties,\n :create, :close, :closeall, :addimage, :export, :drawelement, :snapshot,\n :finalizepage, :getpixeldata, :calculategraphicsizeoftext, :renderfilterchain,\n :assignimagetocollection, :removeimagefromcollection, :processframes,\n :createtrack, :addinputtowriter, :addimagesampletowriter,\n :finishwritingframes, :cancelwritingframes, :addmovieinstruction,\n :inserttracksegment, :insertemptytracksegment]\n\n commands = MIMeta.listallcommands\n unless origCommands.eql? commands\n raise \"Command lists are different, new:\" + commands.to_s\n end\n\n origObjects = [:bitmapcontext, :imageimporter, :imageexporter,\n :imagefilterchain, :pdfcontext, :nsgraphiccontext,\n :movieimporter, :movieeditor, :videoframeswriter]\n objectTypes = MIMeta.listobjecttypes\n\n unless origObjects.eql? objectTypes\n raise \"List of objects is different, new:\" + commands.to_s\n end\n\n origInputVideoWriterPresets = \"h264preset_sd jpegpreset h264preset_hd \" +\n \"prores4444preset prores422preset\"\n \n videoWriterPresets = MIMeta.listvideoframewriterpresets\n unless origInputVideoWriterPresets.eql? videoWriterPresets\n raise \"List of video writer presets is different, new:\" + videoWriterPresets.to_s\n end\n\n origUserInterfaceFonts = \"kCTFontUIFontMiniEmphasizedSystem \" +\n \"kCTFontUIFontSmallToolbar kCTFontUIFontWindowTitle \" +\n \"kCTFontUIFontMenuTitle kCTFontUIFontSystem kCTFontUIFontMenuItem \" +\n \"kCTFontUIFontEmphasizedSystem kCTFontUIFontToolbar kCTFontUIFontMessage \" +\n \"kCTFontUIFontEmphasizedSystemDetail kCTFontUIFontSmallEmphasizedSystem \" +\n \"kCTFontUIFontUserFixedPitch kCTFontUIFontMiniSystem kCTFontUIFontLabel \" +\n \"kCTFontUIFontControlContent kCTFontUIFontSystemDetail kCTFontUIFontViews \"+\n \"kCTFontUIFontUser kCTFontUIFontSmallSystem kCTFontUIFontApplication\" +\n \"kCTFontUIFontToolTip\"\n \n userInterfaceFonts = MIMeta.listuserinterfacefonts\n unless userInterfaceFonts.eql? userInterfaceFonts\n raise \"User iterface fonts are different, new:\" + userInterfaceFonts\n end\n\n rescue RuntimeError => e\n $errorcode = Smig.exitvalue\n unless $errorcode.zero?\n puts \"Exit string: #{Smig.get_exitstring}\"\n end\n puts e.message\n puts e.backtrace.to_s\n puts #{Smig.exitstring}\"\n# exit 240\n end\nend", "def update_unique_ids(env, content); end", "def handle_changed_sis_user_ids\n if Settings.canvas_proxy.dry_run_import.present?\n logger.warn \"DRY RUN MODE: Would change #{@sis_user_id_changes.length} SIS user IDs #{@sis_user_id_changes.inspect}\"\n else\n logger.warn \"About to change #{@sis_user_id_changes.length} SIS user IDs\"\n @sis_user_id_changes.each do |canvas_user_id, new_sis_id|\n self.class.change_sis_user_id(canvas_user_id, new_sis_id)\n end\n end\n end", "def resizeCanvas(w,h)\n puts(\"resizing canvas\")\n puts(w,h)\n @canvasHeight = h #Set the canvas height\n @canvasWidth = w #Set the canvas width\n @canvas.resize(w,h)\n @exportImage = FXPNGImage.new(@parentApp, nil, @canvasWidth, @canvasHeight)\n @exportImage.create #initializes the image object.\n @exportImage.resize(@canvasWidth, @canvasHeight) #Sets the image to match canvas width and height\n @layerArray = Array.new #Reset the layer array\n @imageArray = Array.new #Reset the image array\n @dirtyArray = Array.new #Reset the dirty array\n @activeIndex = 0 #Reset the active index\n createImage() #Push a blank image data.\n @activeImage = @imageArray[@activeIndex] #Update active index to default.\n @canvas.update #Update the draw canvas to reflect changes.\n end", "def change_client_related_flags\n fail if @client_ids_array.blank?\n clients = Client.where(id: @client_ids_array).all\n clients.each do |client|\n if GlobalConstant::Base.main_sub_environment?\n client.send(\"unset_#{GlobalConstant::Client.mainnet_test_economy_qr_code_uploaded_status}\")\n client.send(\"unset_#{GlobalConstant::Client.mainnet_registered_in_mappy_server_status}\")\n else\n client.send(\"unset_#{GlobalConstant::Client.sandbox_test_economy_qr_code_uploaded_status}\")\n client.send(\"unset_#{GlobalConstant::Client.sandbox_registered_in_mappy_server_status}\")\n end\n client.save!\n end\n end", "def draw(canvas, max_x, max_y)\n render.each_line.with_index do |line, rowi|\n line.each_char.with_index do |char, coli|\n next if char == \"\\n\"\n pos = camera.cartesian2screen(self)\n\n off_x = -camera.x + camera.half_screen_width\n off_y = -camera.y + camera.half_screen_height\n\n # _x = coli + pos.x - camera.half_screen_width\n # _y = rowi + pos.y - camera.half_screen_height\n # _x = coli - (pos.x * width_offset) + width_offset\n # _y = rowi - (pos.y * height_offset) + height_offset\n # _x = coli + x - off_x # pos.x\n # _y = rowi - y + off_y # pos.y\n _x = (camera.screen.width - position.x * width) - width\n _y = (camera.screen.height - position.y * height) - height\n # _x = coli + x\n # _y = rowi + y\n\n _x = position.x*3 - (camera.screen.width/2)\n _y = (camera.screen.height/2) - position.y*3\n\n _x += width*2 + 1\n # _x += width_offset\n _y += height*2 - 1\n # _y += height_offset\n\n _x += coli\n _y += rowi\n\n canvas[_y][_x] = char if camera.can_view?(_x, _y, self)\n # canvas[_x][_y] = char\n # canvas[x][y] = char if camera.can_view?(x, y, self)\n end\n end\n end", "def copy_generated_images(parent)\n img = parent.find_inspire_image\n mobile = parent.image_for img, 'mobile_inspire'\n desktop = parent.image_for img, 'desktop_inspire'\n thumbnails = parent.image_for '', 'thumbnails'\n\n FileUtils.cp(mobile, \"#{data_path}/inspire/mobile\")\n FileUtils.cp(desktop, \"#{data_path}/inspire/desktop\")\n FileUtils.cp_r(\"#{thumbnails}/.\", \"#{data_path}/thumbnails\")\n end", "def app_canvas_url\n \"#{request.ssl? ? \"https://\" : \"http://\"}apps.facebook.com/#{app_namespace}\"\n end", "def create\n # byebug\n @canvas = Canvas.create(canvas_params)\n end", "def canvas_for(slice, opts)\n file = file_for(slice, opts)\n file[:canvas]\n end", "def embed_frameworks_output_paths(framework_paths, xcframeworks)\n paths = framework_paths.map do |framework_path|\n \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{File.basename(framework_path.source_path)}\"\n end.uniq\n # Static xcframeworks are not copied to the build dir\n # so only include dynamic artifacts that will be copied to the build folder\n xcframework_paths = xcframeworks.select { |xcf| xcf.build_type.dynamic_framework? }.map do |xcframework|\n \"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/#{xcframework.name}.framework\"\n end\n paths + xcframework_paths\n end", "def prebuild_frameworks! \n\n # build options\n sandbox_path = sandbox.root\n existed_framework_folder = sandbox.generate_framework_path\n bitcode_enabled = Pod::Podfile::DSL.bitcode_enabled\n targets = []\n \n if local_manifest != nil\n\n changes = prebuild_pods_changes\n added = changes.added\n changed = changes.changed \n unchanged = changes.unchanged\n deleted = changes.deleted \n \n existed_framework_folder.mkdir unless existed_framework_folder.exist?\n exsited_framework_pod_names = sandbox.exsited_framework_pod_names\n \n # additions\n missing = unchanged.select do |pod_name|\n not exsited_framework_pod_names.include?(pod_name)\n end\n\n\n root_names_to_update = (added + changed + missing)\n\n # transform names to targets\n cache = []\n targets = root_names_to_update.map do |pod_name|\n tars = Pod.fast_get_targets_for_pod_name(pod_name, self.pod_targets, cache)\n if tars.nil? || tars.empty?\n raise \"There's no target named (#{pod_name}) in Pod.xcodeproj.\\n #{self.pod_targets.map(&:name)}\" if t.nil?\n end\n tars\n end.flatten\n\n # add the dendencies\n dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []\n targets = (targets + dependency_targets).uniq\n else\n targets = self.pod_targets\n end\n \n # frameworks which mark binary true, should be filtered before prebuild\n prebuild_framework_pod_names = []\n podfile.target_definition_list.each do |target_definition|\n next if target_definition.prebuild_framework_pod_names.empty?\n prebuild_framework_pod_names += target_definition.prebuild_framework_pod_names\n end\n \n \n\n \n # filter local pods\n targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) } if not Podfile::DSL.allow_local_pod\n\n # filter dependency\n # targets = targets.select {|pod_target| prebuild_framework_pod_names.include?(pod_target.pod_name) }\n \n # build!\n Pod::UI.puts \"🚀 Prebuild files (total #{targets.count})\"\n Pod::Prebuild.remove_build_dir(sandbox_path)\n \n targets = targets.reject { |pod_target| Pod::Podfile::DSL.binary_white_list.include?(pod_target.pod_name) }\n \n # 是否值缓存 .a 文件\n only_store_lib_file = Podfile::DSL.only_store_lib_file\n \n # 是否开启md5 命名\n md5_file_name = Podfile::DSL.md5_file_name\n md5_file_name_list = []\n \n \n subspec_name_enable = true\n \n # building check ...\n targets.each do |target|\n \n target_name = target.name\n # root_name = \"#{target_name}/\"\n spec = target.root_spec\n\n# Pod::UI.puts \"🚀 000 #{target.specs.to_json} \"\n\n specs_name = get_subspec_name(target)\n# Pod::UI.puts \"🚀 666 #{specs_name} \"\n\n \n # 如果过长 采用md5 + 文件记录\n if md5_file_name\n item = get_subspec_name_md5(target_name, specs_name, spec.version)\n specs_name = item[\"specs_name\"]\n# Pod::UI.puts \"🚀 333 #{specs_name} \"\n md5_file_name_list.push(item)\n end\n \n# specs_name = spec.name\n# Pod::UI.puts \"🚀 666 #{target.to_json} \"\n \n UI.section \"🍭 Prebuild Ready to build #{target_name} [#{target.label}]\".blue do\n if !target.should_build?\n Pod::UI.puts \"🏇 Skipping #{target.label}\"\n next\n end\n\n output_path = sandbox.framework_folder_path_for_target_name(target_name)\n output_path.mkpath unless output_path.exist?\n \n need_pull = Podfile::DSL.binary_cache\n need_push = false\n need_build = false\n\n generate_path = sandbox.generate_framework_path.to_s\n rsync_server_url = Podfile::DSL.rsync_server_url\n \n loop do\n if not need_pull\n need_build = true\n break\n end\n \n if sandbox.local?target_name and not Podfile::DSL.local_binary_cache\n need_build = true\n break\n end\n \n exist_remote_framework = Pod::PrebuildFetch.fetch_remote_framework_for_target(spec.name, specs_name, spec.version, generate_path, rsync_server_url)\n if not exist_remote_framework\n Pod::UI.puts \"💦 Non exist remote cache, #{target_name}\".blue\n \n need_build = true\n need_push = true\n break\n end\n \n Pod::UI.puts \"🎁 Exist remote cache, #{target_name}\".green\n\n break\n end\n\n if need_build\n Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)\n end\n \n if need_push\n Podfile::DSL.builded_list.push(target_name)\n\n \n if only_store_lib_file\n Pod::PrebuildFetch.sync_prebuild_framework_to_server(spec.name, specs_name, spec.version, generate_path, rsync_server_url)\n else\n store_pack = {}\n store_pack[\"spec_name\"] = spec.name\n store_pack[\"specs_name\"] = specs_name\n store_pack[\"spec_version\"] = \"#{spec.version}\"\n store_pack[\"generate_path\"] = generate_path\n store_pack[\"server_url\"] = rsync_server_url\n\n Podfile::DSL.builded_store_list.push(store_pack)\n end\n end\n \n \n \n # public private headers\n if Podfile::DSL.allow_public_headers and target.build_as_framework?\n headers = []\n target.file_accessors.each do |fa|\n headers += fa.headers || []\n end\n\n config_umbrella_header(output_path, target_name, headers)\n end\n\n \n # ...\n #target.static_framework\n #target.build_as_dynamic_library\n #target.build_as_static_framework\n \n # save the resource paths for later installing\n if !target.resource_paths.empty? #and target.build_as_dynamic?\n framework_path = output_path\n framework_path = framework_path + target.framework_name if target.build_as_framework?\n \n standard_sandbox_path = sandbox.standard_sanbox_path\n\n resources = begin\n if Pod::VERSION.start_with? \"1.5\"\n target.resource_paths\n else\n # resource_paths is Hash{String=>Array<String>} on 1.6 and above\n # (use AFNetworking to generate a demo data)\n # https://github.com/leavez/cocoapods-binary/issues/50\n target.resource_paths.values.flatten\n end\n end\n raise \"Wrong type: #{resources}\" unless resources.kind_of? Array\n\n path_objects = resources.map do |path|\n object = Prebuild::Passer::ResourcePath.new\n #object.real_file_path = framework_path + File.basename(path)\n object.real_file_path = path.gsub('${PODS_ROOT}', sandbox.generate_framework_path.to_s) if path.start_with? '${PODS_ROOT}'\n \n object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'\n object.target_file_path = path.gsub(\"${PODS_CONFIGURATION_BUILD_DIR}\", standard_sandbox_path.to_s) if path.start_with? \"${PODS_CONFIGURATION_BUILD_DIR}\"\n \n object\n end\n # mark Generated files to Pods/xx\n Prebuild::Passer.resources_to_copy_for_static_framework[target_name] = path_objects\n \n # Logger(1000, \"path_objects\", path_objects)\n # Logger(1001, \"target.name\", target.name)\n\n end\n \n end\n\n end\n \n if md5_file_name\n pods_path = self.sandbox.root\n md5_file_name_path = pods_path + \"md5_file_name.txt\"\n File.write(md5_file_name_path.to_s, md5_file_name_list.to_json)\n end\n \n \n # remove build path\n Pod::Prebuild.remove_build_dir(sandbox_path) if Podfile::DSL.clean_build_dir\n \n def copy_vendered_files(lib_paths, root_path, target_folder)\n lib_paths.each do |lib_path|\n relative = lib_path.relative_path_from(root_path)\n destination = target_folder + relative\n destination.dirname.mkpath unless destination.dirname.exist?\n FileUtils.cp_r(lib_path, destination, :remove_destination => true, :verbose => Pod::Podfile::DSL.verbose_log)\n end\n end\n \n def copy_vendered_headers(lib_paths, root_path)\n lib_paths.each do |lib_path|\n FileUtils.cp_r(lib_path, root_path, :remove_destination => true, :verbose => Pod::Podfile::DSL.verbose_log)\n end\n end\n \n \n # copy vendored libraries and frameworks\n targets.each do |target|\n root_path = self.sandbox.pod_dir(target.name)\n target_folder = sandbox.framework_folder_path_for_target_name(target.name)\n \n # If target shouldn't build, we copy all the original files\n # This is for target with only .a and .h files\n if not target.should_build? \n Prebuild::Passer.target_names_to_skip_integration_framework << target.name\n\n FileUtils.cp_r(root_path, target_folder, :remove_destination => true, :verbose => Pod::Podfile::DSL.verbose_log)\n next\n end\n \n# Logger(10032, \"dependencies\", target.dependencies)\n \n # continue ....\n next unless File.exist?(root_path)\n \n # copy to Generated\n target.spec_consumers.each do |consumer|\n file_accessor = Sandbox::FileAccessor.new(root_path, consumer)\n \n lib_paths = []\n\n #add frameworks\n lib_paths += file_accessor.vendored_frameworks || []\n \n if Pod::VERSION.start_with? \"1.9\"\n lib_paths += file_accessor.vendored_xcframeworks || [] # cocoapods version 1.9.0+\n end\n \n #add libraries\n lib_paths += file_accessor.vendored_libraries || []\n \n #add headers\n lib_paths += file_accessor.headers || []\n \n lib_paths += file_accessor.docs || []\n\n #add resources\n lib_paths += file_accessor.resources || []\n \n lib_paths += file_accessor.resource_bundles.values if not file_accessor.resource_bundles.nil?\n lib_paths += file_accessor.resource_bundle_files || []\n\n #add license\n lib_paths += [file_accessor.license] if not file_accessor.license.nil?\n lib_paths += [file_accessor.spec_license] if not file_accessor.spec_license.nil?\n\n #add readme\n lib_paths += [file_accessor.readme] if not file_accessor.readme.nil?\n \n\n #developer_files ⇒ Array<Pathname> Paths to include for local pods to assist in development.\n\n copy_vendered_files(lib_paths, root_path, target_folder)\n\n # framework not same\n if Podfile::DSL.allow_public_headers and target.build_as_framework?\n headers = file_accessor.headers || []\n copy_vendered_headers(headers, \"#{target_folder}/#{target.framework_name}/Headers\")\n end\n end\n end\n\n # save the pod_name for prebuild framwork in sandbox \n targets.each do |target|\n sandbox.save_pod_name_for_target target\n end\n \n \n # Remove useless files\n # remove useless pods\n all_needed_names = self.pod_targets.map(&:name).uniq\n useless_target_names = sandbox.exsited_framework_target_names.reject do |name| \n all_needed_names.include? name\n end\n \n \n useless_target_names.each do |name|\n path = sandbox.framework_folder_path_for_target_name(name)\n #path.rmtree if path.exist?\n FileUtils.rm_r(path.realpath, :verbose => Pod::Podfile::DSL.verbose_log) if path.exist?\n end\n \n if not Podfile::DSL.dont_remove_source_code\n # only keep manifest.lock and framework folder in _Prebuild\n to_remain_files = [\"Manifest.lock\", File.basename(existed_framework_folder)]\n to_delete_files = sandbox_path.children.select do |file|\n filename = File.basename(file)\n not to_remain_files.include?(filename)\n end\n to_delete_files.each do |path|\n #path.rmtree if path.exist?\n FileUtils.rm_r(path.realpath, :verbose => Pod::Podfile::DSL.verbose_log) if path.exist?\n end\n else \n # just remove the tmp files\n path = sandbox.root + 'Manifest.lock.tmp'\n #path.rmtree if path.exist?\n FileUtils.rm_r(path.realpath, :verbose => Pod::Podfile::DSL.verbose_log) if path.exist?\n end\n \n \n Pod::UI.puts \"🚀 Push Store Info: #{Podfile::DSL.builded_store_list}\"\n\n Podfile::DSL.builded_store_list.each do |store_pack|\n spec_name = store_pack[\"spec_name\"]\n specs_name = store_pack[\"specs_name\"]\n spec_version = store_pack[\"spec_version\"]\n generate_path = store_pack[\"generate_path\"]\n server_url = store_pack[\"server_url\"]\n \n Pod::PrebuildFetch.sync_prebuild_framework_to_server(spec_name, specs_name, spec_version, generate_path, server_url)\n end\n \n Podfile::DSL.builded_store_list = []\n end", "def update_option_ids(attrs_in, opt_map)\n qopts = attrs_in['question_options_attributes']\n qopts.each_pair do |_, attr_hash|\n old_id = attr_hash['id']\n new_id = opt_map[old_id]\n attr_hash['id'] = new_id\n end\n attrs_in\n end", "def consumer_ids_for_owners\n consumer_ids = self.owners.map do |doc_owner|\n if doc_owner.owner_type == \"GroupUser\"\n doc_owner.owner.group.owner.id\n elsif %w[User Consumer].include?(doc_owner.owner_type)\n doc_owner.owner.id\n else\n nil\n end\n end\n consumer_ids << self.consumer_id # always include uploader/creator of standard_base_document\n consumer_ids.uniq.reject(&:blank?)\n end", "def set_card_types\r\n credit_cards = 'vi-mc'\r\n credit_cards.concat('-di') if @PARAM_HASH['DISCOVER_IMAGE'] == 'discvr.gif'\r\n credit_cards.concat('-am') if @PARAM_HASH['AMEX_IMAGE'] == 'amex.gif'\r\n return credit_cards \r\n end", "def set_card_types\r\n credit_cards = 'vi-mc'\r\n credit_cards.concat('-di') if @PARAM_HASH['DISCOVER_IMAGE'] == 'discvr.gif'\r\n credit_cards.concat('-am') if @PARAM_HASH['AMEX_IMAGE'] == 'amex.gif'\r\n return credit_cards \r\n end", "def add_ids(code, id)\n code.freeze\n code = id + \" #{code} #{id}\"\n code\n end", "def getCanvasCourseList(course_data, userid)\n # could the regexp be a constant?\n instructure_regexp = Regexp.new(/instructure.com\\/courses\\/(\\d+)/)\n\n # get the course link urls, extract course number (if canvas per regexp), remove nil from non-matches.\n # Push(nil) is added to make sure there is at least 1 nil.\n\n mpathways_canvas_courses = CourseList.getValuesForKey('Link', course_data.value).map { |link| instructure_regexp.match(link); $1 }\n .push(nil).compact.sort.uniq\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: uniq mpathways_canvas_courses: #{mpathways_canvas_courses}\"\n\n mpathways_canvas_courses\n end", "def update!(**args)\n @allow_all_bundle_ids = args[:allow_all_bundle_ids] if args.key?(:allow_all_bundle_ids)\n @allowed_bundle_ids = args[:allowed_bundle_ids] if args.key?(:allowed_bundle_ids)\n @apple_developer_id = args[:apple_developer_id] if args.key?(:apple_developer_id)\n end", "def set_api_v1_canvas\n @api_v1_canvas = Api::V1::Canvas.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render json: '{\"error\": \"record not found\"}', status: 404\n end", "def getTargetingAnnosCanvasFromID\n inputID = params['id']\n targetingAnno = Annotation.where(annotation_id: inputID).first\n origCanvasAnno = getTargetingAnnosCanvas(targetingAnno)\n request.format = \"json\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: origCanvasAnno, content_type: \"application/text\" }\n end\n end", "def json_sets_without_image\n ids = []\n JsonSet.all.each do |set|\n if set.json_cards.any?\n if File.exist?(\"/home/deploy/magic/shared/public/#{set.json_cards.first.image_url}\")\n next\n else\n ids << set.id\n end\n elsif set.json_tokens.any?\n if File.exist?(\"/home/deploy/magic/shared/public/#{set.json_tokens.first.image_url}\")\n next\n else\n ids << set.id\n end\n end\n ids\n end\n end", "def admin_set_ids_for_deposit\n Hyrax::Collections::PermissionsService.source_ids_for_deposit(ability: current_ability)\n end", "def resize(player)\r\n #@log.debug \"gxc: resize deck_main\"\r\n img_opponent_deck = @image_gfx_resource[:card_opp_img]\r\n \r\n # deck\r\n model_canvas_gfx = @gfx_res.model_canvas_gfx\r\n x_deck_start = 50\r\n y_deck_start = 50\r\n \r\n if model_canvas_gfx.info[:deck_info][:position] == nil\r\n x_deck_start = model_canvas_gfx.info[:canvas][:width] - (img_opponent_deck.width + 30)\r\n y_deck_start = (model_canvas_gfx.info[:canvas][:height] - (img_opponent_deck.height + 30))/ 2\r\n else\r\n x_deck_start = model_canvas_gfx.info[:deck_info][:position][:x_deck_start]\r\n y_deck_start = model_canvas_gfx.info[:deck_info][:position][:y_deck_start]\r\n end\r\n \r\n rest_x = 0\r\n rest_y = 0\r\n @deck_todisp.each do |card_deck|\r\n card_deck.pos_x = x_deck_start + rest_x\r\n card_deck.pos_y = y_deck_start + rest_y\r\n rest_y += 1\r\n rest_x += 1 \r\n end\r\n model_canvas_gfx.info[:deck_info][:x_deck_start] = x_deck_start\r\n model_canvas_gfx.info[:deck_info][:y_deck_start] = y_deck_start\r\n model_canvas_gfx.info[:deck_info][:rest_x] = rest_x\r\n model_canvas_gfx.info[:deck_info][:rest_y] = rest_y\r\n \r\n if @briscola and @card_briscola_todisp\r\n # briscola\r\n # it is a rotated card\r\n y_brisc = y_deck_start + (img_opponent_deck.height / 2 - img_opponent_deck.width / 2 - 12)\r\n x_brisc = x_deck_start - (img_opponent_deck.height - img_opponent_deck.height / 3 + 20) \r\n @card_briscola_todisp.pos_x = x_brisc\r\n @card_briscola_todisp.pos_y = y_brisc\r\n end\r\n \r\n end", "def update_origin_plates\n # operations that have not yet errored are guarenteed to correspond to correct colonies on the original plates.\n # we will update the associations of the origin plate for each op to reflect this new verified colony\n operations.running.select { |op| op.input(\"PCR\").sample_type.name != 'Plasmid' }.each do |op|\n # Use association map to cleanly deal with data associated to parts of a collection\n colony_pick = op.input(\"PCR\").part.get(:colony_pick).to_i\n origin_plate_id = op.input(\"PCR\").part.get(:origin_plate_id).to_i\n \n if origin_plate_id && Item.exists?(origin_plate_id) && colony_pick\n origin_plate = Item.find(origin_plate_id)\n correct_colonies = origin_plate.get(:correct_colonies) ? origin_plate.get(:correct_colonies) : []\n \n # rely on idempotence of .to_s to normalize correct \n # colony association into an array regardless\n # of whether it started in array or string format.\n correct_colonies.to_s.chomp(']').chomp!('[') #convert Array to string representation if Array and remove brackets (if string: stays the same)\n correct_colonies = correct_colonies.split(\",\") #string array back to array\n \n correct_colonies.push \"c#{colony_pick}\"\n origin_plate.associate(:correct_colonies, correct_colonies)\n end\n end\n end", "def notify_original_creators\n origins.each do |o|\n unless o.parent.user_id == o.jingle.user_id\n Notification.create(\n target_id: o.parent_id,\n target_type: \"Jingle\",\n notice_id: o.jingle_id,\n notice_type: \"JingleOrigin\",\n user_id: o.jingle.user_id,\n notifier_id: user_id\n )\n end\n end\n end", "def onCanvasPaint(sender, sel, event)\r\n dc = FXDCWindow.new(@canvas_disp, event)\r\n dc.foreground = @canvas_disp.backColor\r\n dc.fillRectangle(0, 0, @canvas_disp.width, @canvas_disp.height)\r\n @cards_todisp.each do |v|\r\n dc.drawImage(v.image, v.pos_x, v.pos_y)\r\n end\r\n end", "def custom_data\n token[AtomicLti::Definitions::CUSTOM_CLAIM]&.reject { |_, s| s.to_s.start_with?(\"$Canvas\") } || {}\n end", "def collection_ids=(new_ids)\n # This is slightly crude, but lets just delete the join models that we\n # don't need anymore.\n\n # NOTE: Datamapper will try to insert rows into the join table on a Many to Many\n # even if the relationship is already defined.\n # You need to clear the relationships and reinsert them to prevent composite key\n # violation errors\n\n #self.gluttonberg_asset_gluttonberg_asset_collections.all(:asset_collection_id.not => new_ids).destroy!\n clear_all_collections\n self.collections = Gluttonberg::AssetCollection.all(:id => new_ids)\n end", "def precompile_app_assets\n puts \"Precompiling assets...\"\n\n # make sure the Rails environment is loaded\n ::Rake.application['environment'].invoke\n\n # temporarily set the static assets location from public/assets to our spec directory\n ::Rails.application.assets.static_root = Rails.root.join(\"spec/javascripts/generated/assets\")\n\n # rake won't let you run the same task twice in the same process without re-enabling it\n\n # once the assets have been cleared, recompile them into the spec directory\n ::Rake.application['assets:precompile'].reenable\n ::Rake.application['assets:precompile'].invoke\n end", "def wym_editor_initialize(*dom_ids)\n editor_ids = (@wym_editor_ids || []) + wym_extract_dom_ids(*dom_ids)\n output = []\n output << stylesheet_link_tag('/wymeditor/wymeditor/skins/default/screen')\n output << javascript_include_tag('/wymeditor/jquery/jquery')\n output << javascript_include_tag('/wymeditor/wymeditor/lang/en.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.explorer.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.mozilla.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.opera.js')\n output << javascript_include_tag('/wymeditor/wymeditor/jquery.wymeditor.safari.js')\n output << javascript_include_tag('/javascripts/boot_wym.js')\n output.join(\"\\n\")\n end", "def set_client_id(opts)\n opts = check_params(opts,[:client_ids])\n super(opts)\n end" ]
[ "0.51671386", "0.5106367", "0.47858417", "0.47071484", "0.47009945", "0.4624035", "0.46234953", "0.45965797", "0.45164967", "0.4490806", "0.44689232", "0.44512233", "0.44357508", "0.44357508", "0.44298148", "0.44162613", "0.44056684", "0.4389592", "0.4387859", "0.4379568", "0.43739262", "0.43644997", "0.43642747", "0.43502495", "0.43301737", "0.43301147", "0.43301147", "0.43164545", "0.43134677", "0.43043247", "0.43015185", "0.42695045", "0.42595938", "0.42447346", "0.42430252", "0.42410374", "0.42303583", "0.42239618", "0.42186776", "0.4215941", "0.4211388", "0.42096573", "0.4198418", "0.41875625", "0.41831118", "0.41812775", "0.4174485", "0.41541243", "0.41540343", "0.4153731", "0.4151762", "0.4146978", "0.41335574", "0.41335574", "0.41303426", "0.41302684", "0.41223615", "0.4120322", "0.41171193", "0.4112219", "0.4096342", "0.4087866", "0.40840596", "0.40833235", "0.40812218", "0.40753356", "0.40725163", "0.40663666", "0.40617174", "0.40612644", "0.4057093", "0.40562764", "0.4049134", "0.40426102", "0.40425864", "0.4041854", "0.4039372", "0.40341967", "0.40329352", "0.4032104", "0.4030955", "0.40247256", "0.40197012", "0.40197012", "0.40135086", "0.4008603", "0.40050036", "0.4000937", "0.39940634", "0.39936835", "0.3986768", "0.39861843", "0.3982118", "0.39780942", "0.3976782", "0.39740604", "0.39723206", "0.3961694", "0.3951184", "0.39429346" ]
0.6614143
0
List all available interfaces
def interfaces iflist = `ifconfig | egrep "^[a-z0-9]+:" | awk '{print $1}' | sed 's/://'`.split interfaces = Hash.new interfaces['carp'] = []; interfaces['logical'] = []; interfaces['pfsync'] = []; interfaces['tunnel'] = [] interfaces['vlan'] = []; interfaces['trunk'] = []; interfaces['physical'] = [] iflist.each do |interface| ifconfig = `ifconfig #{interface}` iface = Hash.new iface['ip'] = Array.new iface['name'] = interface ifconfig.each do |line| case when line =~ /flags=\d+\<(.*)\>\s+mtu\s+([0-9]+)/ iface['mtu'] = $2 iface['flags'] = $1.split(",") iface["up?"] = iface['flags'].to_a.include?("UP") ? "up" : "down" when line =~ /^\s*media:\s+(.*)/ iface['media'] = $1 when line =~ /lladdr\s+(.*)/ iface['lladdr'] = $1 when line =~ /description: (.*)/ iface['description'] = $1 when line =~ /^\s+inet ([0-9\.]+) netmask ([0-9\.a-fx]+) broadcast ([0-9\.])/ ip_address = $1 broadcast = $3 $2 =~ /(0x..)(..)(..)(..)/ netmask = $1.hex.to_s + "." + $2.hex.to_s + "." + $3.hex.to_s + "." + $4.hex.to_s # Add a nice (dhcp) tag if the address has been given using dhcp ip_address += " (dhcp)" if `ps -ax | egrep "dhclient: #{iface['name']} " | grep -v grep | wc -l`.to_i > 0 iface['ip'] << { "address" => ip_address, "netmask" => netmask, "broadcast" => broadcast } end end case iface['name'] when /^carp/ then interfaces['carp'] << iface when /^(tun|gif)/ then interfaces['tunnel'] << iface when /^(enc|pflog|lo)[0-9]+/ then interfaces['logical'] << iface when /^pfsync/ then interfaces['pfsync'] << iface when /^vlan/ then interfaces['vlan'] << iface when /^trunk/ then interfaces['trunk'] << iface else interfaces['physical'] << iface end end interfaces end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\n end", "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend", "def interfaces()\n ifaces = []\n request = Packet.create_request(COMMAND_ID_SNIFFER_INTERFACES)\n response = client.send_request(request)\n response.each(TLV_TYPE_SNIFFER_INTERFACES) { |p|\n vals = p.tlvs.map{|x| x.value }\n iface = { }\n if vals.length == 8\n # Windows\n ikeys = %W{idx name description type mtu wireless usable dhcp}\n else\n # Mettle\n ikeys = %W{idx name description usable}\n end\n ikeys.each_index { |i| iface[ikeys[i]] = vals[i] }\n ifaces << iface\n }\n return ifaces\n end", "def interfaces\n InterfaceCollection.open\n end", "def getInterfaces()\n # this actually resolves to the output of ifconfig, which we can then\n # scan for connections\n ifconfigOut = `ifconfig`\n\n @interfaces = Array.new\n\n arr = ifconfigOut.scan(/inet addr:([0-9]+.[0-9]+.[0-9]+.[0-9]+)/)\n arr.each { |ip| \n newIp = ip[0]\n if newIp !~ /127.0.0.1/\n @interfaces.push(newIp)\n end\n }\n end", "def interfaces\n Vedeu::Interfaces.registered\n end", "def interfaces\n [\n 'LocalLB.Monitor',\n 'LocalLB.NodeAddressV2',\n 'LocalLB.Pool',\n 'LocalLB.VirtualServer',\n 'Management.DeviceGroup',\n 'System.ConfigSync',\n 'System.Failover',\n 'System.Inet'\n ]\n end", "def read_network_interfaces\n end", "def get_interfaces\n\t\trequest = Packet.create_request('stdapi_net_config_get_interfaces')\n\t\tifaces = []\n\n\t\tresponse = client.send_request(request)\n\n\t\tresponse.each(TLV_TYPE_NETWORK_INTERFACE) { |iface|\n\t\t\tifaces << Interface.new(\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_IP),\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_NETMASK),\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_MAC_ADDRESS),\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_MAC_NAME))\n\t\t}\n\n\t\treturn ifaces\n\tend", "def get_interfaces\n brctl_exit =`#{CONF[:brctl]} show`\n brctl_exit.split(\"\\n\")[1..-1].collect{|l| l.split.last }\nend", "def interfaces\n @interfaces ||= Interface.coercer(attributes[:interfaces])\n end", "def ip_all\n Socket.getifaddrs.map do |iface|\n next unless iface.addr.ipv4?\n\n puts \"\\nName: : #{iface.name}\"\n puts \"Address: :' + #{iface.addr.ip_address}\"\n end\nend", "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end", "def read_host_only_interfaces\n execute(\"list\", \"hostonlyifs\").split(\"\\n\\n\").collect do |block|\n info = {}\n\n block.split(\"\\n\").each do |line|\n if line =~ /^Name:\\s+(.+?)$/\n info[:name] = $1.to_s\n elsif line =~ /^IPAddress:\\s+(.+?)$/\n info[:ip] = $1.to_s\n elsif line =~ /^NetworkMask:\\s+(.+?)$/\n info[:netmask] = $1.to_s\n end\n end\n\n info\n end\n end", "def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end", "def sorted_interfaces\n process if @interfaces.nil?\n\n sorter.sort.map { |name|\n @interfaces.find { |i| i.name == name } or puts \"ignoring interface: #{name}\"\n }.compact\n end", "def local_network_interfaces\n network_interfaces_inventory.nil? ? [] : network_interfaces_inventory.network_interfaces(:all)\n end", "def local_network_interfaces\n network_interfaces_inventory.nil? ? [] : network_interfaces_inventory.network_interfaces(:ipv6)\n end", "def interfaces\n if @current_dir=~/\\/interfaces.*$/\n @interfaces||=FileList[\"#{@current_dir}/**/build.cfg\"].pathmap(\"%d\")\n else\n @interfaces||=FileList[\"#{@current_dir}/**/interfaces/**/build.cfg\"].pathmap(\"%d\")\n end\n return @interfaces\n end", "def unmanaged_interfaces\n if_list = cr_ohai_network.map { |x| x[0] }\n\n conduit_to_if_map.each do |conduit_name, conduit_def|\n next unless conduit_def.key?(\"if_list\")\n\n conduit_def[\"if_list\"].each do |interface|\n if_list.delete(interface)\n end\n end\n\n if_list\n end", "def local_network_interfaces\n network_interfaces_inventory.nil? ? [] : network_interfaces_inventory.network_interfaces(:ipv4)\n end", "def read_bridged_interfaces\n end", "def fc_interfaces\n provider.fc_interfaces\n end", "def test_interface_apis\n intf = interfaces[0]\n intf2 = interfaces[1]\n\n # Verify show_name usage\n one = InterfaceChannelGroup.interfaces(intf)\n assert_equal(1, one.length,\n 'Invalid number of keys returned, should be 1')\n assert_equal(Utils.normalize_intf_pattern(intf), one[intf].show_name,\n ':show_name should be intf name when show_name param specified')\n\n # Verify 'all' interfaces\n all = InterfaceChannelGroup.interfaces\n assert_operator(all.length, :>, 1,\n 'Invalid number of keys returned, should exceed 1')\n assert_empty(all[intf2].show_name,\n ':show_name should be empty string when show_name param is nil')\n\n # Test non-existent loopback does NOT raise when calling interfaces\n Interface.new('loopback543', false).destroy if\n Interface.interfaces(nil, 'loopback543').any?\n one = InterfaceChannelGroup.interfaces('loopback543')\n assert_empty(one, 'InterfaceChannelGroup.interfaces hash should be empty')\n end", "def extract_interfaces(document)\n document.xpath(\"interface\").map do |interface|\n InterfaceSpecification.parse(interface, name)\n end\n end", "def list_node_interfaces(opts = {})\n data, _status_code, _headers = list_node_interfaces_with_http_info(opts)\n return data\n end", "def ip_names\n Socket.getifaddrs.map do |ifnames|\n next unless ifnames.addr.ipv4?\n\n puts \" #{ifnames.name}\"\n end\nend", "def adapters(interface)\n mod_hash = interfaces[name_to_key(interface)] || {}\n mod_hash[:adapters] ? mod_hash[:adapters].keys : []\n end", "def init_network_interfaces\n @@client.describe_network_interfaces.network_interfaces\n end", "def network_interfaces\n netifcs = []\n procfs_file(\"net\", \"dev\") do |file|\n file.read.scan(NET_DATA) do |columns|\n type = case columns[0]\n when /^eth/ then NetworkInterface::ETHERNET_TYPE\n when /^lo/ then NetworkInterface::LOOPBACK_TYPE\n end\n\n netifcs << NetworkInterface.new(columns[0].to_sym, columns[1].to_i,\n columns[3].to_i, columns[4].to_i,\n columns[9].to_i, columns[11].to_i,\n type)\n end\n end\n netifcs\n end", "def network_interfaces\n @network_interfaces ||= init_network_interfaces\n end", "def ids\n interfaces_hash.keys\n end", "def index\n @interfaces = Interface.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @interfaces }\n end\n end", "def each_interface(&block)\n\t\tget_interfaces().each(&block)\n\tend", "def read_bridged_interfaces\n execute(\"list\", \"bridgedifs\").split(\"\\n\\n\").collect do |block|\n info = {}\n\n block.split(\"\\n\").each do |line|\n if line =~ /^Name:\\s+(.+?)$/\n info[:name] = $1.to_s\n elsif line =~ /^IPAddress:\\s+(.+?)$/\n info[:ip] = $1.to_s\n elsif line =~ /^NetworkMask:\\s+(.+?)$/\n info[:netmask] = $1.to_s\n elsif line =~ /^Status:\\s+(.+?)$/\n info[:status] = $1.to_s\n end\n end\n\n # Return the info to build up the results\n info\n end\n end", "def load_interfaces_details( app_path )\n interfaces = Array.new\n interfaces_path = \"#{app_path}/interfaces/\"\n Dir.entries(interfaces_path).select {|entry| File.directory?(File.join(interfaces_path, entry)) && !(entry =='.' || entry == '..') }.each do |iface_dir|\n interfaces.push extract_interface_info( interfaces_path, iface_dir )\n end\n interfaces\nend", "def included_interfaces; end", "def read_network_interfaces\n nics = {}\n execute(\"showvminfo\", @uuid, \"--machinereadable\").split(\"\\n\").each do |line|\n if line =~ /^nic(\\d+)=\"(.+?)\"$/\n adapter = $1.to_i\n type = $2.to_sym\n\n nics[adapter] ||= {}\n nics[adapter][:type] = type\n elsif line =~ /^hostonlyadapter(\\d+)=\"(.+?)\"$/\n adapter = $1.to_i\n network = $2.to_s\n\n nics[adapter] ||= {}\n nics[adapter][:hostonly] = network\n elsif line =~ /^bridgeadapter(\\d+)=\"(.+?)\"$/\n adapter = $1.to_i\n network = $2.to_s\n\n nics[adapter] ||= {}\n nics[adapter][:bridge] = network\n end\n end\n\n nics\n end", "def read_host_only_interfaces\n end", "def listIPs\n ips = []\n cloud_desc.network_interfaces.each { |iface|\n ips << iface.network_ip\n if iface.access_configs\n iface.access_configs.each { |acfg|\n ips << acfg.nat_ip if acfg.nat_ip\n }\n end\n }\n ips\n end", "def get_cloud_aws_network_interface_list(opts = {})\n data, _status_code, _headers = get_cloud_aws_network_interface_list_with_http_info(opts)\n data\n end", "def extended_interfaces; end", "def san_interfaces\n if san_nics.length == sans.length \n ports = san_network_ports().sort\n ips = san_nodes.map{|x| x.ip_address.to_s }.sort\n #return [] if ports.length != ips.length \n ports.zip(ips)\n else\n []\n end\n end", "def read_bridged_interfaces\n host_hw_info = read_host_info.fetch('Hardware info', {})\n net_list = host_hw_info.select do |name, attrs|\n # Get all network interfaces except 'vnicXXX'\n attrs.fetch('type') == 'net' and name !~ /^(vnic(.+?))$/\n end\n\n bridged_ifaces = []\n net_list.keys.each do |iface|\n info = {}\n ifconfig = execute('ifconfig', iface)\n # Assign default values\n info[:name] = iface\n info[:ip] = '0.0.0.0'\n info[:netmask] = '0.0.0.0'\n info[:status] = 'Down'\n\n info[:ip] = $1.to_s if ifconfig =~ /(?<=inet\\s)(\\S*)/\n if ifconfig =~ /(?<=netmask\\s)(\\S*)/\n # Netmask will be converted from hex to dec:\n # '0xffffff00' -> '255.255.255.0'\n info[:netmask] = $1.hex.to_s(16).scan(/../).each.map { |octet| octet.hex }.join('.')\n end\n info[:status] = 'Up' if ifconfig =~ /\\W(UP)\\W/ and ifconfig !~ /(?<=status:\\s)inactive$/\n\n bridged_ifaces << info\n end\n bridged_ifaces\n end", "def index\n @scan_protocols = current_account.scan_protocols.all\n end", "def find\n @interface.values\n end", "def getInterfaces profile_name\n interfaces=[]\n eval(\"TCD::Profiles::#{profile_name.to_s}\").rolloverDay.each_key {|k| interfaces << k.to_sym }\n interfaces\n end", "def list\n all.each { |device| puts(device.pretty_name) }\n end", "def nonquadport_member_interfaces(interfaces)\n Array(interfaces).map do |interface|\n next unless parsed = parse_interface(interface)\n\n if parsed[:type] == \"Fo\" && switch.facts[\"quad_port_interfaces\"].include?(parsed[:interface])\n quadport_member_interfaces(interface)\n else\n interface\n end\n end.flatten.compact.uniq.sort\n end", "def interface_methods; end", "def methods(interface)\n mod_hash = interfaces[name_to_key(interface)] || {}\n mod_hash[:methods] || []\n end", "def get_names(snmp = nil)\n snmp = snmp_manager unless snmp\n\n if snmp\n @names.clear\n\n begin\n snmp.walk([OID_SYS_INTERFACE_NAME]) do |row|\n row.each do |vb|\n @names.push(vb.value)\n end\n end\n rescue Exception => e\n NewRelic::PlatformLogger.error(\"Unable to gather Interface names with error: #{e}\")\n end\n\n NewRelic::PlatformLogger.debug(\"Interfaces: Found #{@names.size} interfaces\")\n return @names\n end\n end", "def intface_info\n Socket.getifaddrs.map do |iface|\n next unless iface.addr.ipv4?\n\n p iface.netmask\n end\nend", "def read_network_interfaces\n nics = {}\n\n # Get enabled VM's network interfaces\n ifaces = read_settings.fetch('Hardware', {}).keep_if do |dev, params|\n dev.start_with?('net') and params.fetch('enabled', true)\n end\n ifaces.each do |name, params|\n adapter = name.match(/^net(\\d+)$/)[1].to_i\n nics[adapter] ||= {}\n\n case params['type']\n when 'shared'\n nics[adapter][:type] = :shared\n when 'host'\n nics[adapter][:type] = :hostonly\n nics[adapter][:hostonly] = params.fetch('iface', '')\n when 'bridged'\n nics[adapter][:type] = :bridged\n nics[adapter][:bridge] = params.fetch('iface', '')\n end\n end\n nics\n end", "def lan_nics\n x = nics.find_all_by_network_type('lan', :order =>:port_name)\n x = [] if x.nil?\n x\n end", "def get_interfaces(data)\n\n interfaces = Array.new\n @interface = Interface.new\n\n data.each{|value|\n values = get_values(value)\n\n if values.nil?\n next\n end\n\n # New interface\n unless values.nil? || values.interface.eql?(\"\")\n\n unless @interface.empty?\n interfaces << @interface\n end\n\n @interface = Interface.new\n\n 2.times {\n puts \"\"\n }\n puts \"-----------------------\"\n\n @interface.name = values.interface.gsub(/[^a-zA-Z0-9]/,'')\n\n puts \"Interface: #{@interface.name}\"\n\n # In the same line of new Interface, probably a method is defined\n unless values.method.eql?(\"\")\n @method = MethodDef.new\n @method.name = values.method\n @method.output = values.output\n @method.description = values.description\n puts \" Method: #{@method.name} -> #{@method.description} : #{@method.output}\"\n end\n\n unless values.parameter.nil? || values.parameter.eql?(\"\")\n puts \" Parameter: #{values.parameter}\"\n @method.add_parameter values.parameter\n end\n else # Same interface\n # New method\n unless values.method.eql?(\"\")\n @interface.add_method(@method)\n @method = MethodDef.new\n @method.name = values.method\n @method.output = values.output\n @method.description = values.description\n puts \" Method: #{@method.name} -> #{@method.description} : #{@method.output}\"\n end\n # Get parameter for current method\n unless values.parameter.nil? || values.parameter.eql?(\"\")\n puts \" Parameter: #{values.parameter}\"\n @method.add_parameter values.parameter\n end\n end\n }\n @interface << @method\n interfaces << @interface\n interfaces\n end", "def interface?(ifname)\n\n\t\tip('link', 'list', ifname)\n\t\trescue Puppet::ExecutionFailure\n\t\t\twarnonce(\"Network interface \" + ifname + \" does not exist\")\n\n\tend", "def interface_decls; end", "def list(refresh=false)\n\t\t\tself.refresh if !ready? or refresh\n\n\t\t\t# return a hash or object representation of the internal model\n\t\t\tn = 0\n\t\t\t@device_number_arr.each { |dev| \n\t\t\t\tprint \"eth#{dev}:\\n\";\n\t\t\t\tprint \"\t#{@private_ip_arr[n]}\";\n\t\t\t\tprint \" => #{@public_ip_arr[n]}\" if not @public_ip_arr[n].include? \"xml\";\n\t\t\t\tprint \"\\n\"; n += 1 }\n\t\tend", "def local_ips\n list = cmd(\"addr show dev #{name} primary\", sudo: false, errors: true) +\n cmd(\"addr show dev #{name} secondary\", sudo: false, errors: true)\n list.lines.grep(/inet ([0-9\\.]+)\\/.* #{name}/i){ $1 }\n rescue\n raise Errors::UnknownInterface, \"Interface #{name} not found on this machine\" unless exists?\n raise\n end", "def scan_interfaces\n first_with_medium = self.class.interfaces.find {\n |iface| iface.medium_present?\n }\n\n if first_with_medium\n first_with_medium.name\n else\n # if we get here no interface was found with a cable attached\n # default to eth0 and hope for the best\n STDERR.puts \"warning: no suitable interface found, using eth0\"\n 'eth0'\n end\n end", "def get_interface \n\t@interface = \"\"\n\tuntil @interface != \"\" and $? == 0 do print @start,\"WIRELESS INTERFACE?\".light_yellow,@prompt\n\t@interface = gets.chomp\n\t`ifconfig #@interface`\n\tend\nend", "def quadport_member_interfaces(interfaces)\n Array(interfaces).map do |interface|\n next unless parsed = parse_interface(interface)\n\n if parsed[:type] == \"Fo\"\n (Integer(parsed[:interface])..(Integer(parsed[:interface]) + 3)).map do |int|\n \"Te %s/%s\" % [parsed[:unit], int]\n end\n else\n interface\n end\n end.flatten.compact.uniq.sort\n end", "def listen_addresses\n node['network']['interfaces'].map do |iface, data| \n data[\"addresses\"].select { |addr, data| data[\"family\"] == \"inet\" }.keys[0]\n end\nend", "def interfaces\n klass = is_a?(Class) ? self : self.class\n klass.included_modules.select { |mod| mod.is_a?(Abstract) }\n end", "def index\n @equipment_implements = EquipmentImplement.all\n end", "def list(selection=nil)\n env.load!\n\n env.config.providers.each do |name,provider|\n env.logger.debug(\"Asking provider #{name} to list ip #{selection}\")\n provider.ip_list(selection,options)\n end\n end", "def interfaces(direction, collections)\n mode = case direction\n when :input then true\n when :output then false\n else\n raise Bud::CompileError, \"unrecognized interface type #{direction}\"\n end\n collections.each do |tab|\n t_provides << [tab.to_s, mode]\n end \n end", "def interfacesCreate(node)\n interfaces=Array.new\n @parser.getInterfaces(node).each do |int|\n interfaces.push Interface.new(@parser.getInterfaceName(int))\n ip, net = @parser.getNetwork(int)\n interfaces.last.ip = ip\n interfaces.last.netmask = net\n end\n return interfaces\n end", "def list_node_interfaces_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.list_node_interfaces ...\"\n end\n # resource path\n local_var_path = \"/node/network/interfaces\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeNetworkInterfacePropertiesListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#list_node_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_available_pnics\n pnics_in_use = []\n pnics_available = []\n\n # Get pnics in use in standard switches\n @item.config.network.vswitch.each do |vs|\n vs.pnic.each do |pnic|\n pnic.slice!(\"key-vim.host.PhysicalNic-\")\n pnics_in_use << pnic\n end\n end\n\n # Get pnics in host\n self['config.network'].pnic.each do |pnic|\n pnics_available << pnic.device if !pnics_in_use.include?(pnic.device)\n end\n\n return pnics_available\n end", "def load_framework_interfaces\n interfaces = Array.new\n components_directory = \"#{File.dirname(__FILE__)}/../\"\n Dir.entries(components_directory).select {|entry| File.directory?(File.join(components_directory, entry)) && !(entry =='.' || entry == '..') }.each do |iface_dir|\n interfaces.push(extract_interface_info( components_directory, iface_dir)) if File.exist?(\"#{components_directory}#{iface_dir}/index.html\")\n end\n interfaces\nend", "def get_network_by_interface(interface)\n\n ifconfig = `ifconfig`.split(\"\\n\\n\").index_by{|x| x[/\\w+/,0]}\n inet = ifconfig[interface][/inet addr:([^\\s]*)/, 1].split('.')\n broadcast = ifconfig[interface][/Bcast:([^\\s]*)/, 1].split('.')\n mask = ifconfig[interface][/Mask:([^\\s]*)/, 1].split('.')\n\n start_first = inet[0].to_i & mask[0].to_i\n start_second = inet[1].to_i & mask[1].to_i\n start_third = inet[2].to_i & mask[2].to_i\n start_fourth = inet[3].to_i & mask[3].to_i\n\n first_range = start_first..broadcast[0].to_i\n second_range = start_second..broadcast[1].to_i\n third_range = start_third..broadcast[2].to_i\n fourth_range = start_fourth..broadcast[3].to_i\n \n @ips_to_check = []\n first_range.each do |first|\n second_range.each do |second|\n third_range.each do |third|\n fourth_range.each do |fourth|\n @ips_to_check << \"#{first}.#{second}.#{third}.#{fourth}\"\n end\n end\n end\n end\n puts \"Checking ips in (#{first_range}).(#{second_range}).(#{third_range}).(#{fourth_range})\"\n \n @ips_to_check\n end", "def ingress_interface\n list = config_get('itd_service', 'ingress_interface', @get_args)\n rlist = []\n list.each do |intf, next_hop|\n intf.gsub!('Eth', 'ethernet ')\n intf.gsub!('Po', 'port-channel ')\n intf.gsub!('Vlan', 'vlan ')\n next_hop = '' if next_hop.nil?\n rlist << [intf, next_hop]\n end\n rlist\n end", "def list_ips options={}\n if ip_version==6\n # Only list ips that have a resolutions\n AddressResolution.for_subnet(self).map &:ip\n else\n if range?\n ips = []\n if options[:include_network]\n ips << cidr.nth(0).to_s\n end\n (cidr.len - 2).times do |i|\n ips << cidr.nth(i + 1).to_s\n end\n if options[:include_gateway]\n ips << cidr.nth(cidr.len - 1).to_s\n end\n ips\n #cidr.to_a#.enumerate[1..-2]\n else\n [ip]\n end\n end\n end", "def interfaces=(new_interfaces)\n new_interfaces.each {|i| i.possible_types << self }\n @interfaces = new_interfaces\n end", "def vifs\n v = []\n __vifs.each do |vif|\n v << connection.vifs.get(vif)\n end\n v\n end", "def list_all_installable_packages(server)\n @connection.call('system.list_all_installable_packages', @sid, server)\n end", "def list\n Airplay.devices.each do |device|\n puts <<-EOS.gsub(/^\\s{12}/,'')\n * #{device.name} (#{device.info.model} running #{device.info.os_version})\n ip: #{device.ip}\n mac: #{device.id}\n password?: #{device.password? ? \"yes\" : \"no\"}\n type: #{device.type}\n resolution: #{device.info.resolution}\n\n EOS\n end\n end", "def unimplemented_methods\n self.class.interfaces.inject({}) do |hash, interface|\n methods = unimplemented_methods_for(interface)\n methods.empty? ? hash : hash.merge!(interface => methods)\n end\n end", "def get_adapter_ext_eth_interface_list(opts = {})\n data, _status_code, _headers = get_adapter_ext_eth_interface_list_with_http_info(opts)\n data\n end", "def list()\n puts \"Listing all endpoints\"\n load_manifest\n\n pp manifest.keys\n\n end", "def get_virtualization_vmware_virtual_network_interface_list(opts = {})\n data, _status_code, _headers = get_virtualization_vmware_virtual_network_interface_list_with_http_info(opts)\n data\n end", "def unimplemented_methods_for(interface)\n interface.instance_methods(false).reject { |method| respond_to_missing?(method.to_sym, true) || self.method(method.to_sym).owner != interface }.sort.map(&:to_sym)\n end", "def determine_ips\n ips = @info[:ip] = {private: [], public: []}\n\n ifc_cmd = \"/sbin/ifconfig|grep 'inet addr'|grep -v ':127'|sed -e \" \\\n \"'s/.*addr:\\([0-9.]*\\) .*/\\\\1/'\"\n ifconfig = @shell.query('IFCONFIG', ifc_cmd)\n\n ifconfig.each_line do |ip|\n ip.strip!\n ips[rfc1918?(ip)] << ip\n end\n end", "def router_nat_list_all(timeout=10)\n\t\t\t\t\t\tnat_cmd = \"iptables -t nat -nvL\"\n\t\t\t\t\t\trouter_send_cmd(nat_cmd, timeout)\n\t\t\t\tend", "def all\n scan_supported_keys\n end", "def get_all_tables\n\t\ttc = new_sub(@discovery['tables']['url'], @discovery['tables']['capability'])\n\t\ttc.listen.map {|x| JSON.parse(x) rescue nil}.compact\n\tend", "def all_servers\n Infrataster::Server.defined_servers.map { |i| server(i.name) }\nend", "def display_all_shortcuts\n # Interface method\n end", "def interface\n @interface ||= EC2.find_interface(description)\n end", "def inports\n all_ports :in\n end", "def get_virtualization_vmware_virtual_network_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VirtualizationApi.get_virtualization_vmware_virtual_network_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/virtualization/VmwareVirtualNetworkInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'VirtualizationVmwareVirtualNetworkInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"VirtualizationApi.get_virtualization_vmware_virtual_network_interface_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VirtualizationApi#get_virtualization_vmware_virtual_network_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def notifyinterface\r\n\t\t\t`#{BITS::BITSADMIN} /getnotifyinterface {#{@id}}`\r\n\t\tend", "def all(options = {})\n data = service.get_records 'VLAN'\n load(data)\n end", "def network_interface\n node = 'AWS_NETWORK_INTERFACE'\n q = []\n\n # network interface\n q.push(_upsert({ node: node, id: @name }))\n\n # vpc node and relationship\n if @data.vpc_id\n opts = {\n parent_node: node,\n parent_name: @name,\n child_node: 'AWS_VPC',\n child_name: @data.vpc_id,\n relationship: 'MEMBER_OF_VPC'\n }\n\n q.push(_upsert_and_link(opts))\n end\n\n # security_groups and relationship\n @data.groups.each do |sg|\n opts = {\n node: 'AWS_SECURITY_GROUP',\n id: sg.group_id,\n headless: true\n }\n\n q.push(_merge(opts))\n\n # network_interface -> security_group\n opts = {\n from_node: 'AWS_NETWORK_INTERFACE',\n from_name: @name,\n to_node: 'AWS_SECURITY_GROUP',\n to_name: sg.group_id,\n relationship: 'IN_SECURITY_GROUP',\n headless: true\n }\n q.push(_link(opts))\n end\n\n q\n end", "def list_api\n return self.sendcmd(\"fldigi.list\")\n end", "def defaults\n {\n interfaces: []\n }\n end", "def list_known\n normalize_listing_output rvm(:list, :known).stdout\n end", "def get_adapter_host_eth_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_host_eth_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/HostEthInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'AdapterHostEthInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_host_eth_interface_list\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AdapterApi#get_adapter_host_eth_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.7889084", "0.76509845", "0.7390691", "0.7368879", "0.7358693", "0.7311803", "0.70828545", "0.704498", "0.70353276", "0.68507147", "0.68278056", "0.68234175", "0.6802205", "0.6641686", "0.655568", "0.6536816", "0.65230703", "0.648733", "0.6451476", "0.6334007", "0.63130057", "0.6288739", "0.6286816", "0.6283506", "0.6273074", "0.6265642", "0.6260661", "0.6246634", "0.62398803", "0.6227945", "0.6218472", "0.62009466", "0.6177303", "0.6158859", "0.6137352", "0.6088509", "0.60824", "0.60774183", "0.6068998", "0.605438", "0.60361207", "0.6006858", "0.6006593", "0.6004293", "0.5964627", "0.5942812", "0.5904621", "0.5877743", "0.5876461", "0.5857857", "0.5857389", "0.58177143", "0.580835", "0.5794347", "0.57400894", "0.5736545", "0.5704021", "0.5697551", "0.5677062", "0.5671007", "0.56405216", "0.5623411", "0.55834234", "0.556639", "0.5565563", "0.5543826", "0.553575", "0.5525348", "0.55205756", "0.5505184", "0.5488594", "0.5473691", "0.543576", "0.5430677", "0.54200983", "0.5401223", "0.5397409", "0.5388505", "0.53875595", "0.5380203", "0.537502", "0.5355105", "0.53520167", "0.53458476", "0.5343182", "0.5342707", "0.5333212", "0.53099835", "0.5304146", "0.5304109", "0.52791315", "0.5273867", "0.52464664", "0.5235491", "0.5233768", "0.5227671", "0.5213753", "0.52092206", "0.52051234", "0.5202896" ]
0.60195714
41
Use callbacks to share common setup or constraints between actions.
def set_media @media = Media.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def media_params params.permit(:user_id, :type, :title, :description, :item, :message_id, :is_deleted) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
If servers is given, then this environment variable will only apply to that server (or array of servers) (these should match names given in :domain). If servers is not given, then this environment variable applies to all servers.
def env(key, value, servers = nil) servers = Array(servers) if servers @environment[[key, servers]] = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servers=(servers)\r\n @servers = {}\r\n servers.each{|s| @servers[s.host] = s}\r\n end", "def set_servers(servers)\n servers = Array(servers)\n servers.map! do |server|\n server.is_a?(String) ? server : inspect_server(server)\n end\n super\n end", "def enterprise_proxy_servers=(value)\n @enterprise_proxy_servers = value\n end", "def servers # Only in Ruby API (1.3 compatible)\n\t\t@settings.servers\n\tend", "def dns_servers(arg=nil)\n set_or_return(:dns_servers, arg, :kind_of => String)\n end", "def servers=(server_hash) # Only in Ruby API (1.3 compatible)\n\t\t@settings.servers = server_hash\n\tend", "def servers\n @_servers ||= []\n end", "def servers\n @_servers ||= []\n end", "def enterprise_internal_proxy_servers=(value)\n @enterprise_internal_proxy_servers = value\n end", "def set_servers(name, servers)\n current = get(name)\n current[:servers].each do |srv|\n return false unless remove_server(name, srv)\n end\n servers.each do |srv|\n hostname = srv[:name]\n return false unless add_server(name, hostname, srv)\n end\n true\n end", "def add_servers(servers)\n servers.each{|s| @servers[s] = s}\n end", "def servers(servers)\n servers.select{ |server| server.mongos? }\n end", "def add_default_dns_server(servers)\n\n unless @default_server.to_s.empty? || @default_server == '127.0.0.1'\n (servers ||= []) << @default_server\n servers.uniq!\n end\n\n servers\n end", "def dns_servers=(dns_servers)\n if !dns_servers.nil? && dns_servers.length > 3\n fail ArgumentError, 'invalid value for \"dns_servers\", number of items must be less than or equal to 3.'\n end\n\n if !dns_servers.nil? && dns_servers.length < 1\n fail ArgumentError, 'invalid value for \"dns_servers\", number of items must be greater than or equal to 1.'\n end\n\n @dns_servers = dns_servers\n end", "def servers\n configuration.servers\n end", "def servers\n @config['servers'].map { |server| server.split(/:/) }\n end", "def alias_server_attributes\n @config['server'].each do |key, value|\n instance_variable_set('@' + key, value)\n end\n end", "def enterprise_proxy_servers_are_authoritative=(value)\n @enterprise_proxy_servers_are_authoritative = value\n end", "def set_name_servers(opts = {})\n value = opts[:value]\n enable = opts.fetch(:enable, true)\n default = opts[:default] || false\n\n case default\n when true\n cmds = 'default ip name-server'\n when false\n cmds = ['no ip name-server']\n if enable\n value.each do |srv|\n cmds << \"ip name-server #{srv}\"\n end\n end\n end\n configure cmds\n end", "def servers\n gateway_check\n unavailable_servers_check\n @servers\n end", "def save_server_in_context(servers, overwrite=true)\n fields = [\"#{provider}_private_ips\", \"cloud_private_ips\", \"#{provider}_ips\", \"cloud_ips\", \"#{provider}_names\", \"cloud_names\"]\n values = {}\n fields.each {|f| values[f] = get_field(f) || []}\n\n servers.each do |s|\n private_addr = private_address(s)\n ip = s.public_ip_address\n name = server_name(s)\n\n if private_addr and !private_addr.empty?\n values[\"#{provider}_private_ips\"] << private_addr\n values[\"cloud_private_ips\"] << private_addr\n end\n\n unless s.public_ip_address.nil?\n values[\"#{provider}_ips\"] << ip\n values[\"cloud_ips\"] << ip\n end\n\n values[\"#{provider}_names\"] << name\n values[\"cloud_names\"] << name\n end\n\n values.each {|k,v| set_field(k, v)}\n end", "def all_servers\n if is_zz?\n return app_config[:all_servers]\n end\n\n return @all_servers if @all_servers != nil\n\n instances = ey['environment']['instances']\n\n # collect all the app server hosts\n @all_servers = []\n instances.each do |instance|\n @all_servers << instance['private_hostname']\n end\n # add ourselves if we have no info, running on dev box\n @all_servers << this_host_name if @all_servers.empty?\n\n @all_servers\n end", "def generic_envs\n\t\t\treturn [\"production\", \"sandbox\"]\n\t\tend", "def config_server_name\n return if config[:server_name]\n\n if config[:server_name_prefix]\n config[:server_name] = server_name_prefix(\n config[:server_name_prefix]\n )\n else\n config[:server_name] = default_name\n end\n end", "def servers\n gateway_check\n @servers\n end", "def set_servers(servers)\n Array(servers).each_with_index do |server, index|\n # Socket\n check_return_code(\n if server.is_a?(String) and File.socket?(server)\n args = [@struct, server, options[:default_weight].to_i]\n Lib.memcached_server_add_unix_socket_with_weight(*args)\n # Network\n elsif server.is_a?(String) and server =~ /^[\\w\\d\\.-]+(:\\d{1,5}){0,2}$/\n host, port, weight = server.split(\":\")\n args = [@struct, host, port.to_i, (weight || options[:default_weight]).to_i]\n if options[:use_udp]\n Lib.memcached_server_add_udp_with_weight(*args)\n else\n Lib.memcached_server_add_with_weight(*args)\n end\n else\n raise ArgumentError, \"Servers must be either in the format 'host:port[:weight]' (e.g., 'localhost:11211' or 'localhost:11211:10') for a network server, or a valid path to a Unix domain socket (e.g., /var/run/memcached).\"\n end\n )\n end\n end", "def prod_server\n PROD_SERVER\n end", "def domain=(nd)\n self['SERVER_NAME'] = self['HTTP_HOST'] = nd\n end", "def initialize(servers)\n @servers = servers\n end", "def servers(servers)\n servers.select do |server|\n (replica_set_name.nil? || server.replica_set_name == replica_set_name) &&\n server.primary? || server.secondary?\n end\n end", "def available_servers\n authenticate_user!\n @rackspace_servers = Server.rackspace_servers\n end", "def server_settings\n [\n {\n url: \"https://{subdomain}.{site}\",\n description: \"No description provided\",\n variables: {\n site: {\n description: \"The regional site for Datadog customers.\",\n default_value: \"datadoghq.com\",\n enum_values: [\n \"datadoghq.com\",\n \"us3.datadoghq.com\",\n \"us5.datadoghq.com\",\n \"ap1.datadoghq.com\",\n \"datadoghq.eu\",\n \"ddog-gov.com\"\n ]\n },\n subdomain: {\n description: \"The subdomain where the API is deployed.\",\n default_value: \"api\",\n }\n }\n },\n {\n url: \"{protocol}://{name}\",\n description: \"No description provided\",\n variables: {\n name: {\n description: \"Full site DNS name.\",\n default_value: \"api.datadoghq.com\",\n },\n protocol: {\n description: \"The protocol for accessing the API.\",\n default_value: \"https\",\n }\n }\n },\n {\n url: \"https://{subdomain}.{site}\",\n description: \"No description provided\",\n variables: {\n site: {\n description: \"Any Datadog deployment.\",\n default_value: \"datadoghq.com\",\n },\n subdomain: {\n description: \"The subdomain where the API is deployed.\",\n default_value: \"api\",\n }\n }\n }\n ]\n end", "def servers\n @servers ||= execute_remote!(command(:servers)).each_line.map { |line| JSON.parse line }\n end", "def set_site_domain\n begin\n @enable_games = false\n @enable_topics = false\n @enable_wiki = false\n @site_domain = 'lefiores.com'\n @facebook_url = 'https://www.facebook.com/www.gamerz.wiki'\n @twitter_url = 'https://twitter.com/gamerzwiki'\n @google_plus_url = 'https://plus.google.com/116093313158973278682/about'\n\n if Rails.env.production? \n @site_domain = 'lefiores.com' \n \n else\n @site_domain = 'localhost:3000' \n end\n rescue \n @site_domain = 'lefiores.com' \n end\n end", "def servers_selected\n @_servers_selected ||=[]\n end", "def proxmox_servers\n @proxmox_servers\n end", "def server_hosts\n return [:default] if @resource[:server_hosts] &&\n @resource[:server_hosts][0] == :default &&\n @property_hash[:server_hosts] ==\n @aaa_group.default_servers\n @property_hash[:server_hosts]\n end", "def activate_servers(servers)\n raise \"You have to provide at least one server\" unless servers\n options = {load_balancer_id: self.id, server_ids: servers.collect(&:id)}\n response = Profitbricks.request :activate_load_balancing_on_servers, options\n return true\n end", "def deactivate_servers(servers)\n raise \"You have to provide at least one server\" unless servers\n options = {load_balancer_id: self.id, server_ids: servers.collect(&:id)}\n response = Profitbricks.request :deactivate_load_balancing_on_servers, options\n return true\n end", "def servers\n servers_for\n end", "def all_app_servers\n if is_zz?\n return app_config[:app_servers]\n end\n\n return @all_app_servers if @all_app_servers != nil\n @app_server_types ||= Set.new [ 'solo', 'app', 'app_master' ].freeze\n\n instances = ey['environment']['instances']\n\n # collect all the app server hosts\n @all_app_servers = []\n instances.each do |instance|\n if @app_server_types.include?(instance['role'])\n @all_app_servers << instance['private_hostname']\n end\n end\n # add ourselves if we have no info, running on dev box\n @all_app_servers << this_host_name if @all_app_servers.empty?\n\n @all_app_servers\n end", "def domain_has_servers?(options = {})\n return true if EmailAddress.known_domains.include?(domain.name.downcase)\n servers = []\n servers << domain.exchange_servers(options)\n servers << domain.address_servers(options) if !options[:mx_only]\n servers.flatten!\n if (servers.size - servers.nitems) > 0\n options.fetch(:fail_on_timeout, true) ? nil : true\n else\n !servers.empty?\n end\n end", "def server_name=(value)\n @server_name = value\n end", "def exchange_servers(options = {})\n servers_in :exchange, options\n end", "def set_master_dns(server)\n run_script('master_init', server)\n end", "def servers\r\n @servers.values\r\n end", "def all_server_hosts\n [server_host]\n end", "def env_set?(*vars)\n vars.map{ |v| ENV.has_key?(v) }.all?\n end", "def servers\n servers_by_name.values\n end", "def custom_server(server)\n \"#{PREFIX}#{server}\" if !server.start_with? PREFIX\n end", "def register_servers(servers)\n raise \"You have to provide at least one server\" unless servers\n options = {load_balancer_id: self.id, server_ids: servers.collect(&:id)}\n response = Profitbricks.request :register_servers_on_load_balancer, options\n self.reload\n return true\n end", "def environments\n @environments ||= [:production]\n end", "def load_servers\n servers = load_config_file Constants::Filepath::SERVER\n servers.each { |server_type, servers|\n servers.each { |server|\n server[:server_type] = server_type.to_s\n @servers_map[server[:server_id]] = server\n }\n }\n end", "def configured_servers\n\t\thosts = self.configured_hosts\n\t\treturn Mongrel2::Config::Server.where( id: hosts.select(:server_id) )\n\tend", "def set_env(papers, site_host, site_name, nwo)\n ENV['REVIEW_REPOSITORY'] = nwo\n ENV['DOI_PREFIX'] = \"10.21105\"\n ENV['PAPER_REPOSITORY'] = papers\n ENV['JOURNAL_URL'] = site_host\n ENV['JOURNAL_NAME'] = site_name\n end", "def set_defaults\n self.subdomain ||= \"app\"\n end", "def detect_os\n @server_os = Array.new\n @servers.each do |server|\n if object_behavior(server, :spot_check_command?, \"lsb_release -is | grep Ubuntu\")\n puts \"setting server to ubuntu\"\n server.os = \"ubuntu\"\n server.apache_str = \"apache2\"\n server.apache_check = \"apache2ctl status\"\n server.haproxy_check = \"service haproxy status\"\n else\n puts \"setting server to centos\"\n server.os = \"centos\"\n server.apache_str = \"httpd\"\n server.apache_check = \"service httpd status\"\n server.haproxy_check = \"service haproxy check\"\n end\n end\n end", "def servers\n return self.bare_metal_servers + self.virtual_servers\n end", "def address_servers(options = {})\n servers_in :address, options\n end", "def add_servers servers\n @station.add_servers servers\n end", "def default_server\n server?(:default)\n end", "def domain\n server_name || http_host\n end", "def nameserver_config\n return unless ENV.key?('MM_DNSRC') && ENV['MM_DNSRC']\n\n address, port = ENV['MM_DNSRC'].split(/:/)\n\n {\n nameserver_port: [[address, port.to_i]]\n }\n rescue StandardError\n {}\n end", "def add_servers(servers)\n sync do\n servers.each do |server|\n unless @servers.has_key?(server)\n @servers[server] = server\n @available_connections[server] = []\n @allocated[server] = {}\n end\n end\n end\n end", "def hosts(args = nil)\n if args and args[:server]\n args[:server].split(';').collect { |server| $hosts[server] ||\n Config.warn_fail(\"#{server} is not a known host\") }\n else\n $hosts.values\n end\nend", "def defined_preferences\n super - [:server]\n end", "def servers\n sync{@servers.keys}\n end", "def exchange_server=(value)\n @exchange_server = value\n end", "def fog_servers\n @fog_servers = @cloud.fog_servers\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def set_Server(value)\n set_input(\"Server\", value)\n end", "def setup_domains\n authorize unless @heroku\n each_heroku_app do |heroku_env, app_name, repo|\n # get the domains that we are aiming towards\n domains = @config.domains(heroku_env)\n\n # get the domains that are already on the servers\n existing_domains = (@heroku.list_domains(app_name) || []).map{|a| a[:domain]}\n\n # remove the domains that need to be removed\n existing_domains.each do |existing_domain|\n # check to see if we need to delete this domain\n unless domains.include?(existing_domain)\n # delete this domain if they arent on the approved list\n destroy_command \"heroku domains:remove #{existing_domain} --app #{app_name}\"\n end\n end\n\n # add the domains that dont exist already\n domains.each do |domain|\n # check to see if we need to add this domain\n unless existing_domains.include?(domain)\n # add this domain if they are not already added\n creation_command \"heroku domains:add #{domain} --app #{app_name}\"\n end\n end\n\n # display the destructive commands\n output_destroy_commands(app_name)\n end\n end", "def remove_servers(servers)\n raise(Sequel::Error, \"cannot remove default server\") if servers.include?(:default)\n servers.each do |server|\n disconnect_server(server, &@disconnection_proc)\n @servers.delete(server)\n end\n end", "def host_or_domain=(value)\n @host_or_domain = value\n end", "def environments\n fetch(:environments, nil) || [fetch(:environment, 'production')]\n end", "def servers\n tuples = config.scan(SERVER_REGEXP)\n tuples.map do |(host, mplex, vrf, port, tout, keyfm, key)|\n hsh = {}\n hsh[:hostname] = host\n hsh[:vrf] = vrf\n hsh[:port] = port.to_i\n hsh[:timeout] = tout.to_i\n hsh[:key_format] = keyfm.to_i\n hsh[:key] = key\n hsh[:multiplex] = mplex ? true : false\n hsh\n end\n end", "def homeserver_suffix\n \":#{homeserver}\" if domain\n end", "def homeserver_suffix\n \":#{homeserver}\" if domain\n end", "def set_master_dns(server)\n audit = server.run_executable(@scripts_to_run['master_init'])\n audit.wait_for_completed\n end", "def public_host_config\n config = {:host => SERVER_DOMAIN[RAILS_ENV.to_sym], :subdomain => subdomain, :l => locale(:en)}\n if default_host\n config = {:host => default_host, :subdomain => 'www', :l => locale(:en)}\n end\n\n config\n end", "def reset_servers(service_id, servers=[])\n request :put, \"/services/#{service_id}/servers\"\n end", "def set_server_name; self.name = domain; end", "def deregister_servers(servers)\n raise \"You have to provide at least one server\" unless servers\n options = {load_balancer_id: self.id, server_ids: servers.collect(&:id)}\n response = Profitbricks.request :deregister_servers_on_load_balancer, options\n return true\n end", "def default_short_domain\n Fanforce::Base::DomainEnvironments.method(environment).call[:default_short_domain]\n end", "def main_site_host\n case Rails.env\n when 'development'\n # '192.168.1.140' # to test in ie\n # 'ngoaidmap.dev'\n 'iom.dev'\n when 'test'\n 'example.com'\n when 'staging'\n Settings.main_site_host\n when 'production'\n Settings.main_site_host\n end\n end", "def servers(backend = nil)\n my_servers = []\n if backend.nil?\n # return all servers\n backend_instances.each_value do | backend|\n my_servers << backend.server_names\n end\n else\n begin\n my_servers = backend_instances[backend].server_names\n rescue KeyError => e\n \"The backend #{backend} is not a valid argument\"\n end\n end\n # return a list of serv\n my_servers.flatten.uniq\n end", "def auth_server(environment)\n auth_server_url = ENV['ADSAPI_AUTH_URL']\n if auth_server_url.nil?\n environment = environment.upcase.to_sym\n auth_server_url = auth_server_config[environment]\n end\n if auth_server_url.nil?\n # If we don't have an entry for this environment, we just return the\n # default server (the same one being used for the default environment)\n auth_server_url = auth_server_config[default_environment()]\n end\n return auth_server_url\n end", "def servers\n @servers.select { |server| server.operable? }\n end", "def servers\n @servers.keys\n end", "def get_server_domain\n @hostname ||= Socket.gethostname\n end", "def host_only=(value)\n @host_only = value\n end", "def detect_os\n @server_os = Array.new\n @servers.each do |server|\n# if obj_behavior(server, :spot_check_command?, \"lsb_release -is | grep Ubuntu\")\n if probe(server, \"lsb_release -is | grep Ubuntu\")\n puts \"setting server to ubuntu\"\n server.os = \"ubuntu\"\n server.apache_str = \"apache2\"\n server.apache_check = \"apache2ctl status\"\n server.haproxy_check = \"service haproxy status\"\n else\n puts \"setting server to centos\"\n server.os = \"centos\"\n server.apache_str = \"httpd\"\n server.apache_check = \"service httpd status\"\n server.haproxy_check = \"service haproxy check\"\n end\n end\n end", "def run_servers(dirs: %w(app servers))\n files = server_files(dirs)\n fail \"No servers found!\" if files.empty?\n\n # Load each server defined in the project dir\n files.each do |file|\n @servers << run_server_file(file)\n end\n\n @servers\n end", "def enterprise_proxy_servers_are_authoritative\n return @enterprise_proxy_servers_are_authoritative\n end" ]
[ "0.6727048", "0.66139", "0.61317766", "0.6121265", "0.60839874", "0.60374045", "0.59241694", "0.59241694", "0.5913596", "0.5811272", "0.5779118", "0.5750701", "0.5742925", "0.5716683", "0.5696739", "0.56193817", "0.5572627", "0.5555297", "0.54933023", "0.54788536", "0.54535234", "0.5452002", "0.5443796", "0.5412591", "0.5405034", "0.5392637", "0.53732514", "0.5354562", "0.5353638", "0.53494996", "0.53208876", "0.53008", "0.52894604", "0.5275835", "0.5275525", "0.5274342", "0.52606475", "0.5237951", "0.52338773", "0.52248806", "0.5223245", "0.5221694", "0.5212701", "0.5206356", "0.5180312", "0.5179927", "0.51715523", "0.51606685", "0.5160342", "0.5150788", "0.5132571", "0.51235294", "0.5123043", "0.510112", "0.5090155", "0.50896657", "0.50894386", "0.50697076", "0.50485283", "0.50412136", "0.5036614", "0.5032086", "0.50219613", "0.50210506", "0.50156933", "0.5012889", "0.50128126", "0.49928313", "0.4991811", "0.49854892", "0.49854892", "0.49854892", "0.49854892", "0.49854892", "0.49854892", "0.49854892", "0.49854892", "0.49674964", "0.49673325", "0.49665254", "0.49632263", "0.49603158", "0.49587402", "0.49587402", "0.49443653", "0.49441242", "0.4940081", "0.49388084", "0.49384764", "0.49353728", "0.49266848", "0.49263024", "0.492566", "0.49227795", "0.49170274", "0.4904819", "0.4892217", "0.48900485", "0.4889263", "0.48867297" ]
0.59428513
6
Returns an array of hashes for redis to pass to publisher
def team_members_for_output members = team_memberships.map do |tm| profile = tm.person_profile.published_version next unless profile.present? { title: profile.content_item.title, url_path: profile.content_item.url_path, role_holder_name: profile.role_holder_name, summary: profile.content_item.summary, role_holder_photo_url: profile.role_holder_photo_url, role_holder_photo_alt_text: profile.role_holder_photo_alt_text, role_holder_photo_caption: profile.role_holder_photo_caption, member_order: tm.member_order } end members.compact! # Split up the members who have or do not have an order for separate sorting later members_without_order = [] members_with_order = [] members.each do |member| if member[:member_order].nil? members_without_order << member else members_with_order << member end end # Sort the team members who have a specified order by order, then name members_with_order.sort_by! { |m| [m[:member_order], m[:role_holder_name]] } # Sort the team members who do not have a specified order by name only members_without_order.sort_by! { |m| m[:role_holder_name] } # List the ordered ones first, then ones without an order members_with_order + members_without_order end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entries\n @redis.keys('*')\n end", "def hash_to_redis(hash)\n hash.inject([]) { |arr, kv| arr + [kv[0], kv[1]] }\n end", "def to_json_redis\r\n JSON.generate({:application_id => @application_id, \r\n :secure_hash_key => @secure_hash_key, \r\n :create_date => @create_date,\r\n :max_age => @max_age,\r\n :modify_time => @modify_time,\r\n :last_used => @last_used,\r\n :status=> @status}) \r\n end", "def keys\n @redis.keys(@list + '*').reject { |s| s.end_with? '_MD5' }\n end", "def to_json_redis\r\n JSON.generate({:private_key => @private_key, \r\n :certificate => @certificate, \r\n :create_date => @create_date,\r\n :secure_hash_key => @secure_hash_key,\r\n :status => @status,\r\n :scope => @scope}) \r\n end", "def hashes\n return @hashes\n end", "def getredisproto(*args)\n proto = [] \n proto.push(\"*\"+args.length.to_s+\"\\r\\n\")\n args.each{|arg|\n proto.push(\"$\"+arg.to_s.bytesize.to_s+\"\\r\\n\")\n proto.push(arg.to_s+\"\\r\\n\")\n }\n proto\nend", "def all_redis_objects\n Base.redis_objects.merge(self.redis_objects)\n end", "def hgetall(hash)\n redis_token.hgetall(hash)\n end", "def hash\n [].hash\n end", "def entries\n MicroQ.redis do |r|\n r.lrange(QUEUES[:entries], 0, -1)\n end.collect(&MicroQ::Util.json_parse)\n end", "def find_all\n find_all_redis_keys.map do |redis_key|\n find_by_redis_key(redis_key)\n end\n end", "def to_hash\n h = {}\n self.all_redis_objects.each do |o|\n field = o[0]\n redis_type = o[1][:type] \n case redis_type\n when :value\n h[field] = try_a_number(self.method(field).call.value)\n when :set\n h[field] = self.method(field).call.members.map{ |x| try_a_number(x) }\n end\n end\n h\n end", "def inputs\n Base.redis.hexists(self.name, :inputs) ? \\\n Marshal.load(Base.redis.hget(self.name, :inputs)) \\\n : []\n end", "def redis_pool; end", "def subscribers\n subs = {}\n subscriber_names.each do |sname|\n subs[sname] = ::Qup::Adapter::Redis::Queue.new(@uri, sname, @name)\n end\n return subs\n end", "def hash\n @events.hash\n end", "def keys\n return [], []\n end", "def all_hash\n results = CONNECTION.execute(\"SELECT * FROM #{get_table_name};\")\n return array_list = make_object_array(results)\n end", "def ids\n if Array === key\n Stal.solve(redis, key)\n else\n key.call(\"SMEMBERS\")\n end\n end", "def to_a\n store.keys.to_a\n end", "def get_pubkeys\n chunks\n .select do |c|\n c.pushdata? && [33, 65].include?(c.pushed_data.bytesize) &&\n [2, 3, 4, 6, 7].include?(c.pushed_data[0].bth.to_i(16))\n end\n .map { |c| c.pushed_data.bth }\n end", "def _all\n out = {}\n ids.each {|i| @store.transaction(true) {out[i] = @store[i]}}\n out\n end", "def find_all_redis_keys\n redis.connection do |c|\n c.keys(\"#{self.REDIS_KEY_NAMESPACE}:*\")\n end\n end", "def subscribers\n store[name].map { |r| r.contents } \n end", "def redis_connections\n @redis_connections ||= Stockpile::RedisConnectionsFactory.build_connections\n end", "def items_hash()\n return @items\n end", "def serialize_array\n `self.serializeArray()`.map { |e| Hash.new(e) }\n end", "def redis_set_options\n {}\n end", "def keys\n configs.keys | store.keys\n end", "def keys\n begin \n @connection = case params['filter']\n when 'all' \n $redis.keys\n when 'mall'\n $redis.keys 'mall*' \n when 'cache'\n $redis.keys 'mallc*'\n when 'session'\n $redis.keys 'malls*' \n when nil\n $redis.keys.length\n else\n $redis.keys \"#{params['filter']}*\"\n end\n rescue => e\n @connection = {status: 500, message: e.message }\n end \n\n respond_to do |format|\n format.json { render json: @connection }\n end \n end", "def list\n @redis.hgetall(STORE_KEY).sort.map do |name, command|\n AliasedCommand.new(name, command)\n end\n end", "def get_cache_aggregation\n redis_data = []\n cache_result = []\n redis_cache = $redis.keys\n unless redis_cache.empty?\n redis_cache.each do |k|\n reading = eval($redis.get(k))\n next if !reading[\"household_token\"].eql?(params[:household_token])\n redis_data << { \"temperature\" => reading[\"temperature\"], \"humidity\" => reading[\"humidity\"], \"battery_charge\" => reading[\"battery_charge\"] }\n end\n end\n\n unless redis_data.blank?\n thermostat_attr = [\"temperature\", \"humidity\", \"battery_charge\"]\n avg_data = get_avg_data(thermostat_attr, redis_data)\n min_data = get_min_data(thermostat_attr, redis_data)\n max_data = get_max_data(thermostat_attr, redis_data)\n cache_result << {\"temperature\" => {\"avg\" => avg_data[0].round(2), \"min\" => min_data[0], \"max\" => max_data[0]}}\n cache_result << {\"humidity\" => {\"avg\" => avg_data[1].round(2), \"min\" => min_data[1], \"max\" => max_data[1]}}\n cache_result << {\"battery_charge\" => {\"avg\" => avg_data[2].round(2), \"min\" => min_data[2], \"max\" => max_data[2]}}\n end\n return cache_result\n end", "def to_redis\r\n\r\n # Hash representation\r\n representation = {\r\n finish_time: finish_time,\r\n description: description\r\n }\r\n\r\n representation.to_json.to_s\r\n\r\n end", "def list_workers\n Shuttle::Redis.smembers worker_set_key\n end", "def keys\n return []\n end", "def dump(type)\n\n @redis.keys_to_a(\"#{type}/*\").sort.join(\"\\n\")\n end", "def get_hashpipe_status_values(redis, skey, *hkeys)\n hkeys.flatten.map! do |hk|\n sval = redis.hget(hk, skey)\n block_given? ? yield(sval) : sval\n end\nend", "def get_hashes(items)\n hashes = []\n items.each do |item|\n hashes.push((Digest::SHA2.new << item).to_s)\n end\n\n return hashes\n end", "def read_hash_for_id(id)\n Sidekiq.redis do |conn|\n conn.hgetall id\n end\n end", "def versions(name)\n @redis.hkeys(\"cookbook:#{name}\")\n end", "def to_ary\n @keys\n end", "def keys\n @store.keys\n end", "def to_hash\n {:hashes => @hashes}\n end", "def commands\n ensure_cache_up_to_date\n commands = self.redis.keys(\"bluster:objects:command:*\")\n commands.map! { |r| r.split(\":\")[3] }\n commands.uniq\n end", "def redis\n Resque.redis\n end", "def get_stored_paths\n redis.smembers stored_paths_key\n end", "def populate_from_redis\n response_from_redis_or_service\n end", "def digests\n @digests ||= SidekiqUniqueJobs::Digests.new\n end", "def registered\n return [] if empty?\n return storage.keys if storage.is_a?(Hash)\n return storage.to_a if storage.is_a?(Set)\n\n storage\n end", "def publishers_coll\n settings.db['publishers']\n end", "def keys\n\t\t\treturn @storage.keys\n\t\tend", "def hash\n [monitor_tags].hash\n end", "def registered\n return [] if storage.empty?\n\n return storage.keys if storage.is_a?(Hash)\n return storage.to_a if storage.is_a?(Set)\n\n storage\n end", "def collect_node_nei_hashes\n @log.info(\"#{__method__.to_s} started[#{self.class.to_s}]\")\n\n node_nei_hash = @redis_connector.fetch_relations\n end", "def identity_publisher_hash\n return @identity_publisher_hash\n end", "def history(client)\n @redis.hgetall(key(client))\n end", "def get_subscribers\n subscriber_data = RunrWatcherServer.runr_session_get(\"subscribers\")\n return [] unless subscriber_data.present?\n list = subscriber_data[:subscribers][\"list\"]\n return [] unless list.present?\n JSON.parse list\n end", "def persistent_schedules\n redis.hgetall(:persistent_schedules).tap do |h|\n h.each do |name, config|\n h[name] = decode(config)\n end\n end\n end", "def load_pools_to_redis\n @redis.with_metrics do |redis|\n previously_configured_pools = redis.smembers('vmpooler__pools')\n currently_configured_pools = []\n config[:pools].each do |pool|\n currently_configured_pools << pool['name']\n redis.sadd('vmpooler__pools', pool['name'].to_s)\n pool_keys = pool.keys\n pool_keys.delete('alias')\n to_set = {}\n pool_keys.each do |k|\n to_set[k] = pool[k]\n end\n to_set['alias'] = pool['alias'].join(',') if to_set.key?('alias')\n to_set['domain'] = Vmpooler::Dns.get_domain_for_pool(config, pool['name'])\n\n redis.hmset(\"vmpooler__pool__#{pool['name']}\", *to_set.to_a.flatten) unless to_set.empty?\n end\n previously_configured_pools.each do |pool|\n unless currently_configured_pools.include? pool\n redis.srem('vmpooler__pools', pool.to_s)\n redis.del(\"vmpooler__pool__#{pool}\")\n end\n end\n end\n nil\n end", "def servers\n @servers.keys\n end", "def keys\n @monitor.synchronize { @stash.keys }\n end", "def gen_redis_proto *cmd\n proto = \"*#{cmd.length}\\r\\n\"\n cmd.each { |arg|\n proto << \"$#{arg.bytesize}\\r\\n#{arg}\\r\\n\"\n }\n proto\nend", "def all\n # Accessing the store requires a transaction \n @store.transaction do\n # Create an array with the values for each key \n @store.roots.map { |id| @store[id] }\n end\n end", "def redis\n $redis\n end", "def registered\n return [] if empty?\n\n storage\n end", "def redis_info\n @redis_info ||= redis.info\n end", "def hash\n members.hash\n end", "def to_hash\n @list\n end", "def find_keys(key, redis=nil)\n redis ||= DulyNoted.redis\n keys = []\n keys += redis.keys(\"#{key}:*\")\n keys += redis.keys(\"#{key}\")\n keys -= redis.keys(\"#{key}:*:meta\")\n keys -= redis.keys(\"#{key}:ref:*\")\n keys -= redis.keys(\"#{key}:*fields\")\n end", "def list\n @artifacts ||= {}\n @artifacts.keys\n end", "def get_subscriptions\n subscriptions = []\n\n # Load the checks\n file = File.read(CHECKS)\n checks = JSON.parse(file)\n\n for check in checks\n subscriptions |= check[\"subscribers\"]\n end\n\n return subscriptions\nend", "def aliases\n SideJob.redis.smembers \"#{redis_key}:aliases\"\n end", "def hash\n to_a.hash\n end", "def jde_buyer_invoice_hashes_array\n jde_invoice_hashes_array('member')\n end", "def jde_seller_invoice_hashes_array\n jde_invoice_hashes_array('seller')\n end", "def get_all_posts\n @posts = []\n\n Post.all.each do|post|\n @posts << post.to_hash\n end\n end", "def pruned_clients\n now = Time.current.to_i\n\n out = []\n RedisInstance.hgetall(STATE_KEY).each do |uuid, raw|\n data = JSON.parse(raw)\n if stale?(data['last'])\n RedisInstance.hdel(STATE_KEY, uuid)\n else\n out << {\n uuid: sanitize(uuid),\n name: sanitize(data['name']),\n value: data['value'].to_f\n }\n end\n end\n out\n end", "def get_shelves\n shelves = [@shelf_ag, @shelf_hp, @shelf_qz]\n return shelves\n end", "def hash\n @__set.to_a.hash\n end", "def cache_objects_keys\n @object_data[].keys\n end", "def arrays_to_hashes\n end", "def redis\n @redis ||= (self['redis'] || {}).symbolize_keys\n end", "def server_structs\n array = []\n if @struct.hosts\n @struct.hosts.count.times do |i|\n array << Lib.memcached_select_server_at(@struct, i)\n end\n end\n array\n end", "def to_a\n [\n \"Auto Restart: #{automatic_restart}\",\n \"Case Sensitivity: #{case_sensitive_matching}\",\n \"Hashtag TTL: #{tag_time_to_live_in_seconds}\",\n \"Storage Type: #{hashtag_storage_class}\",\n \"Streaming Endpoint: #{streaming_endpoint}\",\n \"Valid Keys: #{is_valid?}\",\n \"Log Device: #{log_capture_device == STDOUT ? 'console' : log_capture_device}\"\n ]\n end", "def hash\n [host_list, total_matching, total_returned].hash\n end", "def all_online\n @redis.pipelined do\n active_bucket_keys.each{|k| @redis.smembers key }\n end.inject(&:|)\n end", "def keys\n return self.keySet.to_a\n end", "def gen_redis_proto(*cmd)\n proto = \"\"\n proto << \"*\"+cmd.length.to_s+\"\\r\\n\"\n cmd.each{|arg|\n proto << \"$\"+arg.to_s.bytesize.to_s+\"\\r\\n\"\n proto << arg.to_s+\"\\r\\n\"\n }\n proto\nend", "def generate_keys(num)\n num.times.inject({}) do |acc, i| \n key = ::Digest::MD5.hexdigest(i.to_s)\n node = redis.node_for(key).client\n hash_key = \"redis://#{node.host}:#{node.port}/#{node.db}\"\n acc[hash_key] = [] if acc[hash_key].nil?\n acc[hash_key] << key\n acc\n end\n end", "def many\n Fatboy::Many.new(@redis)\n end", "def track\n Redis.current.multi do\n Redis.current.lpush(redis_key, to_json)\n Redis.current.ltrim(redis_key, 0, REDIS_LIMIT)\n end\n end", "def to_hash\n @aliases\n end", "def to_mash; end", "def ids\n @keys ||= []\n end", "def get_all\n verify_connection_url\n\n output = {}\n list.each { |key| output[key.to_sym] = get key }\n output\n end", "def to_h\n Hash[items]\n end", "def to_ary\n [couchdb_uri, database, auth_uri, authz_couch, sql_database, superuser_id].compact\n end", "def hash\n [cluster, options].hash\n end", "def hash\n [cluster, options].hash\n end", "def hosts\n @hosts.values\n end" ]
[ "0.6576654", "0.6424024", "0.6396166", "0.6395923", "0.6322102", "0.6284408", "0.61999875", "0.6188677", "0.6064842", "0.6042535", "0.59600085", "0.5922322", "0.58391297", "0.58147764", "0.5805049", "0.5802257", "0.57898283", "0.57757455", "0.5765015", "0.57619435", "0.57426286", "0.5740719", "0.57171303", "0.5716623", "0.5711079", "0.5689086", "0.56663847", "0.56478506", "0.5629216", "0.56247807", "0.5618798", "0.5618517", "0.5614698", "0.56126285", "0.5603103", "0.558745", "0.5570958", "0.55636716", "0.5560503", "0.555151", "0.55493623", "0.5543351", "0.5538912", "0.5537218", "0.55285203", "0.55282885", "0.55267876", "0.5520267", "0.5509591", "0.5490798", "0.54770637", "0.5465322", "0.545775", "0.54561865", "0.5445679", "0.544216", "0.5434078", "0.5430633", "0.5428366", "0.54216284", "0.5419678", "0.5411707", "0.54028696", "0.5401276", "0.5401202", "0.53932744", "0.5390717", "0.5386437", "0.53750205", "0.5357553", "0.534931", "0.53482354", "0.5342492", "0.5338634", "0.53245294", "0.5323281", "0.5316046", "0.5315657", "0.5303749", "0.53018045", "0.52977586", "0.5297146", "0.5289941", "0.5277731", "0.52683556", "0.52671266", "0.52644104", "0.5261226", "0.5259909", "0.52528214", "0.52440894", "0.5235463", "0.5223046", "0.5219996", "0.52180636", "0.5216719", "0.52123713", "0.5211791", "0.5207919", "0.5207919", "0.52024645" ]
0.0
-1
, :avatar_url def avatar_url object.avatar.url end
def success object.member? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avatar_url\n avatar_uri(object)\n end", "def avatar_url\n @attributes[:avatar_url]\n end", "def avatar_url\n @attributes[:avatar_url]\n end", "def avatar_url\r\n return @user.avatar_url\r\n end", "def avatar\n object.avatar.url\n end", "def avatar_url\n @data['avatarUrl']\n end", "def avatar_url\n uploaded ? avatar.url : \"/assets/no_avatar.png\"\n end", "def avatar_url\n\t\t\"http://zombitar.com/#{id}.jpg\"\n\tend", "def avatar\n if object.dp.present?\n k = object.dp.url.gsub('upload','upload/g_face,c_thumb,w_150,h_150')\n else\n k = object.avatar\n end\n end", "def image_url\n url_for(object.profile_pic)\n end", "def avatar_url\n self.avatar.attachment.nil? ? '' :\n \"#{Rails.configuration.api_url}#{Rails.application.routes.url_helpers.rails_blob_path(self.avatar, only_path: true)}\"\n end", "def avatar_url\n self.avatar.attachment.nil? ? '' :\n \"#{Rails.configuration.api_url}#{Rails.application.routes.url_helpers.rails_blob_path(self.avatar, only_path: true)}\"\n end", "def avatar_url\n attachment = @object.avatar_attachment\n return if attachment.nil?\n\n Rails.application.routes.url_helpers.rails_blob_url(attachment, only_path: true)\n end", "def picture\n if self.avatar?\n self.avatar.url\n elsif self.image_url != nil\n self.image_url\n else\n 'generic_avatar'\n end\n end", "def url(*args)\n avatar.url(*args)\n end", "def avatar_url\n return image_url if image_url\n return DEFAULT_AVATAR if email.nil?\n\n gravatar_url\n end", "def image_url\n self.filename.url \n end", "def avatar_url(style = :small)\n if avatar_file_name\n avatar.url(style)\n else\n url = avatar.url(style)\n providers.each do |e|\n next unless e.image_url\n\n url = e.image_url\n end\n url\n end\n end", "def avatar\n if object.avatar.attached?\n if Rails.env === 'production'\n object.avatar.url\n else\n rails_blob_url(object.avatar)\n end\n end\n end", "def avatar_url(avatar_size=\"small\")\n if self.has_shelby_avatar\n return self.shelby_avatar_url(avatar_size)\n else\n return self.user_image_original || self.user_image || \"#{Settings::ShelbyAPI.web_root}/images/assets/avatar.png\"\n end\n end", "def avatar_url\n \"https://avatars.githubusercontent.com/u/#{uid}?v=2\"\n end", "def user_img_URL\n self.user.image_url\n end", "def image_url\n object.image_url\n end", "def author_avatar\n is_anonymous ? Avatar.default.url : user.profile.avatar.url\n end", "def image_url\n image.url\n end", "def author_avatar\n anonymous? ? Avatar.default.url : user.profile.avatar.url\n end", "def imgurl\n picref.imgurl if picref\n end", "def default_url\n Settings.image.default_avatar\n end", "def default_url\n Settings.image.default_avatar\n end", "def default_url\n Settings.image.default_avatar\n end", "def avatar_url(type = :small)\n \"#{authentications.first.avatar_url}?type=#{type}\"\n end", "def show_avatar\n\n end", "def show_avatar\n\n end", "def user_avatar_url\n @raw['user']['avatar_url']\n end", "def avatar_url\n root = Rails.application.routes.url_helpers.url_for(:root)\n uri = URI(root)\n uri.path = avatar_path\n uri.to_s\n end", "def avatar_remote_url=(url_value)\n self.avatar = URI.parse(url_value)\n # Assuming url_value is http://example.com/photos/face.png\n # avatar_file_name == \"face.png\"\n # avatar_content_type == \"image/png\"\n @avatar_remote_url = url_value\n end", "def avatar_url (size)\n if avatar.present?\n return avatar.url(size)\n # elsif provider == \"facebook\" and external_uid\n # return \"https://graph.facebook.com/#{external_uid}/picture\"\n else\n return \"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}\"\n end\n end", "def user_avatar(user)\n user.avatar ? user.avatar.photo.url(:thumb) : \"default-avatar.jpg\"\n end", "def avatar_url(user_id, avatar_id)\n \"#{api_base}/users/#{user_id}/avatars/#{avatar_id}.jpg\"\n end", "def avatar_param\n nil\n end", "def remote_url=(url)\n tmp = URI.parse(url)\n self.avatar = tmp\n end", "def image_url\n# Somehow the picture field returns false for 'nil?' regardless of wether it's set or not\n# So we'll have to check if the size of the url is 0 to see if it exists\n# There should be a better way to do this, probably?\nif self.picture.size == 0\n\tself.profile_picture.nil? ? 'image-unknown.jpg' : self.profile_picture\nelse \n\tself.picture.ava\nend\nend", "def image_url\n image_uri\n end", "def avatar_url\n \"http://robohash.org/#{email}?gravatar=yes\"\n end", "def avatar_url\n if !self.fb_id.blank?\n return 'https://graph.facebook.com/%s/picture?width=90&height=90' % self.fb_id\n elsif !self.gpp_id.blank?\n return 'http://profiles.google.com/s2/photos/profile/%s?sz=90' % self.gpp_id\n else\n return ''\n end\n end", "def image_url\n model.image_url.presence || h.asset_path('face.jpg')\n end", "def default_url\n \"https://s3.amazonaws.com/whisprdev/uploads/default_avatar.png\"\n end", "def get_avatar_url(user_id)\n u = User.find_by_id( user_id)\n avatar = u.avatar.url(:thumb)\n unless u.avatar_file_size?\n avatar = false\n end\n return avatar || Settings.avatar_image \n end", "def pic_url\n {\n picture: self.object.pic.service_url\n }\n end", "def get_avatar\n u = User.find_by_id(self.id)\n if u.role == 'user'\n return u.avatar.url unless u.avatar.nil?\n else\n info = Info.find_by_email(self.email)\n return info.info_avatar.image.url unless info.nil?\n end\n return nil\n end", "def defAvatar\n @obj['defAvatar']\n end", "def avatar(avatar_holder)\n if avatar_holder.avatar.attached?\n avatar = avatar_holder.avatar\n else\n avatar = \"https://arena-fighter.s3.eu-west-3.amazonaws.com/avatar.jpg\"\n end\n end", "def avatar_url\n hash = Digest::MD5.hexdigest(email)\n \"http://www.gravatar.com/avatar/#{hash}\"\n end", "def avatar\n @data['avatar']\n end", "def avatar\n @data['avatar']\n end", "def avatar\n \"https://cdn.discordapp.com/avatars/#{@obj['id']}/#{@obj['avatar']}.webp?size=1024\"\n end", "def avatar_url(size)\n self.avatar.url(size)\n # .gsub('s3.amazonaws.com/', 's3-us-west-2.amazonaws.com/')\n end", "def avatar_remote_url=(url)\n avatar_url = process_uri(url)\n self.avatar = URI.parse(avatar_url)\n # Assuming url_value is http://example.com/photos/face.png\n # avatar_file_name == \"face.png\"\n # avatar_content_type == \"image/png\"\n @avatar_remote_url = avatar_url\n end", "def file_url\n end", "def get_image_url( account_profile ) \n account_profile['profile_image_url']\n end", "def picture_url\n if avatar\n image_path(\"speakers/#{avatar}\")\n else\n image_path(\"default-avatar.png\")\n end\n end", "def photo_url\n defined?(object.photo) ? object.photo.url : ''\n end", "def avatar_url_for(person, options = {})\n person.nil? ? nil : url\n end", "def image_url\n rails_blob_url(object.image)\n # This helper gets the URL from the file we pass to it\n end", "def avatar_url(size)\n gravatar_id = Digest::MD5::hexdigest(self.email).downcase\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}\"\n end", "def avatar_url\n @avatar_url ||= document.at(\"#name-poster\").attr('src') rescue nil\n end", "def profile_photo\n\tend", "def defavatar\n @data['defAvatar']\n end", "def defavatar\n @data['defAvatar']\n end", "def image\n return unless resource.avatar\n \"#{Seek::Config.site_base_host}/#{resource.class.table_name}\" \\\n \"/#{resource.id}/avatars/#{resource.avatar.id}?size=250\"\n end", "def test_avatar_thumb_image_url_returns_thumb_image_url_from_avatar\n avatar = Avatar.new\n def avatar.thumb_image_url\n \"grapefruit\"\n end\n \n profile = Profile.new\n profile.avatar = avatar\n assert_equal \"grapefruit\", profile.avatar_thumb_image_url\n end", "def avatar\n \t\t# get the email from URL-parameters or what have you and make lowercase\n\t\temail_address = self.email.downcase\n\t\t \n\t\t# create the md5 hash\n\t\thash = Digest::MD5.hexdigest(email_address)\n\t\t \n\t\t# compile URL which can be used in <img src=\"RIGHT_HERE\"...\n\t\timage_src = \"http://www.gravatar.com/avatar/#{hash}\"\n \tend", "def avatar_url(format = nil)\n return API::User.default_avatar(@discriminator) unless @avatar_id\n\n API::User.avatar_url(@id, @avatar_id, format)\n end", "def image_url\n image.url(:medium)\n end", "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end\n end", "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end\n end", "def avatar_file\n @attributes[:avatar_file]\n end", "def avatar(object, size=200, return_image_tag_only=false, url=nil, alt=nil, show_tooltip=true)\n alternative = \"\"\n if show_tooltip\n tooltip_text = (alt.nil? ? h(object.name) : alt)\n else\n alternative = (alt.nil? ? h(object.name) : alt) \n end\n \n case object.class.name.downcase\n when \"person\", \"institution\", \"project\"\n if object.avatar_selected?\n img = image_tag avatar_url(object, object.avatar_id, size), :alt=> alternative, :class => 'framed'\n else\n img = null_avatar(object.class.name, size, alternative)\n end\n end\n \n # if the image of the avatar needs to be linked not to the url of the object, return only the image tag\n if return_image_tag_only\n return img\n else \n unless url\n url = eval(\"#{object.class.name.downcase}_url(#{object.id})\")\n end\n return link_to(img, url, :title => tooltip_text)\n # return link_to(img, url, :title => tooltip_title_attrib(tooltip_text))\n end\n end", "def image_url\n self.data['image_url'] || nil\n end", "def avatar_image=(val)\n return false if avatar_state == :locked\n\n # Clear out the old avatar first, in case of failure to get new avatar.\n # The order of these attributes is standard throughout the method.\n self.avatar_image_source = 'no_pic'\n self.avatar_image_url = nil\n self.avatar_image_updated_at = Time.zone.now\n self.avatar_state = 'approved'\n\n # Return here if we're passed a nil val or any non-hash val (both of which\n # will just nil the user's avatar).\n return unless val.is_a?(Hash)\n external_avatar_url_patterns = Setting.get('avatar_external_url_patterns', '^https://[a-zA-Z0-9.-]+\\.instructure\\.com/').split(/,/).map {|re| Regexp.new re}\n\n if val['url'] && val['url'].match?(GRAVATAR_PATTERN)\n self.avatar_image_source = 'gravatar'\n self.avatar_image_url = val['url']\n self.avatar_state = 'submitted'\n elsif val['type'] == 'attachment' && val['url']\n self.avatar_image_source = 'attachment'\n self.avatar_image_url = val['url']\n self.avatar_state = 'submitted'\n elsif val['url'] && external_avatar_url_patterns.find { |p| val['url'].match?(p) }\n self.avatar_image_source = 'external'\n self.avatar_image_url = val['url']\n self.avatar_state = 'submitted'\n end\n end", "def picture_url(size)\n \tself.picture.url(size)\n \tend", "def avatar_img\n \"https://cdn.discordapp.com/avatars/#{id}/#{avatar}.webp?size=1024\"\n end", "def avatar_img\n \"https://cdn.discordapp.com/avatars/#{id}/#{avatar}.webp?size=1024\"\n end", "def photo_from_url(url)\n end", "def new_avatar(avatar,comment)\n gravatar_url_from_email(comment.email)\n end", "def artist_avatar\n if self.avatar.attached?\n image_tag artist.avatar\n else\n image_tag 'default_avatar.jpg'\n end\n end", "def image_url\n return @image_url\n end", "def thumbnail_url\n company.image.url(:thumbnail)\n end", "def square_url\n thumb_url\n end", "def logo_url\n logo? ? logo.url : profile_img\n end", "def thumb_url\n self.source.thumb.url\n end", "def father_avatar\n\n Tweet.find(self.tweet_id).user.url_photo\n\n end", "def avatar_image\n avatar_data = NSData.alloc.initWithContentsOfURL(NSURL.URLWithString(avatar_url))\n image = UIImage.alloc.initWithData(avatar_data)\n end", "def image_url\n Image.find(image_id).url\n end", "def image_path\n thumbnail_url\n end", "def avatar_url(user)\n default_url = \"#{root_url}images/guest.jpg\"\n # BUG: Don't use gravatar as you can get someone else's gravatar with your name.\n # eg. Try signing up with name \"test meme\" ... it's some dude's distorted face\n # if user.profile\n # if user.profile.avatar_url.present?\n # user.profile.avatar_url\n # else\n # gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n # \"http://gravatar.com/avatar/#{gravatar_id}?s=200&d=#{CGI.escape(default_url)}\"\n # end\n # else\n # default_url\n # end\n end", "def thumb_url\n image.url(:thumbnail)\n end", "def thumb_url\n image.url(:thumbnail)\n end", "def dynamic_avatar_url(size = 256, url_type = :id, schema = :https)\n url = case schema\n when :https then Figaro.env.avatar_https!\n when :ssl then Figaro.env.avatar_https!\n else Figaro.env.avatar_http!\n end\n\n \"#{url}#{dynamic_avatar_path(size,url_type)}\"\n end", "def image_avatar_path(person, options={})\n options = {:name => :thumb, :anonymous => false}.merge(options).symbolize_keys\n source = options.delete(:source)\n return source if source \n name = options.delete(:name)\n anonymous = options.delete(:anonymous)\n\n if person && !anonymous && person.avatar.file?\n source = person.avatar.url(name)\n end\n if source.blank?\n if :profile == name.to_sym\n source = person && person.is_female? ? image_path('icons/avatars/female_large_turquoise.png') : image_path('icons/avatars/male_large_turquoise.png')\n else\n if person && person.partner?\n source = person.is_male? ? image_path('icons/avatars/male_green.png') : image_path('icons/avatars/female_green.png')\n else\n source = person && person.is_female? ? image_path('icons/avatars/female_blue.png') : image_path('icons/avatars/male_blue.png')\n end\n end\n end\n source\n end", "def user_gravatar_url\n self.user.gravatar_url\n end" ]
[ "0.88326186", "0.84959793", "0.84959793", "0.8480823", "0.8419805", "0.83732456", "0.7999302", "0.79641056", "0.796162", "0.7920086", "0.7909154", "0.788931", "0.78592026", "0.77745324", "0.7749754", "0.7688729", "0.7590882", "0.7566636", "0.7526722", "0.75108284", "0.74877805", "0.74824136", "0.7475999", "0.74305576", "0.7427832", "0.74122274", "0.7389061", "0.7365627", "0.7365627", "0.7365627", "0.733035", "0.7330169", "0.7330169", "0.73256916", "0.73238647", "0.7323269", "0.73185456", "0.7315253", "0.7313038", "0.7300011", "0.7298079", "0.72980696", "0.72769666", "0.724659", "0.7194488", "0.7176308", "0.71754783", "0.7173697", "0.71722203", "0.717035", "0.7165045", "0.7158383", "0.7145613", "0.7142398", "0.7142398", "0.713239", "0.7127036", "0.71092916", "0.7101288", "0.7099465", "0.70991564", "0.7081351", "0.70765495", "0.70677114", "0.70544213", "0.70434326", "0.7028621", "0.70249784", "0.70249784", "0.6989632", "0.69838935", "0.6983401", "0.6976153", "0.6966292", "0.6961055", "0.69610137", "0.69485146", "0.69485027", "0.6926503", "0.6920161", "0.69035226", "0.69008374", "0.69002646", "0.689559", "0.68748504", "0.68664926", "0.6861573", "0.6858189", "0.68558025", "0.6854045", "0.6849548", "0.68467885", "0.68287116", "0.68274844", "0.6826225", "0.6815914", "0.6799735", "0.6799735", "0.67978424", "0.6797252", "0.6784927" ]
0.0
-1
Copyright (C) Hamsterland. All rights reserved.
def divisible min, max, num for i in min..max if num % i != 0 return false end end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def berlioz; end", "def hiss; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def dh; end", "def terpene; end", "def herald; end", "def identify; end", "def weber; end", "def blg; end", "def stderrs; end", "def jack_handey; end", "def verdi; end", "def gounod; end", "def loc; end", "def loc; end", "def loc; end", "def hd\n \n end", "def ext; end", "def ext; end", "def user_os_complex\r\n end", "def mozart; end", "def from; end", "def from; end", "def from; end", "def from; end", "def implementation; end", "def implementation; end", "def ibu; end", "def trd; end", "def bs; end", "def anchored; end", "def spec; end", "def spec; end", "def who_we_are\r\n end", "def sld; end", "def fingerprint; end", "def sitemaps; end", "def hamlet; end", "def internal; end", "def malts; end", "def internship_passed; end", "def villian; end", "def implemented_in; end", "def formation; end", "def lsi; end", "def r; end", "def r; end", "def schumann; end", "def rassoc(p0) end", "def tld; end", "def tld; end", "def escaper; end", "def mitch_hedberg; end", "def reflector; end", "def reflector; end", "def offences_by; end", "def rossini; end", "def extension; end", "def extension; end", "def extension; end", "def extension; end", "def init; end", "def init; end", "def init; end", "def init; end", "def same; end", "def original; end", "def yyerrok; end", "def yyerrok; end", "def feruchemist; end", "def tiny; end", "def expanded; end", "def parslet; end", "def parslet; end", "def parslet; end", "def parslet; end", "def external; end", "def ca; end", "def isolated; end", "def isolated; end", "def alt; end", "def origin; end", "def origin; end", "def origin; end", "def suivre; end", "def refutal()\n end", "def bellini; end", "def g; end", "def g; end", "def ios; end", "def internal_encoding()\n #This is a stub, used for indexing\n end", "def initialize; end", "def initialize; end", "def initialize; end", "def initialize; end" ]
[ "0.6940908", "0.63237536", "0.61760026", "0.6125841", "0.6124663", "0.6070463", "0.6070463", "0.6070463", "0.6070463", "0.60607785", "0.59713674", "0.59098226", "0.5906366", "0.5885416", "0.5859558", "0.5856454", "0.5851987", "0.5816286", "0.577079", "0.5747805", "0.5747805", "0.5747805", "0.5739854", "0.57113665", "0.57113665", "0.5676642", "0.56489635", "0.56364167", "0.56364167", "0.56364167", "0.56364167", "0.5630534", "0.5630534", "0.56023526", "0.5590421", "0.55667806", "0.5562902", "0.55466866", "0.55466866", "0.55440426", "0.55402416", "0.5538367", "0.5527849", "0.5504279", "0.5488878", "0.54842347", "0.5477903", "0.5472199", "0.54630214", "0.54507214", "0.54442096", "0.54258704", "0.54258704", "0.54157114", "0.54097825", "0.5401582", "0.5401582", "0.53976554", "0.538641", "0.53824854", "0.53824854", "0.53816754", "0.5379041", "0.53643817", "0.53643817", "0.53643817", "0.53643817", "0.5364149", "0.5364149", "0.5364149", "0.5364149", "0.535721", "0.535134", "0.5351288", "0.5351288", "0.5333693", "0.53307736", "0.5313312", "0.53129673", "0.53129673", "0.53129673", "0.53129673", "0.53118473", "0.53064", "0.53029317", "0.53029317", "0.5298569", "0.52976155", "0.52976155", "0.52976155", "0.52931577", "0.5292168", "0.5291744", "0.52897537", "0.52897537", "0.5284158", "0.5270577", "0.52697945", "0.52697945", "0.52697945", "0.52697945" ]
0.0
-1
Don't do anything; the interesting work has already been done in
def validate(*args, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def done!\n # Do nothing\n end", "def done!\n # Do nothing\n end", "def behold_nothing_happens!\n behold! {}\n end", "def pausable; end", "def done\n # Do nothing.\n end", "def done; end", "def keep_going; end", "def post_process; end", "def running; end", "def running; end", "def discard_results; end", "def proceed!; end", "def proceed!; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def discard; end", "def discard; end", "def skipped; end", "def do_work\n end", "def incomplete\r\n\r\n end", "def abandon_results!()\n #This is a stub, used for indexing\n end", "def ignores; end", "def process\n # no-op\n end", "def unrun\n log \"Nothing to do.\"\n end", "def skipped!; end", "def skips; end", "def do_not_thread; true; end", "def do_not_thread; true; end", "def do_not_thread; true; end", "def reap; end", "def enter_pending; end", "def done\n raise NotImplementedError\n end", "def remaining; end", "def busy?; end", "def finished; end", "def perform; end", "def perform; end", "def bye; end", "def pre_loop; end", "def done?; true end", "def probers; end", "def faint; end", "def faint; end", "def do_work\n # does things\n end", "def reset!\n raise if working?\n @is_complete = false\n end", "def suspend()\n #This is a stub, used for indexing\n end", "def run() end", "def finish()\n #This is a stub, used for indexing\n end", "def done_adding(*) end", "def ignore; end", "def done?; end", "def recall; end", "def complete?; end", "def run_warned; end", "def dont_care\n each(&:dont_care)\n myself\n end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def pass; end", "def pass; end", "def process!\n end", "def refork; end", "def sleepy_run; end", "def running?; end", "def complete!\n raise NotImplementedError\n end", "def finish\n noth\n end", "def dirty; end", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def reset() end", "def processor; end", "def perform\n \n end", "def continue; end", "def continue; end", "def done\n end", "def done\n end", "def prepareForReuse; end", "def performed?; end", "def performed?; end", "def borked?; @borked; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end" ]
[ "0.63040125", "0.63040125", "0.62884694", "0.62741685", "0.62526935", "0.61460346", "0.6144904", "0.6094074", "0.6082118", "0.6082118", "0.6078432", "0.60683423", "0.60683423", "0.60496694", "0.60496694", "0.60496694", "0.60496694", "0.60496694", "0.60496694", "0.60496694", "0.60496694", "0.6041194", "0.6041194", "0.6019715", "0.6007951", "0.59929544", "0.5970451", "0.59695077", "0.5930244", "0.59288365", "0.5917643", "0.5894283", "0.5835589", "0.5835589", "0.5835589", "0.5805725", "0.5804185", "0.5797118", "0.57919174", "0.5787144", "0.5772766", "0.5769888", "0.5769888", "0.5726855", "0.5710124", "0.5702374", "0.5701517", "0.5689174", "0.5689174", "0.56820285", "0.56807697", "0.5674124", "0.5670234", "0.5667416", "0.56590676", "0.5654207", "0.56493986", "0.5648011", "0.56465656", "0.56465113", "0.56463355", "0.56451285", "0.56451285", "0.56451285", "0.56451285", "0.56451285", "0.56451285", "0.56451285", "0.56451285", "0.56451285", "0.5628803", "0.5628803", "0.5626447", "0.5625396", "0.56120074", "0.56071293", "0.5605298", "0.5593215", "0.5578372", "0.5574124", "0.55704975", "0.55674523", "0.55672085", "0.55663866", "0.55663866", "0.554873", "0.554873", "0.55438054", "0.5542004", "0.5542004", "0.55401325", "0.55375355", "0.55375355", "0.55375355", "0.55375355", "0.55375355", "0.55375355", "0.55375355", "0.55375355", "0.55375355", "0.55375355" ]
0.0
-1