query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
get the page that lets you edit an existing post
def edit end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n end", "def edit\n @post = Post.find(params[:post_id])\n\n assert(@post.kind_of?(Post))\n\n return @post\n end", "def edit\r\n @post = Post.find(params[:id])\r\n end", "def edit\n # @post = Post.find(params[:id])\n end", "def edit # Showing edit form\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id]) #find the post\n end", "def edit\n # @post = Post.find(params[:id])\nend", "def edit\n\t\t@post = Post.find(params[:id])\n\tend", "def edit\n\t\t@post = Post.find(params[:id])\n\tend", "def edit\n @blogpost = Blogpost.find(params[:id])\n @page_title = \"Editing Blog Post\"\n end", "def edit\n \t\t@post = Post.find(params[:id])\n\tend", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find(params[:id])\n end", "def edit\n @post = Post.find_by(id: params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit\n @post = BlogPost.find(params[:id])\n end", "def edit \n\t@post=Post.find(params[:id])# URL is used to get de post id to find, @post gets assigned a post object, if a form is created for it, it will map such object properties \n end", "def edit \n @post = BlogPost.find(params[:id])\n end", "def edit\n # find_post method gets called here\n end", "def edit\n\t\t@post = @document.post\n\tend", "def edit\n\t\t@post = Post.find(params[:id])\n\t\trender layout: \"admin_layout\"\n\tend", "def edit\n #@post = Post.find(params[:id])\n #^This variable becomes visible in edit.html.erb\n ## No longer need to define @post because of before_action up there ^ ##\n end", "def edit\n @post = PostService.getPostById(params[:id])\n @post_form = PostForm.new(PostForm.initialize(@post))\n end", "def edit\r\n @blog_post = BlogPost.find(params[:id])\r\n end", "def edit\n @blog_post = BlogPost.find(params[:id])\n end", "def edit\n @blog_post = BlogPost.find(params[:id])\n end", "def edit\n @title = \"Edit Page\"\n begin\n @page = Page.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to admin_pages_path, :flash => {:notice => \"Page not found\"}\n end\n end", "def edit\n @page = Page.find(params[:id])\n end", "def edit\n @page = Page.find(params[:id])\n end", "def edit\n @page = Page.find(params[:id])\n #render the edit form\n end", "def edit\n @page = Page.find(params[:id])\n # render edit.html.erb\n end", "def edit\n @page = Page.find(params[:id])\n # render :edit - app/views/pages/\n end", "def post_edit\n post = Post.find(params[:id])\n redirect_to post if post.user != current_user\n end", "def edit_by_title\n @post = Roxiware::Blog::Post.where(:guid=>request.env['REQUEST_PATH']).first\n raise ActiveRecord::RecordNotFound if @post.nil?\n authorize! :edit, @post\n\n respond_to do |format|\n format.html { render :partial =>\"roxiware/blog/post/editform\" }\n format.json { render :json => @post.ajax_attrs(@role) }\n end\n end", "def edit\n @page = Page.find(params[:id])\n #render :edit - app/views/pages/edit.html.erb\n end", "def edit(id)\n @post = flash[:form_data] || Post[id]\n\n # Make sure the post is valid\n if @post.nil?\n flash[:error] = 'The specified post is invalid'\n redirect_referrer\n end\n\n @title = \"Edit #{@post.title}\"\n\n render_view(:form)\n end", "def update\n if @post.update(post_params)\n redirect_to find_redirect(@post.page)\n else\n render :edit\n end\n end", "def edit\n @posts = Post.where(postable_id: @post.postable.id).order(created_at: :desc)\n redirect_to root_path and return unless @post.user == current_user\n end", "def edit_post(params)\r\n db = connect()\r\n result=db.execute(\"SELECT posts.title, posts.text, posts.postid FROM posts WHERE posts.postid=(?)\", params['id'].to_i)\r\n return result\r\n end", "def edit\n post = PostsService.getPostById(params[:id])\n @post_update_form = PostUpdateForm.new(PostUpdateForm.attributes(post))\n end", "def edit\n # Clear the page cache for this page... ?\n @page = Comatose::Page.find_is_snippet params[:id]\n if request.post?\n @page.update_attributes(params[:page])\n @page.updated_on = Time.now\n @page.author = current_user\n if @page.valid? && @page.save\n expire_cms_page @page\n expire_cms_fragment @page\n flash[:notice] = \"Saved changes to '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n end\n \n end\n end", "def show\n post = Post.find_by(id: params[:id])\n redirect_to admin_preview_post_path(post)\n end", "def edit\n @user = User.find_by_slug(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n @post_title = \"editing your post\"\n# @title = \"editing #{@post.title}\" if @post.title?\n respond_with(@user, @post)\n end", "def edit\n @entry_url = n_url params[:url]\n @coll_url = n_url params[:coll_url]\n\n @coll = find_coll(@coll_url)\n\n maybe_needs_authorization('url' => @entry_url, 'coll_url' => @coll_url) do\n @entry = new_atom_http.get_atom_entry @entry_url\n end\n\n @title = if @entry.title\n \"editing \\\"#{@entry.title.to_s}\\\".\"\n else\n \"editing an entry.\"\n end\n end", "def edit\n\n @user = User.find_by_slug(params[:user_id])\n @post = @user.posts.find(params[:id])\n\n @post_title = \"editing your post\"\n# @title = \"editing #{@post.title}\" if @post.title?\n respond_with(@user, @post)\n end", "def edit\n\t\t@page_name = \" - Edit Show\"\n\tend", "def page_post\n Post.find_by_permalink(params[:id])\n end", "def edit\n respond_with(page)\n end", "def edit\n\t\tpre_edit\n\trescue ActiveRecord::RecordNotFound\n\t\tflash[:warning] = \"Could not find a page matching the requested id (‘#{params[:id]}’).\"\n\t\tredirect_to :action=>'index'\n\trescue Wayground::UserWithoutAccessPermission\n\t\tflash[:error] = \"You do not have permission to edit the requested page (‘#{params[:id]}’).\"\n\t\tredirect_to page_path(@page)\n\t\t@page = nil\n\tend", "def edit\n @posting = Posting.find(params[:id])\n end", "def edit\n\t\t@post = Post.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @post}\n\t\tend\n\tend", "def mokio_preview_link_in_edit_page\n self.path\n end", "def edit\n @post = Post.find(params[:post_id])\n @comment = Comment.find(params[:id])\n end", "def update\n\t\t#If a post has the post parameteres (title and content) redirect to the index of posts\n\t\tif @post.update(post_params)\n\t\t\tredirect_to @post\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\tend", "def edit_page(obj)\n page do\n t = String.new\n form_attr = form_attributes(:action=>url_for(\"update/#{model.primary_key_value(obj)}\"))\n t << Forme.form(obj, form_attr, form_opts(form_attr[:action])) do |f|\n model.columns_for(:edit, request).each do |column|\n col_opts = column_options_for(:edit, request, obj, column)\n if html = model.edit_html_for(obj, column, :edit, request)\n col_opts = col_opts.merge(:html=>html)\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Update', :class=>'btn btn-primary')\n end\n if model.supported_action?(:delete, request)\n t << Forme.form(form_attributes(:action=>url_for(\"delete/#{model.primary_key_value(obj)}\")), form_opts) do |f|\n f.button(:value=>'Delete', :class=>'btn btn-danger')\n end\n end\n t << association_links(obj)\n end\n end", "def edit\n @todo = TodoItem.find(params[:id]) # this wants to call an \"update\" method. see bundle exec rails routes to see why\n # default action: render :show - app/views/pages/show.html.erb\n end", "def set_edit_page\n # Definimos el nombre de la página\n @page = \"Editar cuenta\"\n @edit = params[:edit]\n end", "def post_url(post)\n if post.published?\n url(:post, post)\n else\n url(:preview_post, post.id)\n end\n end", "def show\n\t \t@post = Post.published.friendly.find(params[:id])\n\t end", "def edit_post_action\n if params[:post_title].strip.size == 0\n flash[:error] = \"Title cannot be empty.\"\n return redirect_to \"/edit_post/\" + params[:post_id]\n end\n post = Post.find(params[:post_id].to_i)\n while !post.tags.empty?\n Tag.unlink_tag_from_post(post, post.tags.first)\n end\n post.title = params[:post_title]\n post.content = params[:post_content]\n post.javascript = params[:post_javascript]\n post.css = params[:post_css]\n post.tags = params[:post_tags].downcase.split(\",\").map { |tag| tag.strip }.select { |tag| tag != \"\" }.map { |name| Tag.get_tag_by_name(name) }\n post.is_public = !!params[:post_is_public]\n post.markdown!\n post.save!\n flash[:notice] = \"The changes to the post entitled \\\"\" + post.title_html + \"\\\" have been saved.\"\n return redirect_to \"/edit_post/\" + params[:post_id]\n end", "def edit\n @ask_doctor = AskDoctor.find(params[:ask_doctor_id])\n @post = @ask_doctor.posts.find(params[:id])\n end", "def url_edit\n cname = self.class.classname.to_s.downcase\n return \"?show=#{cname}_edit&#{cname}_id=#{self.id}\"\n end", "def show\n\t\t@post = @document.post\n\n\t\tif @post\n\t\t\tredirect_to edit_admin_document_post_path(@document)\n\t\telse\n\t\t\tredirect_to new_admin_document_post_path(@document)\n\t\tend\n\tend", "def get_post\n @post = Post.find(params[:id])\n end", "def handle_edit\n if request.id\n obj = model.with_pk(normalized_type, request, request.id)\n model.hook(:before_edit, request, obj)\n edit_page(obj)\n else\n list_page(:edit)\n end\n end", "def edit\n # Clear the page cache for this page... ?\n @page = ComatosePage.find params[:id]\n @root_pages = [fetch_root_page].flatten\n if request.post?\n @page.update_attributes(params[:page])\n @page.updated_on = Time.now\n @page.author = fetch_author_name\n if @page.save\n expire_cms_page @page\n expire_cms_fragment @page\n flash[:notice] = \"Saved changes to '#{@page.title}'\"\n redirect_to :controller=>self.controller_name, :action=>'index'\n end\n end\n end", "def edit\n @blog = Blog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def edit_post_link(obj)\n if logged_in? && (obj.creator == current_user || current_user.admin?)\n link_to edit_post_path(obj), title: 'Edit Post', :'data-toggle' => 'tooltip' do\n content_tag :small do\n content_tag :span, '', class: 'glyphicon glyphicon-pencil', :'aria-hidden' => true\n end\n end\n end\n end", "def edit\n render locals: {\n page: Administrate::Page::Form.new(dashboard, requested_resource)\n }\n end", "def update\n\t\t@post = Post.find(params[:id])\n\t\t\n\t\tif @post.update(params[:post].permit(:title, :text))\n\t\t\tredirect_to @post\n\t\t\t\n\t\telse\n\t\t\t#@post is passed back to the edit template\n\t\t\t#when it is rendered\n\t\t\trender 'edit'\n\t\tend\n\tend", "def update\n if post.save\n render action: :index\n else\n render :new\n end\n end", "def show_post\n @post = Post.find(params[:id])\n end", "def edit\n # Renders the edit form\n end", "def edit_post(params)\n if validate_edit_post(params) \n id = params[\"id\"]\n db = connect_to_db()\n db.results_as_hash = true\n \n if params.key?(\"image\") and params[\"image\"]\n temp_file = params[\"image\"][\"tempfile\"]\n new_file_name = SecureRandom.uuid\n path = File.path(temp_file)\n new_file = FileUtils.copy(path, \"./public/img/#{new_file_name}\")\n db.execute(\"UPDATE posts SET picture=? WHERE id=?\", new_file_name, id)\n end\n \n if params.key?(\"content\") and params[\"content\"].length > 1\n db.execute(\"UPDATE posts SET content=? WHERE id=?\", [params[\"content\"], id])\n end\n else\n return {error: \"You are not the owner of this post!\"}\n end\n end", "def edit\n render\n end", "def edit\n render\n end", "def edit\n end", "def edit\n end", "def edit\n end" ]
[ "0.7815621", "0.76617306", "0.7585463", "0.7578561", "0.75766695", "0.7572105", "0.7558112", "0.75522447", "0.75522447", "0.7546631", "0.7536902", "0.7526222", "0.7526222", "0.7526222", "0.7526222", "0.7526222", "0.7526222", "0.7526222", "0.7524478", "0.75001323", "0.7495716", "0.7495716", "0.7495716", "0.74955434", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.74278456", "0.7420459", "0.74118024", "0.7364108", "0.7348986", "0.7249973", "0.72376424", "0.71271497", "0.70773554", "0.7030122", "0.7030122", "0.7016941", "0.7006001", "0.7006001", "0.6970391", "0.69574374", "0.6918322", "0.68991435", "0.6892422", "0.6891206", "0.68695104", "0.683736", "0.6759913", "0.67572784", "0.67344964", "0.6692706", "0.6689541", "0.66571325", "0.66518134", "0.66189927", "0.66015273", "0.6601006", "0.6578759", "0.6560265", "0.6536043", "0.6530863", "0.64581406", "0.6425362", "0.64161193", "0.64010125", "0.6398324", "0.6394339", "0.6377664", "0.6363615", "0.6361607", "0.63597894", "0.6352613", "0.63478655", "0.6342193", "0.6329601", "0.63192636", "0.6317974", "0.62931645", "0.6286076", "0.6276924", "0.6266639", "0.62601084", "0.62533617", "0.6251894", "0.6250738", "0.6250738", "0.62393236", "0.62393236", "0.62393236" ]
0.0
-1
put the data you just filled out to edit the post back to the serber so it can perform the updated
def update if @listing.update(listing_params) redirect_to "/listings/#{@listing.id}" else flash[:warning] = 'Y U DO THIS' render :edit end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updated_data\n\tend", "def edit\n \n end", "def update\n validate_save_and_respond(load_change_set, :edit)\n end", "def update\n\n\tend", "def update\n\n\tend", "def update\n\t\tend", "def update\n\t\tend", "def update\n validate_save_and_respond(update_change_set, :edit)\n end", "def edit\n load_data\n end", "def update\r\n\r\n end", "def update\r\n end", "def update #saves and redirects, saves changes\n end", "def do_update\n do_edit\n update_save\n end", "def update\n\t\t\n\t\tend", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def update\r\n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def edit\n \n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n end", "def update\n\n\n end", "def update\n \n end", "def update\n \n end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def edit; end", "def update\n\n end", "def update\n\tend", "def update\n\tend", "def update\n\tend", "def update\n\tend", "def update\n\tend", "def update_old_data(id1,id2,data)\n render :update do |page|\n page << \"jQuery('##{id1}').hide();jQuery('##{id2}').show();jQuery('##{id1} span input[name]').val('#{data}');\"\n page << \"jQuery('#name').html('<strong>#{data}</strong>')\" if params[:field] == 'name'\n page << \"jQuery('#comment_description').html('<h>#{data}</h>')\" if params[:field] == 'comment'\n page.call \"flash_writter\", \"Blank submission is not possible\" if !params[:name].present?\n end\nend", "def edit\n yield if block_given?\n save\n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update\n \n end", "def update \n end", "def update\n #\n end", "def update\n\t\t# Left empty intentionally.\n\tend", "def update\n end", "def update\n end" ]
[ "0.66186893", "0.65684605", "0.6561305", "0.6552876", "0.6552876", "0.65500325", "0.65500325", "0.65133214", "0.6485604", "0.64667314", "0.64452916", "0.6431905", "0.6427693", "0.6419288", "0.6414134", "0.6414134", "0.6414134", "0.6414134", "0.6397871", "0.6397871", "0.6397871", "0.6397871", "0.6397871", "0.6397871", "0.6397871", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674724", "0.63674366", "0.6365611", "0.6365611", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63538027", "0.63463396", "0.63375956", "0.63375956", "0.63375956", "0.63375956", "0.63375956", "0.63364875", "0.6303069", "0.63016087", "0.63016087", "0.63016087", "0.63016087", "0.63016087", "0.6292952", "0.62918615", "0.6291084", "0.6290791", "0.6290791" ]
0.0
-1
delete one specific post by sending a delete request to the server
def destroy @listing.destroy redirect_to "/listings" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_post\n\t \n \tend", "def delete\n @post = Post.find(params[:id])\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def delete(id, post)\n File.unlink(post_path(post))\n\n update_digests do |digests|\n digests.delete(id)\n end\n end", "def destroy\n respond_with post.destroy(params[:id])\n end", "def destroy\n @post.destroy\n render json: {}, status: :ok\n end", "def destroy\n @post.destroy\n\n json_response(@post)\n end", "def delpost\n if params[:post_id]\n Post.find_by_sql('delete from Posts where id = ' + params[:post_id].to_s)\n redirect_to current_user\n end\n end", "def delete_post\n post = Post.find_by_id(params[:id])\n if !post.nil?\n post.destroy\n end\n end", "def destroy\n if @post.destroy\n render json: {\n post: @post\n }, status: :ok\n else\n render status: :bad_request\n end\n end", "def perform(id)\n Post.find(id).delete\n end", "def destroy\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n r.delete @post\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def delete_post\n if post = TeamPost.where(:id=>params[:post_id]).first\n post.destroy\n flash[:success] = \"Your post has been deleted.\"\n end\n redirect_to registration_olympiad_path(@olympiad, :page=>\"wall\")\n end", "def delete\n request(:delete)\n end", "def delete\n @post = Post.find_by(id: params[:id])\n post_gid = GroupId.find_by(post_id: @post.id)\n if post_gid == nil\n @post.destroy\n else\n tags = Tag.where(post_id: @post.id)\n if tags.length == 1\n delete_tag(tags[0], @post)\n else\n tags.each do |tag|\n delete_tag(tag, @post)\n end\n end\n # After unlinking tags from post, simply destroy the post\n @post.destroy\n end\n flash[:notice] = \"Your post has been deleted.\"\n redirect_to(\"/posts/index\")\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @api_post.destroy\n\n head :no_content\n end", "def destroy\n @api_post.destroy\n end", "def delete_post(post_id, post_data)\n uri = \"#{@api_url}/#{@project_id}/posts/#{post_id}?access_token=#{@access_token}\"\n delete uri, post_data\n end", "def test_delete_post\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Delete.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end", "def destroy\r\n errors ||= Array.new\r\n if params[:id].blank? && Posts.isExists(params[:id].to_i)\r\n errors.push(I18n.t(\"errors.messages.element_not_id\"))\r\n end\r\n if errors.length == 0 \r\n postObj = Posts.find_by_id(params[:id].to_i)\r\n postObj.is_delete = true\r\n postObj.save\r\n self.default_response\r\n else\r\n render :json => Api::Init.ShowErrorJson(API_CODE_ERRORS['Services']['Global']['formInputError'],I18n.t(\"errors.messages.feelike.input_error\"), errors).to_json\r\n end\r\n end", "def destroy\n @post.destroy\n\n head :no_content\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post.destroy\n end", "def delete(postid)\n prepare_agent unless @agent\n if postid.kind_of?(Tumblr::Data::Post)\n postid = postid.id\n end\n @agent.post('http://www.tumblr.com/delete', \"id\" => postid)\n end", "def destroy\n @post.destroy\n head :no_content\n end", "def delete(*args)\n Request.delete(*args)\n end", "def destroy\n destroy_q(@post, posts_url)\n end", "def delete\n \n end", "def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: params[:id]}}, status: :ok\n end\n end", "def destroy\n @post.destroy\n head :no_content\n end", "def destroy\n @post.destroy\n head :no_content\n end", "def destroy\n if @post.destroy\n render json: {status: 1, notice: \"删除成功\", errors: []}\n else\n render json: {status: -1, notice: \"删除失败\", errors: @post.errors.fall_message} \n end\n end", "def destroy\n @post.destroy\n\n end", "def destroy\n @post.destroy\n render json: {\n data: {\n post: { key: @post.id },\n status: @post.status,\n }\n }\n end", "def destroy\n @post.destroy\n success_post_destroy\n end", "def destroy\n respond_with Post.destroy(params[:id])\n end", "def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def remove_post(params)\n db = SQLite3::Database.new(\"db/database.db\")\n db.results_as_hash = true\n\n db.execute(\"DELETE FROM posts WHERE postId = ?\", params[\"post_id\"])\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def delete_post(post_num_input)\n BLOG.delete_at(post_num_input)\n puts \"\\nSuccessfully deleted!\"\n puts ''\n display_posts_by_title\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n @title = \"Kill Post\"\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "def delete!\n request! :delete\n end", "def destroy\n post = current_user.posts.find_by_uuid(params[:id])\n return render_item_not_found('Post') unless post\n post.destroy\n broadcast(post, 'delete')\n head :ok\n end", "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @post.destroy\n end", "def delete\n end", "def destroy\n @post = Post.find(params[:id])\n #@post = @contest.posts.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_path) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = @save.post\n @save.destroy\n respond_to do |format|\n format.html { redirect_to post_url(@post), notice: 'Save was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_post\n Rails.logger.info('delete post')\n Post.delete_post_when_id_given((Post.find(params[:post_id_from_view])).id)\n redirect_to :controller => 'homes',:action =>'index'\n\n end", "def destroy\n Post.find(params[:id]).delete\n\n redirect_to '/'\n end", "def delete\n api(\"Delete\")\n end", "def delete\n\[email protected]\n redirect_to @post, notice: 'Post was successfully destroyed.'\n \n \n \nend", "def delete\n end", "def delete\n end", "def delete(payload)\n post_like payload, Net::HTTP::Delete.new(@uri.path)\n end", "def destroy\n authorize @post, :update?\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: 'Пост удален' }\n format.json { head :no_content }\n end\n end", "def delete\n\n end", "def destroy\n post = @post\n @post.destroy\n redirect_to find_redirect(post.page)\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 end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def delete post\n\t\t$DIRTY << :news\n\t\tpost = @children[post] if post.kind_of? Integer\n\t\traise ArgumentError, \"Post not found\" unless @children.include? post\n\n\t\tif @children[-1] == post and post.children.size == 0\n\t\t\[email protected] post\n\t\telse\n\t\t\tpost.title = \"<Deleted>\"\n\t\t\tpost.body = \"<Post deleted>\"\n\t\t\tpost.drill(true){|b| b.locked = true}\n\t\tend\n\n\t\tpost.sticky = false if post.sticky\n\tend", "def deletePost(post, deleted_user_id)\n post.update(\n 'deleted_at' => Time.now,\n 'deleted_user_id' => deleted_user_id\n )\n end", "def delete\n \n end", "def destroy\n respond_with @post.destroy\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @posto = Posto.find(params[:id])\n @posto.destroy\n\n respond_to do |format|\n format.html { redirect_to postos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n ben = Post.find(params[:id])\n ben.destroy\n redirect_to :back\n end", "def destroy_by_title\n @post = Roxiware::Blog::Post.where(:guid=>request.env['REQUEST_PATH']).first\n raise ActiveRecord::RecordNotFound if @post.nil?\n authorize! :destroy, @post\n @post.destroy\n respond_to do |format|\n if [email protected]\n format.json { render :json=>report_error(@post)}\n format.html { redirect_to @post, :alert => 'Failure deleting blog post.' }\n else\n format.json { render :json=>{}}\n end\n end\n end", "def destroy\n @mypost = Mypost.find(params[:id])\n @mypost.destroy\n\t\n\n respond_to do |format|\n format.html { redirect_to myfeed_path }\n format.json { head :no_content }\n end\n\t\t end", "def destroy\n @update = Update.find(params[:id])\n @post = @update.post\n @update.destroy\n\n respond_to do |format|\n format.html { redirect_to @post }\n format.json { head :no_content }\n end\n end", "def destroy\n @ad_post = AdPost.find(params[:id])\n @ad_post.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_posts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@post = Post.find(params[:id])\n \[email protected]\n \tredirect_to :back\n\tend", "def destroy\n\t\tcurrentUserId = current_user.id\n\t\tpostId = params[:id]\n\t\tresponse.headers['Access-Control-Allow-Origin'] = \"*\" # * means any. specify to \n\t\tbegin\n\t\t\tthePost = ::Post.find(postId)\n\t\t\trescue ActiveRecord::RecordNotFound \n\t\t\trender :json => {:status => -1, :message => 'Couldn\\'t delete post because post does not exist.' }, :status => 404\n\t\t\treturn\n\t\tend\n\n\t\tif thePost.user_id == currentUserId # Delete the post\n\t\t\t::Post.delete(params[:id])\n\t\t\tredirect_to posts_path\n\t\tend\n\tend", "def delete\n if body.empty? && params[:id]\n client.delete(params)\n elsif body.empty?\n client.delete_by_query(params.merge(body: body.merge(ALL)))\n else\n client.delete_by_query(params.merge(body: body))\n end\n end", "def delete(url)\n raise Error, \"Missing URL\" unless url\n get('posts/delete?uri=' << u(url))\n nil\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url, notice: \"Anúncio removido com sucesso.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n respond_with Post.destroy(params[:id])\n end", "def destroy\n @post.destroy\n flash[:notice] = \"収納術を削除しました\"\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @post.destroy\n\n respond_with @post\n end", "def delete_post(post_id,current_user,rank)\n owner_id = get_from_db(\"user_id\",\"post\",\"post_id\",post_id)[0][\"user_id\"]\n if current_user == owner_id || rank == \"admin\"\n db.execute(\"PRAGMA foreign_keys = ON\")\n db.execute(\"DELETE FROM post WHERE post_id = ?\", post_id)\n p \"success\"\n else\n p \"fail\"\n end\n end", "def delete\n delete_from_server single_url\n end", "def destroy\n @post.destroy\n respond_to do |format|\n format.html { redirect_to posts_url, notice: '写真を削除しました。' }\n format.json { head :no_content }\n end\n end", "def delete!\n return if @deleted\n delete_page = @client.get @delete_url\n delete_form = delete_page.form_with(:action => /delete/i)\n delete_button = delete_form.button_with(:name => /delete/i)\n delete_form.submit delete_button\n @deleted = true\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n save_notice(\"文章删除成功.\")\n format.html { redirect_to(cpanel_posts_url) }\n format.xml { head :ok }\n end\n end", "def deleteRequest\n\n end", "def delete(*args)\n request(:delete, *args)\n end", "def destroy\n @reply = Reply.find(params[:id])\n @reply.destroy\n @post = @reply.post\n\n respond_to do |format|\n format.html { redirect_to @post }\n format.json { head :ok }\n end\n end", "def delete(name)\n request(uri = uri(name), Net::HTTP::Delete.new(uri.request_uri))\n end" ]
[ "0.80192304", "0.76795584", "0.74897903", "0.7422145", "0.73755056", "0.73445046", "0.73435605", "0.73238945", "0.7284451", "0.72810245", "0.72650707", "0.7259744", "0.723818", "0.72066754", "0.7176677", "0.71586996", "0.7156068", "0.71224886", "0.7111127", "0.71048844", "0.71048194", "0.7079135", "0.7073455", "0.7073455", "0.7073455", "0.7073455", "0.7057089", "0.70373344", "0.70349866", "0.7030922", "0.7020116", "0.70170116", "0.7011861", "0.7011861", "0.7010942", "0.70102143", "0.7001053", "0.6999862", "0.6969738", "0.69530773", "0.69320565", "0.6929547", "0.69293135", "0.6924469", "0.69170576", "0.69048923", "0.6901516", "0.6897657", "0.68921053", "0.687822", "0.6869983", "0.68652576", "0.6854438", "0.6835815", "0.6830487", "0.68141425", "0.6811926", "0.6809507", "0.67969173", "0.6795938", "0.67910624", "0.67821115", "0.67821115", "0.67821115", "0.67821115", "0.67755544", "0.67755544", "0.67755544", "0.67755544", "0.67755544", "0.67755544", "0.67755544", "0.67703134", "0.6763343", "0.67619", "0.6751479", "0.6747539", "0.6747395", "0.67447555", "0.67442507", "0.6741746", "0.6740182", "0.67354053", "0.6718188", "0.67160666", "0.6709951", "0.6708767", "0.67075413", "0.6706814", "0.67043763", "0.67031944", "0.67023575", "0.6693368", "0.66911674", "0.6686957", "0.6683615", "0.6681266", "0.6678596", "0.6677267", "0.6676138", "0.6669483" ]
0.0
-1
To support object equality tests
def hash expr.hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def === obj\n #This is a stub, used for indexing\n end", "def eq(_obj)\n raise NotImplementedError\n end", "def ==(other); false; end", "def eql?(*) end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def eql?(ct); end", "def eql?(ct); end", "def ==(obj)\n return true if obj.equal?(self)\n self.__getobj__ == obj\n end", "def eql?(obj)\n self == obj\n end", "def equal?(other); end", "def == other\n return @hash == other.hash if other.class <= Blobject\n return @hash == other if other.class <= Hash\n super\n end", "def ==(object)\n self._id == object._id rescue false\n end", "def ==(other)\n end", "def eqv?(obj1, obj2)\n obj1 == obj2\n end", "def object_equal(obj1, obj2)\n vars1 = obj1.instance_variables\n vars2 = obj2.instance_variables\n return false unless vars1.length == vars2.length\n # if they don't have exactly the same instance_variables names then return false\n return false unless vars1.map(&:to_s).sort.to_s == vars2.map(&:to_s).sort.to_s\n\n equal = true\n some(vars1, proc { |v|\n val1 = obj1.instance_variable_get(v)\n val2 = obj2.instance_variable_get(v)\n if val1 != val2\n equal = false\n true\n else\n false\n end\n })\n equal\nend", "def equal?(another_game_object); end", "def eql?(obj)\n return true if obj.equal?(self)\n obj.eql?(__getobj__)\n end", "def ==\n end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def ==(other)\n super || object == other\n end", "def ==(other)\n self.class==other.class && self.hash==other.hash\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 ===(other); end", "def assertSameTest object\n assertSame object, object\n end", "def eql?(p0) end", "def eql?(p0) end", "def eql?(p0) end", "def eql?(p0) end", "def eql?(p0) end", "def eql?(p0) end", "def eql?(p0) end", "def ==(ct); end", "def ==(ct); end", "def == other\n other.class == Foo and other.x == x\n end", "def eql?(obj)\n build\n obj.build\n obj.all_info_matches?(@info)\n rescue StandardError\n false\n end", "def ==(other)\n raise NotImplementedError\n end", "def eql?(other); self == other; end", "def eql?(other) self.class == other.class and target==other.target and source==other.source; end", "def eql?(other) self.class == other.class and target==other.target and source==other.source; end", "def eql?(object)\n self.class.equal?(object.class) && attributes == object.attributes\n end", "def eql?(other)\n super\n end", "def eql?(other)\n super\n end", "def objects_equal?(other)\n other.is_a?(Linkage::MetaObject) && other.object == self.object\n end", "def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end", "def eql?(obj)\n (obj.class == model) && (obj.values == @values)\n end", "def == other\n self.object_id == other.object_id\n end", "def ==(*) end", "def ==(*) end", "def ==(*) end", "def ==(other)\n super\n end", "def ==(other)\n super\n end", "def eql?(arg0)\n end", "def eql?(arg0)\n end", "def eql?(arg0)\n end", "def objects_equal?(x, y)\n if x.nil?\n y.nil?\n elsif y.nil?\n nil\n elsif x.is_a?(Hash)\n return nil unless y.is_a?(Hash)\n return nil unless x.size == y.size\n x.each do|k, v|\n return nil unless objects_equal?(v, y[k])\n end\n true\n elsif x.is_a?(Array)\n return nil unless y.is_a?(Array)\n return nil unless x.size == y.size\n for i in 0..x.size\n return nil unless objects_equal?(x[i], y[i])\n end\n true\n else\n return nil if y.is_a?(Hash) || y.is_a?(Array)\n x == y\n end\n end", "def ==(obj)\n self.class == obj.class and self.val == obj.val\n end", "def ==(other)\n return false unless super\n true\n end", "def ==(obj)\n return false unless obj.kind_of? self.class\n\n value == obj.value\n end", "def == (other_object)\n other_object.x == @x && other_object.y == @y\n end", "def == (other_object)\n other_object.x == @x && other_object.y == @y\n end", "def ==(other)\n self.to_hash == other.to_hash\n end", "def ==(other)\n eql?(other)\n end", "def ==(other)\n eql?(other)\n end", "def eql?(obj_)\n if obj_.kind_of?(::String)\n obj_ = @_format.parse(obj_) rescue nil\n end\n return false unless obj_.kind_of?(Value)\n index_ = 0\n obj_.each_field_object do |field_, value_|\n return false if field_ != @_field_path[index_] || value_ != @_values[field_.name]\n index_ += 1\n end\n true\n end", "def ==(*)\n true\n end", "def ==(object)\n return false unless object.is_a?(self.class)\n \n self.identifiers == object.identifiers and self.title == object.title and self.journal_title == object.journal_title and\n self.book_title == object.book_title and self.article_title == object.article_title\n end", "def equal?(other)\n object_id == other.object_id\n end", "def eql?(other)\n self==other\n end", "def ==(obj)\n self.to_s == obj.to_s\n end", "def === obj\n return false unless obj.respond_to?(@shibboleth)\n return false unless @size == obj.size\n @matchers.each do |k, v|\n begin\n it = obj.fetch(k)\n rescue\n return false\n end\n next if v.nil?\n next if v == it\n next if v === it\n return false\n end\n return true\n end", "def ==(obj)\n to_s == obj.to_s\n end", "def == o\n identifier == o.identifier\n end", "def === obj\n ! ! to_proc.call(obj)\n end" ]
[ "0.7874092", "0.7811582", "0.7697245", "0.76817495", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7481989", "0.7468269", "0.7468269", "0.74399126", "0.73562664", "0.73477453", "0.73433846", "0.73409986", "0.73303884", "0.73260665", "0.73247504", "0.7303655", "0.72778046", "0.72713125", "0.72692716", "0.72692716", "0.72692716", "0.72692716", "0.72692716", "0.72692716", "0.72692716", "0.7268953", "0.724976", "0.7243206", "0.7237862", "0.7191486", "0.719069", "0.719069", "0.719069", "0.7190504", "0.7190504", "0.7190504", "0.7190504", "0.7179598", "0.7179598", "0.7179559", "0.717137", "0.71476215", "0.7134243", "0.7129144", "0.7129144", "0.7096656", "0.70556307", "0.70556307", "0.704594", "0.7045733", "0.7045733", "0.7035182", "0.70216167", "0.70216167", "0.70216167", "0.70074296", "0.70074296", "0.70038086", "0.70038086", "0.70038086", "0.69837767", "0.69835824", "0.69676197", "0.69572175", "0.6940235", "0.6940235", "0.69229317", "0.69198525", "0.69198525", "0.69173187", "0.69100916", "0.69092655", "0.69064456", "0.68955374", "0.68782467", "0.68725514", "0.68694067", "0.6865674", "0.68579286" ]
0.0
-1
expand_hash_conditions_for_aggregates assumes our hash keys can be converted to symbols, so this has to be implemented, but it doesn't really have to do anything useful.
def to_sym nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expand_hash_conditions_for_aggregates(attrs) # :nodoc:\n conditions = super\n enums.each do |name, reflection|\n if conditions.key?(name)\n value = conditions.delete(name)\n elsif conditions.key?((string_name = name.to_s))\n value = conditions.delete(string_name)\n else\n next\n end\n if value.is_a?(Array)\n id = value.map { |el| reflection.id(el) }\n else\n id = reflection.id(value)\n end\n conditions[reflection.id_name] = id\n end\n conditions\n end", "def conditions_hash\n params[\"conditions\"].grep(HashWithIndifferentAccess).reduce(:merge).merge(clr_hash)\n rescue\n Rails.logger.error(\"**** S3 policy generation error, invalid params ***\")\n return nil\n end", "def expanded_keys( hash )\n hash.each do |k,v|\n ek = expand_key( k )\n yield ek, v unless ek.empty?\n end\n end", "def visit_Hash(o, parent)\n predicates = super\n\n if predicates.size > 1\n Arel::Nodes::Grouping.new(Arel::Nodes::And.new predicates)\n else\n predicates.first\n end\n end", "def injectfunctions(shortcuthash,functionhash)\n combinedhash = {}\n functionhash.each do |k,v|\n combinedhash[k] = functionhash[k].merge(shortcuthash[k])\n end\n return combinedhash\nend", "def merge_hash(hash, prelude = nil)\n hash.reduce({}) do |acc, kv|\n k, v = kv\n generated_key = prelude ? \"#{prelude}_#{k}\" : k.to_s\n #puts(\"Generated key #{generated_key}\")\n if v.is_a?(Hash)\n acc.merge!(merge_hash(v, generated_key))\n elsif v.is_a?(Array)\n acc[generated_key] = v.to_s\n else\n acc[generated_key] = v\n end\n acc\n end\n end", "def format_conditions_hash(attrs)\n # Store values in the order they are placed in the conditions array/string\n values = []\n\n parse_hash = Proc.new do |hash, klass|\n hash.map do |attr, value|\n if value.is_a?(Hash)\n parse_hash.call(value, (klass || self).reflect_on_association(attr.to_sym).klass)\n else\n values << value\n \"#{(klass || self).table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}\"\n end #if value.is_a?(Hash)\n end.flatten.join(' AND ')\n end #do |hash|\n\n conditions = parse_hash.call(attrs)\n \n return [conditions, *values]\n end", "def proc_ordered_hash(ordered_hash)\n updated_els = Hash.new\n ordered_hash.each do |k,v|\n unless is_scalar_type?(v)\n updated_els[k] = convert_to_string_form(v)\n end\n end\n \n ordered_hash.merge(updated_els)\n end", "def hash_for(expression)\n\n end", "def sanitize_hash\n @hash_of_merged_data.map { |key,values|\n values.map! {|value| to_float_or_int(value) }\n values.uniq!\n values.sort!\n { key => values }\n }.reduce(:merge)\n end", "def smart_hash(h)\n h = Hash[h.map{|k,v| [k, v.is_a?(Hash) ? smart_hash(v) : v]}]\n h.instance_eval do\n def method_missing(name, *args, &block)\n self[name.to_s]\n end\n end\n h\nend", "def to_hash_groups(key_column, value_column=nil, opts=OPTS)\n if (@opts[:eager_graph] || @opts[:eager]) && !opts.has_key?(:all)\n opts = Hash[opts]\n opts[:all] = true\n end\n super\n end", "def _merge_when(hash, &block)\n hash[:conditions] = Sequel.virtual_row(&block) if block\n\n if merge_when = @opts[:merge_when]\n clone(:merge_when => (merge_when.dup << hash.freeze).freeze)\n else\n clone(:merge_when => [hash.freeze].freeze)\n end\n end", "def method_missing(method, *args)\n instance.value_for(method, args) do |v, args|\n instance.collapse_hashes(v, args)\n end\n end", "def merge(base_hash, derived_hash, **opts); end", "def deep_hash_merge(query_hash, attribute_hash)\n query_hash.merge(attribute_hash) do |_key, oldval, newval|\n oldval = oldval.to_hash if oldval.respond_to?(:to_hash)\n newval = newval.to_hash if newval.respond_to?(:to_hash)\n oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash' ? deep_hash_merge(oldval, newval) : newval\n end\n end", "def aggregate_function\n build_function(super, aggregate_constants)\n end", "def hashed_key_and_args(key, *args)\n base = args.inject('') do |memo, arg|\n memo << (':' + arg.class.to_s + ':') << case arg\n when Array\n hashed_key_and_args(key, *arg)\n when Hash\n hashed_key_and_args(key, *arg.to_a)\n when NilClass, Numeric, String, Symbol\n arg.to_s\n else\n raise ArgumentError, 'can only compute digest for primitive objects'\n end\n\n Digest::SHA1::hexdigest(memo)\n end\n\n key + ':' + base\n end", "def hvals(key); end", "def hvals(key); end", "def filter_hash!(hsh)\n [[:timestamp, ->(t) { t.to_f }]].each do |k, f|\n hsh[k] = f.call(hsh[k])\n end\n hsh\n end", "def criteria_from_hash(condition) # :nodoc:\n h = {}\n condition.each { |k,v|\n h[k] = case v\n when Array\n {:$in => k == 'id' || k == '_id' ? v.collect{ |val| val.to_oid} : v} # if id, can't pass in string; must be ObjectId\n when Range\n {:$gte => v.first, :$lte => v.last}\n else\n v\n end\n }\n h\n end", "def subhash(*extract)\n\t\th2 = self.select{|key, value| extract.include?(key) }\n\t\th2\n\tend", "def build_condition_clauses(conditions, aggregations)\n {}.tap do |clauses|\n aggregations.each do |agg|\n clauses.merge!(agg.to_query) if agg.selections?\n end\n conditions.each_pair do |name, condition|\n next if condition.name == :keywords\n merge_clause(clauses, condition.to_query) unless condition.blank?\n end\n end\n end", "def merge(base_hash, derived_hash); end", "def internal_deep_merge!(source_hash, specialized_hash)\n\t\t\tspecialized_hash.each_pair do |rkey, rval|\n\t\t\t\tif source_hash.has_key?(rkey) then\n\t\t\t\t\tif rval.is_a?(Hash) and source_hash[rkey].is_a?(Hash) then\n\t\t\t\t\t\tinternal_deep_merge!(source_hash[rkey], rval)\n\t\t\t\t\telsif rval == source_hash[rkey] then\n\t\t\t\t\telse\n\t\t\t\t\t\tsource_hash[rkey] = rval\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tsource_hash[rkey] = rval\n\t\t\t\tend\n\t\t\tend\n\t\t\tsource_hash\n\t\tend", "def criteria_keys_by_population\n criteria_keys_by_population = {}\n population_criteria.each do |name, precondition|\n criteria_keys_by_population[name] = precondition_criteria_keys(precondition).reject { |ck| ck == 'MeasurePeriod' }\n end\n criteria_keys_by_population\n end", "def process_hash(exp)\n kv_list = exp\n raise if kv_list.length % 2 != 0 \n\n args = \n without_result do\n want_expression do\n kv_list.map {|i| process(i)}.join(\",\")\n end\n end\n\n str = @model.lookup_constant('::Hash') + \".\"\n if kv_list.empty?\n # empty Hash\n @model.add_method_call(m = @model.encode_method(\"new\"))\n str << \"#{m}()\" \n else\n @model.add_method_call(m = @model.encode_method(\"new_from_key_value_list\"))\n str << \"#{m}(#{@model.encode_nil},#{args})\" \n end\n\n exp.clear\n\n return str\n end", "def deep_symbolize(hsh, &block)\n hsh.inject({}) do |result, (key, value)|\n # Recursively deep-symbolize subhashes\n value = deep_symbolize(value, &block) if value.is_a? Hash\n # Recursively deep-symbolize subarrays\n value = deep_symbolize_array(value, &block) if value.is_a? Array\n\n # Pre-process the key with a block if it was given\n key = yield key if block_given?\n # Symbolize the key string if it responds to to_sym\n sym_key = key.to_sym rescue key\n\n # write it back into the result and return the updated hash\n result[sym_key] = value\n result\n end\n end", "def hash_including(*args)\n if defined?(super)\n super\n else\n WebMock::Matchers::HashIncludingMatcher.new(anythingize_lonely_keys(*args))\n end\n end", "def hash\n [name, operator, expanded].hash\n end", "def filter_hash(hash, filter, debug = false)\n fail 'Hash argument is not a Hash!' unless hash.is_a? Hash\n\n filtered_hash = {}\n select_logic = case filter\n when String then 'k.nil? ? false : k[Regexp.new(filter)] && k.length == filter.length'\n when (Fixnum || Integer || Float || Numeric) then \"k[Regexp.new('#{filter}')]\"\n when Regexp then 'k[filter]'\n when Symbol then\n 'k == filter'\n when NilClass then true # Return all specs if a filter is set to nil (i.e. user doesn't care about this filter)\n else true\n end\n filtered_hash = hash.select do |k, v|\n # binding.pry if filter == 'SubSection A'\n [TrueClass, FalseClass].include?(select_logic.class) ? select_logic : eval(select_logic)\n end\n filtered_hash\n end", "def deep_merge!(*other_hashes, &blk); end", "def obligation(attr_validator, hash = nil)\n hash = (hash || @conditions_hash).clone\n hash.each do |attr, value|\n if value.is_a?(Hash)\n hash[attr] = obligation(attr_validator, value)\n elsif value.is_a?(Array) && value.length == 2\n hash[attr] = [value[0], attr_validator.evaluate(value[1])]\n else\n raise AuthorizationError, 'Wrong conditions hash format'\n end\n end\n hash\n end", "def flatmap(h, e, prefix = '')\n e.each do |k,v|\n if k == 'repo'\n k = 'repository'\n end\n if v.is_a?(Hash)\n flatmap(h, v, prefix+k+\"_\")\n else\n key = prefix+k\n\n next if [email protected]? key\n\n case v\n when TrueClass then h[key] = 1\n when FalseClass then h[key] = 0\n else\n next if v.nil?\n h[key] = v unless v.is_a? Array\n end\n end\n end\n h\nend", "def fetch_hash_objects(h)\n price_dimensions = []\n h.each_pair do |k, v|\n if v.is_a?(Hash)\n price_dimensions << fetch_hash_objects(v)\n else\n price_dimensions << {\"#{k}\": v} if ALLOWED_KEYS.include?(k)\n end\n end\n price_dimensions.flatten\n end", "def aggregations_params\n # fields = Topic::Field.joins(:topic).where(:sensit_topics => {:slug => params[:topic_id]}).map(&:key)\n params.require(:report).require(:aggregations).map do |aggregation|\n type = aggregation.delete(:type)\n aggregation[:kind] = type\n aggregation.tap do |whitelisted|\n whitelisted[:name] = aggregation[:name] if aggregation.has_key?(:name)\n whitelisted[:kind] = aggregation[:kind]\n whitelisted[:query] = aggregation[:query] if aggregation.has_key?(:query)\n end\n end\n end", "def append_00minutes_to_60min_hashes(source)\n # For 60min aggregation periods, the keys are missing the minutes in the timestamp (ie: \"2020-12-24 17:00\"),\n # so we need to add them to have the timestamps consistent across API calls.\n\n fail(\"The hash doesn't contain intraday values to append to.\") if source.keys[0].split(\":\").length <= 1\n\n appended_hash = { }\n source.keys.each do |key|\n appended_hash[\"#{key}:00\"] = source[key]\n end\n fail(\"Hash is empty\") if appended_hash.empty?\n return appended_hash\nend", "def my_hash_modification_method(source, thing_to_modify)\n newsource=Hash[source.map{|key, value| [key, value.is_a?(Integer)? value + thing_to_modify : value]}]\nend", "def filter_lower_than(input_hash, bound)\n output_hash = {}\n input_hash.each do |key, value|\n if (value < bound)\n output_hash[key] = value \n end\n end\n return output_hash\n end", "def expanded_key(key) # :nodoc:\n return validate_key(key.cache_key.to_s) if key.respond_to?(:cache_key)\n\n case key\n when Array\n if key.size > 1\n key = key.collect{|element| expanded_key(element)}\n else\n key = key.first\n end\n when Hash\n key = key.sort_by { |k,_| k.to_s }.collect{|k,v| \"#{k}=#{v}\"}\n end\n\n validate_key(key.respond_to?(:to_param) ? key.to_param : key)\n end", "def hash_merger(query_vals)#another hash that is nested)\n merged_hash = Hash.new\n # for each key_val_set\n # check if key exists in merged_hash\n # if not - add in the value\n # if yes - key into merged_hash with key, and check next key\n\n query_vals.each do |keys, val|\n current = merged_hash\n keys.each_with_index do |key,i|\n if i == keys.length - 1\n current[key] = val\n else\n current[key] ||= {}\n current = current[key]\n end\n end\n end\n merged_hash\n end", "def upsert_hash(event)\n h = format_hash(event)\n\n Hash.new.tap do |hash|\n @increment_keys.each do |key, value|\n # Set and cache increment value if it's numeric (i.e. static independent of event or granularity)\n # or if it's a lambda that requires the event instance as the only argument\n inc_value = value.respond_to?(:call) && value.arity == 1 ? value.call(event) : value\n\n if key.to_s.include?(\"%{granular_key}\")\n GRANULARITIES.each do |granularity, interval|\n # Set the increment value if it's a lambda that requires the event instance and the granularity\n # and interval as arguments (i.e. it's still a lambda due to having arity != 1 above)\n inc_result = inc_value.respond_to?(:call) ? inc_value.call(event, granularity, interval) : inc_value\n\n h[:granular_key] = granular_key(granularity, interval, event.created_at)\n hash[ sprintf(key, h) ] = inc_result\n end\n else\n hash[ sprintf(key, h) ] = inc_value\n end\n end\n end\n end", "def flatten_param_hash( params )\n\t found = true\n\n\t while found\n\t found = false\n\t new_hash = {}\n\n\t params.each do |key,value|\n\t if value.is_a?( Hash )\n\t found = true\n\t value.each do |key2,value2|\n\t new_hash[ key.to_s + '[' + key2.to_s + ']' ] = value2\n\t end\n\t else\n\t new_hash[ key.to_s ] = value\n\t end\n\t end\n\t params = new_hash\n\t end\n\t params\n\tend", "def my_hash_modification_method!(source, thing_to_modify)\n# source = Hash[source.map {|k,v| [k, thing_to_modify + v ]}]\nsource.each do |key, value|\n source[key] = value + thing_to_modify\nend\nend", "def valid_attributes\n { :name => \"My Report\", :query => {\"match_all\" => { }}, :aggregations => [{\"name\" => \"aggregation1\", \"type\" => \"terms\" ,\"query\" => { :field => \"value1\"}}]}\n end", "def eval_hash(raw_hash)\n raw_hash.each_pair { |key, value| raw_hash[key] = value.class == String ? eval(value) : value }\n end", "def merge_hash_with_counts(hash_total, hash_event)\n hash_event.each do |key, value|\n if hash_total.key?(key)\n hash_total[key] = hash_event[key] + hash_total[key]\n else\n hash_total[key] = hash_event[key]\n end\n end\n hash_total\n end", "def deep_merge_hashes(master_hash, other_hash); end", "def aggregates\n self.class.instance_variable_get(:@aggregates) || {}\n end", "def parameterize(hash)\n _hash = {}\n hash.each do |k,v|\n _hash[k.to_sym] = parameterized?(k) ? attributes_to_hash(v) : v\n end\n _hash\n end", "def conditions2include(conditions, original = true)\n nest = false\n new_include = *(conditions.inject([]) do |m, (k, v)|\n if v.is_a?(Hash)\n temp_v, includes_hash = conditions2include(v, false)\n nest = true\n m << (includes_hash ? {k => temp_v} : k)\n end\n m\n end)\n return original ? new_include : [new_include, nest]\n end", "def deep_merge!(other_hash, &block); end", "def process_hash(tags, property, content, **opts)\n itemprop = content.delete(:itemprop)\n content.each do |key, value|\n if key.to_s == \"_\"\n iprop = itemprop\n key = property\n else\n key = \"#{property}:#{key}\"\n end\n\n normalized_value = if value.is_a?(Symbol)\n normalized_meta_tags[value]\n else\n value\n end\n process_tree(tags, key, normalized_value, **opts.merge(itemprop: iprop))\n end\n end", "def my_hash_modification_method!(source, thing_to_modify)\n\nreturn source.each_with_object(source) { |(key, value), hash| hash[key] = value + thing_to_modify}\nend", "def deep_merge(*other_hashes, &blk); end", "def keyValuePairByAggQryBilled(aggregateQuery, bookingColl, byName)\n aggregateCursor = bookingColl.aggregate(aggregateQuery)\n keyArray = []; valueArray = []; returnObj = {}\n uniqueArray = [];\n\n aggregateCursor.each do |doc|\n uniqueArray << doc[:_id]\n end\n keyArray << byName; valueArray << uniqueArray.size \n returnObj = {\n :key => keyArray,\n :value => valueArray\n }\n return returnObj\n end", "def build_extended_set_clauses(set)\n set = normalize_keys(set)\n set_clauses, cols = {}, set.keys\n table_extended_with.each do |ext|\n key_cols = (ext.extended & cols)\n next if key_cols.empty?\n set_clauses[ext.table] = key_cols.collect {|col| build_set_clause(col,set[col]) }.join(', ')\n cols -= key_cols\n end\n key_cols = (column_names & cols)\n unless key_cols.empty?\n set_clauses[table_name] = key_cols.collect {|col| build_set_clause(col,set[col]) }.join(\", \")\n end\n set_clauses\n end", "def resolve_safe(hash, options = EMPTY_HASH, &block)\n result = {}\n\n hash.each do |key, value|\n k = @transform_key.(key)\n type = @name_key_map[k]\n\n if type\n result[k] = type.call_safe(value, &block)\n elsif strict?\n yield\n end\n end\n\n resolve_missing_keys(result, options, &block) if result.size < keys.size\n\n result\n end", "def agg_where\n agg_filters = params.fetch(:agg_filters, {})\n if agg_filters.is_a?(String)\n agg_filters = JSON.parse(agg_filters)\n end\n where = Hash[agg_filters.map{|key, val|\n [key, val]\n }.reject{|x| x[1].empty? }.map{|x| [x[0], x[1].keys]}]\n\n [\"start_date\", \"completion_date\"].each do |key|\n if where.has_key?(key)\n unix_milliseconds_string = where[key].first # only doing one!\n year = Time.at(unix_milliseconds_string.to_i / 1000).year\n where[key] = {\n gte: \"#{year}||/y\",\n lte: \"#{year}||/y\",\n }\n end\n end\n where\n end", "def summarize_hash hash\n hash.map do |key,v|\n \"#{key.inspect}=>#{summarize_value(v)}\"\n end.sort.join(\",\")\n end", "def group_by_exp(input, variable, expression); end", "def group_by(*args)\n @group_keys = args\n\n @group_by = Proc.new do |allocations|\n getters = attribute_getters(@group_keys)\n\n allocations.group_by do |allocation|\n getters.map { |getter| getter.call(allocation) }\n end\n end\n\n self\n end", "def arg_hash_keys_limit(required_keys, optional_keys, *args)\n args.each do |h|\n missing = required_keys - h.keys\n extra = h.keys - required_keys - optional_keys\n \n unless missing.empty? && extra.empty?\n msg = \"\"\n msg << \"Hash is missing required keys (#{missing.join(', ')}).\\n\" unless missing.empty?\n msg << \"Hash has extra keys which aren't allowed (#{extra.join(', ')}).\\n\" unless extra.empty?\n msg << \" Got: #{h.inspect}\"\n raise ArgumentError, msg\n end\n end\n end", "def extended_with(hash)\n hash.__angry_hash_extension if hash.respond_to?(:__angry_hash_extension)\n end", "def to_hash_groups(key_column, value_column = nil, opts = Sequel::OPTS)\n if value_column && !opts[:hash]\n clone(:_sequel_pg_type=>:hash_groups, :_sequel_pg_value=>[key_column, value_column]).fetch_rows(sql){|s| return s}\n {}\n elsif opts.empty?\n super(key_column, value_column)\n else\n super\n end\n end", "def keyword_value_hash\n self.data_attributes.inject({}) do |hsh, a| \n if a.class == ImportAttribute\n hsh.merge!(a.import_predicate => a.value)\n else # there are only two\n hsh.merge!(a.predicate.name => a.value)\n end\n end \n end", "def multiply_aggregation( node, normalized )\n aggregation = Hash.new\n normalized.keys.each do |entity|\n multiplicand = 0\n node['children'].each do |child|\n entity_hash = normalized[entity]\n if entity_hash.nil?\n entity_hash = Hash.new\n end\n if multiplicand == 0\n multiplicand = entity_hash[child['id']]\n else\n multiplicand *= entity_hash[child['id']]\n end\n end\n aggregation[entity] = multiplicand\n end\n aggregation\n end", "def sanitize_sql_hash_for_conditions_with_enumerations(attrs, *args)\n replace_enumerations_in_hash(attrs)\n sanitize_sql_hash_for_conditions_without_enumerations(attrs, *args)\n end", "def group_by(hash)\n hash.inject({}) do |ret_hash,(key,el)|\n group_key = yield el\n prev_for_group = ret_hash[group_key] || {}\n group = {key => el}.merge(prev_for_group)\n ret_hash.merge(group_key => group)\n end\n end", "def magify_hash(hash)\n hash.keys.each do |key|\n meth_key = key.gsub(/\\//, '_')\n hash.instance_eval %{def #{meth_key}; self['#{key}']; end}\n end\n\n hash\n end", "def build_hash_condition(column, value)\n case @condition_options[:hash_style]\n when \"equality\"\n # We want an equality condition. Directly use value.\n [{ column => value }]\n when \"range\"\n # We want a range condition. Wrap value in a range.\n [{ column => value..value }]\n when \"subset\"\n # We want a subset condition. Wrap value in an array.\n [{ column => [value] }]\n else\n raise \"Condition option hash style '#{@condition_options[:hash_style]}' not supported.\"\n end\n end", "def aggregate_with_tweaks(pubkeys, tweaks, modes)\n raise ArgumentError, 'tweaks and modes must be same length' unless tweaks.length == modes.length\n agg_ctx = aggregate(pubkeys)\n tweaks.each.with_index do |tweak, i|\n tweak = hex2bin(tweak)\n raise ArgumentError, 'tweak value must be 32 bytes' unless tweak.bytesize == 32\n agg_ctx = agg_ctx.apply_tweak(tweak, modes[i])\n end\n agg_ctx\n end", "def association_filter_key_expression(keys, meths, obj)\n vals = if obj.is_a?(Sequel::Dataset)\n {(keys.length == 1 ? keys.first : keys)=>obj.select(*meths).exclude(Sequel::SQL::BooleanExpression.from_value_pairs(meths.zip([]), :OR))}\n else\n vals = Array(obj).reject{|o| !meths.all?{|m| o.get_column_value(m)}}\n return SQL::Constants::FALSE if vals.empty?\n if obj.is_a?(Array)\n if keys.length == 1\n meth = meths.first\n {keys.first=>vals.map{|o| o.get_column_value(meth)}}\n else\n {keys=>vals.map{|o| meths.map{|m| o.get_column_value(m)}}}\n end \n else\n keys.zip(meths.map{|k| obj.get_column_value(k)})\n end\n end\n SQL::BooleanExpression.from_value_pairs(vals)\n end", "def aggregate(value)\n @query_hash[AGGREGATE][value] = value\n self\n end", "def associated_key_array\n cached_fetch(:associated_key_array) do\n if self[:uses_left_composite_keys]\n associated_key_alias.zip(predicate_keys).map{|a, k| SQL::AliasedExpression.new(k, a)}\n else\n [SQL::AliasedExpression.new(predicate_key, associated_key_alias)]\n end\n end\n end", "def full_schematics_hash\n\n def sub_weight_and_cost(subs, item, do_item = true)\n if subs.blank?\n wgt = item.weight\n cost = item.vendor_sell_price\n build = item.crafting_seconds\n else\n wgt = cost = build = 0\n subs.each_value do |sub|\n wgt += sub[:wgt].to_f * sub[:qty].to_f\n cost += sub[:cost].to_f * sub[:qty].to_f\n build += sub[:build].to_f * sub[:qty].to_f\n end\n end\n result = {:wgt => wgt, :cost => cost, :build => build}\n if item and do_item\n result.merge(:item => item, :item_id => item.id)\n else\n result\n end\n end\n\n def item_assembley(item_schematic, level, items, assemblies, level_info = true)\n unless assemblies[item_schematic.item_id].blank?\n assembley = assemblies[item_schematic.item_id].inject({}) do |subs, schematic|\n comp_hash = component_to_hash(schematic, level, items)\n unless assemblies[schematic.item_id].blank?\n comp_hash.merge!( item_assembley(schematic, level + 1, items, assemblies, false) )\n #item has subs...cost and wgt and recalc based on subs\n comp_hash.merge!( sub_weight_and_cost(comp_hash[:assembley], nil, false) )\n end\n subs.merge(schematic.id => comp_hash)\n end\n end\n if level_info && items[item_schematic.item_id]\n result = sub_weight_and_cost(assembley, items[item_schematic.item_id] )\n result[:qty] = item_schematic.qty\n else\n result = {}\n end\n result[:assembley] = assembley unless assembley.nil?\n result #return it\n end\n\n def component_to_hash(item_schematic, level, items)\n {\n :item_schematic_id => item_schematic.id,\n :item_id => item_schematic.item_id, #TODO not need once we have item obj\n :level => level,\n :qty => item_schematic.qty,\n }.merge(sub_weight_and_cost(nil, items[item_schematic.item_id]))\n end\n #item knows what assembleys make its schematic... load all ItemSchematic by assemblies\n item_components = assemblies.blank? ? [] : ItemSchematic.by_assemblies(assemblies)\n #build lookup tables\n assemblies = item_components.inject({}) do |asses, component|\n if asses[component.root_item_id].nil?\n asses.merge(component.root_item_id => [component])\n else\n asses.merge(component.root_item_id => (asses[component.root_item_id] << component))\n end\n end\n #item_components is the complete schematic... extract all items from schematic for x-reference\n all_items = (item_components.collect{|s| s.item_id} + item_components.collect{|s| s.root_item_id}).uniq\n refed_items = Item.find(all_items).inject({}) do |items, item|\n items.merge(item.id => item)\n end\n #iterate through item_components array and build full schematic hash\n full_assembley = schematic_roots.inject({}) do |full_schematic, item_schematic|\n full_schematic.merge( item_schematic.id => item_assembley(item_schematic, 1, refed_items, assemblies) )\n end\n #final step.. construct full assembley (including top level item) and calc costs, weight\n {:assembley => full_assembley}.merge(sub_weight_and_cost(full_assembley, self))\n end", "def keyValuePairByAggQryRepeatNew(aggregateQueries, bookingColl, byName)\n aggregateQuery1 = aggregateQueries[:query1]\n aggregateQuery2 = aggregateQueries[:query2]\n aggregateQuery3 = aggregateQueries[:query3]\n\n aggregateCursor1 = bookingColl.aggregate(aggregateQuery1)\n aggregateCursor2 = bookingColl.aggregate(aggregateQuery2)\n aggregateCursor3 = bookingColl.aggregate(aggregateQuery3)\n keyArray = []; returnObj1 = {}; returnObj2 = {}; returnObj3 = {}\n uniqueArray1 = []; uniqueArray2 = []; uniqueArray3 = []\n bookingArray1 = []; bookingArray2 = []; bookingArray3 = [] \n newBookingToPrevArray = []; newBookingToMorePrevArray = [] \n dormantBookingToPrevArray = []; dormantBookingToMorePrevArray = []\n uniqueDict1 = {}; uniqueDict2 = {}; uniqueDict3 = {}\n\n aggregateCursor1.each do |doc|\n uniqueArray1 << doc[:_id]\n uniqueDict1[doc[:_id]] = doc[:booking]\n end\n aggregateCursor2.each do |doc|\n uniqueArray2 << doc[:_id]\n uniqueDict2[doc[:_id]] = doc[:booking]\n end\n aggregateCursor3.each do |doc|\n uniqueArray3 << doc[:_id]\n uniqueDict3[doc[:_id]] = doc[:booking]\n end\n\n newToPrevArray = uniqueArray1 - uniqueArray2\n newBookingToPrev = 0.0\n newToPrevArray.each do |element|\n if !uniqueDict1[element].nil?\n newBookingToPrev += uniqueDict1[element]\n end\n end\n #puts \"New Booking to Prev: #{newBookingToPrev}\"\n\n newToMorePrevArray = uniqueArray1 - uniqueArray3\n newBookingToMorePrev = 0.0\n newToMorePrevArray.each do |element|\n if !uniqueDict1[element].nil?\n newBookingToMorePrev += uniqueDict1[element]\n end\n end\n #puts \"New Booking to More Prev: #{newBookingToMorePrev}\"\n\n dormantToPrevArray = uniqueArray2 - uniqueArray1\n dormantBookingToPrev = 0.0\n dormantToPrevArray.each do |element|\n if !uniqueDict2[element].nil?\n dormantBookingToPrev += uniqueDict2[element]\n end\n end\n #puts \"Dormant Booking to Prev: #{dormantBookingToPrev}\"\n \n dormantToMorePrevArray = uniqueArray3 - uniqueArray1\n dormantBookingToMorePrev = 0.0\n dormantToMorePrevArray.each do |element|\n if !uniqueDict3[element].nil?\n dormantBookingToMorePrev += uniqueDict3[element]\n end\n end\n #puts \"Dormant Booking to More Prev: #{dormantBookingToMorePrev}\"\n\n totalAccounts = uniqueArray1.size # Total Number of accounts\n totalAccountsPrev = uniqueArray2.size # Total Last Year Accounts\n totalAccountsMorePrev = uniqueArray3.size # Total Last 3 Year Accounts\n\n totalBooking1 = 0.0\n uniqueDict1.each do |cust, booking|\n totalBooking1 += booking\n end\n\n totalBooking2 = 0.0\n uniqueDict2.each do |cust, booking|\n totalBooking2 += booking\n end\n\n totalBooking3 = 0.0\n uniqueDict3.each do |cust, booking|\n totalBooking3 += booking\n end\n\n newAccountsToPrev = newToPrevArray.size # New accounts compared to Last year\n newAccountsToMorePrev = newToMorePrevArray.size # New Accounts compared to last 3 years\n\n # Calculate the counts and total booking from the array\n repeatAccountsToPrev = totalAccounts - newAccountsToPrev # Repeat accounts compared to last year\n repeatBookingToPrev = totalBooking1 - newBookingToPrev # Repeat accounts' booking compared to last year\n\n repeatAccountsToMorePrev = totalAccounts - newAccountsToMorePrev # Repeat accounts compared to last 3 years\n repeatBookingToMorePrev = totalBooking1 - newBookingToMorePrev # Repeat accounts' booking compared to last 3 year\n \n dormantAccountsToPrev = dormantToPrevArray.size # Dormant accounts compared to last year\n\n dormantAccountsToMorePrev = dormantToMorePrevArray.size # Dormant accounts compared to last 3 years\n\n\n keyArray << byName \n returnObj1 = {\n :key => keyArray,\n :val => totalAccounts,\n :value => totalBooking1/THOUSAND,\n :value2 => newAccountsToPrev,\n :value3 => newBookingToPrev/THOUSAND,\n :value4 => repeatAccountsToPrev,\n :value5 => repeatBookingToPrev/THOUSAND,\n }\n returnObj2 = {\n :key => keyArray,\n :val => totalAccounts,\n :value => totalBooking2/THOUSAND,\n :value2 => newAccountsToMorePrev,\n :value3 => newBookingToMorePrev/THOUSAND,\n :value4 => repeatAccountsToMorePrev,\n :value5 => repeatBookingToMorePrev/THOUSAND,\n }\n returnObj3 = {\n :key => keyArray,\n :val => totalAccountsPrev,\n :value => totalBooking3/THOUSAND,\n :value2 => dormantAccountsToPrev,\n :value3 => dormantBookingToPrev/THOUSAND,\n :value4 => totalAccountsMorePrev,\n :value5 => dormantAccountsToMorePrev,\n :value6 => dormantBookingToMorePrev/THOUSAND,\n }\n returnObj = {\n :obj1 => returnObj1,\n :obj2 => returnObj2,\n :obj3 => returnObj3,\n }\n return returnObj\n end", "def combine_hashes(*hashes)\n final_hash = {}\n hashes.each do |this_hash|\n # where matching, add the values.\n final_hash = final_hash.merge(this_hash) {\n |_key, oldval, newval| newval + oldval \n }\n end\n return final_hash\nend", "def merge!(*other_hashes, &blk); end", "def by_group(hashes, key)\n groups = hashes.group_by { |h| h[key] }\n groups.values.map { |g| flat(g) }\n end", "def deep_transform_keys(&block); end", "def association_bound_variable_hash(table, ks, vs)\n Hash[*ks.zip(vs).map{|k, v| [:\"#{table}.#{k}\", get_column_value(v)]}.flatten]\n end", "def grouped_predicates_attributes\n @grouped_predicates_attributes ||= predicates_attributes.inject({}) do |result, predicate|\n namespace, name = predicate['namespace'], predicate['name']\n predicate = SourceTransferObject.new(predicate['titleized'])\n result[namespace] ||= {}\n result[namespace][name] ||= []\n result[namespace][name] << predicate\n result\n end\n end", "def mergeable?(hash_a, hash_b)\n\n hash_a.each do |key, value_a|\n #TODO: one day maybe just use symbols for all keys?\n if hash_b.has_key?(key.to_sym) || hash_b.has_key?(key.to_s)\n value_b = hash_b[key]\n if value_a.is_a?(Hash) && value_b.is_a?(Hash)\n return false if !mergeable?(value_a, value_b)\n else\n return false\n end\n end\n end\n true\n end", "def build_hash items\n result = {}\n items.each do |v|\n k = yield v\n if result.has_key? k\n raise \"Duplicate hash key: #{k} with values #{v} and #{result[k]}\"\n end\n result[k] = v\n end\n result\n end", "def merge(*other_hashes, &blk); end", "def hash_check(start_hash, end_hash, hash = {})\n key = (start_hash.keys + end_hash.keys).uniq.first\n st = start_hash.first.last unless start_hash.first.nil?\n ed = end_hash.first.last unless end_hash.first.nil?\n\n if start_hash.empty? && end_hash.empty?\n hash\n else\n if st.class == Hash && ed.class == Hash\n hash[key] = hash_check(st, ed, {})\n else\n hash[key] = st != ed ? [st, ed] : st\n [start_hash, end_hash].each {|x| x.delete(key)}\n hash_check(start_hash, end_hash, hash)\n end\n end\n hash\nend", "def collect_map_rule(map_mod, out_hash)\n out_hash[:maps] ||= []\n if map_mod[:simple_value]\n out_hash[:maps] << [map_mod[:simple_value].to_i, :<=, 1]\n return\n end\n\n collect_complex_map_rule(map_mod, out_hash)\n end", "def summarize_per_subset\n @having = ANY_ROWS\n end", "def deep_transform_keys!(&block); end", "def _deep_merge(original_hash, filtered_hash)\n original_hash.merge(filtered_hash) do |_key, original_item, filtered_item|\n if original_item.is_a?(Hash) && filtered_item.is_a?(Hash)\n _deep_merge(original_item, filtered_item)\n elsif filtered_item == FILTERED_VALUE\n filtered_item\n else\n original_item\n end\n end\n end", "def group_with_builtin(coll)\n puts \"Grouping by 'Make' (built-in)\"\n coll.group({\n :key => [:Make],\n :initial => {:crashes => 0},\n :reduce => 'function(doc, prev) {prev.crashes += 1;}'\n })\nend", "def expanded\n h = Hash.new\n [:id, :email, :api_key, :name, :phone, :password,:states, :approval, :suspend,\n :registration_ip_address, :dates, :some_msg].each do |setting|\n if grouped = self.send(\"#{setting}\").is_a?(Hash)\n self.send(\"#{setting}\").each {|k,v| h[k.to_sym] = v}\n else\n h[setting] = self.send(\"#{setting}\")\n end\n end\n h\n end", "def averages(grade_hash)\n# a_new_hash = my_hash.inject({}) { |h, (k, v)| h[k] = v.upcase; h }\naverages = grade_hash.inject({}) { |h, (k,v)| h[k] = v.reduce{|x,n| x += n}/v.length ; h}\nend", "def format_keys(resource)\n resource.keys.reduce({}) do |memo, key|\n value = resource[key]\n\n formatted_key = Ubw::Util.snakify(key)\n formatted_key << '?' if !!value == value # Add a ? to the key if value is a Boolean\n\n memo[formatted_key] = value\n\n memo\n end\n end", "def expand_repeats(hash)\n\t\t\t\thash.each do |key,val|\n\t\t\t\t\tif val.kind_of? Array\n\t\t\t\t\t\tval.each_with_index{|v, i| hash[\"#{key}(#{i+1})\"] = v}\n\t\t\t\t\t\thash.delete(key)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\thash\n\t\t\tend", "def hash(hash=nil,var=nil,&guard)\n # coerce literals into patterns\n patterns = hash.to_a.map! { |(k,v)|\n [k,(v.is_a?(Pattern) ? v : is(v))]\n }\n matcher = lambda { |h,context|\n context.fail unless h.is_a?(Hash)\n patterns.each { |(k,value_pattern)|\n case k\n when Array\n # optional key\n k = k.first\n # try matching iff the value is non-nil\n if value=h[k]\n context.nest(value,value_pattern)\n end\n # regexp match is a bit silly...\n # when Regexp\n # # pattern applies to all keys that matches regexp\n # re = k\n # hash.keys.each do |k|\n # if k =~ re\n # context.nest(h[k],value_pattern)\n # end\n # end\n \n else\n # required key\n context.fail(\"no required key: #{k}\") unless h.has_key?(k)\n context.nest(h[k],value_pattern)\n end\n }\n true\n }\n Pattern.new(matcher,guard,var,\"Hash\")\n end", "def build_partial_update_query(all_attribute_keys, hashes)\n # Cache the connection for the batch\n connection = get_connection\n\n all_attribute_keys = (all_attribute_keys + unique_index_columns).uniq\n\n update_query = update_query_beginning(all_attribute_keys)\n update_query += update_query_from_values(hashes, all_attribute_keys, connection, unique_index_columns)\n update_query\n end", "def store_aggregates\n raise NotImplementedError\n end", "def validate_data_hash(data_hash)\n super\n module_prefix = \"#{module_name}::\"\n data_hash.each_key.reduce(data_hash) do |memo, k|\n next memo if k == LOOKUP_OPTIONS || k.start_with?(module_prefix)\n msg = \"#{yield} must use keys qualified with the name of the module\"\n memo = memo.clone if memo.equal?(data_hash)\n memo.delete(k)\n Puppet.warning(\"Module '#{module_name}': #{msg}\")\n memo\n end\n data_hash\n end" ]
[ "0.71716416", "0.53500956", "0.5294393", "0.5188842", "0.5148199", "0.50564456", "0.50068414", "0.49903038", "0.4976921", "0.49376142", "0.4923076", "0.4907806", "0.49004897", "0.4891337", "0.48866627", "0.48831445", "0.4878997", "0.48743153", "0.48596075", "0.48596075", "0.48324394", "0.48183125", "0.48125434", "0.47888345", "0.47807798", "0.47773838", "0.4774888", "0.47726735", "0.47539753", "0.4751396", "0.4750726", "0.4746663", "0.47355375", "0.47330788", "0.47240576", "0.47223178", "0.4722089", "0.47195926", "0.4715085", "0.46996143", "0.46973243", "0.4693284", "0.46862566", "0.46836358", "0.46833524", "0.46748042", "0.4663488", "0.46616903", "0.46487248", "0.46470842", "0.46456322", "0.4637586", "0.4632986", "0.46326646", "0.4631409", "0.46266478", "0.46263003", "0.4625418", "0.46140108", "0.46044376", "0.46034056", "0.46030444", "0.4600657", "0.45998895", "0.45951104", "0.45771134", "0.457272", "0.45695543", "0.45669857", "0.45595282", "0.45572627", "0.45506537", "0.45496157", "0.45474988", "0.45454118", "0.4545369", "0.4543911", "0.454122", "0.45242456", "0.4522476", "0.45184463", "0.45119193", "0.45082003", "0.45018953", "0.44989973", "0.4497794", "0.4497671", "0.4491272", "0.44886908", "0.44881245", "0.44873026", "0.4483463", "0.44824937", "0.44686207", "0.44636747", "0.446022", "0.44588646", "0.44586217", "0.4457111", "0.44549757", "0.44479418" ]
0.0
-1
Indicates whether the tunnel is busy.
def busy? status == "busy" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def busy?\n @busy\n end", "def busy?\n @busy\n end", "def busy?\n status == :busy\n end", "def busy?()\n @mutex.synchronize() do\n return @busy\n end\n end", "def busy?\n !(@status == :wait || @status == :disabled || @status == :error)\n end", "def busy?(connection)\n connection.busy?\n end", "def busy?\n busy = false\n @mutex.synchronize { busy = !!@busy }\n busy\n end", "def busy?()\n !@current_req.nil? || [email protected]? || @actor.busy?\n end", "def busy?\n\n @queue.size > 0\n end", "def busy?()\n\t\tcommand_center.busy?\n\tend", "def busy?\n busy || (max_workers && work_units.count >= max_workers)\n end", "def busy?\n\t\t\t\[email protected] do |_,usage|\n\t\t\t\t\treturn true if usage > 0\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn false\n\t\t\tend", "def busy?\n\t\t\t\[email protected] do |_, usage|\n\t\t\t\t\treturn true if usage > 0\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn false\n\t\t\tend", "def busy?\n @tasks.each_value { |task| return true if task.busy? }\n false\n end", "def busy?; end", "def busy?\n online? and presence.show == :dnd\n end", "def busy?\n @flows.each_value { |f| return true if f.busy? }\n return true if [email protected]? && @log.busy?\n return true if !@error_handler.nil? && @error_handler.busy?\n false\n end", "def active?\n !!@raw_connection&.ping\n end", "def run_on_busy_tb?\n $game_message.busy?\n end", "def busy?\n !@work_queue.empty? || super\n end", "def alive?\n ! @handle.completed\n end", "def link_alive?\n !!socket && !socket.closed? && !@dead && @disabled_tx == 0\n end", "def busy?(purpose)\n (@exclusive_thread && @exclusive_thread != Thread.current) ||\n @waiting.any? { |k, v| k != Thread.current && !v.include?(purpose) } ||\n @sharing.size > (@sharing[Thread.current] > 0 ? 1 : 0)\n end", "def alive?\n @alive && @mailbox.alive?\n end", "def ping_is_pending?\n return @ping_request\n end", "def busy?(include_invisible=false)\n true\n end", "def idle?\n\t\t\[email protected]?\n\t\tend", "def waiting? #:nodoc:\n false|@waiting\n end", "def valid?\n ping\n end", "def busy?\n @battler && BusyPhases.any? do |phase|\n phase == @battler.battle_phase\n end && [email protected] || (@battler && @battler.moving?)\n end", "def active? # :nodoc:\n # Pings the connection to check if it's still good. Note that an\n # #active? method is also available, but that simply returns the\n # last known state, which isn't good enough if the connection has\n # gone stale since the last use.\n @raw_connection.ping\n rescue OracleEnhanced::ConnectionException\n false\n end", "def is_alive?\n\t\treturn @alive\n\tend", "def stalled?\n # only makes sense for jobs that are in an actively processing state\n return false unless pending? || in_progress?\n\n (Time.zone.now - updated_at) > IDLE_THRESHOLD\n end", "def blocked?\n (status == BLOCKED)\n end", "def waiting?\n @waiting\n end", "def check\n render json: !@@thread.alive?\n end", "def alive?\n @thread.alive?\n end", "def busy?(include_invisible=false)\n servers.any? { |server| server.busy?(include_invisible) }\n end", "def running?\n @pool_lock.synchronize { @worker_threads.size != 0 && @worker_threads.all? { |t| t.status } }\n end", "def ok?\n @threads_lock.synchronize { @threads.all? {|_, thr| thr.alive?} }\n end", "def alive?\n synchronize { !@dead }\n end", "def alive?\n @thread ? @thread.alive? : false\n end", "def available?\n idle.any?\n end", "def waiting?\n @waiting\n end", "def waiting?\n @lock.synchronize { !defined?(@start_time) }\n end", "def idle?\n @idle\n end", "def waiting?\n @status[:description] == :wait\n end", "def active?\n # Pings the connection to check if it's still good. Note that an\n # #active? method is also available, but that simply returns the\n # last known state, which isn't good enough if the connection has\n # gone stale since the last use.\n @connection.ping\n rescue OracleEnhancedConnectionException\n false\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def locked?\n (status & (1 << 0)).zero?\n end", "def waiting?\n @waiting.set?\n end", "def any_waiting?\n synchronize do\n @num_waiting > 0\n end\n end", "def blocking?\n false\n end", "def alive?\n unless(@recvthread.instance_of?(Thread))\n return false\n end\n \n [email protected]?\n @sendthreads.each_value{|t|\n ret&=t\n }\n ret&=([email protected]?)\n \n return ret\n end", "def working?\n return true if @httpserv and @httpserv.working_count > 0\n return false\n end", "def active?\n [email protected]? && @socket.active?\n end", "def busy?\n BusyPhases.any? {|phase| battle_phase == phase }\n end", "def alive?\n return @thread.alive? if @thread\n return false\n end", "def idle?\n @idle_time > 0\n end", "def work_pending?\n !buffer.empty?\n end", "def throttle?\n false\n end", "def alive?\n Utils::NetworkUtils.port_open?(@host, @port)\n end", "def ongoing?\n status == 1\n end", "def ping?\n false\n end", "def idle?\n @state == :idle\n end", "def alive?\n\t\tconnection.alive?\n\tend", "def alive?\n\t\tconnection.alive?\n\tend", "def running?; @alive end", "def busy?\n (@enemy_sprites + @actor_sprites).any? do |sprite|\n sprite.busy?\n end\n end", "def lock_status?\n return @unlocked == true\n end", "def reachable?\n ping\n true\n rescue Orocos::ComError\n false\n end", "def alive?\n return false if not @thread or not @fd\n @thread.alive?\n end", "def is_locked\n return @is_locked\n end", "def running?\n @server_thread && @server_thread.alive?\n end", "def available?\n @available && connected?\n end", "def dead?\n @thread.dead?\n end", "def unhealthy?\n @_closed || @_shutting_down || is_unrecoverable\n end", "def complete?\n if threaded?\n !running?\n else\n true\n end\n end", "def alive?\n super && !@cancelled\n #!!@alive# && !@cancelled\n end", "def is_alive\n @state == ALIVE\n end", "def usable?\n [:connected, :connecting].include?(@status)\n end", "def ready?\n status == \"RUNNING\"\n end", "def locked?\n self.released?\n end", "def ready?\n status == DONE_STATE\n end", "def locked?\n @bridge.device_locked?\n end", "def alive?\n @alive\n end", "def keep_alive?\n @keep_alive\n end", "def server_available?\n !in_latency_window.empty?\n end", "def viable?\n\t\t\t\t\t\t@ready && @stream&.connected?\n\t\t\t\t\tend", "def timeout?\n @status == :timeout\n end", "def reachable?\n @state['reachable']\n end", "def in_progress?\n started? && response.nil?\n end", "def held?\n status.queued_held?\n end", "def available?\n status == :available\n end", "def online?\n get['state']['reachable']\n end", "def alive?\n return false if @thread.nil?\n\n @thread.alive?\n end", "def keep_alive?\n !!@keep_alive && [email protected]?\n end", "def live_thread?\n threads.any?(&:alive?)\n end", "def idle?\n conversation_state.idle?\n end" ]
[ "0.7779011", "0.7779011", "0.7715679", "0.76334006", "0.76183325", "0.7596095", "0.7508368", "0.7464069", "0.7182531", "0.7127738", "0.7063052", "0.6934519", "0.69339556", "0.68022513", "0.677755", "0.6773345", "0.6770824", "0.6620363", "0.65954554", "0.65731025", "0.6544448", "0.64912647", "0.6489832", "0.6488516", "0.6481125", "0.6462997", "0.6415853", "0.6368231", "0.63616705", "0.63562554", "0.6332665", "0.63308847", "0.63279086", "0.62770104", "0.62638766", "0.624498", "0.62362045", "0.6232709", "0.62146074", "0.6202604", "0.61999273", "0.6190394", "0.6186581", "0.6179191", "0.6174285", "0.6172701", "0.61706805", "0.6158747", "0.61529446", "0.61529446", "0.615242", "0.6149447", "0.6136146", "0.6122012", "0.61181283", "0.6115835", "0.6115826", "0.6111111", "0.61076313", "0.610612", "0.6105994", "0.6096462", "0.60865265", "0.60792965", "0.60724306", "0.6071238", "0.6070453", "0.6070453", "0.6055778", "0.60522735", "0.60472965", "0.6043768", "0.60333943", "0.60080737", "0.6007514", "0.60047597", "0.6002259", "0.6000111", "0.59989405", "0.59972787", "0.59891725", "0.5985304", "0.59832364", "0.59825265", "0.59811366", "0.5976633", "0.5965312", "0.5952321", "0.59462875", "0.59447974", "0.594392", "0.59436506", "0.59400517", "0.5937369", "0.59369653", "0.59300506", "0.5924839", "0.5923655", "0.59222543", "0.59181243" ]
0.7538359
6
Save putting the btn and btnmini bootstrap classes in every link below...
def workflow_action_link(title, link, opts={}) link_to(title, link, {:class=>'btn btn-mini'}.merge(opts)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primary_button_small\n \"highlight-button-dark btn btn-small button\"\n end", "def payment_button_classes(additional_classes = [])\n %w(btn btn-secondary btn-sm) + additional_classes\n end", "def bootstrap_button(text, *params)\n options = params.extract_options!.symbolize_keys\n if options.include?(:class)\n options[:class] << \" btn small\"\n end\n options[:class] ||= \"btn small\"\n options[:href] ||= \"#\"\n content_tag(:a, text, options)\n end", "def submit_classes(*extra_classes, btn_style: 'btn-primary')\n bootstrap_classes = ['btn', btn_style, 'btn-block']\n css_classes = [*bootstrap_classes, *extra_classes]\n css_classes.join(' ')\n end", "def buttons(f, cf0925)\n # content_tag :div, class: 'form-inline' do\n [f.submit(\"Save\", class: \"btn btn-primary\"),\n f.button(\"Reset\", type: \"reset\", class: \"btn btn-primary\"),\n print_button(cf0925),\n home_button].join(\" \").html_safe\n # end\n end", "def button_go_to\n h.link_to \"Order ##{object.id}\", h.order_path(object), class: \"btn btn-xs #{btn_type}\", target: :_blank\n end", "def navbar_buttons param, buttons, args={}\n\t\t\ta = []\n\t\t\tbuttons.each do |b|\n\t\t\t\thtml = \"<a type='button' class='btn btn-default \"\n\t\t\t\tp = chk_qs(param,b) \n\t\t\t\thtml += \"active\" if (p || p.nil? && UI_DEFAULTS[param] == b) || args[:active]\n\t\t\t\thtml += \"' href='\"+ chg_qs(param, b) +\"'>\"+b+\"</a>\"\n\t\t\t\ta << html\n\t\t\tend\n\t\t\ta\n\t\tend", "def edit_button_table(model, link_args = {})\n link_args[:class] = 'btn-warning btn-xs' + (link_args[:class] || '')\n link_args[:additional_I18n] = 'short'\n action_button :edit, model, link_args\n end", "def include_pretty_buttons\n stylesheet_link_tag 'buttons'\n end", "def view_all_button(url, attrs = {})\n attrs = {class: '', label: 'See all', modal_title: '', modal_size: '', remote: true}.merge(attrs)\n content_tag :div, link_to(\"#{attrs[:label]} &raquo;\".html_safe, url, class: 'link_all_btn ujs_link_modal margin_top10 inline underline '+attrs[:class], remote: attrs[:remote], 'data-disable-with' => button_spinner, 'data-modal-title' => attrs[:modal_title], 'data-modal-size' => attrs[:modal_size]), class: 'text-center'\n end", "def sm_rnd_btn_class(classnames = nil)\n default_classnames = Array(fab_class(%w[btn-sm shadow-none]))\n join_classnames(default_classnames, classnames)\n end", "def button_to(*args, &block)\n args = append_class_as! :class, 'btn', *args, &block\n if Bh::Stack.find(Bh::Navbar)\n args = append_class_as! :form_class, 'navbar-form', *args, &block\n end\n super *args, &block\n end", "def link_btn(text, path, opts = {}, html_opts = {})\n if icon = opts.delete(:icon)\n text = content_tag(:span, \"\", :class => 'icon') << text\n end\n text = content_tag(:span, text)\n opts[:class] = [\n :minibutton, \n opts[:class].full? ? opts[:class] : icon.full?, \n icon.full? { |i| \"btn-#{i}\" }\n ].compact.join(' ')\n link_to text, path, opts, html_opts\n end", "def button_class(button, options={})\n if button.to_s.match(/img/i)\n \"\"\n else\n options[:button_class] ? options[:button_class] : \"medium button\"\n end \n end", "def publicbuttong(flag)\n if flag == false\n return \"btn btn-success\"\n else\n return \"btn btn-danger\"\n end\n end", "def submit_class(size=nil)\n size = form_field_settings.field_size unless size\n\n \"btn btn-primary btn-#{size}\"\n end", "def old_button_link_to( title, url, options={} )\n#\t\tid = \"id='#{options[:id]}'\" unless options[:id].blank?\n#\t\tklass = if options[:class].blank?\n#\t\t\t\"class='link'\"\n#\t\telse\n#\t\t\t\"class='#{options[:class]}'\"\n#\t\tend\n#\t\ts = \"<button #{id} #{klass} type='button'>\"\n\t\tclasses = ['link']\n\t\tclasses << options[:class]\n\t\ts = \"<button class='#{classes.flatten.join(' ')}' type='button'>\"\n\t\ts << \"<span class='href' style='display:none;'>\"\n\t\ts << url_for(url)\n\t\ts << \"</span>\"\n\t\ts << title\n\t\ts << \"</button>\"\n\t\ts\n\tend", "def mini_button(action, object, options = {}, html_options = {})\n case action\n when :check_out\n path = new_loan_path(object)\n ability = options.delete(:ability) || :create\n html_options.reverse_merge!({\n :text => t(\"helpers.mini_buttons.check_out\").html_safe,\n :title => t(\"helpers.actions.check_out\"),\n :class => 'btn btn-mini',\n :method => :get,\n })\n # when :edit\n # path = [:edit, object]\n # ability = options.delete(:ability) || :update\n # html_options.reverse_merge!({\n # :text => t(\"helpers.mini_buttons.edit\").html_safe,\n # :title => t(\"helpers.actions.edit\"),\n # :class => 'btn btn-mini',\n # :method => :get,\n # })\n when :edit\n path = [:edit, object]\n ability = options.delete(:ability) || :update\n html_options.reverse_merge!({\n :text => t(\"helpers.mini_buttons.edit\").html_safe,\n :title => t(\"helpers.actions.edit\"),\n :class => 'btn btn-mini',\n :method => :get,\n })\n when :show\n path = object\n ability = options.delete(:ability) || :read\n html_options.reverse_merge!({\n :text => t(\"helpers.mini_buttons.show\").html_safe,\n :title => t(\"helpers.actions.show\"),\n :class => 'btn btn-mini',\n :method => :get\n })\n else\n raise \"unknown action\"\n end\n\n # defaults for all buttons\n html_options.reverse_merge!({\n :rel => \"tooltip\",\n 'data-delay' => 500\n })\n\n # authorize the action\n unless can?(ability, object)\n html_options.merge!(\"disabled\" => \"disabled\")\n end\n\n text = html_options.delete(:text)\n #button_to(text, path, options)\n my_button_to(path, html_options) do\n text\n end\n end", "def linkwizard_startover_button\n $tracer.trace(__method__)\n return ToolTag.new(form.id(\"StartOver\").button.className(\"/btn/\") ,__method__)\n end", "def form_buttons(**opt)\n opt.reverse_merge!('data-manifest': object.id)\n buttons = super\n buttons << submission_button(**opt)\n buttons << export_button(**opt)\n buttons << import_button(**opt)\n buttons << comm_status(**opt)\n block_given? ? yield(buttons) : buttons\n end", "def button_link_to(text, icon, url, options = {})\n options[:class] = \"btn #{options[:type] || 'btn-default'} #{options[:class]}\".strip\n icon_link_to(text, icon, url, options)\n end", "def button_link(title, url, icon = nil, html_options = {}) # TODO: use this more\n html_options[:class] = '' unless html_options[:class]\n html_options[:class] += ' btn ' unless html_options[:class].include?('btn ')\n html_options[:class] += ' btn-default ' unless html_options[:class].include?('btn-')\n if icon\n link = link_to(url, html_options) do\n if icon.include?('psap-entity-icon')\n raw(icon.gsub('psap-entity-icon', '')) + ' ' + title\n elsif icon.include?('glyphicon')\n content_tag(:span, '', class: 'glyphicon ' + icon) + ' ' + title\n else\n content_tag(:i, '', class: 'fa ' + icon) + ' ' + title\n end\n end\n return raw(link)\n end\n raw(link_to(title, url, html_options))\n end", "def tbs_button_link(title, path, options = {})\n\t\tbtn_class = \"btn\"\n\t\tbtn_class += \" btn-#{options[:size]}\" unless options[:size].nil?\n\t\tbtn_class += \" btn-#{options[:style]}\" unless options[:style].nil?\n\t\toptions.delete(:size)\n\t\toptions.delete(:style)\n\n\t\ticon = options[:icon]\n\t\toptions.delete(:icon)\n\t\toptions.merge! class: btn_class\n\n\t\tif icon.nil?\n\t\t\tlink_to title, path, options\n\t\telse\n\t\t\tlink_to path, options do\n\t\t\t\tcontent_tag(:i, nil, class: \"icon-#{icon} icon-white\") + \" #{title}\"\n\t\t\tend\n\t\tend\n\tend", "def button_link_to( title, url, options={} )\n\t\tclasses = ['link']\n\t\tclasses << options[:class]\n\t\ts = \"<a href='#{url_for(url)}' style='text-decoration:none;'>\"\n\t\ts << \"<button type='button'>\"\n\t\ts << title\n\t\ts << \"</button></a>\\n\"\n\tend", "def fixme_button(done, auto_check)\n content_tag(:div, class: \"col-sm-1\") do\n if !done && auto_check\n link_to url_helpers.edit_product_path(@review.product) do\n content_tag(:button, 'FIXME', type: \"button\", class: \"btn btn-warning btn-xs\")\n end\n end\n end\n end", "def crud_link_css(options, action)\n\n if options.keys.include?(:icon_only) && options[:icon_only] == true\n if options.keys.include?(:class)\n options[:class] += \"#{action.to_s.downcase}-link \"\n else\n options[:class] = \"#{action.to_s.downcase}-link \"\n end\n else\n if options.keys.include?(:class)\n options[:class].insert(0, \"#{action.to_s.downcase}-link btn \")\n else\n options[:class] = \"#{action.to_s.downcase}-link btn\"\n end\n\n case true\n when %w(delete destroy).include?(action.to_s.downcase) then options[:class] += ' btn-danger'\n end\n end\n\n options\n end", "def bootstrap_form_buttons(&block)\n content_tag :div, class: 'form-actions row' do\n content_tag :div, class: 'col-md-10 col-md-offset-2', &block\n end\n end", "def buttons attrs = {}, &block\n Tagz.tag :div, { :class => 'form-buttons' }.merge(attrs), &block\n end", "def phx_button_for( model, captionSuffix, alternateCaptions, name, cssClass, disabled = false, remote = false, id = nil, overrideCaption = nil, tabindex = nil )\n\n buttonClass = \"btn btn-sm btn-default \" << cssClass\n if overrideCaption\n fullCaption = overrideCaption\n elsif !alternateCaptions.present?\n fullCaption = (model.object.persisted? ? \"Update \" : \"Create \") << captionSuffix\n else\n fullCaption = model.object.persisted? ? alternateCaptions[1] : alternateCaptions[0]\n end\n # let rails generate the html\n if tabindex\n button = capture do concat model.submit( fullCaption, name: name, class: buttonClass, disabled: disabled, remote: remote, id: id, tabindex: tabindex ) end\n else\n button = capture do concat model.submit( fullCaption, name: name, class: buttonClass, disabled: disabled, remote: remote, id: id ) end\n\n end\n\n button.html_safe\n\n end", "def activate\n ApplicationHelper.class_eval{\n def save_model_button(model)\n label = if model.new_record?\n \"Create #{model.class.name}\"[:create]\n else\n 'Save Changes'[:save_changes]\n end\n submit_tag label, :class => 'button'\n end\n\n def save_model_and_continue_editing_button(model)\n submit_tag 'Save and Continue Editing'[:save_and_continue], :name => 'continue', :class => 'button'\n end\n \n def updated_stamp(model)\n unless model.new_record?\n updated_by = (model.updated_by || model.created_by)\n login = updated_by ? updated_by.login : nil\n time = (model.updated_at || model.created_at)\n if login or time\n html = %{<p style=\"clear: left\"><small>#{\"Last updated\"[:last_updated]} } \n html << %{#{\"by\"[:by]} #{login} } if login\n html << %{#{\"at\"[:at]} #{ timestamp(time) }} if time\n html << %{</small></p>}\n html\n end\n else\n %{<p class=\"clear\">&nbsp;</p>}\n end\n end\n }\n # Translate Main Menu\n admin.tabs.remove \"Pages\"\n admin.tabs.add \"Seiten\", \"/admin/pages\", :before => \"Snippets\"\n \n admin.tabs.remove \"Snippets\"\n admin.tabs.add \"Snippets\", \"/admin/snippets\", :before => \"Layouts\", :visibility => [:admin, :developer]\n \n admin.tabs.remove \"Layouts\"\n admin.tabs.add \"Layouts\", \"/admin/layouts\", :after => \"Snippets\", :visibility => [:admin, :developer]\n \n end", "def view_button(object, link = nil)\n link_to '<span class=\"glyphicon glyphicon-eye-open\"></span> View'.html_safe,\n link ? link : polymorphic_path(object),\n class: 'btn btn-default',\n title: \"View #{object_title(object)}\"\n end", "def save_button\n if user_signed_in?\n if action_name == \"new\"\n \"<button class='btn-save' id='btn-save'><span><i class='fas fa-cloud'></i></span>Save</button>\".html_safe\n elsif action_name == 'edit' && current_user == @pen.user\n \"<button class='btn-save' id='btn-update'><span><i class='fas fa-cloud'></i></span>Save</button>\".html_safe\n end\n end\n end", "def action_button_form options\n label = options[:label] ? options[:label] : \"Boton\"\n url = options[:url] ? options[:url] : \"#\"\n myclass = options[:class] ? \"btn-action #{options[:class]}\" : \"btn-action\"\n\n \"<li><div class='#{myclass}'>#{link_to(label, url)}</div></li>\".html_safe\n end", "def link_to_modal_form project\n link_to \"##{ idify( project ) }\", :class => 'btn btn-mini btn-warning',\n :'data-toggle' => \"modal\", :role=>\"button\" do\n content_tag( :i, nil, :class => \"icon-wrench\" ) +\n \" Setup your project\"\n end\n end", "def button_to(name, options = {}, html_options = {}) \n\t\thtml_options = check_options(html_options)\n\t\thtml_options[:class] << 'button'\n\t\tsuper(name, options, html_options)\n\tend", "def button(opts = {})\n opts[:class] << ' button' if opts[:class]\n opts[:class] ||= 'button'\n opts[:class] << ' alert' if opts[:action] == :destroy\n link(opts)\n end", "def helper_app_btn_icon_show_row\n \"btn glyphicon glyphicon-eye-open\"\n end", "def view_more_button(url, custom_class = '', settings = {})\n settings = {label: 'View more', closest: '.text-center'}.merge(settings)\n content_tag :div, link_to(\"#{settings[:label]} &raquo;\".html_safe, url, class: 'link_more_btn ujs_success_replace margin_top10 inline underline '+custom_class, 'data-closest-replace' => settings[:closest], remote: true, 'data-disable-with' => button_spinner), class: 'text-center'\n end", "def manageable_button(body, url, html_options = {})\n html_options[:class] = [html_options[:class], \"button\"].compact.join(\" \")\n icon = manageable_icon(html_options.delete(:icon), :small, :alt => body) if html_options[:icon]\n\n link_to url, html_options do\n [icon, body].compact.join(\"&nbsp;\").html_safe\n end\n end", "def button_link(which)\n link.href(\"/page/#{which}\")[\n button\n .css(:button)\n .disabled(app.done_scope == which)\n .style(margin_right: 1.em, width: 6.em)[\n \"#{which.to_s.capitalize} (#{TODOS.count(which)})\"\n ]\n ]\n end", "def loan_mini_button(text, object, options={})\n path = String.new\n\n case object.class.to_s\n when \"ComponentModel\"\n path = new_component_model_loan_path(object, options)\n when \"ComponentModelDecorator\"\n path = new_component_model_reservation_path(object.model, options)\n when \"Kit\"\n path = new_kit_loan_path(object, options)\n when \"KitDecorator\"\n path = new_kit_loan_path(object.model, options)\n else\n raise \"Expected an instance of Kit, KitDecorator, ComponentModel or ComponentModelDecorator, got: #{ object.class }\"\n end\n link_to(text, path, :class => 'btn btn-mini')\n end", "def setup_button_class\n \"btn btn-primary btn-block worker_task#{@project.may_setup? ? '' : ' disabled'}\"\n end", "def dt_actions\n\n links = []\n links << h.link_to(h.project_path(object), class: 'btn btn-success mx-1') do \n h.fa_icon 'rocket', text: h.t('explore')\n end\n links << h.link_to(h.edit_project_path(object), class: 'btn btn-primary mx-1') do \n h.fa_icon 'edit', text: h.t('edit')\n end\n links << h.link_to(h.project_path(object), method: :delete, remote: true, class: 'btn btn-danger', data: h.dataConfirm) do \n h.fa_icon 'remove', text: h.t('remove')\n end\n h.safe_join(links, '')\n end", "def classname\n source.default? ? \"btn\" : \"btn btn-success\"\n end", "def show_button_to(path, text = t('show'))\n link_to path, class: 'button small' do\n concat text\n end\n end", "def apphelp_protected_buttons_to( *button_data )\n buttons = ''\n\n button_data.each do | data |\n next if ( data.nil? )\n\n action = data[ 0 ] # NB: This is the action the button will represent, not the current, user-requested action for the enclosing page.\n options_for_link = data[ 1 ] || {}\n options_for_url = data[ 2 ]\n\n case action_name.to_sym # NB: This is the current, user-requested action for the enclosing page, not the action the button will represent.\n when :new, :create, :edit, :update\n mapping_hash = @@apphelp_button_mappings[ :for_read_write_pages ]\n when :show, :index\n mapping_hash = @@apphelp_button_mappings[ :for_read_only_pages ]\n else\n mapping_hash = @@apphelp_button_mappings[ :for_general_use ]\n end\n\n mapping = mapping_hash[ action ] || @@apphelp_button_mappings[ :for_general_use ][ :default ]\n ctrl = options_for_link[ :controller ] || controller.class\n variant = options_for_link.delete( :variant ) || mapping[ :variant ]\n icon = options_for_link.delete( :icon ) || mapping[ :icon ]\n text = options_for_link.delete( :text ) || apphelp_heading( ctrl, action )\n\n options_for_link[ :class ] ||= \"#{ variant } round\"\n\n buttons += ' ' unless ( buttons.empty? )\n buttons += apphelp_protected_link_to(\n action,\n options_for_link,\n options_for_url\n ) do\n image_tag(\n \"icons/#{ icon }.png\",\n :alt => '' # Explicit empty ALT text => icon not important for screen reading\n ) << text\n end\n end\n\n return buttons\n end", "def all_button\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@menu_tag.find.div.className(\"mm-content-base\").find.a.className(\"mainButton\"), format_method(__method__))\n end", "def navigate_to(button)\n find('.navbar-toggle').click unless has_css?('.glyphicon.glyphicon-cog')\n find('.ng-binding', text: button).click\n end", "def btn_link_to(text, path, opts={})\n html_opts = opts\n html_classes = %w(btn)\n if klass = html_opts.delete(:class)\n html_classes << klass\n end\n html_opts[:class] = html_classes.join(\" \")\n if icon = html_opts.delete(:icon)\n text = \"<i class=\\\"icon-#{icon}\\\"></i> #{text}\"\n end\n link_to text.html_safe, path, html_opts\n end", "def back_button(back_route)\n link_to(\"<i class=\\\"icon-white icon-arrow-left\\\"></i> Voltar\".html_safe, back_route, :class => 'btn btn-inverse',:title => 'voltar')\n end", "def buttons; end", "def pretty_button(content, path, options={})\n options[:class] = options[:class].nil? ? \"button\" : \"button \" << options[:class]\n link_to \"<span>#{content}</span>\".html_safe, path, options\n end", "def submit_and_back_buttons(back_route, options = {})\n label_name = options[:label_name] unless options[:label_name].nil? || options[:label_name].blank?\n content_tag(:div, :class => 'control-group') do\n content_tag(:div,\n tag(:input, :type => 'submit', :class => 'btn', :value => label_name) +\n link_to(\"<i class=\\\"icon-white icon-arrow-left\\\"></i> Voltar\".html_safe, back_route, :class => 'btn btn-inverse',:title => 'voltar'),\n :class => 'controls btn-group')\n end\n end", "def menu_link_to(name,path,options={})\n style = \"page_item\"\n style = \"current_page_item\" if current_page?(path)\n options.merge!( { :class => \"#{style} btn btn-small\" } )\n link_to( name, path, options )\n end", "def linkwizard_next_button\n $tracer.trace(__method__)\n return ToolTag.new(button.className(\"/ats-search_button/\") ,__method__)\n end", "def default_crud_actions(resource, options = {})\n options = {\n use_button_group: true,\n button_group_class: \"btn-group\",\n except: []\n }.merge(options)\n\n links = ''.html_safe\n\n if options.keys.include?(:class)\n options[:class] += ' btn-default btn-xs '\n else\n options[:class] = 'btn-default btn-xs '\n end\n\n links << view_link(resource, options) unless options[:except].include?(:show)\n links << edit_link(resource, options) unless options[:except].include?(:edit)\n links << destroy_link(resource, options) unless options[:except].include?(:delete)\n\n if options[:use_button_group] == true\n content_tag(:div, links.html_safe, :class => \"#{options[:button_group_class]}\")\n else\n links\n end\n end", "def helper_app_btn_icon_edit_row\n \"btn glyphicon glyphicon-edit\"\n end", "def integrated_slat_action_link_css_classes\n [\n (\"text-#{theme}\" if theme),\n 'd-block'\n ].join(' ').squish\n end", "def reservation_mini_button(text, object, options={})\n path = String.new\n\n case object.class.to_s\n when \"ComponentModel\"\n path = new_component_model_reservation_path(object, options)\n when \"ComponentModelDecorator\"\n path = new_component_model_reservation_path(object.model, options)\n when \"Kit\"\n path = new_kit_reservation_path(object, options)\n when \"KitDecorator\"\n path = new_kit_reservation_path(object.model, options)\n else\n raise \"Expected an instance of Kit, KitDecorator, ComponentModel or ComponentModelDecorator, got: #{ object.class }\"\n end\n link_to(text, path, :class => 'btn btn-mini')\n end", "def button(type, *args, &proc)\n options = args.extract_options!.dup\n options[:class] = [*options[:class]]\n\n # Add the specified class type.\n if options[:class].select { |cls| BUTTON_CLASSES.include?(cls) }.empty?\n if type.to_s == :submit.to_s.freeze\n options[:class] << 'btn-primary'\n else\n options[:class] << 'btn-default'\n end\n end\n args << options\n\n super(type, *args, &proc)\n end", "def toolbar_button(options = {})\n options.symbolize_keys!\n defaults = {\n :overlay => true,\n :skip_permission_check => false,\n :active => false,\n :link_options => {},\n :overlay_options => {},\n :loading_indicator => true\n }\n options = defaults.merge(options)\n button = content_tag('div', :class => 'button_with_label' + (options[:active] ? ' active' : '')) do\n link = if options[:overlay]\n link_to_overlay_window(\n render_icon(options[:icon]),\n options[:url],\n options[:overlay_options],\n {\n :class => 'icon_button',\n :title => options[:title],\n 'data-alchemy-hotkey' => options[:hotkey]\n }.merge(options[:link_options])\n )\n else\n link_to options[:url], {:class => (\"icon_button#{options[:loading_indicator] ? ' please_wait' : nil}\"), :title => options[:title], 'data-alchemy-hotkey' => options[:hotkey]}.merge(options[:link_options]) do\n render_icon(options[:icon])\n end\n end\n link += content_tag('label', options[:label])\n end\n if options[:skip_permission_check]\n return button\n else\n if options[:if_permitted_to].blank?\n action_controller = options[:url].gsub(/^\\//, '').split('/')\n options[:if_permitted_to] = [action_controller.last.to_sym, action_controller[0..action_controller.length-2].join('_').to_sym]\n end\n if permitted_to?(*options[:if_permitted_to])\n return button\n else\n return \"\"\n end\n end\n end", "def go_to(button)\n find('.navbar-toggle').click unless has_css?('.glyphicon.glyphicon-cog')\n find('.dropdown-toggle').click\n find('.ng-binding', text: button).click\n end", "def continue_button\n\tfind(\".btn--large\").click\nend", "def designed_button_link(&block)\n content_tag :div, :class => \"op-control\" do \n content_tag :ul, :class => \"cf\" do\n content_tag :li do\n content_tag :button do\n yield\n end\n end\n end\n end \n end", "def show_header_buttons\n session[:header_shown] = 1\n if user_signed_in?\n html = link_to(\"\", destroy_user_session_path, method: :delete, class: \"fa fa-sign-out fa-3x icon\", \"data-turbolinks\": false, title: \"Kirjaudu ulos\")\n html += link_to(\"\", settings_path, class: \"fa fa-child fa-3x icon\")\n if !current_user.confirmed?\n html += link_to(\"\", confirm_path, class: \"fa fa-paw fa-3x icon\", title: \"Vahvista tunnus\")\n end\n else\n html = link_to(\"\", new_user_session_path(locale: locale), class: \"fa fa-sign-in fa-3x icon\", \"data-turbolinks\": false, title: \"Kirjaudu sisään\")\n html += link_to(\"\", instruction_path, class: \"fa fa-info-circle fa-3x icon\", title: \"Ohje\")\n end\n\n html += link_to(\"\", vote_proposals_path, class: \"fa fa-list fa-3x icon\", \"data-turbolinks\": false, title: \"Takaisin listaukseen\")\n \n html += '<a href=\"#\" class=\"fa fa-close fa-3x icon button-action\" title=\"Sulje\"></a>'.html_safe\n end", "def button(found, date_id, new_date)\n ret_btn = \"<a href='#{button_href(date_id)}' \"\n ret_btn += \"class='#{button_classes(found)}'>\"\n ret_btn += \"#{button_text(found, new_date)}</a>\"\n ret_btn\n end", "def crud_link_icon(action, options)\n action_str = action.to_s.downcase\n\n case true\n when %w(new create).include?(action_str) then bootstrap_icon = 'icon-plus'\n when %w(update edit).include?(action_str) then bootstrap_icon = 'icon-pencil'\n when %w(show view).include?(action_str) then bootstrap_icon = 'icon-eye-open'\n when %w(delete destroy).include?(action_str) then bootstrap_icon = 'icon-trash'\n when %w(back).include?(action_str) then bootstrap_icon = 'icon-chevron-left'\n else bootstrap_icon = ''\n end\n\n bootstrap_icon\n end", "def all_topic_follow_unfollow_buttons\n @browser.buttons(:class => \"btn-default icon\")\n end", "def save_button\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.button.className(create_ats_regex_string(\"ats-savebtn\")), format_method(__method__))\n end", "def govuk_continuation_buttons(page_description, form_builder, secondary_button = true, return_link = true, primary_button = true, red_secondary_button = false, primary_btn_as_link = false, secondary_btn_as_link = false)\n buttons = ActiveSupport::SafeBuffer.new\n\n buttons << govuk_first_button(page_description, form_builder, red_secondary_button, primary_btn_as_link) if primary_button\n buttons << govuk_second_button(page_description, form_builder, red_secondary_button, secondary_btn_as_link) if secondary_button\n\n if (secondary_button || primary_button) && return_link\n buttons << tag.br\n buttons << link_to(page_description.navigation_details.return_text, page_description.navigation_details.return_url, class: 'govuk-link govuk-!-font-size-19', aria: { label: page_description.navigation_details.return_text })\n end\n\n tag.div(class: 'govuk-!-margin-top-5') do\n buttons\n end\n end", "def form_button_for(obj, name = nil)\n name ||= obj.object.new_record? ? 'Create' : 'Update'\n\n obj.button name, class: 'btn btn-theme', data: { disable_with: raw(\"<i class='fa fa-circle-o-notch fa-spin'></i> Saving...\") }\n end", "def pagination_links(obj)\n paginator = Paginator.new(obj)\n paginator.current_page = params[:page]\n\n # PAGE BUTTON LINKS (w/Bootstap styling)\n def previous_page_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.previous_page }, { remote: true, :'aria-label' => 'Previous Page', title: 'Previous Page', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">&laquo;</span>'\n end\n end\n end\n\n def previous_group_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.previous_range_first_page }, { remote: true, :'aria-label' => 'Previous Page Group', title: 'Previous Page Group', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">...</span>'\n end\n end\n end\n\n def page_link(page_num, current_page)\n status = 'active' if page_num == current_page\n\n content_tag :li, class: \"#{status}\" do\n link_to(\"#{page_num}\", controller: \"#{controller_name}\", action: \"#{action_name}\", page: \"#{page_num}\", remote: true)\n end\n end\n\n def next_group_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.next_range_first_page }, { remote: true, :'aria-label' => 'Next Page Group', title: 'Next Page Group', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">...</span>'\n end\n end\n end\n\n def next_page_link(paginator)\n content_tag :li do\n link_to({ controller: \"#{controller_name}\", action: \"#{action_name}\", page: paginator.next_page }, { remote: true, :'aria-label' => 'Next Page', title: 'Next Page', data: { toggle: 'tooltip', placement: 'top' } }) do\n raw '<span aria-hidden=\"true\">&raquo;</span>'\n end\n end\n end\n\n # BUILD PAGINATION LINKS\n # Start Bootstap pagination style\n output = '<nav class=\"text-center\"><ul class=\"pagination\">'\n\n # Show the '<<' aka previous page button\n unless paginator.first_page? || paginator.current_page < 1\n output += previous_page_link(paginator)\n end\n\n # Show the '...' aka previous page group button\n unless paginator.first_page? || paginator.current_page <= paginator.links_per_page\n output += previous_group_link(paginator)\n end\n\n # Show individual page links, stopping at the limit of links per page set by the user\n paginator.current_range_first_page.upto(paginator.last_page_in_current_range) do |page_num|\n output += page_link(page_num, paginator.current_page) unless page_num > paginator.total_pages\n end\n\n # Show the '...' aka next page group button\n unless paginator.next_range_first_page > paginator.total_pages || paginator.last_page?\n output += next_group_link(paginator)\n end\n\n # Show the '>>' aka next page button\n unless paginator.last_page? || paginator.current_page > paginator.total_pages\n output += next_page_link(paginator)\n end\n\n # Append page numbering and end Bootstap pagination style\n output += \"</ul><p><strong>Page:</strong> #{paginator.current_page} / #{paginator.total_pages}</p></nav>\"\n\n # Output the string to the view\n raw output unless paginator.total_pages <= 1\n end", "def color\n %w{ btn-primary btn-success }[params.valve.cmd]\n end", "def add_default_styling_selected(button_class)\n button_class ||= \"#3300FF\"\n button_class.insert(0, \"button \")\n end", "def button_to_remote name, css_class, options = {}\n button_to_function name, remote_function(options), :class=>css_class\n end", "def custom_button(entity, action, path, label)\n\t\temployee_icons = {\"show\" => 'icons/icons_01.gif',\n\t\t\t\t\t\t\"new\" => 'icons/icons_02.gif',\n\t\t\t\t\t \"del\" => 'icons/icons_03.gif',\n\t\t\t\t\t\t\"edit\" => 'icons/icons_04.gif'\n\t\t}\n\t\tassign_icons = { \"show\" => 'icons/icons_05.gif',\n\t\t\t\t\"new\" => 'icons/icons_06.gif',\n\t\t\t \"del\" => 'icons/icons_07.gif',\n\t\t\t\t\"edit\" => 'icons/icons_08.gif'\n\t\t}\n\t\tstore_icons = { \"show\" => 'icons/icons_09.gif',\n\t\t\t\t\"new\" => 'icons/icons_10.gif',\n\t\t\t \"del\" => 'icons/icons_11.gif',\n\t\t\t\t\"edit\" => 'icons/icons_12.gif'\n\t\t}\n\t\tjob_icons = { \"show\" => 'icons/icons_13.gif',\n\t\t\t\t\"new\" => 'icons/icons_14.gif',\n\t\t\t\t\"del\" => 'icons/icons_15.gif',\n\t\t\t \"edit\" => 'icons/icons_16.gif'\n\t\t}\t\n\t\tshift_icons = { \"show\" => 'icons/icons_17.gif',\n\t\t\t\t\"new\" => 'icons/icons_18.gif',\n\t\t\t\t\"del\" => 'icons/icons_19.gif',\n\t\t\t\t\"edit\" => 'icons/icons_20.gif'\n\t\t}\t\t\t\t\t\t\t \n\t\ticons = { \"employee\" => employee_icons, \n\t\t\t \"assignment\" => assign_icons, \n\t\t\t \"store\" => store_icons, \n\t\t\t \"job\" => job_icons, \n\t\t\t \"shift\" => shift_icons\n\t\t}\n\t\timg_tag = image_tag(icons[entity][action], :alt => label)\n\t\treturn '<a href=\"' + path + '\" class=\"btn btn-large ' + action + '\">' + label + \" \" + img_tag + '</a>'\n\tend", "def button_contents\n return if helpers.controller.blacklight_config.bootstrap_version == 5\n\n tag.span '&times;'.html_safe, aria: { hidden: true }\n end", "def navBarLink(url,text, img_name, link_option)\n ### <%= link_to raw('<button type=\"button\" class=\"btn-img btn btn-default navbar-btn\">'+image_tag(\"list16x16.png\",{:title =>\"Ir al Listado\", :alt=>\"Listar\", :border => \"0\"})+\" Listado</button>\"), cargos_path %>\n\n link_to raw('<button type=\"button\" class=\"btn-img btn btn-default navbar-btn\">'+image_tag(img_name,{:border=>\"0\", :alt=>\"\"})+\" \"+text+\"</button>\"), url, link_option\n end", "def index\n @nav_buttons.push('my_projects')\n setup_instance_variables\n end", "def button_link(css: '.button', **opt)\n opt[:role] ||= 'button'\n link(css: css, **opt)\n end", "def submit_button(form, args = {})\n classes = \"btn btn-primary #{args.delete(:class)}\".strip!\n label = args.delete(:label)\n form.submit(label, args.merge!(class: classes))\n end", "def mag_button_to_remote_selected(name, options = {}, html_options = {}) \n html_options[:class] = add_default_styling_selected(html_options[:class])\n name.gsub!(/\\s/, \"&nbsp;\")\n link_to_function(\"<span>#{name}</span>\", remote_function(options), html_options)\n end", "def link_to_all_entries(page)\n url = admin_page_entries_path page\n link_to 'View All', url, class: 'button'\n end", "def modal_button(name, options=nil, html_options={})\n if html_options[:class] == nil\n html_options[:class] = 'pos_action'\n elsif html_options[:class].include?('pos_action') == false\n html_options[:class] += ' pos_action'\n end\n modal_link_to(name, options, html_options)\n end", "def link_to_edit(path)\n link_to 'Edit', path, class: 'btn btn-default btn-xs'\n end", "def build_link(master_u)\n icon_edit = '<span class=\"glyphicon glyphicon-edit\"></span>'\n icon_show = '<span class=\"glyphicon glyphicon-info-sign\"></span>'\n link = link_to(raw(icon_show), master_u)\n link += link_to(raw(icon_edit), edit_master_unit_path(master_u))\n raw('<div class=\"datatable-actions\">'+link+'</div>')\n end", "def dt_actions\n edith_path = object.variant.is_master? ? h.edit_admin_product_path(object.product.id) : h.edit_admin_product_variant_path(object.product.id, object.variant_id)\n h.content_tag(:div, class: 'large ui compact icon buttons') do\n h.link_to(edith_path, target: :_blank, class: 'ui blue basic button') do\n h.content_tag(:i, '', class: 'large white edit icon')\n end +\n h.link_to(h.admin_product_images_path(object.product.id), target: :_blank, class: 'ui blue basic button') do\n h.content_tag(:i, '', class: 'large white images icon')\n end +\n h.link_to(h.product_path(object.product.id), target: :_blank, class: 'ui blue basic button') do\n h.content_tag(:i, '', class: 'large icons') do\n h.content_tag(:i, '', class: 'white desktop icon')+\n h.content_tag(:i, '', class: 'top right corner white eye icon')\n end\n end +\n h.link_to(h.stock_admin_product_path(object.product.id, variant: object.variant_id, stock_location: object.stock_location_id), target: :_blank, class: 'ui blue basic button') do\n h.content_tag(:i, '', class: 'large white dolly icon')\n end +\n h.link_to(h.volume_prices_admin_product_variant_path(product_id: object.product.id, id: object.variant_id), target: :_blank, class: 'ui blue basic button') do\n h.content_tag(:i, '', class: 'large icons') do\n h.content_tag(:i, '', class: 'white clipboard list icon')+\n h.content_tag(:i, '', class: 'top right corner white dollar sign icon')\n end\n end\n end\n end", "def cancel_btn(path=root_path, options={})\n btn_class = 'btn btn-warning'\n btn_class << ' ' << options[:class] if options[:class].present?\n\n link_to t('btn.cancel'), path, class: btn_class\n end", "def custom_form_button(label, options = {})\n options.reverse_merge!({:size => \"35\"})\n\n content_tag :button, :type => \"submit\", :class => \"custom-button-#{options[:size]}\" do\n content_tag(:span, :class => \"left\") do\n concat content_tag(:span, label, :class => \"normal\")\n concat content_tag(:span, label, :class => \"shadow\")\n end\n end\n end", "def edit_button(target:, name: :EDIT.t, **args)\n # necessary if nil/empty string passed\n name = :EDIT.t if name.blank?\n path, identifier, icon, content = button_atts(:edit, target, args, name)\n\n html_options = {\n class: class_names(identifier, args[:class]), # usually also btn\n title: name, data: { toggle: \"tooltip\", placement: \"top\", title: name }\n }.merge(args.except(:class, :back))\n\n link_to(path, html_options) do\n [content, icon].safe_join\n end\n end", "def linkbutton\n config[\"linkbutton\"]\n end", "def navigation_buttons(next_url)\n options = {\n :'data-role' => \"controlgroup\",\n :'data-type' => \"horizontal\",\n :class => \"chart-navigation\"\n }\n content_tag(:div, link_to_previous + link_to_next(next_url), options)\n end", "def back_to_article_index_button\n caption = <<-HTML\n <i class='icon-arrow-left'></i> #{t('cancel')}\n HTML\n button = link_to articles_path, class: \"btn\" do\n raw caption\n end\n button\n end", "def pagy_bootstrap_nav(pagy)\n html = +''\n link = pagy_link_proc(pagy, 'class=\"page-link\"')\n p_prev = pagy.prev\n p_next = pagy.next\n\n add_prev_button(html, link, p_prev)\n add_pagy_series(html, link, pagy)\n add_next_button(html, link, p_next)\n %(<nav class=\"pagy-nav-bootstrap pagy-bootstrap-nav\" role=\"navigation\" aria-label=\"pager\">\n <ul class=\"pagination justify-content-center\">#{html}</ul></nav>)\n end", "def link_to_edit(path, *options)\n link_to path,\n class: \"btn btn-warning btn-sm\",\n title: \"Alterar\",\n style: \"color: #FFF; \" do\n content_tag :span, class: \"fa fa-pencil\" do\n options.first[:label] if options.present? && options.first[:label]\n end\n\n end\n end", "def cancel_btn(path = root_path, options = {})\n btn_class = ['btn btn-warning waves-effect waves-light']\n btn_class << options[:class] if options[:class].present?\n\n link_to t('btn.cancel'), path, class: btn_class.join(' ')\n end", "def button(name, loading_text = 'Saving...')\n button_tag name, class: 'btn btn-theme', data: { disable_with: raw(\"<i class='fa fa-circle-o-notch fa-spin'></i> #{loading_text}\") }\n end", "def linkwizard_confirm_button\n $tracer.trace(__method__)\n return ToolTag.new(button.id(\"/btnSubmit/\") ,__method__)\n end", "def publication_link\n h.link_to \"Read Now\" , object.publication_url , title: 'Read Now' , class: 'btn waves-effect waves-light btn-primary custom-btn' , target: '_blank'\n end", "def modal_create_account_button\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.a.className(create_ats_regex_string(\"btn_negative\")), format_method(__method__))\n end" ]
[ "0.64986676", "0.63702714", "0.623094", "0.6145121", "0.6108558", "0.6061235", "0.59464854", "0.58921236", "0.5888644", "0.5885242", "0.58772016", "0.5852658", "0.5801371", "0.57563955", "0.5754397", "0.57404435", "0.5713552", "0.57047224", "0.5696664", "0.5684216", "0.56460077", "0.5619784", "0.5602264", "0.55826277", "0.55743486", "0.55528814", "0.55336094", "0.55248505", "0.55074745", "0.5490587", "0.54878914", "0.5483911", "0.54758906", "0.54433095", "0.54383296", "0.5437637", "0.5421552", "0.54000825", "0.5399599", "0.53854626", "0.53616184", "0.53574985", "0.53388685", "0.5335839", "0.53349066", "0.5326944", "0.53259724", "0.5325092", "0.5300483", "0.52947646", "0.5290169", "0.5280588", "0.5272009", "0.52576685", "0.52554196", "0.5252265", "0.52499163", "0.5241603", "0.5223607", "0.5223334", "0.52150476", "0.5211046", "0.518448", "0.51782453", "0.51679486", "0.51676285", "0.5145135", "0.51271147", "0.5107184", "0.51041436", "0.5102397", "0.51019496", "0.51000875", "0.50940746", "0.5073127", "0.50709164", "0.5053623", "0.5047029", "0.5040769", "0.5039715", "0.5037797", "0.50361115", "0.50341153", "0.5030566", "0.5018533", "0.50099844", "0.5000853", "0.49856064", "0.49815804", "0.49807015", "0.4975375", "0.49685732", "0.49664456", "0.49623054", "0.495889", "0.49475744", "0.49374762", "0.49370316", "0.49354273", "0.49157715" ]
0.55981475
23
Last push button helper. push_job_class is FtpPushJob, RhnStagePushJob or RhnLivePushJob
def last_push_link(push_job_class, errata) if (last_push = push_job_class.last_push(errata)) push_job_link(last_push, 'Last job') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_prepush_link(push_job_class, errata)\n jobs_since_respin = errata.push_jobs_since_last_state(push_job_class, 'NEW_FILES')\n if (job = jobs_since_respin.nochannel.order('id desc').first)\n push_job_link(job, 'Pre-push')\n end\n end", "def push_history_link(push_job_class, errata)\n if push_job_class.for_errata(errata).any?\n workflow_action_link(\"Push History\", { :controller => 'push', :action => 'push_history_for_errata', :id => errata })\n end\n end", "def last_pop\n @api_adapter.last_pop_from_queue(self.name)\n end", "def github_push(payload)\n pushType = payload[\"repository\"][\"full_name\"].split(\"/\")[1].split(\"-\")[0]\n if pushType == \"assignment\"\n TestGraderWorker.perform_async(payload)\n end\n\tend", "def last_slack_request\n $SLACK_REQUEST_QUEUE.last\nend", "def has_pushed_since_last_respin?(type)\n jobs = push_jobs_since_last_state(type, 'NEW_FILES').where('pub_task_id is not null')\n jobs.reject(&:is_nochannel?).any?(&:is_committed?)\n end", "def push_job_options_for_display(push_job)\n out = []\n\n add_label = lambda do |content, help|\n out << content_tag(:span, content, :class => 'label label-info',\n :title => help)\n end\n\n if push_job.is_nochannel?\n add_label['nochannel', NOCHANNEL_HELP]\n end\n\n if push_job.skip_pub_task_and_post_process_only?\n add_label['tasks-only', TASKS_ONLY_HELP]\n end\n\n options = push_job.pub_options\n if options['push_metadata'] && !options['push_files']\n add_label['metadata-only', METADATA_ONLY_HELP]\n end\n\n if out.empty?\n out << '-'\n end\n\n safe_join(out, ' ')\n end", "def current_push\n Push.where(\"step is not null\").where(:user_id => current_user.id).all[0]\n end", "def last_job_number\n @jobs.length\n end", "def push_errata_submit\n @user = current_user\n\n # Set page page name\n set_page_title get_push_page_name.html_safe\n\n @policies.select { |p| params[p.push_type].to_bool }.each do |policy|\n if policy.push_possible?\n target = resolve_params_for_policy(policy)\n push_request = PushRequest.new(@errata, [target], [policy])\n\n begin\n job = create_push_job(target, push_request)\n rescue StandardError => ex\n log_helper \"Creating push job failed\", :exception => ex\n end\n\n job_submit(job)\n\n enqueued = job.try(:in_queue?)\n add_message \"<div class='push_notices'><h3>#{enqueued ? 'Enqueuing' : 'Doing'} <b>#{policy.push_type_name}</b> push...</h3>\"\n\n add_message job ? \"Ok\" : \"<p class='red bold'>#{policy.push_type_name} push FAILED!</p>\"\n add_message '</div>'\n log_helper \"Push Job Params: #{target.inspect}\", :type => :debug\n\n else\n policy.errors.values.flatten.each { |m| add_message(m) }\n end\n end\n end", "def pop_notification\n notification_queue.shift\n end", "def push(notif)\n\n end", "def pop\n job = Resque.reserve :default\n [job.payload_class, job.args] if job \n end", "def name\n\t\t\t\t\"notify_pushover\"\n\t\t\tend", "def render_push_activity(activity)\n render_repo_activity(activity, \"pushed\")\n end", "def pushed\n return false if deactivated?\n self.status = 'publishing'\n notify_observers :after_push if (suc = save)\n suc\n end", "def name\n\t\t\t\"notify_pushover\"\n\t\tend", "def push(cmd); end", "def latest_backup\n backup_source_jobs.newest\n end", "def last_record\n @callbacks.pop\n end", "def last_popped_stack_elem\n @stack[@sp]\n end", "def last\n stack.last\n end", "def on_button_push\n @command.execute if @command\n end", "def command_last m\n channel = escape m.channel.to_s\n last_logic channel\n end", "def retrieve_hook\n json = ActiveHook.redis.with { |c| c.brpop('ah:queue') }\n json.last if json\n end", "def rocket_job_class\n @rocket_job_class\n end", "def last_event\n history.last\n end", "def last_event\n history.last\n end", "def pop\n\t\t\t@last = @stack.pop||\"\"\n\t\t\t@last\n\t\tend", "def last_button\n last_ele UIAButton\n end", "def push_type_for_validate\n if advisory_rhn_live_pushed?\n 'cdn_if_live_push_succeeds'\n end\n end", "def last_checkin; end", "def hops_finish_button\n $tracer.trace(__method__)\n return ToolTag.new(a.id(\"/SubmitButton/\"), __method__, self)\n end", "def push(arg0)\n end", "def push\n end", "def pushed?\n !!self.pushed_at\n end", "def last_message\n get_json('last-message.json')\n end", "def last_checkout\n meta = Meta.find(:key => 'last_checkout_id')\n Entry[meta.value] if meta\n end", "def push\n cfm.send_to_remote if do_push?\n end", "def receive_push\n return if data['user'] == nil\n return if data['pass'] == nil\n return if data['url'] == nil\n return if data['title'] == nil\n # The line we add looks like: <msg> <commit URL>\n line_add = \"\\n* #{summary_message}: #{summary_url}\"\n # Log in to the install.\n mw = MediaWiki::Gateway.new(data['url'])\n mw.login(data['user'], data['pass'])\n # Good. Fetch page if it exists somehow.\n page_text = mw.get(data['title'])\n if page_text == nil\n mw.create(data['title'], '<!-- autocreated -->', :summary => 'Creating page -- did not exist during push')\n page_text = \"\"\n end\n # Append our line to the end of the page_text\n page_text << line_add\n # Save the page\n mw.edit(data['title'], page_text, :summary => 'Updated commits upon push')\n end", "def recent_job?(wi)\n # In case of large # of queued jobs for the same source, we check for the latest \n # and skip processing if too close in time to the last one \n return false unless last_job_time = BackupWorker.cache.get(job_start_key(wi))\n DaemonKit.logger.debug \"Got job time from Redis: #{last_job_time}\"\n \n (Time.now - Time.parse(last_job_time)) < @@consecutiveJobExecutionTime\n \n # return false unless last_job_time = BackupSourceJob.cleanup_connection do\n # # there should always be a dataType option now..\n # if last_job = BackupSourceJob.backup_source_id_eq(wi.source_id).backup_data_set_id_eq(get_dataset(wi)).newest\n # last_job.created_at\n # end\n # end\n end", "def most_recent_submission\n assignment = Assignment.find(parent_id)\n SubmissionRecord.where(team_id: id, assignment_id: assignment.id).order(updated_at: :desc).first\n end", "def mark_as_pushed!\n self.pushed_at = Time.now\n self.save!\n end", "def index\n @push_jobs = apply_pagination(@push_jobs)\n end", "def pushed?\n !pushed_at.nil?\n end", "def to_job\n super.tap do |job|\n if commit_log.status == PhraseStatus::PUSHED\n job.set_delay(random_delay)\n job.set_queue('finalize')\n end\n end\n end", "def last_status; end", "def push_possible?(options = {})\n unless push_type_supported?\n @errors.add(push_target, \"#{push_type_name} not supported for '#{@errata.fulladvisory}'.\")\n return false\n end\n\n unless can_push?(options)\n @errors.add(push_target, \"Can't push advisory to #{push_type_name} now due to: #{push_blockers(options).join(\", \")}\")\n return false\n end\n\n if existing_job = self.job_klass.active_job_for(@errata)\n # Active job exists\n @errors.add(push_target, \"An <a href='/push/push_results/#{existing_job.id}'>existing #{self.job_klass.name.titleize}</a> is already running. You will need to cancel it to schedule a new one.\")\n return false\n end\n\n return true\n end", "def last\n @history.last\n end", "def sync_job\n return sync_jobs.last unless sync_jobs.empty?\n end", "def get_webhook_url(proj)\n ## used value from this plugin's setting\n if proj.nil?\n return Setting.plugin_redmine_hangouts_chat_integration['hangouts_chat_webhook']\n end\n\n ## used value from this project's custom field\n proj_cf = ProjectCustomField.find_by_name(\"Hangouts Chat Webhook\")\n unless proj_cf.nil?\n proj_cv = proj.custom_value_for(proj_cf)\n unless proj_cv.nil?\n url = proj_cv.value\n return url if url =~ URI::regexp\n end\n end\n\n ## used value from parent project's custom field\n return get_webhook_url(proj.parent)\n end", "def dispatch\n body = {\n 'command' => @command,\n 'nodes' => @nodes,\n 'run_timeout' => @timeout\n }\n\n ::Chef_Delivery::ClientHelper.enter_client_mode_as_delivery\n resp = @rest.post_rest('/pushy/jobs', body)\n ::Chef_Delivery::ClientHelper.leave_client_mode_as_delivery\n\n @job_uri = resp['uri']\n refresh\n end", "def last\n end", "def cmd\n c = [\"git push --set-upstream origin #{current_branch}\"]\n c << argument_string(unknown_options) unless unknown_options.empty?\n c.join(\" \")\n end", "def mark_as_pushed!\n self.status_code = 200\n self.pushed_at = Time.now\n self.save!\n end", "def tv_last_channel \n send_cmd(\"tv_last_channel\")\n end", "def last?; end", "def last_step_page\n history.values.last\n end", "def push\n end", "def last_message \n messages.last\n end", "def receive_last\n\n wrap('ret' => Flor.type(@node['ret']).to_s)\n end", "def last; end", "def last; end", "def last; end", "def on_button_push\n\t\[email protected]_execute if @command\n\t\[email protected] if @command\n\t\[email protected]_execute if @command\n\tend", "def push_pending_job (job)\n\n old = @pending_jobs.find { |j| j.job_id == job.job_id }\n @pending_jobs.delete(old) if old\n #\n # override previous job with same id\n\n if @pending_jobs.length < 1 or job.at >= @pending_jobs.last.at\n @pending_jobs << job\n return\n end\n\n for i in 0...@pending_jobs.length\n if job.at <= @pending_jobs[i].at\n @pending_jobs[i, 0] = job\n return # right place found\n end\n end\n end", "def push\n MessagePublish.new(@message).push\n if params[:redirect] == 'index'\n return_url = admin_messages_path\n else\n return_url = admin_message_path(@message)\n end\n redirect_to return_url, notice: t(:message_push_successful)\n end", "def handle_github_web_hook(github_post_data)\n self.latest_broadcast = []\n \n github_post_data.commits.each do |this_commit|\n warn \"Handling Github commit notification for repo #{self.name}: #{this_commit.id}\"\n commit_timestamp, commit_net_lines_added = fetch_stats_for_commit(this_commit.id)\n data_point = [ commit_timestamp.to_utc_ms, data_series[-1][1] + commit_net_lines_added ]\n \n warn \"data point: #{data_point.to_json}\"\n # record the data point in this object\n self.data_series << data_point\n \n # e.g. {\"team\": \"Team01\", \"comment\": \"added stuff\", \"data_point\": [1345775027, 1000]}\n comment = this_commit.message rescue '-'\n self.latest_broadcast << { 'team' => self.display_name, 'comment' => comment, 'data_point' => data_point }\n end\n \n return self.latest_broadcast\n end", "def latest_commit current_project = last_changed_craft, saves = save_history, new_and_changed = new_and_changed \n crft = \"Ships/#{current_project.craft_type.upcase}/#{current_project.name}.craft\" if current_project\n \n return :current_project if saves[:quicksave].nil? || saves[:quicksave].size.eql?(1)\n if new_and_changed[:changed].include?(crft) || new_and_changed[:new].include?(crft)\n return :current_project\n else \n qs_commit = saves[:quicksave].first if saves[:quicksave] \n if qs_commit && current_project\n craft_commit = current_project.history(:limit => 1).first\n t= [[:quicksave, qs_commit], [:current_project, craft_commit]].sort_by{|_, c| c.try(:date) || Time.now}.last\n return t[0]\n else\n return :current_project\n end\n end\n end", "def display_name\n job_class\n end", "def latest_unpassing_jobs(project_id)\n latest_jobs(project_id).each_with_object([]) do |(branch, job_names), unpassing_jobs|\n job_names.each do |job_name, job|\n unpassing_jobs << job unless job['status'] == 'success'\n end\n end\nend", "def job_class\n SingleInstanceQueueJob\n end", "def push!\n notify.write(\"Pushing to origin\")\n proj.push('origin', proj_branch)\n proj.push('origin', report_branch)\n end", "def handle_repo_push_request\n return unless @repository\n\n branch_name = payload[\"ref\"].sub(%r{\\Arefs/heads/}, '')\n branch = @repository.branches.where(name: branch_name).first\n if branch.present? && branch.convergence? && @repository.run_ci?\n sha = payload[\"after\"]\n branch.kickoff_new_build_unless_currently_busy(sha)\n end\n end", "def brpop(*args); end", "def brpop(*args); end", "def postPushListener\n reCalculateMax\n end", "def push name='create'\n \n end", "def next\n Post.posted.where('publish_at > ?', publish_at).last\n end", "def create_push\n Push::Push.new(self)\n end", "def init_push\n ## empty\n end", "def get_last_message\r\n @messages.fetch(self.count_messages - 1)\r\n end", "def latest_report\n @report_history.last\n end", "def last_action\n Rails.application.routes.recognize_path(request.referrer)[:action]\n end", "def on_push(&blk)\n opts[:on_push] = blk\n end", "def fetch_fn\n fn_raw = send__notification_history_request\n fn_type = GoogleCheckout.notification_type(fn_raw)\n fn_klass = GoogleCheckout.notification_klass(fn_type)\n @fn = fn_klass.new(:raw_params => fn_raw)\n end", "def last(*args)\n all.send(:last, *args)\n end", "def last_hired(obj)\n\n if obj.class == Job\n last_order = last_order(obj)\n\n if last_order\n return last_order.created_at\n else\n return nil\n end\n elsif obj.class == Service\n last_order = last_order(obj)\n\n if last_order\n return last_order.created_at\n else\n return nil\n end\n else\n return nil\n end\n\n end", "def last_commit\n\tresp = github_api(\"commits\")\n\tresp[0]\nend", "def last_button\n # uiautomator index doesn't support last\n # and it's 0 indexed\n button_index = tags(BUTTON).length\n button_index -= 1 if button_index.positive?\n image_button_index = tags(IMAGE_BUTTON).length\n image_button_index -= 1 if image_button_index.positive?\n\n find_element :uiautomator,\n _button_visible_selectors(button_index: button_index,\n image_button_index: image_button_index)\n end", "def push(job)\n super Marshal.load(Marshal.dump(job))\n end", "def newMet\n puts \"Try to create a new branch and then push it back to remote\"\n end", "def push(klass, *args)\n Resque.enqueue klass, args\n end", "def post_to_slack # why is it posting to slack twice?\n unless Rails.env == \"development\"\n \t\tjob = Listing.find(self.id)\n if job.state == 'FL'\n # base_url = \"<http://localhost:3000/listings/#{app_id}>\"\n base_url = \"<http://jobs.interque.co/listings/#{self.id}>\"\n payload = { text: \"New job opportunity with #{job.organization} in #{job.city}, #{job.state}\\n #{base_url}\", username: \"interque\" }\n response = HTTParty.post('https://hooks.slack.com/services/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', body: payload.to_json )\n end\n end\n\tend", "def deliver_push_notification\n return unless push_notification_sent_at.nil? # avoid double send\n return if self.user == self.created_by # dont deliver if user liked own post\n return if event_type == \"push\" || event_type == \"purchase\"\n device_tokens = self.user.push_devices.map(&:token)\n return if device_tokens.blank?\n puts 'CREATING PUSH'\n badge = self.user.events.unread.count\n notification = { :device_tokens => device_tokens,\n :page => push_page,\n :aps => { :alert => push_alert, \n :badge => badge}}\n \n update_attribute(:push_notification_sent_at, Time.now) if Urbanairship.push(notification)\n end", "def get_last_message\n Message.showing.last\n end", "def recent\n @limit = 10\n @webhooks = Webhook.limit(@limit).order(id: :desc)\n end", "def to_message\n Message.new(\n stream: 'github_jobs',\n payload: self.to_h\n )\n end", "def last\n perform_request(last_page_uri) if last_page_uri\n end", "def pushed?\n !!self.pushed_att\n end" ]
[ "0.6802253", "0.61952704", "0.5845433", "0.55359304", "0.5486763", "0.5283278", "0.527172", "0.5262423", "0.5229707", "0.51936495", "0.5119092", "0.50789666", "0.50741094", "0.50379235", "0.50308204", "0.50261736", "0.50074834", "0.5000444", "0.49806094", "0.49791196", "0.4967028", "0.49609324", "0.49512947", "0.4946923", "0.49310374", "0.49266165", "0.49261832", "0.49261832", "0.49074778", "0.4885453", "0.48788238", "0.48625126", "0.48571953", "0.48542738", "0.48542193", "0.48520848", "0.48452586", "0.483173", "0.4809496", "0.48066336", "0.48050663", "0.4767198", "0.47612655", "0.4749535", "0.4744526", "0.4743577", "0.4737516", "0.47350514", "0.47222573", "0.47111505", "0.4709164", "0.46921465", "0.4688658", "0.46867406", "0.46724695", "0.46699795", "0.4658718", "0.4655463", "0.46510947", "0.46489763", "0.46443135", "0.46423534", "0.46423534", "0.46423534", "0.4634923", "0.4627799", "0.46253574", "0.46242228", "0.4622977", "0.4614991", "0.4612367", "0.46115175", "0.46098757", "0.4608879", "0.4607549", "0.4607549", "0.46033135", "0.4599602", "0.45984572", "0.45921135", "0.45917335", "0.4583498", "0.4582778", "0.45801502", "0.4574498", "0.4570982", "0.45682606", "0.45634487", "0.45437846", "0.45433697", "0.4543253", "0.45417306", "0.45396692", "0.45392966", "0.4534268", "0.4529493", "0.45242122", "0.45211726", "0.45204872", "0.45188546" ]
0.757782
0
Shows link to last nochannel job, if any. This is represented to the user as a "prepush" of the live content
def last_prepush_link(push_job_class, errata) jobs_since_respin = errata.push_jobs_since_last_state(push_job_class, 'NEW_FILES') if (job = jobs_since_respin.nochannel.order('id desc').first) push_job_link(job, 'Pre-push') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_push_link(push_job_class, errata)\n if (last_push = push_job_class.last_push(errata))\n push_job_link(last_push, 'Last job')\n end\n end", "def latest_comic\r\n \tif sorted_articles.index(item) == 0\r\n\t\t\t# apply the inactive html and css\r\n\t\t\t'<h7 id=\"last-comic\" title=\"This is the most recent comic.\" class=\"comic-viewer-inactive\">last &#x25B8;&#x25B8;</h7>'\r\n\t\telse\r\n\t\t\t# otherwise it's legit and needs to point to the latest comic\r\n\t\t\tlink_to('last &#x25B8;&#x25B8;', sorted_articles[0].reps[0], :id => \"last-comic\", :title => \"View the latest posted comic.\")\r\n\t\tend\r\n end", "def push_history_link(push_job_class, errata)\n if push_job_class.for_errata(errata).any?\n workflow_action_link(\"Push History\", { :controller => 'push', :action => 'push_history_for_errata', :id => errata })\n end\n end", "def tv_last_channel \n send_cmd(\"tv_last_channel\")\n end", "def formatted_link\n host = ENV['HEROKU_APP_NAME'] ? \"#{ENV['HEROKU_APP_NAME']}.herokuapp.com\" : 'localhost:3000'\n \"<#{Rails.application.routes.url_helpers.thread_url(id, host: host, format: :json)}|this thread>\"\n end", "def previous_comic\r\n\t\tif sorted_articles.index(item) == sorted_articles.length - 1\r\n\t\t\t# apply the inactive html and css\r\n\t\t\t'<h7 id=\"previous-comic\" title=\"This is the first comic.\" class=\"comic-viewer-inactive\">&#x25C2; previous</h7>'\r\n\t\telse\r\n\t\t\tprevious = sorted_articles.index(item) + 1\r\n\t\t\tlink_to('&#x25C2; previous', sorted_articles[previous].reps[0], :id => \"previous-comic\", :title => \"View the previously posted comic.\")\r\n\t\tend\r\n\tend", "def follow_on_job?\n false\n end", "def channel\n render :layout => false\n end", "def channel\n \"private-job-#{id}\"\n end", "def day_link\n h.link_to_unless_current('24小时内热评', {action: :most_replied, id: object.id, limit: 'day'})\n end", "def index\n get_recent_activity\n if params[:remote]\n render partial: \"subscriptions/summary\"\n else\n #current_user.update_attribute(:feed_last_visited_at, Time.now)\n render \"index\"\n end\n end", "def view_last_news_helper\n out = ''\n @news = Newse.joins(:city).where('cities.subdomain' => request.subdomain).order('created_at desc').limit(8)\n if [email protected]?\n @news.each do |news|\n out += \"<li>\"\n out += \"<em class='date'>#{news.created_at}</em>\"\n out += \"#{link_to news.name, {:controller => :tidings, :action=>:show, :id => news.id, :subdomain => request.subdomain}}\"\n out += \"</li>\"\n end\n else\n out += \"<li>Извините, новостей не добавлено!\"\n out += \"</li>\"\n end\n out.html_safe\n end", "def guid\n return '' if @feed.channel.link.nil?\n @feed.channel.link\n end", "def published job\n @job = job\n\n mail :to => @job.email, :subject => \"Empleos TI: #{@job.title}\"\n end", "def no\n @jobs = Job.all\n render template: \"welcome/latest_opportunities\"\n end", "def latest\n @works = Work.latest\n render :index\n end", "def send_news\n feed = RSS::Parser.parse open(KAGDEV_RSS).read\n last_post_title = feed.channel.item.title\n\n # Check, whether the latest title of the post at KAG development\n # blog is still the same, as it was, when the fetcher checked it last\n # time.\n return if unchanged?(last_post_title)\n\n item = feed.channel.item\n\n last_post_date = item.pubDate\n last_post_author = item.dc_creator\n last_post_link = item.link\n\n News.create(\n :title => last_post_title,\n :date => last_post_date,\n :author => last_post_author,\n :link => last_post_link\n )\n\n real_author = reveal_author(last_post_author)\n short_link = open(\"http://clck.ru/--?url=#{last_post_link}\").read\n\n Bot::CHANNELS.each do |chan|\n Channel(chan).send I18n.news_fetcher.news(real_author, last_post_title, short_link)\n end\n rescue SocketError\n nil\n end", "def toggle_history_view_link\n only_comments = (session[:only_comments].to_i == 0)\n str = only_comments ? _(\"Showing Full History\") : _(\"Showing Only Comments\")\n\n return link_to_remote(str, :loading => \"showProgress();\", :complete => \"hideProgress();\",\n :url => { :action => 'toggle_history', :id => @task.id })\n end", "def fetch_job_content\n ids = @project_job.project.project_jobs.map(&:id)\n if params[:type] == \"refresh\"\n @comment = @project_job.comments.new\n render partial: \"project_details\"\n else\n begin\n if params[:type] == \"next\"\n project_id = @project_job.project.id\n unless ids.nil?\n index = ids.find_index(@project_job.id)\n next_id = ids[index+1] unless index == ids.size\n @project_job = @project_job.project.project_jobs.where(\"id=?\",next_id).first\n end\n \n else\n project_id = @project_job.project.id\n unless ids.nil?\n index = ids.find_index(@project_job.id)\n prev_id = ids[index-1] unless index.zero?\n @project_job = @project_job.project.project_jobs.where(\"id=?\",prev_id).first\n end\n end\n redirect_to \"/projects/#{@project_job.project.id}/jobs/#{@project_job.id}\"\n rescue\n redirect_to \"/projects/#{project_id}/jobs\"\n end\n end\n end", "def previous\n @news_item = @news_item.previous_version\n show\n end", "def print\n puts \"====== Pastes History ======\".green\n unless @links.empty?\n @links.each_with_index { |l, i| puts \"#{i+1}. #{l}\" }\n else\n puts \"your history is empty...\"\n end\n puts \"============================\".green\n end", "def receive_push\n return if data['user'] == nil\n return if data['pass'] == nil\n return if data['url'] == nil\n return if data['title'] == nil\n # The line we add looks like: <msg> <commit URL>\n line_add = \"\\n* #{summary_message}: #{summary_url}\"\n # Log in to the install.\n mw = MediaWiki::Gateway.new(data['url'])\n mw.login(data['user'], data['pass'])\n # Good. Fetch page if it exists somehow.\n page_text = mw.get(data['title'])\n if page_text == nil\n mw.create(data['title'], '<!-- autocreated -->', :summary => 'Creating page -- did not exist during push')\n page_text = \"\"\n end\n # Append our line to the end of the page_text\n page_text << line_add\n # Save the page\n mw.edit(data['title'], page_text, :summary => 'Updated commits upon push')\n end", "def no_recent_plagiarism\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem) and return\n end\n end", "def newest\n @submissions = Submission.all.order(\"created_at DESC\")\n @from_newest = true;\n render :index\n end", "def no_recent_plagiarism\n if @submission.user == current_user.sk\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem, :sub => @submission) and return\n end\n end\n end", "def last_slack_request\n $SLACK_REQUEST_QUEUE.last\nend", "def channel\n render inline: '<script src=\"//connect.facebook.net/en_US/all.js\"></script>', layout: false\n end", "def get_tumblr_embed_link_title(work)\n title = work.title + \" (#{work.word_count} #{ts('words')})\".html_safe\n if work.anonymous?\n pseud = ts(\"Anonymous\")\n else\n pseud = work.pseuds.map {|pseud| (pseud.name)}.join(', ').html_safe\n end\n title + ts(\" by \") + pseud + ts(\" [#{ArchiveConfig.APP_SHORT_NAME}]\")\n end", "def next_comic\r\n \tif sorted_articles.index(item) == 0\r\n\t\t\t# apply the inactive html and css\r\n\t\t\t'<h7 id=\"next-comic\" title=\"This is the most recent comic.\" class=\"comic-viewer-inactive\">next &#x25B8;</h7>'\r\n\t\telse\r\n\t\t\tnxt = sorted_articles.index(item) - 1\r\n\t\t\tlink_to('next &#x25B8;', sorted_articles[nxt].reps[0], :id => \"next-comic\", :title => \"View the next comic.\")\r\n\t\tend\r\n end", "def latest\n @loops = Loop.latest\n render 'list'\n end", "def push_job_options_for_display(push_job)\n out = []\n\n add_label = lambda do |content, help|\n out << content_tag(:span, content, :class => 'label label-info',\n :title => help)\n end\n\n if push_job.is_nochannel?\n add_label['nochannel', NOCHANNEL_HELP]\n end\n\n if push_job.skip_pub_task_and_post_process_only?\n add_label['tasks-only', TASKS_ONLY_HELP]\n end\n\n options = push_job.pub_options\n if options['push_metadata'] && !options['push_files']\n add_label['metadata-only', METADATA_ONLY_HELP]\n end\n\n if out.empty?\n out << '-'\n end\n\n safe_join(out, ' ')\n end", "def previous\n @link = @link.previous_version\n show\n end", "def display_title\n if @new_posts > 0\n return \"(#{@new_posts}) #{title}\"\n end\n \n title\n end", "def url\n channel_path(params[:message][:channel_id], anchor: \"message_#{params[:message][:id]}\")\n end", "def display_recently_uploaded?\n Flipflop.show_recently_uploaded?\n end", "def get_embed_link_title(work)\n title_link = link_to(content_tag(:strong, work.title.html_safe), work_url(work)) + \" (#{work.word_count} #{ts('words')})\"\n if work.anonymous?\n profile_link = ts(\"Anonymous\")\n else\n profile_link = work.pseuds.map {|pseud| link_to(content_tag(:strong, pseud.name), user_url(pseud.user))}.join(', ').html_safe\n end \n title_link + ts(\" by \") + profile_link\n end", "def publication_link\n h.link_to \"Read Now\" , object.publication_url , title: 'Read Now' , class: 'btn waves-effect waves-light btn-primary custom-btn' , target: '_blank'\n end", "def cur_issue\n #debugger\n @issue = PubDate.latest\n redirect_to public_issue_url(:issue_id => d(@issue.date) )\n rescue\n flash.now[:notice] = \"No Latest Issue.\"\n render(:action => 'unknown', :layout => \"admin\", :status => '404')\n end", "def recent\n @user = User.find params[:id]\n @active_menu = :collections\n @empty_msg = \"As you check out things in RecipePower, they will be remembered here.\"\n response_service.title = \"Recently Viewed\"\n smartrender unless do_stream UserRecentCache\n end", "def tweet_link_for_new_free_episode_vland\n \t\t# TODO\n \tend", "def last_job_number\n @jobs.length\n end", "def push_subscription\n\t\trender :nothing => true\n\tend", "def show_path_for_job_post(current_user,job_post)\n if current_user.nil? then\n link_to \"#{job_post.job_post_title}\", job_post_path(job_post) \n else\n link_to \"#{job_post.job_post_title}\", [current_user,job_post.company,job_post] \n end\n end", "def latest_update\n last = t('ddf.news.updates').keys.last\n t('ddf.news.updates')[last].html_safe\n rescue\n nil\n end", "def last_update\n \"none\"\n end", "def history\n # blank\n end", "def previous_posts_link( label = nil )\n get_previous_posts_link( label )\n end", "def url(link)\n '#'\n end", "def now_playing(m, nick)\n\t\t\t\tnick = CGI::escape(nick)\n\t\t\t\tartist, track = get_data(nick)\n\t\t\t\tm.reply(\"#{nick} has recently played: #{artist} - #{track}\")\n\t\t\tend", "def push_relaunch\n\t\trequire \"config/initializers/launch_juggernaut.rb\"\n\t\trender :nothing => true\n\tend", "def show\n \treferer = request.referer\n \treferer = \"NA\" if referer.nil?\n \tRequestLoggerJob.perform_later(params[:short_url],referer, request.env[\"HTTP_USER_AGENT\"], request.remote_ip)\n \tredirect_to @url.link\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def came_comment\n @user = @receiver\n link = \"/#{@comment.commentable_type.downcase.pluralize}/#{@comment.commentable.id}\"\n @notification = @user.notifications.find_by(link: link) || @user.notifications.find_by(link: \"#{link}#latest-comment\")\n mail to: @user.email, subject: \"[FBC] #{@message}\"\n end", "def show\n if current_user.created_at > Time.now-4.seconds\n gon.tour1 = 1\n p \"GON 1 \"*19\n end\n if (current_user.jobs.count == 1) && (current_user.jobs.first.updated_at-current_user.jobs.first.created_at < 30.seconds)\n gon.tour4 = 4\n p \"GON 4 \"*19\n end\n\n @company = Company.new\n @job = Job.new\n if check_to_mail?\n flash[:info] = \"Congratulations! Your are ready to submit your 10/30.\"\n end\n end", "def pingback_link_tag\n '<link rel=\"pingback\" href=\"'+pingback_server_url+'\" />'\n end", "def history\n @submissions = current_user.submissions.order('created_at desc')\n end", "def post_remotely_as_delayed_job\n \n # The link will be of type \"entry\", and will be redirected in StreamController:\n # 'starting_soon' => sends people to the store's program page store#program\n # 'checkin' => sends people to the public entry page stream#entry\n \n # The options hash needs:\n # :okay_to_post (overrides private_beta flag)\n # :for_object\n # :for_id\n # :message\n # :name (facebook)\n # :caption (facebook)\n # :latitude\n # :longitude\n # :foursquare_place_id (foursquare)\n message_hash = {:okay_to_post => Rails.env.production?,\n :for_object => 'entry',\n :for_id => self.id,\n :message => self.message,\n :name => (self.program.present? ? self.program.name : \"Budge\"),\n :caption => \"Budge helps you do things you didn't think you could!\",\n :latitude => (self.location_context.present? ? self.location_context.latitude : nil),\n :longitude => (self.location_context.present? ? self.location_context.longitude : nil)}\n \n # PlayerMessage\n if self.post_to_coach? and self.program_player.present?\n program_coach = self.program_player.program_coach rescue nil\n if program_coach.present?\n @send_to = program_coach\n @send_to_coach = true\n elsif self.program_player.supporters.where(:active => true).present?\n @send_to = self.program_player.supporters.where(:active => true).first\n @send_to_supporter = true\n end\n \n if program_player.player_budge and program_player.player_budge.program_budge_id == self.program_budge_id\n player_budge = program_player.player_budge\n end\n player_message = PlayerMessage.create({:from_user_id => self.user_id,\n :to_user_id => (@send_to ? @send_to.user_id : nil),\n :content => self.message,\n :program_player_id => self.program_player_id,\n :player_budge_id => (player_budge.present? ? player_budge.id : nil),\n :deliver_via_pref => PlayerMessage::WEBSITE,\n :delivered_via => PlayerMessage::WEBSITE,\n :delivered => true,\n :to_coach => @send_to_coach,\n :to_supporters => @send_to_supporter,\n :to_player => false,\n :program_id => self.program_id,\n :program_budge_id => self.program_budge_id,\n :deliver_at => Time.now.utc})\n end\n \n # Post to Twitter\n if self.post_to_twitter? \n if Rails.env.production? and !PRIVATE_BETA\n twitter_oauth_token = self.user.oauth_for_site_token('twitter') rescue nil \n else\n twitter_oauth_token = OauthToken.budge_token('twitter') rescue nil\n end\n logger.warn twitter_oauth_token.inspect \n if twitter_oauth_token.present?\n self.tweet_id = twitter_oauth_token.broadcast_to_network(message_hash)\n end \n end\n \n # Post to Facebook\n if self.post_to_facebook?\n facebook_oauth_token = self.user.oauth_for_site_token('facebook') rescue nil\n if facebook_oauth_token.present? and Rails.env.production? and !PRIVATE_BETA\n facebook_oauth_token = self.user.oauth_for_site_token('facebook') rescue nil \n else\n facebook_oauth_token = OauthToken.budge_token('facebook') rescue nil\n end\n logger.warn facebook_oauth_token.inspect\n p facebook_oauth_token.inspect\n \n if facebook_oauth_token.present?\n self.facebook_post_id = facebook_oauth_token.broadcast_to_network(message_hash)\n end\n end\n self.save if self.player_message_id.present? or self.tweet_id.present? or self.facebook_post_id.present?\n \n if Rails.env.production? and self.privacy_setting == Entry::PRIVACY_PUBLIC\n super_followers = Relationship.where(:followed_user_id => self.user_id, :super_follow => true)\n super_followers.each do |relationship|\n if relationship.active? and relationship.user.can_sms?\n relationship.user.contact_them(:sms, :super_follow_checkin, self)\n end\n end\n end\n return true\n end", "def new_url\n playlist_url(@response.new_index)\n end", "def show\n @message = Message.new # to add a new message\n\n\n @channelconfig = @user.channelconfigs.where(:channel_id => @channel.id).first\n @previously_last_checked = @channelconfig.last_checked\n @previously_last_checked = Time.now if @previously_last_checked.nil?\n @channelconfig.last_checked = Time.now\n @channelconfig.save\n\n get_page\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @channel }\n end\n end", "def welcome\n @post = Post.last_published\n end", "def link\n '-'\n end", "def get_embed_link(work)\n [get_embed_link_title(work), tag(\"br\"), get_embed_link_meta(work)].compact.join\n end", "def published_work?\n true\n end", "def last_message\n get_json('last-message.json')\n end", "def work\n\t\tsuper\n\t\t@link = @work\n\tend", "def recent_logs(channel, num = 10)\n raise \"Not implemented\"\n end", "def url_desktop_talk\n\t\t\t@data[\"content_urls\"][\"desktop\"][\"talk\"]\n\t\tend", "def perform\n Kublog.facebook_client.link! :link => @url, :message => @message\n end", "def active_remote_subscription\n if company_exists?\n @active_remote_subscription ||= company.subscriptions.active_remote.limit(1).order('ends_at DESC NULLS FIRST, id DESC').first\n end\n end", "def recent_commits\n public_events = @client.user_public_events @user[:login]\n public_events.select! { |e| e[:type] == \"PushEvent\" }\n commits = []\n public_events.each do |e|\n e[:payload][:commits].each do |c|\n c[:html_url] = \"https://github.com/#{e[:repo][:name]}/commit/#{c[:sha]}\"\n c[:shortcut] = \"#{e[:repo][:name]}@#{c[:sha][0..7]}\"\n end\n commits.concat e[:payload][:commits]\n end\n commits.take 15\nend", "def push\n cfm.send_to_remote if do_push?\n end", "def command_last m\n channel = escape m.channel.to_s\n last_logic channel\n end", "def url\n client = client_from_attachment( hpg_resolve(shift_argument) )\n id = shift_argument\n\n if id\n b = client.get_backup(id)\n else\n b = client.get_latest_backup\n end\n\n if $stdout.isatty\n display '\"'+b['public_url']+'\"'\n else\n display b['public_url']\n end\n end", "def url\n \"#{File.join(job.url, number.to_s)}/\"\n end", "def post_to_slack # why is it posting to slack twice?\n unless Rails.env == \"development\"\n \t\tjob = Listing.find(self.id)\n if job.state == 'FL'\n # base_url = \"<http://localhost:3000/listings/#{app_id}>\"\n base_url = \"<http://jobs.interque.co/listings/#{self.id}>\"\n payload = { text: \"New job opportunity with #{job.organization} in #{job.city}, #{job.state}\\n #{base_url}\", username: \"interque\" }\n response = HTTParty.post('https://hooks.slack.com/services/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', body: payload.to_json )\n end\n end\n\tend", "def next\n Post.posted.where('publish_at > ?', publish_at).last\n end", "def queue_url(*_)\n if Settings.active_job_queue.url\n Settings.active_job_queue.url\n else\n super\n end\n end", "def self_link\n nil\n end", "def custom_link\n if self.permalink.blank?\n self.company_name\n else\n self.permalink\n end\n end", "def hockey_message(title, link, version)\n\n message = \"\\n++++++++++++++++++++++++++++++++\\n\" +\n title + \" \\n\" +\n \"Ссылка: \" + link + \" \\n\" +\n \"Версия: \" + version +\n \" \\n++++++++++++++++++++++++++++++++\"\n\nend", "def do_previous\n do_command('requests/status.json?command=pl_previous')\n return currently_playing\n end", "def publish_front_page\n\t\tsystem 'clear'\n\t\t@post_list.each do |post|\n\t\t\tif post.sponsored == true\n\t\t\t\tputs \"*****Post #{post.title}*****\"\n\t\t\telse\n\t\t\t\tputs \"Post #{post.title}\"\n\t\t\tend\n\t\t\tputs \"#{post.text}\"\n\t\t\tputs \"#{post.creation_date}\"\n\t\t\tputs \"-----------------------\"\n\t\tend\n\tend", "def to_text_for_social_media\n text = \"#{self.company_name.titleize} is looking to hire a #{self.title}\"\n text += \" in #{self.location_name}\" unless self.location_name.blank?\n text += \". More information here https://#{AppSettings.application_host}/jobs/#{self.to_param}\"\n \n return text\n end", "def current_push\n Push.where(\"step is not null\").where(:user_id => current_user.id).all[0]\n end", "def feed_message(activity, recent = false)\n owner = activity.owner\n case activity_type(activity)\n when \"StatusUpdate\"\n status = activity.item\n text = status.text\n time = status.created_at\n if recent\n %(#{owner.short_name}:\n #{sanitize(highlight(text, text))}。)\n else\n %(#{user_link_with_image(owner)}:\n #{sanitize(highlight(text, text))}。)\n end\n when \"BlogPost\"\n post = activity.item\n blog = post.blog\n view_blog = blog_link(\"#{h owner.name} 的日記\", blog)\n if recent\n if owner.class.to_s == \"User\"\n %(#{owner.short_name} 張貼了一篇日記 #{link_to post.title, blog_post_path(blog, post)}。)\n elsif owner.class.to_s == \"Group\"\n %(#{user_link(post.user)} 張貼了一篇日記 #{link_to post.title, blog_post_path(blog, post)}。)\n end\n else\n if owner.class.to_s == \"User\"\n %(#{user_link_with_image(owner)} 張貼了一篇日記\n #{post_link(blog, post)}。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p><p>\n #{post_link(\"繼續閱讀\", blog, post)}</p>)\n elsif owner.class.to_s == \"Group\"\n %(#{user_link(post.user)} 張貼了一篇日記\n #{post_link(blog, post)}。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p><p>\n #{post_link(\"繼續閱讀\", blog, post)}</p>)\n end\n end\n when \"Entry\"\n entry = activity.item\n view_entry = entries_link(\"#{h owner.name} 的所有文章\", owner)\n if recent\n %(#{owner.short_name} 分享了一篇美食評論 #{entry_link(owner, entry)}。)\n else\n %(#{user_link_with_image(owner)} 分享了一篇美食評論\n #{entry_link(owner, entry)} &mdash; #{view_entry}。<p>\n #{entry_link(\"繼續閱讀\", owner, entry)}</p>)\n end\n when \"Photo\"\n photo = activity.item\n view_gallery = gallery_link(\"#{h photo.gallery.title}\", photo.gallery)\n if recent\n if owner.class.to_s == \"User\"\n %(#{owner.short_name} 在相簿 #{view_gallery} 新增了相片\n #{photo_link(owner, photo)}。)\n elsif owner.class.to_s == \"Group\"\n %(#{user_link(photo.creator)} 在相簿 #{view_gallery} 新增了相片 \n #{photo_link(owner, photo)}。)\n end\n else\n if owner.class.to_s == \"User\"\n %(#{user_link_with_image(owner)} 在相簿 #{view_gallery} 新增了相片。<p>\n #{photo_image_link(photo)}</p><p class=\"meta\">\n #{gallery_link(photo.gallery)}</p>)\n elsif owner.class.to_s == \"Group\"\n %(#{user_link_with_image(photo.creator)} 在相簿 #{view_gallery} 新增了相片。<p>\n #{photo_image_link(photo)}</p><p class=\"meta\">\n #{gallery_link(photo.gallery)}</p>)\n end\n end\n when \"Comment\"\n entry = activity.item.entry\n user = entry.user\n if recent\n %(#{owner.short_name} 對 #{someones(entry.user, user)} 分享的美食文章\n #{entry_link(\"#{entry.title}\", user, entry)} 發表回應。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(owner)} 對\n #{someones(entry.user, user)} 分享的美食文章\n #{entry_link(\"#{entry.title}\", user, entry)} 發表回應。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n when \"WallComment\"\n parent = activity.item.commentable\n parent_type = parent.class.to_s\n case parent_type\n when \"BlogPost\"\n post = activity.item.commentable\n blog = post.blog\n if recent\n %(#{owner.short_name} 在 #{someones(blog.owner, owner)} 的日記\n #{link_to post.title, blog_post_path(blog, post)} 留言:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(owner)} 在\n #{someones(blog.owner, owner)} 的日記\n #{link_to post.title, blog_post_path(blog, post)} 留言:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n when \"Photo\"\n photo = activity.item.commentable\n user = photo.owner\n if recent\n %(#{owner.short_name} 對 #{someones(photo.owner, owner)} 的相片\n #{photo_link(user, photo)} 做了評論。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(owner)} 對\n #{someones(photo.owner, owner)} 的相片\n #{photo_link(user, photo)} 做了評論。<p>\n #{photo_image_link(photo)}</p><p class=\"meta\">\n #{gallery_link(photo.gallery)}</p><p class=\"meta\">\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 80))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n when \"User\"\n if recent\n %(#{owner.short_name} 在 #{wall(activity)} 的塗鴉牆留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(activity.item.commenter)}\n 在 #{wall(activity)} 的塗鴉牆留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n when \"Group\"\n if recent\n %(#{owner.short_name} 在群組 #{wall(activity)} 的留言板留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(activity.item.commenter)} 在群組\n #{wall(activity)} 的留言板留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n when \"Event\"\n event = activity.item.commentable\n commenter = activity.item.commenter\n if event.eventable.class.to_s == \"Group\"\n if recent\n %(#{owner.short_name} 在群組 \n #{group_link(event.eventable)} 的活動\n #{event_link(event.title, event)} 頁面上留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(commenter)} 在群組 \n #{group_link(event.eventable)} 的活動\n #{event_link(event.title, event)} 頁面上留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n else\n if recent\n %(#{owner.short_name} 在 \n #{someones(event.user, commenter)} 建立的活動\n #{event_link(event.title, event)} 頁面上留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(commenter)} 在 \n #{someones(event.user, commenter)} 建立的活動\n #{event_link(event.title, event)} 頁面上留言。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n end\n when \"NewsItem\"\n news = activity.item.commentable\n commenter = activity.item.commenter\n if news.newsable.class.to_s == \"User\"\n if recent\n %(#{owner.short_name} 回覆了 \n #{someones(news.creator, commenter)} 的網誌文章\n #{note_link(news.newsable, news)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(commenter)} 回覆了 \n #{someones(news.creator, commenter)} 的網誌文章\n #{note_link(news.newsable, news)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n elsif news.newsable.class.to_s == \"Group\"\n if recent\n %(#{owner.short_name} 在群組 \n #{someones(news.newsable, commenter)} 的新聞訊息\n #{news_link(news.newsable, news)} 回應。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(commenter)} 在群組 \n #{someones(news.newsable, commenter)} 的新聞訊息\n #{news_link(news.newsable, news)} 回應。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n elsif news.newsable.class.to_s == \"Widget\"\n if recent\n %(#{owner.short_name} 在 \n #{someones(news.creator, commenter)} 張貼的新聞訊息\n #{story_link(news)} 回應。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(commenter)} 在 \n #{someones(news.creator, commenter)} 張貼的新聞訊息\n #{story_link(news)} 回應。<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(activity.item.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n end\n end\n when \"Friendship\"\n user = activity.item.user\n friend = activity.item.friend\n if activity.item.friend.admin?\n if recent\n %(#{owner.short_name} 加入了 #{app_name}。)\n else\n %(#{user_link_with_image(activity.item.user)}\n 加入了 Cateplaces。)\n end\n else\n if recent\n %(#{owner.short_name} 和 #{user_link_with_image(activity.item.friend)} 成為了朋友。)\n else\n %(#{someones(user, friend)} 和\n #{someones(friend, user)} 現在已經成為朋友。)\n end\n end\n when \"ForumPost\"\n post = activity.item\n group = post.forum.forumable\n if recent\n if owner.class.to_s == \"Group\"\n %(#{user_link_with_image(post.user)} 貼文回覆了討論串 \n #{topic_link(post.topic)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(post.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{owner.short_name} 貼文回覆討論串 \n #{topic_link(post.topic)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(post.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n else\n if owner.class.to_s == \"Group\"\n %(#{user_link_with_image(post.user)} 貼文回覆了群組\n #{group_link(group)} 的討論串\n #{topic_link(post.topic)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(post.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n else\n %(#{user_link_with_image(owner)} 貼文回覆討論串\n #{topic_link(post.topic)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{sanitize(truncate(post.body, 120))} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n end\n when \"Topic\"\n topic = activity.item\n group = topic.forum.forumable\n if recent\n if owner.class.to_s == \"Group\"\n %(#{user_link_with_image(topic.user)} 在討論區新增了話題: \n #{topic_link(activity.item)}。)\n else\n %(#{owner.short_name} 在討論區 \n #{site_forum_link(activity.item.forum)} 新增了話題: \n #{topic_link(activity.item)}。)\n end\n else\n if owner.class.to_s == \"Group\"\n %(#{user_link_with_image(topic.user)} 在群組\n #{group_link(group)} 的討論區新增了話題:\n #{topic_link(activity.item)}。)\n else\n %(#{user_link_with_image(owner)} 在討論區 \n #{site_forum_link(activity.item.forum)} 新增了話題:\n #{topic_link(activity.item)}。)\n end\n end\n when \"User\"\n if recent\n %(#{owner.short_name} 修改了個人帳號資料。)\n else\n %(#{user_link_with_image(owner)} 修改了他的帳號資料。)\n end\n when \"Gallery\"\n if recent\n %(#{owner.short_name} 新增了一本相簿\n #{gallery_link(activity.item)}。)\n else\n %(#{user_link_with_image(owner)} 新增了一本相簿\n #{gallery_link(activity.item)}。)\n end\n when \"Photo\"\n if recent\n %(#{owner.short_name} \n #{to_gallery_link(activity.item.gallery)} 新增了相片\n #{photo_link(activity.item)}。)\n else\n %(#{user_link_with_image(owner)}\n #{to_gallery_link(activity.item.gallery)} 新增了相片\n #{photo_link(activity.item)}。)\n end\n when \"Event\"\n event = activity.item\n time = event.start_time\n if event.eventable_type == \"Group\"\n if recent\n %(#{owner.short_name} 在群組\n #{group_link(event.eventable)} 建立了一項活動\n #{event_link(event.title, event)}。時間於 \n #{time.strftime('%m月%d日 %H:%M')}。)\n else\n %(#{user_link_with_image(owner)} 在群組\n #{group_link(event.eventable)} 建立了一項活動\n #{event_link(event.title, event)}。時間於 \n #{time.strftime('%y年%m月%d日 %H:%M')}。)\n end\n else\n if recent\n %(#{owner.short_name} 建立了一項活動\n #{event_link(event.title, event)}。時間於 \n #{time.strftime('%m月%d日 %H:%M')}。)\n else\n %(#{user_link_with_image(owner)} 建立了一項活動\n #{event_link(event.title, event)}。時間於 \n #{time.strftime('%y年%m月%d日 %H:%M')}。)\n end\n end\n when \"EventAttendee\"\n event = activity.item.event\n if event.eventable_type == \"Group\"\n if recent\n %(#{owner.short_name} 將出席群組\n #{group_link(event.eventable)} 召集的活動 \n #{event_link(event.title, event)}。) \n else\n %(#{user_link_with_image(owner)} 將出席群組\n #{group_link(event.eventable)} 召集的活動 \n #{event_link(event.title, event)}。) \n end\n else\n if recent\n %(#{owner.short_name} 將出席 \n #{someones(event.user, owner)} 召集的活動 \n #{event_link(event.title, event)}。) \n else\n %(#{user_link_with_image(owner)} 將出席\n #{someones(event.user, owner)} 召集的活動 \n #{event_link(event.title, event)}。) \n end\n end\n when \"Group\"\n if owner.class.to_s == \"Group\"\n if recent\n %(管理員變更了群組頁面的內容。)\n else\n %(#{group_link(activity.item)} 的管理員變更了群組頁面的內容。)\n end\n else\n if recent\n %(#{owner.short_name} 建立了一個群組 \n #{group_link(Group.find(activity.item))}。)\n else\n %(#{user_link_with_image(owner)} 建立了一個群組 \n #{group_link(Group.find(activity.item))}。)\n end\n end\n when \"Membership\"\n if owner.class.to_s == \"Group\"\n if recent\n %(#{user_link_with_image(User.find(activity.item.user))} 現在是群組的成員。)\n else\n %(#{user_link_with_image(User.find(activity.item.user))} 現在是群組 \n #{group_link(Group.find(activity.item.group))} 的成員。)\n end\n else\n if recent\n %(#{owner.short_name} 加入了 #{group_link(Group.find(activity.item.group))} 群組。)\n else\n %(#{user_link_with_image(owner)} 加入了 \n #{group_link(Group.find(activity.item.group))} 群組。)\n end\n end\n when \"NewsItem\"\n news = activity.item\n if owner.class.to_s == \"User\"\n if recent\n %(#{owner.short_name} 發表了一篇網誌文章 \n #{note_link(news.newsable, news)}。)\n else\n %(#{user_link_with_image(news.creator)} 發表了一篇網誌文章 \n #{note_link(news.newsable, news)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{summarize(news.body, 120)} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n elsif owner.class.to_s == \"Group\"\n group = news.newsable\n if recent\n %(#{user_link(news.creator)} 張貼了一篇新聞訊息 \n #{news_link(group, news)}。)\n else\n %(#{user_link_with_image(news.creator)} 在群組 #{group_link(news.newsable)} 張貼了一篇新聞訊息 \n #{news_link(group, news)}:<p>\n #{image_tag(\"start_quote.gif\")} \n #{summarize(news.body, 120)} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n elsif owner.class.to_s == \"Widget\"\n if recent\n %(#{owner.short_name} 張貼了一篇新聞文章 \n #{story_link(news)}。)\n else\n %(#{user_link_with_image(news.creator)} 張貼了一篇新聞文章 \n #{story_link(news)}。<p>\n #{image_tag(\"start_quote.gif\")} \n #{summarize(news.body, 120)} \n #{image_tag(\"end_quote.gif\")}</p>)\n end\n end\n \n else\n raise \"不合法的活動類型 '#{activity_type(activity).inspect}'\"\n end\n end", "def channel_name\n client_channel.present? ? self.client_channel.channel_name : \"\"\n end", "def normal_news_link\n normal_link(\"news_#{@news.news_type}\") if @news\n\tend", "def publish_url(channel)\n (ssl ? \"https\" : \"http\") << \"://#{origin}/publish/#{publish_key}/#{subscribe_key}/#{secret_key || 0}/#{channel}/0\"\n end", "def render_push_activity(activity)\n render_repo_activity(activity, \"pushed\")\n end", "def ezm_link_to_send_message\r\n link_to \"Write\", compose_url\r\n end", "def determinate_back_link_url\n if history.nil? || history.size == 1\n default_url\n else\n \"#{url}?page=#{session.dig(:back_link_history, previous_step)}?back=true\"\n end\n end", "def waiting_for_stable_build_comment_segment(branch, settings)\n \"#{CONTENT_WAITING_STABLE_BUILD} '#{branch_settings(branch, settings)['downstream_job_name']}'\"\nend", "def new_work_url\n url = get_configuration 'url', @work_type_config.dig('hydra_endpoint', 'new_work'), @config.dig('new_work')\n URI.join(server_domain, url)\n end", "def job\n fetch('games.final_fantasy_xiv.jobs')\n end", "def show\n if cancelation_flash @job\n elsif @job.past?\n flash_now_t :warning, :job_is_in_the_past\n elsif @job.user_signed_up? current_user\n flash_now_t :info, @job.full? ? :current_user_signed_up_and_job_full :\n :current_user_signed_up\n end\n end", "def index\n @jobs = Job.published.desc\n end", "def comments_url\n configatron.urls.hacker_news_item + reference_number if reference_number\n end", "def fetch_feeds\n Delayed::Job.enqueue Jobs::RssFeedJob.new\n flash[:notice] = t('flash.voices.fetch_feeds.fetching')\n redirect_to :action => 'index'\n end", "def new\n @job = Job.new\n if current_user and default_queue = current_user.preferences.find_by_kind('default_queue') then @job.jobs_queue_id = default_queue.value end\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @job }\n end\n end" ]
[ "0.6312599", "0.6038397", "0.58215123", "0.5786872", "0.5678297", "0.5531721", "0.5429605", "0.52930015", "0.52412164", "0.5236328", "0.5225987", "0.5205947", "0.5195419", "0.51747936", "0.5166242", "0.5154464", "0.5154326", "0.51509583", "0.5146319", "0.51402384", "0.5121867", "0.510445", "0.510434", "0.5090285", "0.50875664", "0.508287", "0.5081041", "0.5080059", "0.5063089", "0.5061193", "0.50471276", "0.50457335", "0.50134534", "0.4998911", "0.4984978", "0.49784487", "0.4970268", "0.49664634", "0.49663296", "0.49628934", "0.49516463", "0.49430847", "0.49365452", "0.48889574", "0.48827547", "0.48781818", "0.48779052", "0.4872109", "0.4866194", "0.48645616", "0.48619875", "0.4851226", "0.4851226", "0.48280117", "0.48206902", "0.48205587", "0.48150596", "0.480532", "0.4799092", "0.47988728", "0.47978556", "0.47955623", "0.4789769", "0.4779121", "0.47783735", "0.47775814", "0.47769046", "0.47740597", "0.47734267", "0.4769585", "0.4765715", "0.47633362", "0.4763231", "0.47574103", "0.4753193", "0.47523227", "0.47488955", "0.4737851", "0.47373137", "0.47277033", "0.47204188", "0.47175062", "0.47146446", "0.47066832", "0.46987897", "0.46948054", "0.46942437", "0.46935734", "0.468595", "0.46851522", "0.46829814", "0.4676276", "0.4673482", "0.46726376", "0.46715817", "0.4670554", "0.4668824", "0.4667042", "0.46589732", "0.4657462" ]
0.68830806
0
Won't show the link if here are no pushes of the given type since having the button there tends to imply there might be a relevant push job to look at.
def push_history_link(push_job_class, errata) if push_job_class.for_errata(errata).any? workflow_action_link("Push History", { :controller => 'push', :action => 'push_history_for_errata', :id => errata }) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def push_variant_target_disabled_warning(errata, type)\n variants = errata.release_variants.uniq\n unsupported = variants.reject{|v| v.supported_push_types.include?(type)}.sort_by(&:name)\n return if unsupported.none? || unsupported.count == variants.count\n\n popover = block_render('shared/help_popover') do\n content_tag(:h4, \"Push target '#{type}' is not supported by:\") +\n content_tag(:ul, unsupported.map{|v| content_tag(:li, link_to(v.name, v))}.join.html_safe)\n end\n\n (\"Push target is not supported by all variants \" + popover).html_safe\n end", "def link_to_trackable(object, object_type)\n if object\n link_to object_type.downcase, object\n else\n \"a #{object_type.downcase} which does not exist anymore\"\n end\n end", "def push_type_for_validate\n if advisory_rhn_live_pushed?\n 'cdn_if_live_push_succeeds'\n end\n end", "def type_link(type)\n type ? \"<a href='/types/#{type}'>#{type.upcase}</a>\" : ''\n end", "def has_pushed_since_last_respin?(type)\n jobs = push_jobs_since_last_state(type, 'NEW_FILES').where('pub_task_id is not null')\n jobs.reject(&:is_nochannel?).any?(&:is_committed?)\n end", "def link_to\n case object.notifiable_type\n when \"Project\"\n api_v1_project_path(object.project) if object.project.present?\n when \"Story\"\n api_v1_story_path(object.story) if object.story.present?\n when \"Task\"\n api_v1_task_path(object.notifiable) if object.notifiable.present?\n when \"Comment\"\n api_v1_comment_path(object.notifiable) if object.notifiable.present?\n when \"Attachment\"\n api_v1_attachment_path(object.notifiable) if object.notifiable.present?\n end\n\n # If a story or project has been archived...\n rescue ActionController::UrlGenerationError\n nil\n end", "def display_link_to?(action)\n @display_link.include?(action)\n end", "def link_for(type)\n if link = self.links.find { |link| link.type == type }\n link.to_s\n end\n end", "def push_possible?(options = {})\n unless push_type_supported?\n @errors.add(push_target, \"#{push_type_name} not supported for '#{@errata.fulladvisory}'.\")\n return false\n end\n\n unless can_push?(options)\n @errors.add(push_target, \"Can't push advisory to #{push_type_name} now due to: #{push_blockers(options).join(\", \")}\")\n return false\n end\n\n if existing_job = self.job_klass.active_job_for(@errata)\n # Active job exists\n @errors.add(push_target, \"An <a href='/push/push_results/#{existing_job.id}'>existing #{self.job_klass.name.titleize}</a> is already running. You will need to cancel it to schedule a new one.\")\n return false\n end\n\n return true\n end", "def last_prepush_link(push_job_class, errata)\n jobs_since_respin = errata.push_jobs_since_last_state(push_job_class, 'NEW_FILES')\n if (job = jobs_since_respin.nochannel.order('id desc').first)\n push_job_link(job, 'Pre-push')\n end\n end", "def uplink_has_network_of_type?(uplink, type)\n uplink_networks(uplink).map do |network|\n network[\"type\"].downcase\n end.include?(type.downcase)\n end", "def post_type_link(text, type = nil)\n type = text if type.nil?\n link_to text, :controller => 'tumble', :action => 'list_by_post_type',\n :type => type\n end", "def is_linktype?(); @type == GRT_LINKTYPE; end", "def streamlined_auto_discovery_link_tag()\n return if @syndication_type.nil? || @syndication_actions.nil?\n \n if @syndication_actions.include? params[:action]\n \"<link rel=\\\"alternate\\\" type=\\\"application/#{@syndication_type.downcase}+xml\\\" title=\\\"#{@syndication_type.upcase}\\\" href=\\\"#{params[:action]}/xml\\\" />\"\n end\n end", "def receive_push\n return if data['user'] == nil\n return if data['pass'] == nil\n return if data['url'] == nil\n return if data['title'] == nil\n # The line we add looks like: <msg> <commit URL>\n line_add = \"\\n* #{summary_message}: #{summary_url}\"\n # Log in to the install.\n mw = MediaWiki::Gateway.new(data['url'])\n mw.login(data['user'], data['pass'])\n # Good. Fetch page if it exists somehow.\n page_text = mw.get(data['title'])\n if page_text == nil\n mw.create(data['title'], '<!-- autocreated -->', :summary => 'Creating page -- did not exist during push')\n page_text = \"\"\n end\n # Append our line to the end of the page_text\n page_text << line_add\n # Save the page\n mw.edit(data['title'], page_text, :summary => 'Updated commits upon push')\n end", "def associate_social_links(type)\n type_name = type.to_s.capitalize\n lt = LinkType.find_by_name(type_name)\n \n args = [type]\n type_links = @item.links.where(:link_type_id => lt.id)\n if type_links.count > 0\n # do not search for results that have already been added to the item's links\n args << ' AND -link:' + type_links.collect { |l| l.link_url }.join(' -link:')\n end\n city_links = @item.links\n current_size = city_links.size\n extract_social_links(*args).each do |link|\n if [email protected](&:link_url).include?(link)\n @item.links << Link.create(:link_type_id => lt.id, :link_url => link, :name => type_name)\n end\n end\n if current_size < @item.links.size\n WhiskBatter.new(@item).delay.associate_social_links(type)\n end\n end", "def dynamic_send_slack_notification\n ignore_notification = self.annotated_type == 'Task' && self.annotated.present? && self.annotated.annotated_type == 'Source'\n self.send_slack_notification unless ignore_notification\n end", "def check_only_links\n end", "def action_link\n if member.kind_of?(Work)\n link_to \"Info\", work_path(member), class: \"btn btn-primary\"\n elsif download_original_only\n link_to \"Download\", download_path(member.file_category, member), class: \"btn btn-brand-main less-padding\", data: {\n \"analytics-category\" => \"Work\",\n \"analytics-action\" => \"download_original\",\n \"analytics-label\" => member.parent.friendlier_id\n }\n else\n render DownloadDropdownComponent.new(member, display_parent_work: member.parent, use_link:true)\n end\n end", "def render_push_activity(activity)\n render_repo_activity(activity, \"pushed\")\n end", "def require_push_notification?\n if action =~ /up_vote/ && subject.respond_to?(:votes)\n first_notification = !similar_notifications.exists?\n first_notification || subject.votes.count % PUSH_VOTES_INTERVAL == 0\n elsif action =~ /subscription\\.create/\n false\n else\n true\n end\n end", "def no_thanks_button\n $tracer.trace(format_method(__method__))\n return ToolTag.new(a.id(\"/NoAltStoreLinkButton$/\"), format_method(__method__), @spec)\n end", "def respond_to_url_change\n return if apotomo_root.find_by_id('deep_link') # add only once.\n apotomo_root << widget(\"apotomo/deep_link_widget\", :setup, 'deep_link')\n end", "def streamlined_auto_discovery_link_tag\n # return if @syndication_type.nil? || @syndication_actions.nil?\n # \n # if @syndication_actions.include? params[:action]\n # \"<link rel=\\\"alternate\\\" type=\\\"application/#{@syndication_type.downcase}+xml\\\" title=\\\"#{@syndication_type.upcase}\\\" href=\\\"#{params[:action]}/xml\\\" />\"\n # end\n end", "def last_push_link(push_job_class, errata)\n if (last_push = push_job_class.last_push(errata))\n push_job_link(last_push, 'Last job')\n end\n end", "def local_link?\n [1,2].include?(link_type)\n end", "def post_type_link(text, type = nil)\r\n type = text if type.nil?\r\n link_to text, :controller => 'post', :action => 'list_by_type',\r\n :type => type\r\n end", "def push_applicable?\n return false unless push_type_supported?\n\n method = \"has_#{self.push_target}?\"\n return true unless @errata.respond_to?(method)\n\n @errata.send(method)\n end", "def pushed?\n !pushed_at.nil?\n end", "def should_send_push?(look)\n look.votes.count > 25 || look.is_expired?\nend", "def publish_immediately?\n params[:publish_type].to_i > 0\n end", "def link_to_remote_unless(condition, name, options = {}, html_options = nil, &block)\n link_to_remote_if !condition, name, options, html_options, &block\n end", "def link_of_item(kind)\n\titem = @items.find { |i| i.attributes()[:kind] == kind }\n\tlink_to(kind.capitalize, @site.config()[:base_url] + item.path) unless item.nil?\nend", "def transitive_blockers(for_type)\n blocked_by = lambda{|type| [\"This errata cannot be pushed to #{type}, thus may not be pushed to #{for_type}\"]}\n\n if has_rhn_live?\n if !can_push_rhn_live?\n return blocked_by.call('RHN Live')\n elsif has_cdn? && !can_push_cdn_if_live_push_succeeds?\n return blocked_by.call('CDN Live')\n end\n elsif has_cdn? && !can_push_cdn?\n return blocked_by.call('CDN Live')\n end\n\n []\n end", "def can_push_cdn_if_live_push_succeeds?(*args)\n push_cdn_if_live_push_succeeds_blockers(*args).empty?\n end", "def links(type = :local)\n @links = type == :all ? @all_links : @local_links\n end", "def links_feed\n end", "def print_links_only\n found_issues = collect_issues_from_commits\n return if found_issues.empty?\n\n message = \"## Jira issues\\n\\n\"\n found_issues.each do |issue_id|\n if include_resolves_keyword\n message << \"Resolves \"\n end\n message << \"[#{issue_id}](#{jira_site}/browse/#{issue_id})\\n\\n\"\n end\n\n markdown message\n end", "def new_public_app_with_repo ( type=\"repo\")\r\n puts \"+<repo_type> is #{type.upcase}\"\r\n puts \"+ <action> New public app with github repo --- begin\"\r\n make_sure_apps_page unless @driver.current_url =~ /.*apps.*/\r\n # Selenium::WebDriver::Wait.new(:timeout => 120).until { new_app_btn }\r\n sleep 10\r\n if new_app_btn_display?\r\n new_app_locator(:new_app_btn).click\r\n end\r\n new_app_locator(:opensource_repo_tab).click\r\n new_app_locator(:paste_git_repo_input).clear\r\n if type.upcase==\"REPO\"\r\n new_app_locator(:paste_git_repo_input).send_keys $data[:app][:new_app][:by_repo] + \"\\n\"\r\n elsif type.upcase==\"PLUGIN_REPO\"\r\n new_app_locator(:paste_git_repo_input).send_keys $data[:app][:new_app][:by_with_plugin_repo1] + \"\\n\"\r\n elsif type.upcase==\"LARGE_REPO\"\r\n new_app_locator(:paste_git_repo_input).send_keys $data[:app][:new_app][:by_with_large_repo] + \"\\n\"\r\n else\r\n raise \"Not supported repo.\"\r\n end\r\n sleep 10\r\n puts \"+ <action> New public app with github repo --- end\"\r\n end", "def pushed?\n !!self.pushed_att\n end", "def stp_link_type\n super\n end", "def push_repo_to_github?(node)\n !!node['delivery']['config']['build_attributes']['publish']['github']\n rescue\n false\n end", "def github_push(payload)\n pushType = payload[\"repository\"][\"full_name\"].split(\"/\")[1].split(\"-\")[0]\n if pushType == \"assignment\"\n TestGraderWorker.perform_async(payload)\n end\n\tend", "def script_is_push_only?(script)\n script_check_pushes(script, push_only=true, canonical_only=false)\n end", "def _type\n @link['type']\n end", "def is_linkkeys?(); @type == GRT_LINKKEYS; end", "def push_errata_submit\n @user = current_user\n\n # Set page page name\n set_page_title get_push_page_name.html_safe\n\n @policies.select { |p| params[p.push_type].to_bool }.each do |policy|\n if policy.push_possible?\n target = resolve_params_for_policy(policy)\n push_request = PushRequest.new(@errata, [target], [policy])\n\n begin\n job = create_push_job(target, push_request)\n rescue StandardError => ex\n log_helper \"Creating push job failed\", :exception => ex\n end\n\n job_submit(job)\n\n enqueued = job.try(:in_queue?)\n add_message \"<div class='push_notices'><h3>#{enqueued ? 'Enqueuing' : 'Doing'} <b>#{policy.push_type_name}</b> push...</h3>\"\n\n add_message job ? \"Ok\" : \"<p class='red bold'>#{policy.push_type_name} push FAILED!</p>\"\n add_message '</div>'\n log_helper \"Push Job Params: #{target.inspect}\", :type => :debug\n\n else\n policy.errors.values.flatten.each { |m| add_message(m) }\n end\n end\n end", "def links_for_item(item)\n links = super(item)\n\n links.push({\n 'rel' => 'status',\n 'type' => api_media_type(:g5kitemjson),\n 'href' => uri_to(File.join(resource_path(item['uid']), 'status'))\n })\n links\n end", "def skip_pub_task_and_post_process_only?\n !pub_options['push_metadata'] && !pub_options['push_files']\n end", "def publish_button?\n return false unless params[:button]\n\n [PUBLISH, UNPUBLISH].include? params[:button].upcase\n end", "def view_button(object, link = nil)\n link_to '<span class=\"glyphicon glyphicon-eye-open\"></span> View'.html_safe,\n link ? link : polymorphic_path(object),\n class: 'btn btn-default',\n title: \"View #{object_title(object)}\"\n end", "def progress_link\n percentage_string = object.done_percentage_string\n color = case percentage_string\n when \"0%\"\n 'danger'\n when \"100%\"\n 'success'\n else\n 'primary'\n end\n\n if percentage_string == '---'\n else\n tooltip_msg = \"Go to #{object.stage.name} Stage of the Order #{object.order.id}\"\n h.link_to percentage_string, h.order_stage_path(order_id: object.order.id, id: object.stage.id), class: \"btn btn-#{color} btn-xs\", data: { toggle: 'tooltip', position: 'top', original_title: tooltip_msg }, target: :_blank\n end\n end", "def button_link(which)\n link.href(\"/page/#{which}\")[\n button\n .css(:button)\n .disabled(app.done_scope == which)\n .style(margin_right: 1.em, width: 6.em)[\n \"#{which.to_s.capitalize} (#{TODOS.count(which)})\"\n ]\n ]\n end", "def click_through_link\n\t\treturn '/items/' + self.items.first.slug if !self.items.first.blank?\n\t\treturn '/blog/' + self.blogs.first.slug if !self.blogs.first.blank?\n\t\treturn \"#\"\n\tend", "def show\n @pushable = Push.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @push }\n end\n end", "def on_button_push\n @command.execute if @command\n end", "def links_present\n resend_email_link.visible?\n change_email_link.visible?\n back_to_login_page_link.visible?\n end", "def linkbutton\n config[\"linkbutton\"]\n end", "def pushed\n return false if deactivated?\n self.status = 'publishing'\n notify_observers :after_push if (suc = save)\n suc\n end", "def exist_links\n return [] if sumup.blank?\n\n sumup.fetch(\"public_praises\").fetch(\"items\")\n end", "def pushed?\n !!self.pushed_at\n end", "def index\n if params[:contribution_type] == \"show\"\n @contributions = Contribution.where.not(url: '').order(created_at: :desc)\n elsif params[:contribution_type] == \"ask\"\n @contributions = Contribution.where.not(text: '').order(created_at: :desc)\n elsif params[:contribution_type] == nil || params[:contribution_type] == ''\n @contributions = Contribution.all.order(created_at: :desc)\n else\n render :json => {:status => \"400\", :error => \"Bad Request\"}, status: :bad_request\n end\n end", "def render_sharing?\n true\n end", "def push_job_options_for_display(push_job)\n out = []\n\n add_label = lambda do |content, help|\n out << content_tag(:span, content, :class => 'label label-info',\n :title => help)\n end\n\n if push_job.is_nochannel?\n add_label['nochannel', NOCHANNEL_HELP]\n end\n\n if push_job.skip_pub_task_and_post_process_only?\n add_label['tasks-only', TASKS_ONLY_HELP]\n end\n\n options = push_job.pub_options\n if options['push_metadata'] && !options['push_files']\n add_label['metadata-only', METADATA_ONLY_HELP]\n end\n\n if out.empty?\n out << '-'\n end\n\n safe_join(out, ' ')\n end", "def display_link?(user)\n TeamMembership.where(idea_build_id: self.idea_build.id).any? {|tm| tm.user_id == user.id}\n end", "def link_to_trackable(object, object_type, title=nil)\n translate_model_type = I18n.t(\"activerecord.models.#{object_type.downcase}\")\n if object\n if title\n link = link_to title, object\n [translate_model_type, link].join(' ').html_safe\n else\n link_to translate_model_type, object\n end\n else\n \"#{translate_model_type} который (-ая) больше не существует\"\n end\n end", "def publishable?\n self.status == STATUS_PENDING\n end", "def which_action_button?\n if belongs_to_current_profile_user?\n if controller_name == 'photos'\n link_to \"Add New Photo\", new_profile_photo_path(@profile), class: \"btn btn-primary inline pull-right\"\n elsif controller_name == 'profiles' \n link_to \"Edit Profile\", edit_profile_path(@current_user.profile), class: \"btn btn-info inline pull-right\"\n end\n else\n if friendship_id = friend_of_current_user?\n link_to \"Remove Friend\", profile_friendship_path(:profile_id => @profile, :id => friendship_id), method: :delete, class: \"btn btn-danger inline pull-right\"\n else\n #We don't want to show this on our own profile\n unless belongs_to_current_profile_user?\n link_to \"Add Friend\", profile_friendships_path(@profile), method: :post, class: \"btn btn-success inline pull-right\"\n end\n end\n end\n end", "def is_link?\n self.type == 'Document::VirtualCollege' && !is_pdf?\n end", "def push(notif)\n\n end", "def actions\n html_str = ''\n if object.status.to_sym == :pending\n html_str << \"#{context.approve_redemption_button(object)}\"\n html_str << \"#{context.deny_redemption_button(object)}\"\n elsif object.status.to_sym != :denied\n if object.reward.provider_reward?\n html_str << \"#{context.redemption_view_details_link(object)}\"\n else\n if object.additional_instructions.present?\n html_str << \"<div>#{context.redemption_view_additional_instructions_link(object)}</div>\"\n end\n end\n end\n html_str\n end", "def check_stock(product)\n if product.stock < 1\n return link_to 'NO STOCK', \"#\", class: 'btn btn-sm btn-outline-danger disabled'\n else\n return link_to 'COMPRAR', product, class: 'btn btn-sm btn-outline-success'\n end\n end", "def can_issue?(user, type = self.type.to_sym)\n Punishment.can_issue?(user, type)\n end", "def set_url_type_and_command\n if @url =~ %r{http://\\d+.\\d+.\\d+.\\d+/cmd,/ck6fup6/(.*)/(.*)\\?}\n @type = $1.to_sym\n @command = $2.to_sym\n end\n notify \"Type is #{@type} , Command is #{@command}\"\n end", "def new_app_btn_display?\r\n make_sure_apps_page unless @driver.current_url =~ /.*apps.*/\r\n style = new_app_locator(:new_app_btn).attribute(\"style\")\r\n puts \"------style---> #{style} <-------------\"\r\n if style.chomp.include?(\"display: none;\")\r\n sleep 5\r\n puts \"+ <action> new_app_btn_display? NO\"\r\n return false\r\n end\r\n sleep 5\r\n puts \"+ <action> new_app_btn_display? YES\"\r\n return true\r\n end", "def publishing_api_has_no_linked_items\n url = \"#{PUBLISHING_API_V2_ENDPOINT}/linked/\"\n stub_request(:get, %r{#{url}}).to_return(status: 200, body: [].to_json)\n end", "def display_social_bookmarks?; true end", "def linking?\n self.reload\n self.linkbutton\n end", "def check_is_add_link_request\n if params[:add_link]\n link_text = \" link(#{t(:visible_text)}, #{t(:invisible_url)}) \"\n p = Paragraph.find(params[:add_link].keys.first)\n p.update_attributes({title: p.get_title, body: p.get_body + link_text})\n end\n end", "def add_image_link?(options)\n !options.key?(:link) || options[:link]\n end", "def notifiable_url\n\t\tif [\"Reblog\", \"Like\", \"Comment\"].include?(self.notification_type)\n\t\t\t\"posts/#{notification_id}\"\n\t\telse\n\t\t\t\"blogs/#{notification_id}\"\n\t\tend\n\tend", "def notification_link(notification)\n notifiable = notification.notifiable\n return '' unless notifiable\n text = if notification.medium?\n medium_notification_card_link(notifiable)\n elsif notification.course?\n course_notification_card_link\n elsif notification.lecture?\n lecture_notification_card_link\n else\n notifiable.details\n end\n text.html_safe\n end", "def queue_link( tag, source )\n return if tag.attributes['class'] && tag.attributes['class']['thickbox'] == 'thickbox'\n return if tag.attributes['onclick']\n dest = (tag.attributes['onclick'] =~ /^new Ajax.Updater\\(['\"].*?['\"], ['\"](.*?)['\"]/i) ? $1 : tag.attributes['href']\n if !(dest =~ %r{^(mailto:|#|javascript:|http://|.*\\.jpg|aim:|ichat:|xmpp:)})\n @links_to_visit << Link.new( dest, source )\n end\n end", "def follow_on_job?\n false\n end", "def single_actions?\n false\n end", "def check_publishing_workflow!\n self.publishing_workflow_id = content_type.publishing_workflow_id\n end", "def find_social_links_on(type)\n social_url = @@social_links[type] || type\n\n # go through all of the website links of this organization\n @item.links.where(:link_type_id => website_link_type_id).map { |website_link|\n # each_item only iterates through the first 8 items in the response\n # search facebook.com for the organization name\n google_search(@item.name, social_url).collect { |result| result.uri }.select { |social_url|\n # search the organization site for a link to that facebook profile\n # if the result has more than 0 results, add it to the links list\n # (returns a boolean because we are in a select block)\n google_search(\"link:#{social_url} AND\", website_link.link_url).estimated_count > 0 and usable_link?(type, social_url)\n }\n }.flatten\n end", "def line_for pull_request, with_image\n img = if with_image\n image \"Status of ##{pull_request.number}\", status_image(pull_request)\n end\n\n suffix = img ? (\" \" + img) : \"\"\n link_to(pull_request.title, pull_request.html_url) + suffix\n end", "def link_to(body, url)\n \"[#{body}](#{url})\" if !AIPP.options.check_links || url_exists?(url)\n end", "def show_warnings_link(work)\n link_to_remote \"Show warnings\",\n :url => {:controller => 'tags', :action => 'show_hidden', :work_id => work.id },\n :method => :get\n end", "def push_subscription\n\t\trender :nothing => true\n\tend", "def link?\n !link.nil? && !link.empty?\n end", "def link?\n !link.nil? && !link.empty?\n end", "def has_github?\n !github_url.blank?\n end", "def select_which_add_link(name)\n\t\tcase name\n\t\t\twhen \"solutions\"\n\t\t\t\tlink_to(\"Add One Today\", new_issue_solution_path(@issue), class: \"btn btn-primary btn-sm\")\n\t\t\twhen \"workarounds\"\n\t\t\t\tlink_to(\"Add one Today\", new_issue_issue_workaround_path(@issue), class: \"btn btn-primary btn-sm\" )\n\t\tend\n\tend", "def accepts_outcome_url?\n accepted_outcome_types.member?('url')\n end", "def is_link?\n !child_question.nil?\n end", "def any_status_hook\n repo = params[:name]\n link = \"https://github.com/#{repo}\"\n sha = params[:sha]\n state = params[:state]\n context = params[:context]\n description = params[:description]\n target = params[:target_url]\n\n return if state == 'pending' || (state == 'success' && context == 'github/pages')\n\n if repo == 'Charcoal-SE/metasmoke' && context.start_with?('ci/circleci')\n ci_counter = Redis::CI.new(sha)\n if state == 'success'\n ci_counter.sucess_count_incr\n return unless ci_counter.sucess_count == 3\n context = 'ci/circleci'\n else\n ci_counter.sucess_count_reset\n end\n end\n\n message = \"[ [#{repo.sub('Charcoal-SE/', '')}](#{link}) ]\"\n message += \" #{context} \"\n message += if target.present?\n \"[#{state}](#{target})\"\n else\n state\n end\n message += \" on [#{sha.first(7)}](#{link}/commit/#{sha.first(10)})\"\n message += \": #{description}\" if description.present?\n\n ActionCable.server.broadcast 'smokedetector_messages', message: message\n end", "def action_pad_and_link_blocking(activity)\n if activity.class.to_s == \"MatterTask\" || activity.assigned_to_user_id==get_employee_user_id\n return [true,true,true]\n else\n if activity.mark_as==\"PUB\"\n return [true,true,true]\n else\n return [false,false,false]\n end\n end\n end", "def matching_links(type)\n link_pattern = config.public_send(\"link_#{type}_pattern\")\n return [] unless link_pattern\n\n metadata\n .select { |key| __send__(\"#{type}?\", key) }\n .map { |key, value| Allure::ResultUtils.public_send(\"#{type}_link\", key.to_s, value, link_pattern) }\n end" ]
[ "0.59146005", "0.5837964", "0.580161", "0.55455494", "0.551946", "0.55175835", "0.54928124", "0.5478899", "0.54756474", "0.5400246", "0.5371835", "0.52965075", "0.5287611", "0.52856845", "0.5276128", "0.5229828", "0.5210949", "0.519913", "0.5198304", "0.51646775", "0.5105727", "0.50995207", "0.50927705", "0.50894326", "0.50422215", "0.503506", "0.50303257", "0.5020571", "0.50045586", "0.4992702", "0.4988804", "0.49776024", "0.49650812", "0.49599132", "0.49508947", "0.4950137", "0.4946213", "0.49449512", "0.49335226", "0.49049646", "0.48957852", "0.48839575", "0.48722976", "0.4853495", "0.48457646", "0.48453024", "0.48389006", "0.48376924", "0.48376608", "0.48262295", "0.48187706", "0.4815191", "0.48148662", "0.48148584", "0.48140055", "0.4809371", "0.48082903", "0.48075753", "0.4800799", "0.4796708", "0.4792718", "0.47909766", "0.47880322", "0.4781304", "0.47762245", "0.4774189", "0.47724754", "0.47624123", "0.47571588", "0.47493827", "0.47479856", "0.47462955", "0.47451445", "0.47450852", "0.4738319", "0.4731705", "0.47209507", "0.47203812", "0.47178528", "0.47103968", "0.4707938", "0.47046787", "0.46981946", "0.46947464", "0.46927127", "0.46729028", "0.46728012", "0.46648854", "0.46517837", "0.4650608", "0.46440694", "0.46420023", "0.46420023", "0.4638828", "0.4637483", "0.4629571", "0.46285626", "0.4622363", "0.4609874", "0.4607024" ]
0.584095
1
Each step method return a hash of things that can be rendered. (Might refactor this later... Maybe should make classes for these things instead of hashes. eg, have a base class and subclasses for each different 'step'...)
def workflow_step_helper(step_name) raise "Unknown step #{step_name}" unless WorkflowHelper.private_method_defined? step_name method(step_name).call end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def steps\n %w[\n household_member_demographics_step\n household_member_address_step\n household_member_address_search_results_step\n household_member_citizenship_step\n household_member_education_step\n household_member_employments_step\n household_member_assessment_employment_step\n household_member_incomes_step\n household_member_unearned_incomes_step\n household_member_expenses_step\n household_member_resources_step\n household_member_relations_step\n ]\n end", "def step_names\n hash = raw_step_names\n hash = Hash[ hash.map{ |k,v| [ k, ( ft.steps[ k ] | v ).to_s ] } ] if r18n\n hash\n end", "def separate_step_contents(flat_hash)\n step_contents_hash = {}\n nested_hash = Hash.to_nested_hash flat_hash\n self.steps.each do |step|\n values = nested_hash.slice(*get_params_for_step(step))\n step_contents_hash[step.name] = values unless values.empty?\n end\n step_contents_hash\n end", "def getsteps\n\t\t@hide_menu = true\n\n puts \"In Steps\"\n recId = params['query'].inspect\n #this is the link to the API\n url = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/\" + recId[1..-2] + \"/analyzedInstructions?stepBreakdown=true\"\n stepss = Unirest.get url,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n allSteps = stepss.body\n\n recSteps = Hash.new\n\n counter = 1\n #this is how the recipe information is formatted\n allSteps.each do |key|\n key.each do |key2,steps|\n if(key2.eql? \"steps\")\n steps.each do |step|\n step.each do |key3, lastStep|\n if(key3.eql? \"step\")\n recSteps[counter] = lastStep\n counter += 1\n #this gives each step a number, for ease of use\n end\n end\n end\n end\n end\n end\n puts recSteps\n\n @recipeData = recSteps\n render template: \"recipes/data3\"\n end", "def create_steps(value, expected)\n temp = []\n st_count = 0\n\n value.each do |x|\n temp[st_count] = {}\n temp[st_count][:step_number] = \"#{st_count+1}\"\n temp[st_count][:actions] = \"<p>#{x.strip}</p>\"\n temp[st_count][:expected_results] = expected unless expected.nil?\n temp[st_count][:execution_type] = \"1\"\n temp[st_count][:active] = \"1\"\n st_count += 1\n end\n return temp\n end", "def step_tags(current_step,completed_steps)\n tags = {}\n for i in 1 .. Survey::STEP_COMPLETE\n tags[i] = []\n end\n\n tags[4] << \"mainNavNoBg\"\n\n last_done_step = 0\n tags[current_step].push(\"current\")\n if completed_steps > current_step\n tags[current_step].push(\"nextDone\")\n end\n if current_step > 1\n tags[current_step - 1] << (\"lastDone\")\n last_done_step = current_step - 1\n end\n\n if completed_steps > 1\n for i in 1 .. completed_steps\n if i != current_step and i != last_done_step \n tags[i] << \"done\"\n end\n end\n end\n tags.each {|k,v| tags[k] = v.join(\" \")}\n return tags\n end", "def step_result; end", "def steps\n @steps ||= []\n end", "def steps\n %w[name time]\n end", "def sections(form_state = nil)\n if form_state.nil?\n return :general\n else\n case form_state\n when :general\n puts \"Hello world now 1 in perfect method case latest\" \n\t { :title=>'General Info', :next=>:reviewers, :prev=>nil}\n when :coauthors\n {:title=>'Co-Authors', :next=>:reviewers, :prev=>:general}\n when :reviewers\n {:title=>'Reviewers', :next=>:fees, :prev=>:general}\n when :fees\n {:title=>'Fees', :next=>:checklist, :prev=>:reviewers}\n when :checklist\n {:title=>'Checklist', :next=>:nil, :prev=>:fees}\n \n when :review\n {:title=>'Review', :next=>nil, :prev=>:nil}\n end\n end\n end", "def all_steps\n\t#make calls to step here...\nend", "def make_step\n @result\n end", "def build_contents\n # Merge the array of hashes into one.\n flatten_hash = Hash[*step_contents.collect(&:contents).collect{|h| h.to_a}.flatten]\n # Create a flat hash structure\n Hash.to_dotted_hash flatten_hash\n end", "def render_step_result_header(step)\n puts string_with_padding(\"Step #{step}\", 8).white.on_black\n end", "def some_template_method\n step1\n step2\n step3\n end", "def steps\n step_flows.collect(&:current_step)\n end", "def hash\n [paginate_sheets, count_rows_per_page, count_columns_per_page, render_grid_lines, render_empty_rows, render_empty_columns, render_hidden_rows, render_hidden_columns, render_headings, render_print_area_only, text_overflow_mode].hash\n end", "def run inputs = {}\n inputs.merge!(self.options)\n output_inputs(inputs)\n run_step_names = run_steps inputs\n puts \"running steps: #{run_step_names.join(\", \")}\"\n missing = missing_step_inputs inputs\n unless missing.empty?\n output_missing(missing)\n return\n end\n results = []\n @steps.each do |step|\n puts \"step: #{step.name}\"\n step_output = step.outputs_given inputs\n if run_step_names.include? step.name\n results << step.call_run_block(inputs,step_output)\n inputs.merge! step_output\n else\n inputs.merge! step_output\n end\n end\n results\n end", "def steps\n if template_steps_bound?\n @unbound_steps = nil\n @bound_steps ||= build_steps\n else\n @unbound_steps ||= build_steps\n end\n end", "def show\n case step\n when :parameters\n # Create an initial input parameter if there is none\n @algorithm.input_parameters.build if @algorithm.input_parameters.empty?\n when :parameters_details\n # Possibly skip a step if there are no parameters used\n if @algorithm.input_parameters.empty?\n if @algorithm.upload?\n jump_to :parameters\n else\n flash[:notice] = \"Skipped step 3 due to no input parameters set\"\n skip_step\n end\n end\n end\n # Update the step of the algorithm.\n @algorithm.update_attribute(:status, step.to_sym) if steps.include?(step)\n render_wizard\n end", "def calculation\n wizard_step(nil) { { next_step: :calculate_next_step, cache_index: LbttController } }\n end", "def step_indices\n @step_indices ||= step_keys.each_with_index.map { |step, index| [step, index] }.to_h\n end", "def step_indices\n @step_indices ||= step_keys.each_with_index.map { |step, index| [step, index] }.to_h\n end", "def to_html\n #FIXME refactor with to_s\n out = ''\n self.metadata.each{|k,v| out << \"<p>\\n<b>#{k}</b>: #{v}\\n</p>\\n\"}\n out << \"--------------------\\n\"\n self.steps.each{|s| out << s.to_html }\n out\n end", "def show\n \n rec_id = params[:id].to_i\n recipe = Recipe.find(rec_id)\n # find user name for recipe\n \n username = recipe.user.username;\n\n # get all ingredients from step ingredients ?\n ingredients = []\n\n recipe_steps = recipe.recipe_steps\n # one to one step ingredients to ingredients when coming from recipe-steps\n \n # recipe ingredients\n \n \n \n step_ingredients = recipe_steps.map{ |rs| \n { \n step_num: rs.step_num,\n step_image: rs.image,\n instruction: rs.instruction,\n step_ingredients: rs.step_ingredients.map{ |si| \n {amount: si.amount, ingredient: {name: si.ingredient.name} }\n } \n \n }\n \n }\n\n \n step_ingredients.each do |si|\n # byebug \n ings = si[:step_ingredients]\n ings.each do |ing|\n if ing[:amount] \n ing_total = ing[:amount] + \" \" + ing[:ingredient][:name] \n if !ingredients.include?(ing_total)\n ingredients.push(ing_total) \n end\n else\n ing_total = ing[:ingredient][:name] \n if !ingredients.include?(ing_total)\n ingredients.push(ing_total) \n end\n end\n end\n end\n \n # fix time to string\n \n render json: {username: username, recipe: recipe, ingredients: ingredients, recipe_steps: step_ingredients }, status: :accepted\n end", "def steps\n @steps ||= parser.parse\n end", "def steps\n %w[first last]\n end", "def initialize\n @steps = {}\n @notes = {}\n end", "def phase_sequence\n hash = {\n :idle => method(:idle_key),\n :victory => method(:victory_key),\n :hurt => method(:hurt_key),\n :skill => method(:skill_key),\n :evade => method(:evade_key),\n :return => method(:return_key),\n :escape => method(:escape_key),\n :prepare => method(:prepare_key),\n :intro => method(:intro_key),\n :counter => method(:counter_key),\n :collapse => method(:collapse_key),\n :forced => method(:forced_act),\n :covered => method(:covered_key),\n }\n return hash\n end", "def each_step_with_path\n return enum_for(:each_step_with_path) if !block_given?\n\n @steps.each do |step|\n yield step, []\n end\n\n @children.each do |key, result|\n result.errors.each_step_with_path do |step, path|\n yield step, [key, *path]\n end\n end\n end", "def key_map\n steps.key_map\n end", "def render\n render_background\n\n render_heat_maps\n\n render_star\n render_target\n render_hills\n render_walls\n\n render_paths\n end", "def set_steps\n invalid_steps = []\n unless @page && @page.content_type\n steps = {pages: %w[position title type],\n names: %w[Position Title Type]}\n self.steps = steps[:pages]\n self.steps_names = steps[:names]\n else\n invalid_steps << 'type' if params[:id] != 'type'\n steps = @page.form_steps\n self.steps = steps[:pages]\n self.steps_names = steps[:names]\n end\n\n invalid_steps << session[:invalid_steps][@page_id] if session[:invalid_steps][@page_id]\n invalid_steps.flatten!\n invalid_steps.uniq!\n set_invalid_steps invalid_steps\n end", "def visit_step(step)\n tc_before_step(step)\n super\n tc_after_step(step)\n end", "def pretty_step step\n step.sub!(\"Given\", \"<div class='spector-keyword'>Given</div>\")\n step.sub!(\"When\", \"<div class='spector-keyword'>When</div>\") \n step.sub!(\"Then\", \"<div class='spector-keyword'>Then</div>\") \n step.sub!(\"And\", \"<div class='spector-keyword'>And</div>\")\n if step.include?(\"#\")\n step = \"<div class='spector-comment'>#{step}</div>\"\n end\n step = step.split(\"\\\"\").in_groups_of(2).map{|a,b| b.nil? ? a : \"#{a}<div class='spector-quote'>\\\"#{b}\\\"</div>\"}.join\n step\n end", "def steps\n Rails.cache.fetch([self, \"pill_sequence_steps\"]) { pill_sequence_steps }\n end", "def hash\n [start_page_number, count_pages_to_render, pages_to_render, page_rotations, default_font_name, default_encoding, detect_encoding, render_comments, render_notes, render_hidden_pages, spreadsheet_options, cad_options, email_options, project_management_options, pdf_document_options, word_processing_options, outlook_options, archive_options, text_options, mail_storage_options, visio_rendering_options, web_document_options, external_resources, resource_path, is_responsive, minify, exclude_fonts, fonts_to_exclude, for_printing, image_height, image_width, image_max_height, image_max_width, render_to_single_page].hash\n end", "def hash\n [device, duration, error_count, step_count_completed, step_count_total].hash\n end", "def process(step)\n step.inputs.each do |key, val|\n @inputs[key] = val unless @inputs.key?(key) || @outputs.key?(key)\n end\n @outputs.merge!(step.outputs)\n end", "def render_steps(aPhrase, rawData = nil)\n use_table = !rawData.nil?\n macro = find_macro(aPhrase, use_table)\n raise(UnknownMacroError, aPhrase) if macro.nil?\n\n # Render the steps\n return macro.expand(aPhrase, rawData)\n end", "def steps\n unless @steps_loaded\n step_file = File.expand_path(\"./steps/#{self.class.name.underscore}.rb\", @@current_dir)\n if File.exists?(step_file)\n self.instance_eval File.read(step_file), __FILE__, __LINE__ + 1\n else\n raise StepsFileNotFoundError.new(\"File #{step_file} not found\")\n end\n @steps_loaded = true\n end\n end", "def new_states_results_hash\n res = parts.each_with_object({}) do |(_part, test_cases), obj|\n test_cases.each do |test_case|\n next unless test_case\n test_case.test_steps.each do |test_step|\n test_step.results.each do |(_machine, value)|\n step_rewrited_name = @step_status_rewrite_callback.call(value)\n obj[step_rewrited_name] ||= 0\n obj[step_rewrited_name] += 1\n end\n end\n end\n end\n return { 'NotSet' => 1 } if res.empty?\n\n res\n end", "def hash\n [@start_transition, @end_transition].hash\n end", "def step_points\n points.select { |point| point.kind == \"Step\" }\n end", "def steps(name, opts = {}, *args, &block)\n opts[:page] && opts[:page] = pages(opts.fetch(:page))\n instance_handler(name, Steps, opts, *args, block)\n end", "def steps\n find_solution\n end", "def form_steps\n self.steps\n end", "def generate_tokens\n {\n title: @title,\n percent_complete: percent_complete,\n progress_bar: progress_bar,\n step: @step,\n steps_remaining: steps_remaining,\n total_steps: @total_steps,\n time_elapsed: format('%0.2fs', time_elapsed),\n time_remaining: @step.positive? ? format('%0.2fs', time_remaining) : '',\n }.merge! @tokens\n end", "def test_steps; end", "def test_steps; end", "def step1\n\n end", "def step1\n \n end", "def steps\n @steps ||= 0\n end", "def index\n \n @steps = @quest.steps\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def render_sections(options = {})\n \n # find render key\n render_key = song_key\n render_key = song_key.transpose(options[:modulation]) if options[:modulation]\n if options[:alt_key]\n if options[:alt_key].class == SongKey\n render_key = options[:alt_key]\n else\n render_key = SongKey.KEY( options[:alt_key] )\n end\n end\n \n # should be rendered fully?\n render_full = options[:full] || false\n \n # should all sections be rendered\n render_all_sections = options[:render_all_sections] || false\n \n # should lyrics be forced?\n force_lyrics = options[:force_Lyrics] || false\n \n expanded_structure = structure.map { |s| Song.structure_interpreter(s) }\n \n sections_so_far = Hash.new\n \n return expanded_structure.map do |sec|\n \n section_fingerprint = { :type => sec[:type],\n :variation => sec[:variation],\n :modulation => sec[:modulation],\n :lyric_variation => sec[:lyric_variation] }\n \n if render_all_sections || !sections_so_far.keys.include?(section_fingerprint)\n \n section = sections.all.select { |s| s.type == sec[:type] }.find { |s| s.variation == sec[:variation] }\n \n raise \"There is no section #{sec[:type]} with variation #{sec[:variation]} in this song.\" unless section\n \n section_tag = sec[:render_section_number] ? \" #{sec[:lyric_variation]}\" : \"\"\n title = \"#{section.title}#{section_tag}\"\n \n section_lines = Array.new\n \n section_lines += section.render_lines( :variation => sec[:lyric_variation],\n :modulation => sec[:modulation],\n :full => render_full,\n :force_lyrics => force_lyrics )\n \n section_data = { :title => title,\n :lines => section_lines,\n :instrumental => section_lines[-1][:instrumental],\n :repeats => sec[:repeat],\n :is_repeat => false }\n \n sections_so_far[section_fingerprint] = section_data\n \n next section_data\n \n else\n \n prev_repeat = sections_so_far[section_fingerprint]\n \n next { :title => prev_repeat[:title],\n :instrumental => prev_repeat[:instrumental],\n :repeats => sec[:repeat],\n :is_repeat => true }\n \n end\n end\n \n end", "def get_dead_steps\n CukeSniffer::DeadStepsHelper::build_dead_steps_hash(@step_definitions)\n end", "def print\n @steps = @experiment.steps\n \n # renders the print template without the normal layout\n render :layout => false;\n end", "def steps(steps)\n @step_lengths = steps.map {|keyword, name| (keyword+name).unpack(\"U*\").length}\n @max_step_length = @step_lengths.max\n @step_index = -1\n end", "def steps(steps)\n @step_lengths = steps.map {|keyword, name| (keyword+name).unpack(\"U*\").length}\n @max_step_length = @step_lengths.max\n @step_index = -1\n end", "def show\n total_visit_hsh = Hash.new(:total_visit)\n total_visit_hsh[:total_visit] = total_visit\n unique_visit_hsh = Hash.new(:unique_visit)\n unique_visit_hsh[:unique_visit] = unique_visit\n [total_visit_hsh,unique_visit_hsh].map do |visiter|\n PrettyOutput.new(visiter.keys.first, visiter.values.first).formatted_result\n end\n end", "def to_json\n # Convert Object to Hash\n hash = self.to_hash\n\n # Grab the Step objects and convert to Hashes\n steps = hash['steps']\n hashified_steps = []\n steps.each {|step| hashified_steps << step.to_hash}\n hash['steps'] = hashified_steps\n\n # Convert Hash to JSON\n hash.to_json\n end", "def renders\n @_renders ||= {}\n end", "def index\n @steps = Step.collated.ordered.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def get_steps(category)\n steps = []\n params.each do |k,v|\n if (k.starts_with? \"step\") && (cat_number(k) == category[1])\n name = v\n num = step_number(k)\n steps << [cat_number(k),num,name]\n end\n end\n return steps\n end", "def build_steps(b)\n if !steps\n b.builders\n else\n b.builders do\n self.steps ||= default_steps(job_type)\n steps.each do |step|\n method, cmd = step\n send(method.to_sym, b, cmd) # e.g. build_shell_step(b, \"bundle install\")\n end\n if fingerprint\n b.tag! \"hudson.plugins.createfingerprint.CreateFingerprint\" do\n b.targets do\n b << fingerprint\n end\n end\n end\n end\n end\n end", "def render_hashes(tags, **opts)\n meta_tags.meta_tags.each_key do |property|\n render_hash(tags, property, **opts)\n end\n end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json2 do |output|\n output.gsub!(\"threed\",\"3d\")\n %w(font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def render_calls; end", "def opinion_wizard_current_step_of(step)\n current_step_num = opinion_wizard_step_number(step)\n see_steps = content_tag(:span, class: \"hide-for-large\") do\n concat \" (\"\n concat content_tag :a, t(:\"decidim.opinions.opinions.wizard_steps.see_steps\"), \"data-toggle\": \"steps\"\n concat \")\"\n end\n content_tag :span, class: \"text-small\" do\n concat t(:\"decidim.opinions.opinions.wizard_steps.step_of\", current_step_num: current_step_num, total_steps: total_steps)\n concat see_steps\n end\n end", "def output_hash; end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json do |output|\n output.gsub!(\"threed\",\"3d\")\n output.gsub!(\"default_dot_style\",\"dot_style\")\n %w(solid_dot font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click dot_style hollow_dot).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def index\n @steps = Step.all\n end", "def render_for_debug\n report_state_hash = YAML.load(self.view_state)\n\n <<-EOS\n <h3>search_fields</h3>\n #{report_state_hash[:search_fields].inspect}\n <hr />\n <h3>full_parameter_query</h3>\n #{report_state_hash[:full_parameter_query].inspect}\n <hr />\n <h3>parameter_fields_values</h3>\n #{report_state_hash[:parameter_fields_values].inspect}\n <hr />\n <h3>search_engine_or_values</h3>\n #{report_state_hash[:search_engine_or_values].inspect}\n <hr />\n <h3>search_engine_limit</h3>\n #{report_state_hash[:search_engine_limit].inspect}\n <hr />\n <h3>functions</h3>\n #{report_state_hash[:functions].inspect}\n <hr />\n <h3>search_engine_group_by_columns</h3>\n #{report_state_hash[:search_engine_group_by_columns].inspect}\n <hr />\n <h3>search_engine_order_by_columns</h3>\n #{report_state_hash[:search_engine_order_by_columns].inspect}\n <hr />\n <h3>main_table_name</h3>\n #{report_state_hash[:main_table_name].inspect}\n <hr />\n <h3>table_name</h3>\n #{report_state_hash[:table_name].inspect}\n <hr />\n <h3>report_name</h3>\n #{report_state_hash[:report_name].inspect}\n <hr />\n <h3>operator_signs</h3>\n #{report_state_hash[:operator_signs].inspect}\n <hr />\n <h3>columns_list</h3>\n #{report_state_hash[:columns_list].inspect}\n <hr />\n EOS\n end", "def show\n\t#@step = user_information\n end", "def process_steps\n result = nil\n steps.map(&:to_s).each do |step_name|\n result = process_step(step_name)\n return result if @success == false || stop == true\n end\n result\n end", "def build_pages( page_name )\n vars = {}\n paths = page_name.split( '/' )\n loop do\n try_page = paths.join( '_' ).gsub('-','_')\n if respond_to? \"skel_#{ try_page }\"\n section_path = File.dirname( page_name )\n path_storage = storage.path_storage( section_path )\n method( \"skel_#{ try_page }\" ).call( path_storage, section_path ) do |vars|\n vars[:weblog] = self\n raise TypeError, \"No `page' variable returned from skel_#{ try_page }.\" unless vars[:page]\n yield vars\n end\n return\n end\n break unless paths.slice!( -2 ) ## go up a directory\n end\n vars[:weblog] = self\n vars[:page] = Page.new( page_name )\n vars[:page].timestamp = Time.now\n yield vars\n end", "def hash\n\t\t(language + type + klass + thing).hash\n\tend", "def test_case_data(test_case)\n steps_as_string = test_case.test_steps.map{|step| step.source.last}\n .select{|step| step.is_a?(Cucumber::Core::Ast::Step)}\n .reject{|step| step.is_a?(Cucumber::Hooks::BeforeHook)}.map do | g_step |\n str = g_step.send(:keyword)+g_step.send(:name)\n str += g_step.multiline_arg.raw.map{|l|\"\\n| #{l.join(' | ')} |\"}.join if g_step.multiline_arg.data_table?\n str\n end.join(\"\\n\")\n {'title'=>extract_title(test_case),\n 'type_id'=>type_id(test_case),\n 'custom_steps'=>steps_as_string,\n 'refs'=>refs(test_case)\n }\n end", "def get_step_plugins\n plugin_step_list = {}\n\n # get the full plugin list\n plugin_list = get_general_plugins + get_applicable_plugins\n\n plugin_list.each {|plugin|\n plugin_config = PluginManager.get_plugin_config(plugin)\n plugin_config['stages'].each {|stage|\n plugin_step_list[stage] = [] unless plugin_step_list.has_key?(stage)\n plugin_step_list[stage] << plugin }\n }\n end", "def create\n @step = Step.new(step_params) \n\n if @step.save\n render :show, status: :created, location: @step\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def each\n yield render\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = @script.steps.build\n end", "def step_two()\r\nend", "def render_form_section(step_number)\n render :partial => form_section_partial(step_number)\n end", "def rendered; end", "def children\n steps\n end", "def rendered_templates; end", "def get_step_content(step, current_editor_value, current_output_value)\n return nil if !@loaded || step < 1 || [email protected]_key?(step)\n @items[@step].update_current_edit(current_editor_value, current_output_value) if @step > 0\n @step = step\n @current_item = @items[step]\n return @current_item\n end", "def steps\n %w[/14/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/educations\n /12/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /13/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_scores\n /41/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /42/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /15/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/work/characteristics/index\n /29/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_immunization/show\n /ASSESSMENT/disability/characteristics/index\n /ASSESSMENT/mental/characteristics/index\n /35/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/substance_abuse/characteristics/index\n /32/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/domestic/characteristics/index\n /38/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /39/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/clients/medical_pregnancy/show\n /19/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /21/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /22/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /23/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /24/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /25/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /26/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /2/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/employments\n /ASSESSMENT/legal/characteristics/index\n /7/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /assessment_careers/interest_profiler_questions/interest_profiler_question_wizard_initialize\n ]\n\n end", "def index\n @steps = @guide.steps\n end", "def render\n @case = Case.find(self.case_id)\n @page_path = Page.find(self.page_id).path\n end", "def index\n @goal_steps = GoalStep.all\n end", "def account_for\n wizard_step(STEPS) { { setup_step: :setup_step, next_step: :account_for_next_step } }\n end", "def call(result)\n STEPS_IN_ORDER.each do |name|\n before_steps[name]&.each { |step| process_step(step, result) }\n process_step(steps[name], result)\n after_steps[name]&.each { |step| process_step(step, result) }\n end\n result\n end", "def puts_report(step)\n puts \"STEP #{step}\"\n puts \"CONCEPTS: \"\n puts @concepts_list\n puts \"PROPERTIES: \"\n @properties_list.each do |p_name, p_type|\n puts \"#{p_name} --> #{p_type}\"\n end\n puts \"\\n\"\n end", "def show\n @steptwos = Steptwo.where(stepone_id: @stepone.id)\n render_dummy\n end", "def render\n render_background\n # render_heat_map\n render_walls\n # render_path\n # render_labels\n render_arrows\n render_star\n render_target\n unless grid.walls.has_key?(grid.target)\n render_trail\n end\n end", "def hash_tags\n tags = \"\"\n object.data_types.each do |d|\n name = d.name\n tags = tags + h.content_tag( :span, '#' + name, class: 'scenario-tag data-type')\n end\n object.visualization_types.each do |d|\n name = d.name\n tags = tags + h.content_tag( :span, '#' + name, class: 'scenario-tag vis-type')\n end\n object.visualization_tasks.each do |d|\n name = d.name\n tags = tags + h.content_tag( :span, '#' + name, class: 'scenario-tag task')\n end\n return tags.html_safe\n end" ]
[ "0.639915", "0.6030999", "0.5954047", "0.59138244", "0.5865732", "0.5861129", "0.58035946", "0.57344097", "0.5700654", "0.568578", "0.5684771", "0.561813", "0.5599878", "0.5590496", "0.5588678", "0.5579954", "0.55239284", "0.55152494", "0.54987663", "0.54930204", "0.54833716", "0.5480858", "0.5480858", "0.54665166", "0.54649204", "0.54589605", "0.54553986", "0.545386", "0.5441088", "0.5433465", "0.54282886", "0.5409177", "0.5392971", "0.5390601", "0.53534764", "0.5343766", "0.53244996", "0.5317816", "0.5298267", "0.5264887", "0.5260666", "0.52546304", "0.5248263", "0.5244846", "0.52364093", "0.52161604", "0.5205821", "0.51986265", "0.5191244", "0.5191244", "0.5190977", "0.51517296", "0.5133957", "0.5133887", "0.5129467", "0.51289344", "0.51245177", "0.51201594", "0.51201594", "0.5114369", "0.5089781", "0.5086748", "0.5083251", "0.5081843", "0.50794595", "0.50575936", "0.5048348", "0.50379753", "0.5028181", "0.502375", "0.50235873", "0.5017396", "0.5017342", "0.50147146", "0.50068176", "0.50066286", "0.49913585", "0.49828717", "0.4980615", "0.4963591", "0.49567398", "0.49562567", "0.49562567", "0.49562567", "0.49547336", "0.49380141", "0.49345118", "0.49315077", "0.49281707", "0.49203306", "0.4918078", "0.49156457", "0.49134323", "0.49134305", "0.49121535", "0.49108842", "0.49093258", "0.4902458", "0.48996773", "0.48946822", "0.48935154" ]
0.0
-1
constuctor called on item must set item to valid disabled state
def add_with_id item id = @id_gen.gen #here we automatically mix in the IdManaged protocol item.extend IdManaged item.id_manager = self item.pool_id =id @arr << item end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_item(index)\n draw_item(index, disabled_color)\n end", "def disabled; end", "def disabled?; end", "def disabled?; end", "def invalid_items\n @items.select { |item| item.valid == false }\n end", "def initialize(item_description)\n @description = item_description\n @completed = false\n end", "def initialize(params = {})\n super\n self.is_valid = true\n end", "def test_disabled\n base = RoBaseIf.new( 'lab1', '' )\n assert_equal false, base.disabled\n base.disabled = true\n assert_equal true, base.disabled\n end", "def disable(item)\n run(\"no #{ item }\")\n end", "def disabled=(_arg0); end", "def enable?(item); true; end", "def invalid_item(node)\n false\n end", "def initialize(window, item, rect, itemNumberPattern, spacing=8,\n active=true, visible=true)\n super(active, visible)\n @item = item\n \n # Determine rectangles to position controls\n rects = determine_rects(rect, spacing)\n \n @ucIcon = UCIcon.new(window, rects[0], item.icon_index)\n @ucIcon.active = active\n @ucIcon.visible = visible\n\n @cItemName = CLabel.new(window, rects[1], item.name)\n @cItemName.active = active\n @cItemName.visible = visible\n @cItemName.cut_overflow = true\n\n @cItemPrice = CLabel.new(window, rects[2], item.price)\n @cItemPrice.active = active\n @cItemPrice.visible = visible\n\n @cItemPossess = CLabel.new(window, rects[3], $game_party.item_number(item))\n @cItemPossess.active = active\n @cItemPossess.visible = visible\n\n @ucItemNumber = UCNumericUpDown.new(window, rects[4], 0, itemNumberPattern)\n @ucItemNumber.active = active\n @ucItemNumber.visible = visible\n end", "def disabled!\n self\n end", "def enabled_state\n super\n end", "def enabled_state\n super\n end", "def enabled_state\n super\n end", "def enabled_state\n super\n end", "def enabled_state\n super\n end", "def enabled_state\n super\n end", "def initialize(title,deadline,description)\n if Item.valid_date?(deadline)\n @deadline = deadline\n else\n raise \"error\"\n end\n @title = title\n @description = description\n @done = false\n end", "def item_effect_setup\r\n self.critical = false\r\n end", "def initialize()\n @active = false\n end", "def validate_item( x )\n fail 'not implemented!'\n end", "def set_sellable_item_state(state_result)\n if !state_result[:inventory_item].nil?\n if (state_result[:inventory_item].quantity > state_result[:inventory_item].item.quantity_threshold)\n state_result[:inventory_item].update(id: state_result[:inventory_item].id, inventory_item_state: InventoryItemState.find_by(name: \"Available\"))\n elsif (state_result[:inventory_item].quantity == 0)\n state_result[:inventory_item].update(id: state_result[:inventory_item].id, inventory_item_state: InventoryItemState.find_by(name: \"Out_of_Stock\"), inventory_item_condition: InventoryItemCondition.find_by(name: \"Not_Sellable\"))\n else\n state_result[:inventory_item].update(id: state_result[:inventory_item].id, inventory_item_state: InventoryItemState.find_by(name: \"CriticaL_Level\"))\n end\n end\n end", "def disabled(&_block)\n @disabled = true\n yield\n ensure\n @disabled = false\n end", "def initialize(rubric_item_id)\n @rubric_item_id = rubric_item_id\n @is_visible = true\n end", "def add_item_command(disabled)\n add_command(Vocab::item, :item) unless GTBS::HIDE_INACTIVE_COMMANDS && @actor.perf_action\n end", "def enable?(item)\n true\n end", "def enable?(item)\n true\n end", "def initialize pristine = false, &proc\n @parent = nil\n @pristine = pristine\n @opted_items = Array.new\n self.instance_exec(&proc) if proc\n end", "def current_item_enabled?\n true\n end", "def initialize(title,deadline,description)\n @title = title\n if Item.valid_date?(deadline)\n @deadline = deadline\n else\n raise \"error\"\n end\n @description = description\n @done = false\n end", "def setInvalid()\n\t\t@isValid = false\n\tend", "def initialize(item_list)\n\t\t@item_list = item_list\n\tend", "def member_enabled_state(opts)\n opts = check_params(opts,[:slot_ids])\n super(opts)\n end", "def initialize(item_info)\n super(item_info, CLASS_MASKS)\n\n # Get the colour of paint\n if item_info[:name][/^Paint Can/] then\n col_attr = item_info[:attributes].detect { |a| a[:class] == 'set_item_tint_rgb' }\n if (col_attr) then\n col_int = col_attr[:value]\n self[:paint_col] = \"#%06x\" % col_int;\n end\n end\n end", "def enable?(item)\n item && item.price > 0\n end", "def enable?(item)\n end", "def disabled\n @attributes[:disabled]\n end", "def valid_attributes\r\n {\r\n :item_id => 2,\r\n :seller_id => 1,\r\n :bid_amount => 100,\r\n :highest_bidder => 2,\r\n :state => 1,\r\n :end_time => Time.now\r\n }\r\n end", "def initialize(item_description)\n @description = item_description\n @completed_status = false\n @due_date = Time.new(2016, 5, 31)\n end", "def initialize()\n @items = nil\n end", "def member_licensed_state(opts)\n opts = check_params(opts,[:slot_ids])\n super(opts)\n end", "def initialize(attribute, modifier, temporary=true)\n @attribute, @modifier, @temporary = attribute, modifier, temporary\n @active = false\n end", "def initialize(window, item, rect, spacing=8,\n active=true, visible=true)\n super(active, visible)\n @item = item\n \n # Determine rectangles to position controls\n rects = determine_rects(rect, spacing)\n \n @ucIcon = UCIcon.new(window, rects[0], item.icon_index)\n @ucIcon.active = active\n @ucIcon.visible = visible\n \n @cItemName = CLabel.new(window, rects[1], item.name)\n @cItemName.active = active\n @cItemName.visible = visible\n @cItemName.cut_overflow = true\n \n @cItemNumber = CLabel.new(window, rects[2], \n sprintf(MENU_CONFIG::ITEM_NUMBER_PATTERN, \n $game_party.item_number(item)), 2)\n @cItemNumber.active = active\n @cItemNumber.visible = visible\n end", "def failsafe_state\n super\n end", "def initialize\r\n self.items = []\r\n end", "def initialize(guard, items = EMPTY_HASH)\n super(guard, items.dup)\n end", "def ensure_editable; return false unless editable? end", "def []=(idx, item)\n begin\n item = self.class.validate item\n super\n rescue DontInsertException; end\n end", "def enable(item)\n run(item)\n end", "def enable?(item)\n return true\n end", "def enable?(item)\n return true\n end", "def initialize(*args)\n super\n self.items ||= []\n end", "def test_still_protected\n b = ProtectedListMixin.new\n b.update_attributes({:active => false})\n assert_equal true, b.active\n end", "def enable?(item)\n item.enabled?\n end", "def enable?(item)\n item.enabled?\n end", "def new_item\n pause(item_delay) if item_delay\n self[:index] = nil\n self[:value] = nil\n end", "def initialize(ews_item, opts={})\n super(ews_item, opts)\n end", "def initialize(ews_item, opts={})\n super(ews_item, opts)\n end", "def initialize(ews_item, opts={})\n super(ews_item, opts)\n end", "def set_member_enabled_state(opts)\n opts = check_params(opts,[:slot_ids,:member_states])\n super(opts)\n end", "def initialize(item, vi_client=nil)\n @net_rollback = []\n @locking = true\n @item = item\n @vi_client = vi_client\n end", "def initialize\n @items = []\n end", "def current_item_enabled?\n return true\n end", "def test_still_unprotected_mixin\n b = UnProtectedListMixin.new\n b.assign_attributes({:active => false})\n # p UnProtectedListMixin.accessible_attributes.length\n assert_equal false, b.active\n end", "def initialize\r\n self.status = 'inactive'\r\n end", "def enable?(item)\n return false if item.nil?\n return true\n end", "def enable?(item)\n return false if item.nil?\n return true\n end", "def valid?\r\n (forcing && item) || subject.usable?(item)\r\n end", "def disabled=(value)\n super\n if disabled\n self[:_tabindex] = self[:tabindex] if self[:tabindex]\n remove_attribute :tabindex\n self[:disabled] = ''\n else\n self[:tabindex] = self[:_tabindex] if self[:_tabindex]\n remove_attribute :_tabindex\n remove_attribute :disabled\n end\n end", "def initialize\n @items = []\n end", "def initialize\n @configuring = false\n @validating = false\n end", "def disable\n @disabled = true\n end", "def initialize(item, quantity)\n @item = item\n @quantity = quantity\n end", "def set_item\n super\n raise \"403\" unless @item.allowed?(:read, @cur_user, site: @cur_site)\n end", "def initialize(item, password)\n @item = item\n @password = password\n end", "def create(opts)\n opts = check_params(opts,[:items])\n super(opts)\n end", "def disabled_all?; end", "def initialize()\n\t begin\n\t @items = Item.find_with_conditions(nil)\n\t\trescue Exception => e\n\t\t model_exception(e)\n\t\tend\n\t\t@copies = nil\n end", "def offer_an_item(item)\r\n item.status = true\r\n end", "def initialize(item, redis_pool = nil)\n super(item, redis_pool)\n @queue = item[QUEUE]\n @lock_digest = item[LOCK_DIGEST]\n end", "def format_select\n @attr[:disabled] = :disabled\n super\n end", "def test_invalid_when_updating_dropdead_on_in_past_with_past_dropdead_on\n @item = items(:overdue_unfinished_item)\n @item.dropdead_on = 1.days.ago.to_date\n assert [email protected]?\n assert @item.errors.on(:dropdead_on)\n end", "def initialize(user, item_id)\r\n @user = user\r\n @item = item_id\r\n end", "def initialize(items=[])\n if items.nil?\n raise IllegalArgument.new\n else\n @items = []\n \n items.each do |item|\n @items << Item.new(item)\n end\n \n end\n end", "def set_status_to_available_if_nil\n self.status_constant = SupplyItem::AVAILABLE if self.status_constant == nil\n end", "def state_no_items\n\t\t\trefresh_buttons\n\t\t\[email protected](1)\n\t\tend", "def initialize\n @check_model = nil\n @use_airbrake = false\n end", "def drop_item; self['DropItem'] = 1 end", "def initialize n, *item_options\n\n if n.nil? || n.to_s.strip.empty? then \n raise StHtml::Ruing::Exception, \\\n 'Item name must be a not empty string or symbol.' \n end\n\n @name = n \n @options = { :force => {} }.merge( extract_va_options( item_options ) )\n @client_attributes = { }\n\n @value = if @options[:value]\n @options.delete(:value) \n else\n nil\n end\n end", "def initialize(attributes = nil, options = {})\n super\n update_data[:state] = 'ON'\n end", "def _always_valid!\n @always_valid = true\n self\n end", "def validate_items\n not(empty_item_list? or has_invalid_items? ||\n has_different_point_values?) ? true : false\n end", "def disabled?\n false\n end", "def item_holding_initialize(opts)\n # Get item_id list & comparable % list\n items = data.items\n item_id_array = items.select.with_index { |_, index| index.even? }\n item_percent_array = items.select.with_index { |_, index| index.odd? }.reduce([]) do |memo, value|\n memo << memo[-1].to_i + value\n end\n # Take the item according to the rng (% in item_percent_array should be higher than the rng val)\n rng = rand(100)\n @item_holding = item_id_array[item_percent_array.find_index { |value| value > rng } || 101]\n @item_holding = GameData::Item[opts[:item] || @item_holding.to_i].id\n end", "def initialize array_of_items\n\tend", "def initialize(atts = nil, &block)\n super(status: :pending) # Initialize with status pending\n\n return self unless atts.present?\n\n if atts.kind_of?(Hash)\n items = Array(atts[:item]) + Array(atts[:items])\n\n self.user = atts[:user] || items.first.try(:user)\n\n if (address = atts[:billing_address]).present?\n self.billing_address = address\n self.billing_address.full_name ||= user.to_s.presence\n end\n\n if (address = atts[:shipping_address]).present?\n self.shipping_address = address\n self.shipping_address.full_name ||= user.to_s.presence\n end\n\n atts.except(:item, :items, :user, :billing_address, :shipping_address).each do |key, value|\n self.send(\"#{key}=\", value)\n end\n\n add(items) if items.present?\n else # Attributes are not a Hash\n self.user = atts.user if atts.respond_to?(:user)\n add(atts)\n end\n\n self\n end", "def initialize(quantity, desc, price, category)\n @quantity = quantity\n @desc = desc\n @price = price\n @category = category\n\n if desc.include?(\"imported\")\n @imported = true\n else\n @imported = false\n end\n end", "def initialize\n super\n @dropdown.on :mousedown, &:prevent_default\n\n self.searchable = true\n @input.on(:focus) do\n self[:focused] = ''\n show_items\n empty_input\n end\n @input.on(:blur) do\n remove_attribute :focused\n update_input\n end\n end" ]
[ "0.59228885", "0.59176385", "0.59083134", "0.59083134", "0.58846754", "0.5801658", "0.57933956", "0.57691705", "0.573534", "0.5732904", "0.5725638", "0.57125163", "0.5692871", "0.5684329", "0.5679834", "0.5679834", "0.5679834", "0.5679834", "0.5679834", "0.5679834", "0.5658695", "0.56464225", "0.5594814", "0.55923104", "0.5568752", "0.554532", "0.5544001", "0.5514307", "0.5498839", "0.5498839", "0.5478234", "0.5477553", "0.54723585", "0.5459589", "0.5452443", "0.54267824", "0.5412181", "0.5402084", "0.5394678", "0.5379144", "0.53721786", "0.5371788", "0.5370685", "0.53694147", "0.5363594", "0.5361859", "0.5357011", "0.5352708", "0.5349298", "0.53303444", "0.53240436", "0.5311063", "0.5310416", "0.5310416", "0.5294339", "0.5280021", "0.52719134", "0.52719134", "0.5261594", "0.52594286", "0.52594286", "0.52594286", "0.52582604", "0.5257968", "0.524079", "0.5240289", "0.5236754", "0.5236747", "0.5229501", "0.52292395", "0.5211345", "0.5209232", "0.52082974", "0.5203169", "0.5201385", "0.51928574", "0.5188668", "0.5185608", "0.5185588", "0.518514", "0.5183724", "0.5180363", "0.51636285", "0.51613766", "0.5159227", "0.5156663", "0.51544505", "0.5145079", "0.5139257", "0.5135655", "0.51277256", "0.5126147", "0.51246655", "0.5122996", "0.51182556", "0.5118045", "0.51139706", "0.51118904", "0.5108316", "0.5100892", "0.50983304" ]
0.0
-1
this returns valid disabled item
def next_free #need to increment before returning value, because returning exits function sizeup if @next_free >= @max @next_free+=1 # puts "item #{arr[@next_free-1].pool_id} allocated" return @arr[@next_free-1] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def invalid_items\n @items.select { |item| item.valid == false }\n end", "def disabled\n @attributes[:disabled]\n end", "def enable?(item); true; end", "def current_item_enabled?\n return !@data[index].nil?\n end", "def enable?(item)\n true\n end", "def enable?(item)\n true\n end", "def current_item_enabled?\n true#enable?(@data[index])\n end", "def current_item_enabled?\n true\n end", "def enable?(item)\n return true\n end", "def enable?(item)\n return true\n end", "def current_item_enabled?\n current_data ? current_data[:enabled] : false\n end", "def current_item_enabled?\r\n current_data ? current_data[:enabled] : false\r\n end", "def invalid_item(node)\n false\n end", "def enable?(item)\n end", "def current_item_enabled?\n enable?(@data[index])\n end", "def current_item_enabled?\n enable?(@data[index])\n end", "def current_item_enabled?\n enable?(@data[index])\n end", "def current_item_enabled?\n enable?(@data[index])\n end", "def current_item_enabled?\n enable?(@data[index])\n end", "def current_item_enabled?\n enable?(@data[index])\n end", "def enable?(item)\n item.enabled?\n end", "def enable?(item)\n item.enabled?\n end", "def current_item_enabled?\n return true\n end", "def disabled?; end", "def disabled?; end", "def disabled?\n @disabled\n end", "def disabled?\n false\n end", "def enable?(item)\n return false if item.nil?\n return true\n end", "def enable?(item)\n return false if item.nil?\n return true\n end", "def disabled?\n @disabled == true\n end", "def current_item_enabled?\n enabled?(index)\n end", "def current_item_enabled?\n enable?(@data[@index])\n end", "def current_item_enabled?\r\n enable?(index)\r\n end", "def enable?(item)\n return (item.price > 0)\n end", "def disable_item(index)\n draw_item(index, disabled_color)\n end", "def extra_item?\n false\n end", "def disabled\n `#{@el}.disabled`\n end", "def enable?(item)\n return false if item.nil?\n return false if $game_party.gold < item.dismantle_gold_fee \n return item.dismantlable?\n end", "def disabled?\n state == :DISABLED\n end", "def current_item_enabled?\n enable?(@index)\n end", "def enable?(item)\n item && item.price > 0\n end", "def exclusive\n @attributes[:exclusive]\n end", "def disabled?\n !enabled?\n end", "def disabled?\n !enabled?\n end", "def disabled?\n select.disabled?\n end", "def disabled; end", "def validate_items\n not(empty_item_list? or has_invalid_items? ||\n has_different_point_values?) ? true : false\n end", "def invalid_items\n items.select { |item| item.errors.present? }\n end", "def disable(item)\n run(\"no #{ item }\")\n end", "def disabled?\n status == 'disabled'\n end", "def invalid\n @invalid\n end", "def get_disabled_alternatives(d)\n return d.get_disabled_alternatives\n end", "def current_item_enabled?() target end", "def disabled_by_microsoft_status\n return @disabled_by_microsoft_status\n end", "def valid?\r\n (forcing && item) || subject.usable?(item)\r\n end", "def list_items_inactive\r\n return_list = Array.new\r\n for s in self.item_list\r\n if !s.is_active?\r\n return_list.push(s)\r\n end\r\n end\r\n return return_list\r\n end", "def list_items_inactive\r\n return_list = Array.new\r\n for s in self.item_list\r\n if !s.is_active?\r\n return_list.push(s)\r\n end\r\n end\r\n return return_list\r\n end", "def disabled?(thing)\n !enabled?(thing)\n end", "def disabled?\n\n return ! @enabled\n \n end", "def get_valid_items\n list = []\n @items.each do |id, number|\n item = $data_items[id]\n list << item if item.for_friend? || item.for_opponent?\n end\n return list\n end", "def disabled?\n \n return ! @enabled\n \n end", "def disabled?\n \n return ! @enabled\n\n end", "def dismantlable?\n return false unless self.is_a?(RPG::Item) || self.is_a?(RPG::EquipItem)\n return true unless @dismantle_items.empty?\n return false\n end", "def disabled?\n native.has_attribute?('disabled') &&\n %w[button input select textarea optgroup option menuitem fieldset].include?(tag_name)\n end", "def disabled_all?; end", "def items_to_check\n User.not_admins\n end", "def bypass_inactive_disable\n @attributes[:bypass_inactive_disable]\n end", "def enable?(item)\n if item.is_a?(RPG::Item)\n return true if !item.key_item?\n elsif item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)\n return true\n else\n return false\n end\n end", "def enable?(item)\n return false if item.nil?\n return false unless has_recipebook?\n return false if item.tocrafting_gold_fee > $game_party.gold\n return false if $game_party.item_max?(item)\n return false unless have_tools?(item)\n return false unless have_actors?(item)\n return true if item.ingredient_list.empty?\n return have_ingredients?(item)\n end", "def sellable_items\n all_items.select { |item| item.traddable? }\n end", "def get_invalids\n\t\treturn @invalids\n\tend", "def error_on_disabled?\n false\n end", "def is_disabled(user)\n\t\tflag = AssignmentFlag.find_by_assignment_id_and_user_id(self.id, user.id)\n\t\tif(flag.blank?)\n\t\t\treturn self.disabled\n\t\telse\n\t\t\treturn flag.disabled\n\t\tend\n\tend", "def check_item_condition?\n # disallow usage if item button disabled\n return false if !$game_system.item_button\n # disallow usage\n item_condition = false\n # if using direct hotkeys\n if BlizzABS::Config::DIRECT_HOTKEYS\n # check direct hotkeys\n item_condition = self.item_hotkeys?\n # if item button pressed\n elsif Input.trigger?(Input::Item)\n # allow usage\n item_condition = true\n end\n # return result\n return item_condition\n end", "def disabled!\n self\n end", "def enable?(item)\n CookingManager.quantity(item) > 0\n end", "def all_disabled?\n @all_disabled\n end", "def disabled?\n state.zero?\n end", "def disabled?\n @anchor.disabled? || [email protected]['disabled']\n end", "def has_invalid_items?\n unless @offer[:items].empty? || @offer[:items].select { |item_name|\n !Inventory.items_and_values.include?(item_name)}.empty?\n add_error(:offer, :items, \"There is an invalid item in the list\")\n error = true\n end\n unless @for[:items].empty? || @for[:items].select { |item_name|\n !Inventory.items_and_values.include?(item_name)}.empty?\n add_error(:for, :items, \"There is an invalid item in the list\")\n error = true\n end\n\n error ||= false\n end", "def is_disabled(user)\n\t\tflag = AssignmentTypeFlag.find_by_assignment_type_id_and_user_id(self.id, user.id)\n\t\t\n\t\t# check for flag\n\t\tif flag.blank?\n\t\t\t# use assignment type disabled\n\t\t\treturn self.disabled \n\t\telse\n\t\t\t# use flag disabled\n\t\t\treturn flag.disabled\n\t\tend\n\tend", "def enable?(item)\n true#$game_party.usable?(item)\n end", "def validate_item( x )\n fail 'not implemented!'\n end", "def prohibited?(key)\n @status[key] == :prohibited\n end", "def invalid\n\t\tself.validate unless self.validated?\n\t\treturn @invalid\n\tend", "def invalid?\r\n return @invalid\r\n end", "def unique_disabled?\n !unique_enabled?\n end", "def i_books_store_blocked\n return @i_books_store_blocked\n end", "def disabled_tx?; @disabled_tx > 0 end", "def enable_disable_inventory?\n active? && !delivered? && !is_draft?\n end", "def disabled(competition)\n return \"disabled\" if competition.hcp_adjusted\n end", "def invalid?\n return @invalid\n end", "def disabled(&_block)\n @disabled = true\n yield\n ensure\n @disabled = false\n end", "def enabled\n @attributes[:enabled]\n end", "def disabled(expr)\n return expr ? ' disabled=\"disabled\"' : ''\n end", "def item_usable?\r\n user.usable?(item) && item_effects_valid?\r\n end", "def item_choice?\r\n @item_choice_variable_id > 0\r\n end", "def cannot_edit(_offer)\n !session[:is_administrator] && _offer.unbilled_balance <= 0\n end", "def disable\n @disabled = true\n end", "def disabled=(value)\n `#{@el}.disabled = #{value}`\n end", "def disabled?\n self.disabled = !site.incremental? if disabled.nil?\n disabled\n end" ]
[ "0.7152933", "0.6904475", "0.6467445", "0.6383143", "0.6382674", "0.6382674", "0.6263258", "0.62595016", "0.62431616", "0.62431616", "0.62196296", "0.62161297", "0.62089", "0.6206224", "0.6205927", "0.6205927", "0.6205927", "0.6205927", "0.6205927", "0.6205927", "0.62040395", "0.62040395", "0.62009984", "0.6192161", "0.6192161", "0.6171844", "0.61245596", "0.60991454", "0.6098907", "0.60870653", "0.60838026", "0.60789394", "0.6057346", "0.5991008", "0.5979056", "0.59558207", "0.5941141", "0.5935594", "0.5927141", "0.592341", "0.591386", "0.58934027", "0.58877736", "0.5843896", "0.58387846", "0.58175325", "0.58036786", "0.57829803", "0.5775717", "0.5773077", "0.5768894", "0.57606566", "0.57547456", "0.57522506", "0.5740521", "0.5723342", "0.5723342", "0.5710345", "0.5707607", "0.5706281", "0.57027006", "0.56848466", "0.56747335", "0.56428605", "0.56420124", "0.56206423", "0.5600132", "0.559789", "0.55745447", "0.5542994", "0.5539757", "0.5523817", "0.5511072", "0.55004793", "0.5485606", "0.54744154", "0.54715145", "0.546722", "0.54551154", "0.5442766", "0.54248524", "0.54187053", "0.54048085", "0.5383008", "0.5372287", "0.5366461", "0.5348842", "0.53433067", "0.53314084", "0.53263426", "0.5325138", "0.53251266", "0.5319827", "0.5319662", "0.53113306", "0.53107244", "0.52779317", "0.52700394", "0.52626127", "0.5258925", "0.52529794" ]
0.0
-1
have we requested the approval for the venue?
def approval_requested? !([STATE_UNKNOWN, STATE_BLOCK_REQUESTED, STATE_BLOCKED, STATE_UNAVAILABLE, STATE_CANCELLED, STATE_EXPIRED, STATE_AVAILABLE_EXPIRED].include?(self.state)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approved?\n !self.pending\n end", "def approved?\n (status == APPROVED)\n end", "def check_if_approval_is_required\n !offer_request.blank?\n end", "def approved?\n !pending\n end", "def approved?\n !approved_on.nil?\n end", "def approved?\n status == STATUS_APPROVED\n end", "def awaiting_financial_aid_approval?\n dean_approved? && !financial_aid_approved?\n end", "def is_approved?\n self.approved == 'approved'\n end", "def approved?\n approval_state.present? ? approval_state == 'approved' : approval.try(:approved?)\n end", "def is_approval_request\n return @is_approval_request\n end", "def approved?\n closed? && has_met_requirement?\n end", "def approved?\n if order_status == 'approved'\n return true\n else\n return false\n end\n end", "def approved?\n !([STATE_UNKNOWN, STATE_BLOCK_REQUESTED, STATE_BLOCKED, STATE_APPROVAL_REQUESTED, STATE_UNAVAILABLE, STATE_CANCELLED, STATE_EXPIRED, STATE_AVAILABLE_EXPIRED].include?(self.state))\n end", "def approved?\n state == 'approved'\n end", "def approved?\n status_map = employee_vacation_responses.map(&:status).uniq\n status_map.size == 1 && status_map.include?(\"approved\")\n end", "def ready_to_approve?\n status = self.units.map(&:unit_status) & ['condition', 'copyright', 'unapproved']\n return status.empty?\n end", "def successful\n\t\t\t\tself.refunded == \"Approved\"\n\t\t\tend", "def approvable?\n (!current_stage.nil? &&\n current_stage.stage.eql?('verify') &&\n current_stage.status.eql?('passed') &&\n !AutomateSoup.url.nil? &&\n !AutomateSoup.credentials.nil? &&\n !links.nil? &&\n !links['approve'].nil? &&\n !links['approve']['href'].nil?)\n end", "def pending?\n !approved? && !not_approved?\n end", "def is_approved?\n level > Membership::LEVELS[:pending]\n end", "def awaiting_dean_approval?\n awarded? && !dean_approved?\n end", "def pending_manager_approval?\n @is_pending_manager_approval\n end", "def request\n if Pending.approved.include? @@item.attach\n 'unapprove'\n elsif Pending.unapproved.include? @@item.attach\n 'approve'\n elsif @@item.approved and @@item.approved.include? User.initials\n 'unapprove'\n else\n 'approve'\n end\n end", "def can_be_approved?\n self.applied?\n end", "def approved\n @req = Request.last\n RequestMailer.approved(@req)\n end", "def financial_aid_approved?\n !financial_aid_approved_at.blank?\n end", "def approved?\n self.is_approved == true \n end", "def check_if_needs_approval\r\n self.suspended_at = Time.now if Setting.user_signup == :needs_approval && !self.admin\r\n end", "def pending?\n approval_state.present? ? approval_state == 'pending' : approval.try(:pending?)\n end", "def awaiting_disbursement?\n financial_aid_approved? && !disbursed?\n end", "def approvable?(obj)\n \tif is_pending?(obj.release_status)\n \t\tif is_section_head?\n \t\t\tif obj.uploader_role == 'Normal' && uploader_from_same_section(obj.uploaded_by_section)\n \t\t\t\ttrue\n \t\t\tend\n \t\telsif is_department_head?\n \t\t\tif obj.uploader_role == 'Sectionhead'\n \t\t\t\ttrue\n \t\t\tend\n \t\tend\n \tend\n end", "def is_approval_required_for_add\n return @is_approval_required_for_add\n end", "def not_approved?\n status_map = employee_vacation_responses.map(&:status).uniq\n status_map.size == 1 && status_map.include?(\"not_approved\")\n end", "def approved?\n [ 'AUTHORISED' ].include? status\n end", "def has_an_approved_account_set?\n all_monetary_processor_accounts.was_verified.any?\n end", "def complete?\n status == \"verified\"\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 claimable?\n # can this invite be confirmed!\n ( pending? or declined? ) and !roster.full?\n end", "def is_approval_required_for_update\n return @is_approval_required_for_update\n end", "def any_approved_loans?\n Applicant.where(email: @email, recommendation: Applicant::recommendations[:approve]).exists?\n end", "def responded_with_availability?\n !interview_availabilities.empty?\n end", "def approval_status\n if object.approval\n \"Zaakceptowane\"\n elsif object.approval == nil\n \"Oczekujące\"\n else\n \"Odrzucone\"\n end\n end", "def approved?\n (status == ConfigCenter::User::APPROVED)\n end", "def approval_status\n self.approved? ? 'Approved ' : 'Pending '\n end", "def can_approve?(target)\n is_staff? && target && target.active? && !target.approved?\n end", "def requested?\n !invited?\n end", "def is_pending?\n return self.status == Erp::Reservations::Reservation::STATUS_PENDING\n end", "def approved?\n return @approved unless @approved.nil?\n\n approving_users = self.approvals.map { |a| a.approved_by }\n\n unsatisfied = owners_contents.select do |owners|\n (owners & approving_users).empty?\n end\n\n @approved = unsatisfied.empty?\n @approved\n end", "def accepted?\n return listing.accepted_proposal_id == id\n end", "def is_approved?\n (self.approved_feeds.count > 0) && ((self.pending_feeds.count + self.denied_feeds.count) == 0)\n end", "def decided?\n return (self.status == STATUS_DENIED or self.status == STATUS_ACCEPTED)\n end", "def pending_swap_manager_approval?\n @is_pending_swap_manager_approval\n end", "def is_confirmed?\n return self.status == Erp::Reservations::Reservation::STATUS_CONFIRMED\n end", "def pending_repost?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Pending Repost'\").id\n end", "def is_approval_request=(value)\n @is_approval_request = value\n end", "def allow_membership_pending_approval(membership)\n if logged_in?\n if membership.user_established_at == nil\n return membership.user_id == current_user.id\n elsif membership.network_established_at == nil\n return membership.network.administrator?(current_user)\n end \n else\n return false\n end\n end", "def ready_to_submit?\n return self.new_record? == false && \\\n self.approvable.new_record? == false && \\\n self.mail_sent == false\n end", "def any_requested_booking_not_confirmed?\n count = 0\n index\n @requested_bookings.each do |booking|\n count += 1 if !booking.confirmed\n end\n true if count.positive?\n end", "def check_free_venue\n if @total >= 20\n return true\n end\n end", "def is_approvable_by(another_user)\n return false unless is_associated_to_somebody_else_than(another_user)\n\n existing_friendship = @swimmer.associated_user.find_any_friendship_with(another_user)\n !!(\n existing_friendship &&\n existing_friendship.pending? &&\n (existing_friendship.friend_id == another_user.id) # Another user is the one *receiving* the invite\n )\n end", "def has_accepted_attestation_terms?\n SUBMITTED_STATUS.include?(aasm_state)\n end", "def auto_approve?\n return user.auto_approve_comment?\n end", "def approving_change?(approving)\n saved_instance = DesignChange.find(self.id) if self.id\n approving && (!saved_instance || !saved_instance.approved?)\n end", "def approved?\n activated_at || activation_code\n end", "def success?\n @status == \"APPROVED\"\n end", "def revokable?\n\t\tstatus == \"pending\" && created_at >= Donation.revoke_time.ago\n\tend", "def approved?(app)\n ApplicationPet.find_by(application_id: app.id, pet_id: id).status\n end", "def must_have_responded_or_sponsored\n @survey = Survey.with_aasm_state(:finished).find(params[:survey_id])\n if (current_organization_or_survey_invitation.participations.find_by_survey_id(@survey.id).nil? &&\n current_organization != @survey.sponsor) \n then\n flash[:notice] = \"The response deadline has passed. You may not view the results unless you have responded to the survey.\"\n \n if logged_in_from_survey_invitation? then\n redirect_to new_account_path\n else\n redirect_to surveys_path\n end\n \n return false\n end\n end", "def release_on_approval\n super == 'true'\n end", "def invited_for_interview?\n if offering.uses_interviews?\n application_review_decision_type.nil? ? false : application_review_decision_type.yes_option\n else\n false\n end\n end", "def eligible?\n return false if Flipflop.enabled?(:disable_ills) \n # If it has a disqualifying status, you can't ILL it. If it doesn't, you're\n # good to go.\n [\n available_here_now?,\n @status == 'Received',\n ineligible_statuses.include?(@z30status)\n ].none?\n end", "def dean_approved?\n !approved_at.blank?\n end", "def approve_pending_membership(person, email_address=nil)\n membership = community_memberships.where(:person_id => person.id, :status => \"pending_email_confirmation\").first\n if membership && (email_address.nil? || email_allowed?(email_address))\n membership.update_attribute(:status, \"accepted\")\n return true\n end\n return false\n end", "def approve_pending_membership(person, email_address=nil)\n membership = community_memberships.where(:person_id => person.id, :status => \"pending_email_confirmation\").first\n if membership && (email_address.nil? || email_allowed?(email_address))\n membership.update_attribute(:status, \"accepted\")\n return true\n end\n return false\n end", "def has_editorial_or_stock_for_sale\n return false if self.requests.length == 0\n self.requests.each do |r|\n return false if r.state == \"denied\"\n end\n true\n end", "def verify_details_submitted_from_agent_following_lead\n if user_valid_for_viewing?(['Vendor'], params[:udprn].to_i)\n verified = params[:verified] == 'true' ? true : false\n vendor_id = @current_user.id\n agent_id = params[:agent_id].to_i\n if verified\n PropertyService.new(params[:udprn].to_i).attach_assigned_agent(agent_id)\n render json: { message: 'The agent has been chosen as your assigned agent' }, status: 200\n else\n ### TODO: Report to the admin\n render json: { message: 'The incident will reported to admin' }, status: 400\n end\n else\n render json: { message: 'Authorization failed' }, status: 401\n end\n end", "def pending?\n\t\tself.accepted_at == nil\n\tend", "def any_requested_booking_confirmed_not_completed?\n count = 0\n index\n @requested_bookings.each do |booking|\n count += 1 if booking.confirmed && !booking.completed\n end\n true if count.positive?\n end", "def pending_shop_request?\n !launched_shop? && latest_pending_shop_request\n end", "def confirmed?\n [:confirmed, :in_progress, :done].include?(self.status)\n end", "def to_be_performed?\n self.research_billing_qty > 0\n end", "def money_approved?\n true\n end", "def approve?\n return false if user.blank?\n\n role = user.dominant_role\n\n return false unless record.in?(role.donations)\n\n latest_approval = record.approvals.order(:created_at).last\n\n if latest_approval.present?\n case latest_approval.approver\n when NationalFinanceHead then\n false\n when Fellow then\n role.is_a?(NationalFinanceHead)\n when Coach then\n role.class.in?([NationalFinanceHead, Fellow])\n else\n role.class.in?([NationalFinanceHead, Fellow, Coach])\n end\n else\n role.class.in?([NationalFinanceHead, Fellow, Coach])\n end\n end", "def ready_for_submission?\n self.all_reviewers_assigned? && \n self.all_manager_reviewers_assigned? &&\n self.design_data_filled_in?\n end", "def awaiting_email_verification?\n return false if email_verified?\n\n pending_notices({ type: 'email', dispatched: true }).any?\n end", "def can_update?\n if [\"approved\"].include? state\n false\n else\n true\n end\n end", "def request_approval\n reservation = Reservation.first\n ReservationMailer.request_approval(reservation)\n end", "def is_booking_request?\n self.celebrity_id.present?\n end", "def ticket_approved\n TaskMailer.with(task: Task.first).ticket_approved\n end", "def accepted\n OpportunityMailer.accepted\n end", "def stale_approval?\n ActsAsApprovable.stale_check? and update? and stale?\n end", "def approved_purchase_requests\n PurchaseRequest.find(:all,:conditions => {\n :purchase_requester_id => self.id ,\n :is_purchase_order_created => true \n })\n end", "def volunteering_allowed?\n # As of today, cannot volunteer if project is in 'parking lot'\n if self.event.nil? then\n return false\n else\n return self.event.volunteering_enabled?\n end\n end", "def has_request\n request_status_pending? && @friend.requester != current_user\n end", "def accepted?\n verdict && verdict.accepted?\n end", "def review_complete?\n self.review_status_id == ReviewStatus.find(:first,\n :conditions => \"name='Review Completed'\").id\n end", "def accepted?\n return (self.status == STATUS_ACCEPTED)\n end", "def odk_awaiting_media?\n params[\"*isIncomplete*\"] == \"yes\"\n end", "def approved?\n self.status == Task::Status::FINISHED\n end", "def is_approved?\n moderation_flag ? true : false\n end" ]
[ "0.75232476", "0.73368865", "0.7237259", "0.72161156", "0.71513957", "0.7057874", "0.70507216", "0.69595367", "0.695576", "0.69305474", "0.69214153", "0.6919999", "0.69042087", "0.689699", "0.6882513", "0.68550414", "0.6839505", "0.67807174", "0.6778059", "0.67617196", "0.67073756", "0.66979796", "0.66966975", "0.66487634", "0.6597579", "0.6594557", "0.6592334", "0.65861374", "0.6575656", "0.65654606", "0.65417", "0.6538329", "0.65355366", "0.6532502", "0.6508197", "0.64930403", "0.6471438", "0.6470764", "0.6467964", "0.64505184", "0.6436514", "0.64084274", "0.6400363", "0.6393015", "0.63654095", "0.6358388", "0.6354511", "0.63294494", "0.6324199", "0.6323945", "0.6317073", "0.6301195", "0.627427", "0.62670875", "0.62652373", "0.6264822", "0.62641054", "0.62575215", "0.62428063", "0.62372255", "0.6236617", "0.6235428", "0.623388", "0.6230802", "0.6227982", "0.62269765", "0.62225306", "0.62095404", "0.62061", "0.6204049", "0.6200748", "0.61976254", "0.61957467", "0.61957467", "0.61932266", "0.6186256", "0.61792", "0.6178209", "0.61751753", "0.6174945", "0.61619794", "0.61468", "0.6143792", "0.6141072", "0.61409223", "0.6139915", "0.6139567", "0.6133329", "0.6129238", "0.6128471", "0.6121933", "0.6121826", "0.6116831", "0.61004275", "0.6097654", "0.60879064", "0.6084852", "0.6083503", "0.60704964", "0.6066283" ]
0.7193077
4
has the payment been approved for the venue?
def approved? !([STATE_UNKNOWN, STATE_BLOCK_REQUESTED, STATE_BLOCKED, STATE_APPROVAL_REQUESTED, STATE_UNAVAILABLE, STATE_CANCELLED, STATE_EXPIRED, STATE_AVAILABLE_EXPIRED].include?(self.state)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approved?\n (status == APPROVED)\n end", "def approved?\n if order_status == 'approved'\n return true\n else\n return false\n end\n end", "def approved?\n !self.pending\n end", "def payment_success?\n @fields['decision'] == 'ACCEPT'\n end", "def approved?\n status == STATUS_APPROVED\n end", "def approved?\n state == 'approved'\n end", "def successful\n\t\t\t\tself.refunded == \"Approved\"\n\t\t\tend", "def is_approved?\n self.approved == 'approved'\n end", "def approved?\n !pending\n end", "def approved?\n !approved_on.nil?\n end", "def has_an_approved_account_set?\n all_monetary_processor_accounts.was_verified.any?\n end", "def money_approved?\n true\n end", "def paid?\n status == 'paid'\n end", "def paid?\n status == 'paid'\n end", "def in_payment?\n @in_payment\n end", "def paid?\n status == PAID\n end", "def financial_aid_approved?\n !financial_aid_approved_at.blank?\n end", "def approved?\n self.is_approved == true \n end", "def awaiting_financial_aid_approval?\n dean_approved? && !financial_aid_approved?\n end", "def can_be_approved?\n self.applied?\n end", "def paypal_paid?\n self.paypal_transactions.where(status: 'Completed').count >= 1\n end", "def approved?\n approval_state.present? ? approval_state == 'approved' : approval.try(:approved?)\n end", "def payable?\n %w(confirmed bookkept).include?(workflow_state)\n end", "def check_free_venue\n if @total >= 20\n return true\n end\n end", "def paid?\n self.status == 'paid'\n end", "def pending?\n payment_status == 'Pending'\n end", "def invoice_paid_in_full?(invoice_id) # Paid in full if t/f\n sale = @transactions.find_all_by_invoice_id(invoice_id)\n sale.any? { |trans| trans.result == :success }\n end", "def ready_to_approve?\n status = self.units.map(&:unit_status) & ['condition', 'copyright', 'unapproved']\n return status.empty?\n end", "def technically_paid?\n unconfirmed_value_paid >= value_needed\n end", "def approvable?\n (!current_stage.nil? &&\n current_stage.stage.eql?('verify') &&\n current_stage.status.eql?('passed') &&\n !AutomateSoup.url.nil? &&\n !AutomateSoup.credentials.nil? &&\n !links.nil? &&\n !links['approve'].nil? &&\n !links['approve']['href'].nil?)\n end", "def success?\n @status == \"APPROVED\"\n end", "def paid_in_full?\n !payment_outstanding?\n end", "def paid?\n payment_at?\n end", "def approved?\n (status == ConfigCenter::User::APPROVED)\n end", "def approved?\n status_map = employee_vacation_responses.map(&:status).uniq\n status_map.size == 1 && status_map.include?(\"approved\")\n end", "def complete?\n status == \"verified\"\n end", "def is_approved?\n level > Membership::LEVELS[:pending]\n end", "def approved?\n [ 'AUTHORISED' ].include? status\n end", "def settled_payment?\n SUCCESSFUL_PAYMENT.include?(response['payment_state'])\n end", "def postpaid?\n postpaid.to_i == 1\n end", "def awaiting_disbursement?\n financial_aid_approved? && !disbursed?\n end", "def verified?\n paypal_verified? and phone_verified?\n end", "def payed?\n !payment_entry.nil?\n end", "def payment_pending?\n payment_state == PAYMENT_PENDING\n end", "def approvable?(obj)\n \tif is_pending?(obj.release_status)\n \t\tif is_section_head?\n \t\t\tif obj.uploader_role == 'Normal' && uploader_from_same_section(obj.uploaded_by_section)\n \t\t\t\ttrue\n \t\t\tend\n \t\telsif is_department_head?\n \t\t\tif obj.uploader_role == 'Sectionhead'\n \t\t\t\ttrue\n \t\t\tend\n \t\tend\n \tend\n end", "def approved?\n closed? && has_met_requirement?\n end", "def check_for_promo_payment\n if !self.service_promo_id.nil? && !self.payed_booking_id.nil? && self.payed && self.trx_id != \"\"\n return true\n else\n return false\n end\n end", "def approving_change?(approving)\n saved_instance = DesignChange.find(self.id) if self.id\n approving && (!saved_instance || !saved_instance.approved?)\n end", "def accepted?\n return listing.accepted_proposal_id == id\n end", "def public_venue\r\n case public\r\n when 1\r\n return true\r\n else\r\n return false\r\n end\r\n end", "def is_confirmed?\n return self.status == Erp::Reservations::Reservation::STATUS_CONFIRMED\n end", "def paid?\n date_paid_out.present?\n end", "def verified?\n status.include?(success)\n end", "def paid?\n current_transaction\n end", "def payment_in_progress?\n\t\t\t\t\treturn !self.payment_id.nil?\n\t\t\t\tend", "def payment_received?\n status == Enums::PaymentStatus::PAYMENT_RECEIVED\n end", "def confirmed?\n self.contributions.each do |contribution|\n return false if contribution.isPending?\n end\n return true\n end", "def approved?(app)\n ApplicationPet.find_by(application_id: app.id, pet_id: id).status\n end", "def pro_forma?\n status == Enums::PaymentStatus::PRO_FORMA\n end", "def can_activate?\n self.authorize_payment\n end", "def collect_payment?\n true\n end", "def approved?\n activated_at || activation_code\n end", "def bought?\n # paym\n end", "def pending?\n !approved? && !not_approved?\n end", "def payment_on_account?\n status == Enums::PaymentStatus::PAYMENT_ON_ACCOUNT\n end", "def success?\n @result[:payment] === true\n end", "def invoice?\n (payment_on_account? || payment_received?) && fully_shipped?\n end", "def set_invoice_paid\n @invoice.status == 'paid'\n end", "def is_approve\n order = current_user.customer.orders.find(params[:id])\n if order.status == \"Approved\"\n render json: {is_approve: true}\n elsif order.status == \"Declined\"\n render json: {is_approve: false}\n else\n render json: {is_approve: nil}\n end\n end", "def user_and_community_ready_for_payments?(person_id, community_id)\n razorpay_active?(community_id) && user_razorpay_active?(person_id , community_id)\n end", "def accepted?\n return (self.status == STATUS_ACCEPTED)\n end", "def success?\n raw_json['PAYMENTSTATUS'] == 'Completed'\n end", "def revokable?\n\t\tstatus == \"pending\" && created_at >= Donation.revoke_time.ago\n\tend", "def paid?\n !!paid_at\n end", "def confirmed?\n self.status >= 0\n end", "def to_be_performed?\n self.research_billing_qty > 0\n end", "def isAdmissionApproved\n ad = Admission.where(student_id: student_id).first\n #ad = Admission.where(\"student_id = #{student_id}\").order(\"created_on DESC\").find(1)\n unless ad.step == \"Approved\" then\n errors.add(:student_id, \"- You must be approved in order to create a billing record.\")\n end\n end", "def can_finish?\n self.payment_status == PTE::PaymentStatus.processing\n end", "def payment_authorized?(payment_id)\n check_payment = get_payment_intent_info(payment_id)\n status = check_payment['status']\n puts \"Current Payment Status: #{status}\"\n case status\n when 'Authorized', 'Card Verified'\n puts 'Payment has been authorized'\n return true\n # when 'Declined'\n # puts \"Reason for Decline: #{check_payment['response_summary']}\"\n # abort 'Payment has been declined so exiting this program'\n end\n puts \"3DS Flow hasn't been completed\"\n false\n end", "def payment_received?\n payment_state == PAYMENT_RECEIVED\n end", "def dean_approved?\n !approved_at.blank?\n end", "def verified?\n response[\"verified\"]\n end", "def price_consented?\n price_consent_status == 1\n end", "def approved?\n return @approved unless @approved.nil?\n\n approving_users = self.approvals.map { |a| a.approved_by }\n\n unsatisfied = owners_contents.select do |owners|\n (owners & approving_users).empty?\n end\n\n @approved = unsatisfied.empty?\n @approved\n end", "def confirmed?\n [:confirmed, :in_progress, :done].include?(self.status)\n end", "def prepaid?\n not postpaid?\n end", "def cms_voucher_request?\n false\n end", "def verified?\n\t\t\t@verified\n\t\tend", "def payin_created?\n transaction_status == 'PAYIN_CREATED'\n end", "def check_if_approval_is_required\n !offer_request.blank?\n end", "def aasm_state_changed_to_canceled_or_paid?\n aasm_state_changed? && %w(canceled paid).include?(aasm_state_change.last.to_s)\n end", "def verified?\n (status == VERIFIED)\n end", "def payment_api_return?\n\t\ttrue\n\tend", "def payment_confirmation_required?\n true\n end", "def any_sold?\r\n self.is_a?(Listing) && invoices.exists?(status: 'paid')\r\n end", "def awaiting_dean_approval?\n awarded? && !dean_approved?\n end", "def voting?\n state_name == \"voting\"\n end", "def is_confirmed?\n return self.status == Erp::QuickOrders::Order::STATUS_CONFIRMED\n end", "def auditor_verified?\n AUDITOR_COMPLETE_RESULTS.include?(self.auditor_result)\n end", "def test?\n OffsitePayments.mode == :test\n end" ]
[ "0.76204294", "0.7472865", "0.74674994", "0.72933835", "0.72615093", "0.71616435", "0.7159396", "0.71418124", "0.71379435", "0.7126172", "0.7055744", "0.69969577", "0.694285", "0.6906789", "0.690443", "0.68866384", "0.6863279", "0.68529123", "0.68520194", "0.68104196", "0.6808958", "0.68006134", "0.6799091", "0.6794913", "0.67855424", "0.67814004", "0.67053354", "0.6662196", "0.6655618", "0.6633921", "0.66272396", "0.6615645", "0.6605907", "0.660407", "0.66008234", "0.6596644", "0.65754795", "0.6566556", "0.655851", "0.65221536", "0.6515425", "0.65043145", "0.65033", "0.64880884", "0.6476846", "0.6449667", "0.64273345", "0.64270765", "0.642287", "0.6422049", "0.64068675", "0.64066166", "0.6400959", "0.6394688", "0.6393194", "0.6392738", "0.6388286", "0.63680685", "0.63659686", "0.6348403", "0.6335343", "0.63340414", "0.6325114", "0.63114446", "0.630095", "0.6290563", "0.62905073", "0.6285939", "0.6277657", "0.62728083", "0.6260116", "0.62596315", "0.624805", "0.624411", "0.6241811", "0.6241259", "0.62365115", "0.623179", "0.6230608", "0.6228753", "0.62264305", "0.6226251", "0.62149024", "0.62146175", "0.62098503", "0.6207061", "0.62043345", "0.6198313", "0.6198127", "0.6194289", "0.61916834", "0.6191526", "0.6173992", "0.61714906", "0.61680883", "0.61608744", "0.61608356", "0.6155474", "0.61531454", "0.6152091" ]
0.6665339
27
GET /educations or /educations.json
def index @educations = Education.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n render json: @educations\n end", "def index\n @educations = Education.all\n render json: @educations\n end", "def index\n @educations = Education.all\n end", "def index\n @educations = Education.all\n end", "def educations\r\n @education_levels = Education.find(:all)\r\n end", "def show\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n educator = Educator.find(params[:id])\n render json: educator.as_json({\n :only => [\n :id,\n :email,\n :full_name,\n :staff_type,\n :restricted_to_sped_students,\n :restricted_to_english_language_learners,\n :can_view_restricted_notes,\n :schoolwide_access,\n :districtwide_access,\n :grade_level_access,\n :admin\n ],\n :methods => [:labels],\n :include => {\n :school => { :only => [:id, :name] },\n :sections => {\n :only => [:id, :section_number],\n :methods => [:course_description]\n },\n :homeroom => { :only => [:id, :name] }\n }\n })\n end", "def index\n @educ_infos = EducInfo.all\n end", "def educational_attainment\n fetch('demographic.educational_attainment')\n end", "def index\n @educators = Educator.all\n end", "def index\n @educators = Educator.all\n end", "def index\n @endorsements = Endorsement.all\n\n render json: @endorsements\n end", "def index\n @educational_details = EducationalDetail.all\n end", "def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend", "def index\n @digital_editions = DigitalEdition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @digital_editions }\n end\n end", "def get_editions(params = {})\n get_json(get_editions_url(params))\n end", "def index\n @educations = Education.where(:resource_id => current_user.id).where(\"provider_id = 0\")\n\n @facebook_educations = Array.new\n @linked_in_educations = Array.new\n\n @facebook_educations = Education.where(\"resource_id IN ( #{ current_user.identities.where(\"provider_id = 4\").collect{|x| \"'\" + x.id + \"'\"}.join(\", \") } )\") unless current_user.identities.where(\"provider_id = 4\").size == 0\n @linked_in_educations = Education.where(\"resource_id IN ( #{ current_user.identities.where(\"provider_id = 6\").collect{|x| \"'\" + x.id + \"'\"}.join(\", \") } )\") unless current_user.identities.where(\"provider_id = 6\").size == 0\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @educations }\n end\n end", "def teachers\n url = drop_url_version + \"/count/teacherAssociations/#{params['edorg_id']}/teachers\"\n begin\n entities = RestClient.get(url, get_header)\n entities = JSON.parse(entities)\n rescue => e\n logger.info(\"Could not get ed orgs for #{entities} because of #{e.message}\")\n end\n \n respond_to do |format|\n format.json { render json: entities }\n end\n end", "def index\n @climber_educations = ClimberEducation.all\n end", "def show\n @educational_level = EducationalLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @educational_level }\n end\n end", "def index\n @educates = Educate.all\n end", "def get_authors_by_personality\n count = params[:count] # Optional - and must be an integer. Cuts the amount of authors return down to the number specified.\n timeline = params[:timeline] # Optional - and must be boolean. Determines whether to return personality predictions by day, month, and year.\n traits = params[:traits]\n e = params[:E] # Optional - and must be y, n or o. Extraversion personality trait. \n s = params[:S] # Optional - and must be y, n or o. Emotional Stability personality trait. \n a = params[:A] # Optional - and must be y, n or o. Agreeableness personality trait. \n c = params[:C] # Optional - and must be y, n or o. Conscientiousness personality trait. \n o = params[:O] # Optional - and must be y, n or o. Openness personality trait. \n puts \"count:#{count}\"\n puts \"timeline:#{timeline}\"\n puts \"e:#{e}\"\n puts \"s:#{s}\"\n puts \"a:#{a}\"\n puts \"c:#{c}\"\n puts \"o:#{o}\"\n\n request = Net::HTTP::Get.new(\"/personality-api/1/authors_by_personality.json?count=#{count}&timeline=#{timeline}&Extraversion=#{e}&EmotionalStability=#{s}&Agreeableness=#{a}&Conscientiousness=#{c}&Openness=#{o}\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n response = @http.request(request)\n render :text => response.body\n\n end", "def show\n @edu_detail = EduDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @edu_detail }\n end\n end", "def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end", "def index\n @enrollments = Enrollment.all\n\n # Search\n @enrollments = @enrollments.search(params[:q]) if params[:q]\n\n # Filter for group\n #@enrollments = @enrollments.relationship(params[:group]) if params[:group]\n\n # Order by\n @enrollments = @enrollments.order(params[:order].gsub(':', ' ')) if params[:order]\n\n # Pagination\n if (params[:offset] && params[:limit])\n @enrollments = @enrollments.page(1).per(params[:limit]).padding(params[:offset])\n else\n @enrollments = @enrollments.page(1).per(25)\n end\n\n render json: @enrollments if stale?(etag: @enrollments.all, last_modified: @enrollments.maximum(:updated_at))\n end", "def get_all_authors\n count = params[:count] # Optional - and must be an integer. Cuts the amount of authors return down to the number specified.\n timeline = params[:timeline] # Optional - and must be boolean. Determines whether to return personality predictions by day, month, and year.\n traits = params[:traits] # Optional - value must be a substring of \"ESACO\". Determines which traits to return.\n puts \"count:#{count}\"\n puts \"timeline:#{timeline}\"\n puts \"traits:#{traits}\"\n\n request = Net::HTTP::Get.new(\"/personality-api/1/all_authors.json?count=#{count}&timeline=#{timeline}&traits=#{traits}\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n response = @http.request(request)\n render :text => response.body\n\n end", "def index\n @general_educators = GeneralEducator.all\n end", "def index\n @educational_institutions = EducationalInstitution.all\n end", "def index\n rol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"DN\" or rol.nombre == \"ACRM\"\n @achievments = Achievment.all\n else\n @achievments = Achievment.where(:sede_id=>current_user.sede)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @achievments }\n end\n end", "def index\n @education_levels = EducationLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_levels }\n end\n end", "def index\n @expertises = Expertise.all\n\n render json: @expertises\n end", "def show\n @college = College.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college }\n end\n end", "def index\n @designations = Designation.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @designations }\n end\n end", "def index\n @electors = Elector.all\n\n render json: @electors\n end", "def index\n @enrolls = Enroll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enrolls }\n end\n end", "def index\n @exercise_categories = ExerciseCategory.where(\"organization_id IN (?)\", [Organization.current_organization, Organization.admin_organization])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_categories }\n end\n end", "def index\n @search = EducationalLevel.search(params[:search])\n @educational_levels = @search.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erbb\n format.xml { render :xml => @educational_levels }\n end\n end", "def index\n @education_accomplishments = EducationAccomplishment.all\n end", "def index\n @program_educational_objectives = ProgramEducationalObjective.all\n end", "def show\n @electoral_district = ElectoralDistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_district }\n end\n end", "def search\n terms = @authority.search(url_search)\n render json: terms\n end", "def index\n @encouragements = Encouragement.all\n end", "def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end", "def show\n @enroll = Enroll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enroll }\n end\n end", "def get_agreements\n get_agreements_response = Echochamber::Request.get_agreements(token)\n get_agreements_response.fetch(\"userAgreementList\")\n end", "def index\n @editals = Edital.all\n end", "def obligations\n self.class.get(url, { headers: @headers, query: @query })\n end", "def show\n @enrollment = Enrollment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enrollment }\n end\n end", "def index\n @instructor_texts = InstructorText.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instructor_texts }\n end\n end", "def index\n if (params[:client_id])\n @engagements = Engagement.find_all_by_client_id(params[:client_id])\n else\n @engagements = Engagement.all\n end\n\n respond_with(@engagements)\n end", "def index\n @advances = user_capabilities(Advance).current_advances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @advances }\n end\n end", "def index\n @representante_athletes = current_user.organization.athletes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @representante_athletes }\n end\n end", "def show\n @e = Encription.find(params[:id])\n\n respond_to do |format|\n format.html \n format.json { render @e }\n \n end\n end", "def show\n @entrant = Entrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrant }\n end\n end", "def show\n @entrant = Entrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrant }\n end\n end", "def index\n @resumes = Resume.all\n render json: @resumes, include: %i[headers educations work_experiences skills]\n end", "def index\n @ef_mentals = EfMental.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_mentals }\n end\n end", "def show\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibition }\n end\n end", "def index\n \n @evaluation = Evaluation.find_by(user_id: params[:user_id], study_case_id: params[:study_case_id])\n\n if @evaluation.present?\n render :show\n else\n render json: nil\n end\n \n end", "def index\n @edu_docs = current_user.edu_docs\n end", "def index\r\n @attestations = Attestation.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @attestations }\r\n end\r\n end", "def index\n @enrollments = Enrollment.all\n end", "def index\n @enrollments = Enrollment.all\n end", "def index\n @enrollments = Enrollment.all\n end", "def index\n @enrollments = Enrollment.all\n end", "def index\n @undergraduate_majors = UndergraduateMajor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @undergraduate_majors }\n end\n end", "def getEnrollmentsInSection(sid)\r\n\turi = sprintf(\"/api/v1/sections/%d/enrollments?type[]=StudentEnrollment&per_page=999\", sid)\r\n\tenrollments = $canvas.get(uri)\r\n\treturn enrollments\r\nend", "def getEnrollmentsInSection(sid)\r\n\turi = sprintf(\"/api/v1/sections/%d/enrollments?type[]=StudentEnrollment&per_page=999\", sid)\r\n\tenrollments = $canvas.get(uri)\r\n\treturn enrollments\r\nend", "def index\n @encriptions = Encription.all\n respond_to do |format|\n \n format.html \n format.json { render json: @encriptions }\n \n end\n end", "def corrections\n if PRIVATE_TOKEN != params[:private_token]\n render text: {\"message\" => \"401 Unauthorized\"}.to_json(), status: :unauthorized\n else\n view = params[:view]\n page = params[:page]\n page_size = params[:page_size]\n page ||= 1\n page_size ||= 10\n if view == 'users'\n resp = Corrections.users(page, page_size, params[:sort], params[:order], params[:filter])\n else\n resp = Corrections.docs(page, page_size, params[:sort], params[:order], params[:filter], params[:status_filter])\n end\n render text: resp.to_json()\n end\n end", "def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end", "def show\n @ecg = Ecg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ecg }\n end\n end", "def index\n @departments = Department.all\n respond_to do |format|\n format.json{ render json: @departments}\n end\n end", "def retrieve \n if !check_auth()\n render text: { \"message\" => \"401 Unauthorized\" }.to_json(), status: :unauthorized\n else\n uri = params[:uri]\n type = params[:type]\n doc = Document.find_by_uri(uri)\n if doc.present?\n case type\n when 'gale'\n render :text => doc.get_corrected_gale_xml()\n when 'text'\n render :text => doc.get_corrected_text()\n when 'tei-a'\n render :text => doc.get_corrected_tei_a(false)\n when 'tei-a-words'\n render :text => doc.get_corrected_tei_a(true)\n when 'original-gale'\n render :text => doc.get_original_gale_xml()\n when 'original-text'\n render :text => doc.get_original_gale_text()\n end\n else\n render text: { \"message\" => \"Document #{uri} not found\" }.to_json(), status: :not_found\n end\n end\n end", "def index\n @person_equipments = PersonEquipment.all\n respond_to do |format|\n format.html\n format.json { render json: @person_equipments }\n end\n end", "def show\n @deed = Deed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deed }\n end\n end", "def index\n if current_user.district_id and !current_user.admin?\n district = District.find(current_user.district_id)\n @hes = district.hes\n else\n @hes = He.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hes }\n end\n end", "def index\n @enrollments ||= @committee.enrollments if @committee\n @enrollments ||= @user.enrollments if @user\n @enrollments = @enrollments.ordered\n\n respond_to do |format|\n format.html { render :action => 'index' } # index.html.erb\n format.xml { render :xml => @enrollments }\n end\n end", "def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end", "def index\n # To restrict so only views you occupations, see omrails, Add Associations . . ., 33:00\n @occupations = Occupation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @occupations }\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "def index\n render json: @authority.all\n end", "def index\n professors = Professor.includes(:courses).all\n\n render json: professors.to_json(include: :courses)\n end", "def index\n candidate = UspsInPersonProofing::Applicant.new(\n address: search_params['street_address'],\n city: search_params['city'], state: search_params['state'],\n zip_code: search_params['zip_code']\n )\n response = proofer.request_facilities(candidate)\n if response.length > 0\n analytics.idv_in_person_locations_searched(\n success: true,\n result_total: response.length,\n )\n else\n analytics.idv_in_person_locations_searched(\n success: false, errors: 'No USPS locations found',\n )\n end\n render json: response.to_json\n end", "def show\n @education_level = EducationLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @education_level }\n end\n end", "def show\n render json: @endorsement\n end", "def index\n @desginations = Desgination.all\n end", "def index\n @articles = current_user.articles\n json_response(@articles)\n end", "def index\n @universities = University.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @universities }\n end\n end", "def index\n @organizations = Organization.all\n respond_with @organizations\n end", "def new\n @exprience = Exprience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exprience }\n end\n end", "def index\n #@courses = @curriculum.courses\n\n @courses = ScopedCourse.where(:curriculum_id => @curriculum.id)\n .joins(:course_descriptions)\n .where([\"course_descriptions.locale = ?\", I18n.locale]).includes(:strict_prereqs)\n# .joins(<<-SQL\n# INNER JOIN course_descriptions\n# ON competence_nodes.abstract_course_id = course_descriptions.abstract_course_id\n# SQL\n# )\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json do\n render :json => @courses.select(<<-SQL\n competence_nodes.id,\n competence_nodes.course_code,\n course_descriptions.name AS translated_name\n SQL\n ).to_json(:methods => :strict_prereq_ids, :root => true)\n end\n end\n end", "def index\n @empskeds = Empsked.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empskeds }\n end\n end", "def index\n @education_details = EducationDetail.all\n end", "def index\n @entertainments = Entertainment.all\n end", "def index\n @enrolleds = Enrolled.all\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enrolleds }\n end\n end", "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end", "def index\n @assessment_courses = AssessmentCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assessment_courses }\n end\n end", "def show\n @enroll = Enroll.find(params[:id])\n render json: JSON.parse(@enroll.to_json)\n end", "def index\n @course = params[:course_id]\n @students = Student.left_join_enrolls @course\n puts @students.as_json\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @educational_level }\n end\n end" ]
[ "0.72872424", "0.7071079", "0.64314055", "0.64314055", "0.6372139", "0.6195221", "0.5962236", "0.591486", "0.589699", "0.589699", "0.5887036", "0.5867752", "0.5849413", "0.58353686", "0.5831324", "0.5830363", "0.5827697", "0.5811196", "0.57681644", "0.57679933", "0.572583", "0.570082", "0.5682091", "0.5660579", "0.5613163", "0.55895865", "0.5564133", "0.55603147", "0.55472195", "0.5544402", "0.55164486", "0.5515738", "0.5504584", "0.5498468", "0.5491682", "0.54498357", "0.54446626", "0.5428718", "0.54263216", "0.5419313", "0.54170007", "0.5416947", "0.5393025", "0.5392486", "0.53910506", "0.53865", "0.5385413", "0.5355972", "0.53511894", "0.5342973", "0.53347486", "0.53341466", "0.5329374", "0.5329374", "0.5326691", "0.53251755", "0.531711", "0.53128815", "0.53068185", "0.5300795", "0.5299998", "0.5299998", "0.5299998", "0.5299998", "0.52991486", "0.52976924", "0.52976924", "0.5297357", "0.5287088", "0.5277059", "0.52751845", "0.52733254", "0.5258729", "0.52438366", "0.5237178", "0.523471", "0.522949", "0.52267724", "0.5225634", "0.5225403", "0.5225061", "0.52223283", "0.52220386", "0.5219403", "0.5219255", "0.52187353", "0.5217147", "0.5215921", "0.521542", "0.52140963", "0.5212549", "0.5210657", "0.52105063", "0.52083486", "0.52078974", "0.5198497", "0.51982594", "0.51975733", "0.51852715", "0.51709074" ]
0.63766515
4
GET /educations/1 or /educations/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n render json: @educations\n end", "def index\n @educations = Education.all\n render json: @educations\n end", "def show\n raise Exceptions::EducatorNotAuthorized unless current_educator.districtwide_access\n educator = Educator.find(params[:id])\n render json: educator.as_json({\n :only => [\n :id,\n :email,\n :full_name,\n :staff_type,\n :restricted_to_sped_students,\n :restricted_to_english_language_learners,\n :can_view_restricted_notes,\n :schoolwide_access,\n :districtwide_access,\n :grade_level_access,\n :admin\n ],\n :methods => [:labels],\n :include => {\n :school => { :only => [:id, :name] },\n :sections => {\n :only => [:id, :section_number],\n :methods => [:course_description]\n },\n :homeroom => { :only => [:id, :name] }\n }\n })\n end", "def show\n @edu_detail = EduDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @edu_detail }\n end\n end", "def show\n @educational_level = EducationalLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @educational_level }\n end\n end", "def index\n @educations = Education.all\n end", "def index\n @educations = Education.all\n end", "def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end", "def index\n @educations = Education.all\n\n end", "def get_authors_by_personality\n count = params[:count] # Optional - and must be an integer. Cuts the amount of authors return down to the number specified.\n timeline = params[:timeline] # Optional - and must be boolean. Determines whether to return personality predictions by day, month, and year.\n traits = params[:traits]\n e = params[:E] # Optional - and must be y, n or o. Extraversion personality trait. \n s = params[:S] # Optional - and must be y, n or o. Emotional Stability personality trait. \n a = params[:A] # Optional - and must be y, n or o. Agreeableness personality trait. \n c = params[:C] # Optional - and must be y, n or o. Conscientiousness personality trait. \n o = params[:O] # Optional - and must be y, n or o. Openness personality trait. \n puts \"count:#{count}\"\n puts \"timeline:#{timeline}\"\n puts \"e:#{e}\"\n puts \"s:#{s}\"\n puts \"a:#{a}\"\n puts \"c:#{c}\"\n puts \"o:#{o}\"\n\n request = Net::HTTP::Get.new(\"/personality-api/1/authors_by_personality.json?count=#{count}&timeline=#{timeline}&Extraversion=#{e}&EmotionalStability=#{s}&Agreeableness=#{a}&Conscientiousness=#{c}&Openness=#{o}\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n response = @http.request(request)\n render :text => response.body\n\n end", "def educations\r\n @education_levels = Education.find(:all)\r\n end", "def get_editions(params = {})\n get_json(get_editions_url(params))\n end", "def teachers\n url = drop_url_version + \"/count/teacherAssociations/#{params['edorg_id']}/teachers\"\n begin\n entities = RestClient.get(url, get_header)\n entities = JSON.parse(entities)\n rescue => e\n logger.info(\"Could not get ed orgs for #{entities} because of #{e.message}\")\n end\n \n respond_to do |format|\n format.json { render json: entities }\n end\n end", "def index\n @digital_editions = DigitalEdition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @digital_editions }\n end\n end", "def show\n @e = Encription.find(params[:id])\n\n respond_to do |format|\n format.html \n format.json { render @e }\n \n end\n end", "def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend", "def show\n @enrollment = Enrollment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enrollment }\n end\n end", "def show\n @enroll = Enroll.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enroll }\n end\n end", "def index\n @educ_infos = EducInfo.all\n end", "def get_all_authors\n count = params[:count] # Optional - and must be an integer. Cuts the amount of authors return down to the number specified.\n timeline = params[:timeline] # Optional - and must be boolean. Determines whether to return personality predictions by day, month, and year.\n traits = params[:traits] # Optional - value must be a substring of \"ESACO\". Determines which traits to return.\n puts \"count:#{count}\"\n puts \"timeline:#{timeline}\"\n puts \"traits:#{traits}\"\n\n request = Net::HTTP::Get.new(\"/personality-api/1/all_authors.json?count=#{count}&timeline=#{timeline}&traits=#{traits}\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n response = @http.request(request)\n render :text => response.body\n\n end", "def index\n @educators = Educator.all\n end", "def index\n @educators = Educator.all\n end", "def show\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibition }\n end\n end", "def show\n @ecg = Ecg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ecg }\n end\n end", "def show\n @college = College.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college }\n end\n end", "def show\n @education_level = EducationLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @education_level }\n end\n end", "def get_elder_data\n @user_id = JSON.parse(request.body.read)\n @elder_data = Elder.find_by_userId(@user_id[\"userId\"])\n if @elder_data == nil\n render json: \"No elder with this Id in the DB\".to_json\n else\n render json: @elder_data.to_json\n end\n end", "def index\n @endorsements = Endorsement.all\n\n render json: @endorsements\n end", "def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end", "def show\n @election_type = ElectionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @election_type }\n end\n end", "def index\n @education_levels = EducationLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_levels }\n end\n end", "def index\n \n @evaluation = Evaluation.find_by(user_id: params[:user_id], study_case_id: params[:study_case_id])\n\n if @evaluation.present?\n render :show\n else\n render json: nil\n end\n \n end", "def index\n @educational_details = EducationalDetail.all\n end", "def show\n @electoral_district = ElectoralDistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @electoral_district }\n end\n end", "def index\n @electors = Elector.all\n\n render json: @electors\n end", "def index\n @educates = Educate.all\n end", "def index\n @designations = Designation.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @designations }\n end\n end", "def show\n @euclid_user = EuclidUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @euclid_user }\n end\n end", "def show\n @entrant = Entrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrant }\n end\n end", "def show\n @entrant = Entrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrant }\n end\n end", "def index\n @enrolls = Enroll.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enrolls }\n end\n end", "def show\n @enroll = Enroll.find(params[:id])\n render json: JSON.parse(@enroll.to_json)\n end", "def retrieve \n if !check_auth()\n render text: { \"message\" => \"401 Unauthorized\" }.to_json(), status: :unauthorized\n else\n uri = params[:uri]\n type = params[:type]\n doc = Document.find_by_uri(uri)\n if doc.present?\n case type\n when 'gale'\n render :text => doc.get_corrected_gale_xml()\n when 'text'\n render :text => doc.get_corrected_text()\n when 'tei-a'\n render :text => doc.get_corrected_tei_a(false)\n when 'tei-a-words'\n render :text => doc.get_corrected_tei_a(true)\n when 'original-gale'\n render :text => doc.get_original_gale_xml()\n when 'original-text'\n render :text => doc.get_original_gale_text()\n end\n else\n render text: { \"message\" => \"Document #{uri} not found\" }.to_json(), status: :not_found\n end\n end\n end", "def show\n @educator = Educator.first(:conditions => \"id = #{params[:id]}\")\n if @educator.nil?\n redirect_to educators_path \n else\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @educator }\n end\n end\n end", "def index\n @educations = Education.where(:resource_id => current_user.id).where(\"provider_id = 0\")\n\n @facebook_educations = Array.new\n @linked_in_educations = Array.new\n\n @facebook_educations = Education.where(\"resource_id IN ( #{ current_user.identities.where(\"provider_id = 4\").collect{|x| \"'\" + x.id + \"'\"}.join(\", \") } )\") unless current_user.identities.where(\"provider_id = 4\").size == 0\n @linked_in_educations = Education.where(\"resource_id IN ( #{ current_user.identities.where(\"provider_id = 6\").collect{|x| \"'\" + x.id + \"'\"}.join(\", \") } )\") unless current_user.identities.where(\"provider_id = 6\").size == 0\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @educations }\n end\n end", "def show\n @principal_establec = PrincipalEstablec.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @principal_establec }\n end\n end", "def show\n @encuestum = Encuestum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @encuestum }\n end\n end", "def index\n @expertises = Expertise.all\n\n render json: @expertises\n end", "def new\n @exprience = Exprience.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exprience }\n end\n end", "def show\n @deed = Deed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deed }\n end\n end", "def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end", "def show\n @undergraduate_major = UndergraduateMajor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @undergraduate_major }\n end\n end", "def show\n @eou = Eou.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @eou }\n end\n end", "def educational_attainment\n fetch('demographic.educational_attainment')\n end", "def index\n rol = Role.where(:id=>current_user.role).first\n if rol.nombre == \"DN\" or rol.nombre == \"ACRM\"\n @achievments = Achievment.all\n else\n @achievments = Achievment.where(:sede_id=>current_user.sede)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @achievments }\n end\n end", "def show\n @instructor_text = InstructorText.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instructor_text }\n end\n end", "def show\n @client_sex = ClientSex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_sex }\n end\n end", "def show\n @university = University.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university }\n end\n end", "def show\n @university = University.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @university }\n end\n end", "def show\n @book_edition = BookEdition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_edition }\n end\n end", "def show\n @enrollment = Enrollment.on_db(session[:shard_name]).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enrollment }\n end\n end", "def show\n @excercise = Excercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @excercise }\n end\n end", "def index\n @enrollments = Enrollment.all\n\n # Search\n @enrollments = @enrollments.search(params[:q]) if params[:q]\n\n # Filter for group\n #@enrollments = @enrollments.relationship(params[:group]) if params[:group]\n\n # Order by\n @enrollments = @enrollments.order(params[:order].gsub(':', ' ')) if params[:order]\n\n # Pagination\n if (params[:offset] && params[:limit])\n @enrollments = @enrollments.page(1).per(params[:limit]).padding(params[:offset])\n else\n @enrollments = @enrollments.page(1).per(25)\n end\n\n render json: @enrollments if stale?(etag: @enrollments.all, last_modified: @enrollments.maximum(:updated_at))\n end", "def index\n if (params[:client_id])\n @engagements = Engagement.find_all_by_client_id(params[:client_id])\n else\n @engagements = Engagement.all\n end\n\n respond_with(@engagements)\n end", "def index\n @climber_educations = ClimberEducation.all\n end", "def show\n @education = Education.where(:resource_id => current_user.id, :id => params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @education }\n end\n end", "def show\n json_response(@faculty)\n end", "def index\n @undergraduate_majors = UndergraduateMajor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @undergraduate_majors }\n end\n end", "def show\n @excuse = Excuse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excuse }\n end\n end", "def show\n @instructor = Instructor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instructor }\n end\n end", "def show\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attendence }\n end\n end", "def show\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enterprise }\n end\n end", "def show\n @designation = Designation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @designation }\n end\n end", "def index\n @articles = current_user.articles\n json_response(@articles)\n end", "def show\n @instructor = Instructor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @instructor }\n end\n end", "def index\n @person = Person.find((params[:person_id]))\n @person_identification_docs = PersonIdentificationDoc.where(\"person_id = ?\", params[:person_id])\n\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @person_identification_docs }\n end\n end", "def index\n @instructor_texts = InstructorText.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instructor_texts }\n end\n end", "def show\n @escala = Escala.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @escala }\n end\n end", "def show\n @competency_pertenece_evaluation = CompetencyPerteneceEvaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_pertenece_evaluation }\n end\n end", "def index\n @universities = University.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @universities }\n end\n end", "def show\n @endurance = Endurance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @endurance }\n end\n end", "def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end", "def show\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employe }\n end\n end", "def getex\n url = prefix + \"getex\" + id_param\n return response(url)\n end", "def show\n @education = Education.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @education }\n end\n end", "def show\n @doctor_desease = DoctorDesease.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doctor_desease }\n end\n end", "def show\n @etudiant = Etudiant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etudiant }\n end\n end", "def index\n @person_equipments = PersonEquipment.all\n respond_to do |format|\n format.html\n format.json { render json: @person_equipments }\n end\n end", "def show\n @empsked = Empsked.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empsked }\n end\n end", "def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end", "def show\n @college_fee = CollegeFee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college_fee }\n end\n end", "def show\n @edition_type = EditionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @edition_type }\n end\n end", "def show\n @explaination = Explaination.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @explaination }\n end\n end", "def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end", "def show\n @judgement = Judgement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @judgement }\n end\n end", "def show\n @judgement = Judgement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @judgement }\n end\n end", "def index\n @general_educators = GeneralEducator.all\n end", "def show\r\n @attestation = Attestation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @attestation }\r\n end\r\n end", "def show\n @election = Election.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @election }\n end\n end", "def show\n begin\n @gender = Gender.find(params[:id]) \n\n render json: @gender, status: 200\n rescue ActiveRecord::RecordNotFound\n render json: {status: \"gender not found\"}, status: 404\n end\n end", "def get_author\n id = params[:ID]\n puts \"ID:#{id}\"\n request = Net::HTTP::Get.new(\"/personality-api/1/author.json?ID=#{id}\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n response = @http.request(request)\n render :text => response.body\n\n end" ]
[ "0.70480907", "0.6866035", "0.6196898", "0.6093557", "0.60901046", "0.6021141", "0.6021141", "0.59815854", "0.5966388", "0.58582604", "0.58540934", "0.5822059", "0.5789844", "0.5748052", "0.5747645", "0.57330906", "0.57135963", "0.5711395", "0.56712866", "0.5654757", "0.565408", "0.565408", "0.56380457", "0.5629959", "0.5612445", "0.56112534", "0.5598021", "0.55889", "0.5580186", "0.5562673", "0.55529106", "0.55453736", "0.5543514", "0.5543302", "0.5536219", "0.55267364", "0.5509774", "0.5501557", "0.5499494", "0.5499494", "0.549634", "0.54957163", "0.5495211", "0.5494496", "0.5491104", "0.54811645", "0.54775995", "0.5476023", "0.54707015", "0.5464665", "0.54519033", "0.5436112", "0.5434493", "0.5429977", "0.54037404", "0.5395972", "0.5382241", "0.53818333", "0.53818333", "0.53812534", "0.5375176", "0.53743297", "0.53644735", "0.5351485", "0.53511316", "0.5346082", "0.53441036", "0.5339857", "0.532398", "0.53186285", "0.5316504", "0.5305553", "0.5305051", "0.53027505", "0.5302704", "0.5302358", "0.5299152", "0.52961814", "0.5295935", "0.5294678", "0.5291394", "0.5286751", "0.52856165", "0.5284559", "0.528102", "0.52767295", "0.5276252", "0.5275182", "0.5274925", "0.5270562", "0.52686375", "0.52663237", "0.52626324", "0.5262033", "0.52573574", "0.52573574", "0.52563643", "0.5254899", "0.52494234", "0.52493674", "0.5248618" ]
0.0
-1
POST /educations or /educations.json
def create @education = Education.new(education_params) respond_to do |format| if @education.save format.html { redirect_to @education, notice: "Education was successfully created." } format.json { render :show, status: :created, location: @education } else format.html { render :new, status: :unprocessable_entity } format.json { render json: @education.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @educator = Educator.new(params[:educator])\n ong_desc = params[:ong_desc]\n union_movement_desc = params[:union_movement_desc]\n educator_years = params[:educator_years]\n educator_popular_education_years = params[:educator_popular_education_years]\n respond_to do |format|\n if @educator.save\n if [email protected]_participations.first.nil?\n @educator.social_participations.first.save_with_descs(ong_desc, union_movement_desc)\n end\n if [email protected]_education_exps.first.nil?\n @educator.educators_education_exps.first.update_with_years(educator_years, educator_popular_education_years)\n end\n flash[:success] = t('educator.created')\n format.html { redirect_to(educators_path) }\n format.xml { render :xml => @educator, :status => :created, :location => @educator }\n else\n if @educator.core_id.nil?\n @rooms = []\n else\n @rooms = Core.find(core_id).rooms\n end\n \n flash[:error] = t('default_error_message')\n format.html { render :action => \"new\" }\n format.xml { render :xml => @educator.errors, :status => :unprocessable_entity }\n end\n end\n end", "def show\n render json: @educations\n end", "def create\n @educate = Educate.new(educate_params)\n\n respond_to do |format|\n if @educate.save\n format.html { redirect_to @educate, notice: 'Educate was successfully created.' }\n format.json { render :show, status: :created, location: @educate }\n else\n format.html { render :new }\n format.json { render json: @educate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @education = Education.new(education_params)\n\n if @education.save\n render json: @education, status: :created, location: @education\n else\n render json: @education.errors, status: :unprocessable_entity\n end\n end", "def create\n @enrollments = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollments.save\n format.html { redirect_to current_user }\n format.json { render :show, status: :created, location: @enrollments }\n else\n format.html { render :new }\n format.json { render json: @enrollments.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create\n @educator = Educator.new(educator_params)\n\n respond_to do |format|\n if @educator.save\n format.html { redirect_to @educator, notice: 'Educator was successfully created.' }\n format.json { render :show, status: :created, location: @educator }\n else\n format.html { render :new }\n format.json { render json: @educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @deed = Deed.create(deed_params)\n\n if @deed.save\n render json: @deed, status: :created, location: @deed\n else\n render json: @deed.errors, status: :unprocessable_entity\n end\n end", "def create\n if params[:education][:accomplishment][\"0\"] != \"\"\n @education = Education.new(education_params)\n if @education.save\n params[:education][:accomplishment].each do |i, acc|\n EducationAccomplishment.create(description: acc, education_id: @education.id)\n end\n redirect_to '/'\n else\n redirect_to :back, flash: {alert: @education.errors.full_messages}\n end\n else\n redirect_to :back, flash: {alert: \"Must have at least one accomplishment\"}\n end\n end", "def index\n @educations = Education.all\n render json: @educations\n end", "def create\n @edu_doc = current_user.edu_docs.new(edu_doc_params)\n\n respond_to do |format|\n if @edu_doc.save\n format.html { redirect_to edu_docs_path, notice: \"Edu doc was successfully created.\" }\n format.json { render :index, status: :created, location: @edu_docs }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @edu_doc.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @escalation = Escalation.new(escalation_params)\n\n respond_to do |format|\n if @escalation.save\n format.html { redirect_to @escalation, notice: 'Escalation was successfully created.' }\n format.json { render :show, status: :created, location: @escalation }\n else\n format.html { render :new }\n format.json { render json: @escalation.errors, status: :unprocessable_entity }\n end\n end\n end", "def enrollment(params = {})\n scope 'default'\n post('enrollment/', params)\n end", "def educations_add\r\n return jump_to(\"/errors/forbidden\") unless session[:account_id].to_s == params[:id]\r\n \r\n @edu_profile = EducationProfile.new(:account_id => session[:account_id])\r\n \r\n @edu_profile.edu_name = params[:edu_name] && params[:edu_name].strip\r\n @edu_profile.education_id = params[:education_id]\r\n @edu_profile.enter_year = params[:enter_year]\r\n @edu_profile.major = params[:major] && params[:major].strip\r\n \r\n if @edu_profile.save\r\n @edu_profile.add_to_cache\r\n @saved = true\r\n @edu_profile_entry_id = \"edu_profile_#{@edu_profile.id}\"\r\n flash.now[:info_msg] = %Q!已成功保存!\r\n else\r\n @saved = false\r\n flash.now[:error_msg] = %Q!操作失败, 再试一次吧\r\n <br />\r\n #{ApplicationController.helpers.list_model_validate_errors(@edu_profile)}!\r\n end\r\n end", "def create\n @education = Education.new(education_params)\n\n respond_to do |format|\n if @education.save\n format.html { redirect_to educations_url, notice: 'Education was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n if current_user.educational_detail.nil?\n @educational_detail = current_user.create_educational_detail(educational_detail_params)\n\n respond_to do |format|\n if @educational_detail.save\n format.html { redirect_to statuses_url, notice: 'Educational detail was successfully created.' }\n format.json { render :show, status: :created, location: @educational_detail }\n else\n format.html { redirect_to edit_profile_url(current_user), alert: 'Educational detail was not created'}\n format.json { render json: @educational_detail.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to edit_profile_url(current_user)\n flash[:alert] = 'Already exists Educational detail'\n end\n \n end", "def eligibility(params = {})\n scope 'default'\n post('eligibility/', params)\n end", "def create\n @desease = Desease.new(desease_params)\n\n if @desease.save\n render json: @desease, status: :ok\n else\n render json: @desease.errors, status: :unprocessable_entity\n end\n end", "def create\n @education = @resume.educations.build(params[:education])\n\n respond_to do |format|\n if @education.save \n flash[:notice] = '教育信息创建成功.'\n format.html { redirect_to edit_resume_path(@resume) }\n format.xml { render :xml => @resume, :status => :created, :location => @resume }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @education.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @educ_info = EducInfo.new(educ_info_params)\n\n respond_to do |format|\n if @educ_info.save\n format.html { redirect_to @educ_info, notice: 'Educ info was successfully created.' }\n format.json { render :show, status: :created, location: @educ_info }\n else\n format.html { render :new }\n format.json { render json: @educ_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def educator_params\n params.require(:educator).permit(:title, :first_name, :last_name, :job_title, :summary, :dob, :ssn, :gender, :ethnicity)\n end", "def post(request_configuration=nil)\n request_info = self.to_post_request_information(\n request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::EducationAssignment.create_from_discriminator_value(pn) }, error_mapping)\n end", "def create\n @endorsement = Endorsement.new(endorsement_params)\n\n if @endorsement.save\n render json: @endorsement, status: :created, location: @endorsement\n else\n render json: @endorsement.errors, status: :unprocessable_entity\n end\n end", "def create\n @edu_detail = EduDetail.new(params[:edu_detail])\n\n respond_to do |format|\n if @edu_detail.save\n format.html { redirect_to @edu_detail, notice: 'Edu detail was successfully created.' }\n format.json { render json: @edu_detail, status: :created, location: @edu_detail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @edu_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @education_accomplishment = EducationAccomplishment.new(education_accomplishment_params)\n\n respond_to do |format|\n if @education_accomplishment.save\n format.html { redirect_to @education_accomplishment, notice: 'Education accomplishment was successfully created.' }\n format.json { render :show, status: :created, location: @education_accomplishment }\n else\n format.html { render :new }\n format.json { render json: @education_accomplishment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ed = Ed.new(ed_params)\n\n respond_to do |format|\n if @ed.save\n format.html { redirect_to @ed, notice: 'Ed was successfully created.' }\n format.json { render :show, status: :created, location: @ed }\n else\n format.html { render :new }\n format.json { render json: @ed.errors, status: :unprocessable_entity }\n end\n end\n end", "def educate_params\n params.require(:educate).permit(:name, :content, :picture)\n end", "def education_params\n params.require(:education).permit(:content, :admission_id, :author)\n end", "def create\n @general_educator = GeneralEducator.new(general_educator_params)\n\n respond_to do |format|\n if @general_educator.save\n format.html { redirect_to @general_educator, notice: 'General educator was successfully created.' }\n format.json { render :show, status: :created, location: @general_educator }\n else\n format.html { render :new }\n format.json { render json: @general_educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @deed = Deed.new(params[:deed])\n\n respond_to do |format|\n if @deed.save\n format.html { redirect_to @deed, notice: 'Deed was successfully created.' }\n format.json { render json: @deed, status: :created, location: @deed }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deed.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_and_invitation_studant(params = {})\n run(:post, \"/invitations\", [201,422], JSON.dump(params))\n end", "def create\n @knowledge = current_user.knowledges.new(params[:knowledge])\n\n respond_to do |format|\n if @knowledge.save\n format.html { redirect_to @knowledge, notice: 'Knowledge was successfully created.' }\n format.json { render json: @knowledge, status: :created, location: @knowledge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = Enrollment.new(params[:enrollment])\n\n respond_to do |format|\n if @enrollment.save\n flash[:notice] = 'Enrollment was successfully created.'\n format.html { redirect_to(department_lecture_path(@enrollment.lecture.department, @enrollment.lecture)) }\n format.xml { render :xml => @enrollment, :status => :created, :location => @enrollment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @enrollment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @daw_encuest = DawEncuest.new(daw_encuest_params)\n\n respond_to do |format|\n if @daw_encuest.save\n format.html { redirect_to @daw_encuest, notice: 'Daw encuest was successfully created.' }\n format.json { render :show, status: :created, location: @daw_encuest }\n else\n format.html { render :new }\n format.json { render json: @daw_encuest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n if @proposal.save\n format.html { redirect_to @proposal.enrolment, notice: 'Proposal was successfully created.' }\n format.json { render json: @proposal, status: :created, location: @proposal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @desgination = Desgination.new(desgination_params)\n\n respond_to do |format|\n if @desgination.save\n format.html { redirect_to @desgination, notice: 'Desgination was successfully created.' }\n format.json { render :show, status: :created, location: @desgination }\n else\n format.html { render :new }\n format.json { render json: @desgination.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if !params[\"edu_history\"].blank?\n params[\"edu_history\"].each do |edu|\n if edu[\"name\"] != \"\"\n @education = Education.create(education_params(edu))\n @education.user_id = current_user.id\n @education.save\n end\n end\n else\n @education = Education.new(education_params(params[\"education\"]))\n @education.user_id = current_user.id\n @education.save\n\n end\n @email = current_user.profile.official_email.split(\"@\").first\n respond_to do |format|\n if params[:caller] == 'reg'\n format.html { redirect_to '/registeration_steps?step=3&name='+ @email}\n else\n format.html { redirect_to educations_url, notice: 'Education ....' }\n end\n format.json { head :no_content }\n format.js\n end\n end", "def create\n @guest_educator = GuestEducator.new(guest_educator_params)\n\n respond_to do |format|\n if @guest_educator.save\n format.html { redirect_to @guest_educator, notice: 'Guest educator was successfully created.' }\n format.json { render :show, status: :created, location: @guest_educator }\n else\n format.html { render :new }\n format.json { render json: @guest_educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def educator_params\n params.require(:educator).permit(:paperwork)\n end", "def create\n @advancement = Advancement.new(params[:advancement])\n\n respond_to do |format|\n if @advancement.save\n format.html { redirect_to @advancement, notice: 'Advancement was successfully created.' }\n format.json { render json: @advancement, status: :created, location: @advancement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advancement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.find(params[:course_id])\n @enrollment = @course.enrollments.create(params[:enrollment])\n\n respond_to do |format|\n if @enrollment.save\n format.html { render :template => 'enrollments/success', notice: 'ya' }\n format.json { render json: @enrollment, status: :created, location: @enrollment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end", "def create\n @elector = Elector.new(elector_params)\n\n if @elector.save\n render json: @elector, status: :created, location: @elector\n else\n render json: @elector.errors, status: :unprocessable_entity\n end\n end", "def create\n @enrollment = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully created.' }\n format.json { render :show, status: :created, location: @enrollment }\n else\n format.html { render :new }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully created.' }\n format.json { render :show, status: :created, location: @enrollment }\n else\n format.html { render :new }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = current_user.enrollments.build(enrollment_params)\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to user_enrollment_path(current_user, @enrollment), notice: 'We have received your request for enrollment. We\\'ll contact you with further details.' }\n else\n flash[:alert] = @enrollment.errors.full_messages.to_sentence\n format.html { redirect_to request.referrer }\n end\n end\n end", "def create\n @election = Election.new(election_params)\n\n respond_to do |format|\n if @election.save\n format.html { redirect_to @election, notice: \"Election was successfully created.\" }\n format.json { render :show, status: :created, location: @election }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @empsked = Empsked.new(params[:empsked])\n\n respond_to do |format|\n if @empsked.save\n format.html { redirect_to @empsked, notice: 'Empsked was successfully created.' }\n format.json { render json: @empsked, status: :created, location: @empsked }\n else\n format.html { render action: \"new\" }\n format.json { render json: @empsked.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @education = Education.new(params[:education])\n @education.resource_id = current_user.id\n @education.resource_type = 'User'\n @education.provider = 0 \n\n respond_to do |format|\n if @education.save\n format.html { redirect_to(educations_url, :notice => 'Education was successfully added.') }\n format.xml { render :xml => @education, :status => :created, :location => @education }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @education.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @education_entry = EducationEntry.new(education_entry_params)\n\n respond_to do |format|\n if @education_entry.save\n format.html { redirect_to @education_entry, notice: 'Education entry was successfully created.' }\n format.json { render action: 'show', status: :created, location: @education_entry }\n else\n format.html { render action: 'new' }\n format.json { render json: @education_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @enrollment = Enrollment.new(properties_data: enrollment_properties_params)\n #debugger\n #@enrollment = Enrollment.new()\n #render json: request.raw_post(), status: :created\n\n if @enrollment.save\n render json: {:reference_number => @enrollment.reference_number}, status: :created\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end", "def enrollment\n \n connection =\n HTTParty.post('https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n :body => JSON.generate(\"locale\": 'en-us'),\n :headers => { 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\" })\n @parsed = JSON.parse(connection.body)\n create_DB_profile();\n create_profile();\n redirect_to ('/speech')\n end", "def create\n @educational_institution = EducationalInstitution.new(educational_institution_params)\n\n respond_to do |format|\n if @educational_institution.save\n format.html { redirect_to @educational_institution, notice: 'Educational institution was successfully created.' }\n format.json { render :show, status: :created, location: @educational_institution }\n else\n format.html { render :new }\n format.json { render json: @educational_institution.errors, status: :unprocessable_entity }\n end\n end\n end", "def POST; end", "def create\n @tenancy_agreement = TenancyAgreement.new(params[:tenancy_agreement])\n @tenancy_agreement.estate_agent_id = current_user.estate_agent_id\n respond_to do |format|\n if @tenancy_agreement.save\n format.html { redirect_to tenancy_agreements_path, notice: 'Tenancy agreement was successfully created.' }\n format.json { render json: @tenancy_agreement, status: :created, location: @tenancy_agreement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tenancy_agreement.errors, status: :unprocessable_entity }\n end\n end\n end", "def education_accomplishment_params\n params.require(:education_accomplishment).permit(:description, :education_id)\n end", "def certify_event_attendence_post\n #create approval if create approval selected\n @event = Event.find_by_id(params[:event_id])\n if @event != nil && [email protected]_for_certification && [email protected] && @event.event_certification_request == nil\n # check to make sure debriefing is submitted\n # TODO: ^^ This\n # update the event first\n if @event.update(event_certify_params)\n #create certification request\n ecr = EventCertificationRequest.new(event_id: @event.id)\n #create approval\n ecr.approval_id = new_approval(6)\n ecr.user_id = current_user.id\n if ecr.save\n @event.submitted_for_certification = true\n @event.event_certification_request_id = ecr.id\n if @event.save\n render status: 200, json: @event\n else\n render status: 500, json: { message: 'Error Occured. Event could not be submitted for certification' }\n end\n else\n @event.submitted_for_certification = false\n if @event.save\n render status: 500, json: { message: 'ERROR: ECR could not be saved. Event reverted so certification could be made.' }\n else\n render status: 500, json: { message: 'ERROR: ECR could not be saved and the event could not be updated. Data wise this is probably really messed up you will need to contact Rindzer.' }\n end\n end\n else\n render status: 500, json: { message: \"An error occured and the event could not be updated.\" }\n end\n else\n render status: 404, json: { message: 'Either this event was not found or has already been submitted for certification.' }\n end\n end", "def create\n @assoziation = Assoziation.new(assoziation_params)\n\n respond_to do |format|\n if @assoziation.save\n format.html { redirect_to moderator_faculty_assoziations_path(params[:faculty_id]), \n notice: 'Assoziation was successfully created.' \n }\n format.json { render :show, status: :created, location: @assoziation }\n else\n format.html { render :new }\n format.json { render json: @assoziation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enroll = Enroll.new(enroll_params)\n\n respond_to do |format|\n if @enroll.save\n format.html { redirect_to @enroll, notice: 'Enroll was successfully created.' }\n format.json { render :show, status: :created, location: @enroll }\n else\n format.html { render :new }\n format.json { render json: @enroll.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @election = Election.new(election_params)\n\n respond_to do |format|\n if @election.save\n format.html { redirect_to @election, notice: 'Election was successfully created.' }\n format.json { render :show, status: :created, location: @election }\n else\n format.html { render :new }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @election = Election.new(election_params)\n\n respond_to do |format|\n if @election.save\n format.html { redirect_to @election, notice: 'Election was successfully created.' }\n format.json { render :show, status: :created, location: @election }\n else\n format.html { render :new }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @deduction = Deduction.new(deduction_params)\n\n respond_to do |format|\n if @deduction.save\n format.html { redirect_to @deduction, notice: 'Deduction was successfully created.' }\n format.json { render :show, status: :created, location: @deduction }\n else\n format.html { render :new }\n format.json { render json: @deduction.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n course = Course.includes(:professors).new(course_params)\n course.professor_ids=(params[:professors])\n\n if course.save\n render json: course.to_json(include: :professors)\n else\n render :json => { :errors => course.errors }, :status => 422\n end\n end", "def create\nuser=User.find_by_id(current_user.id)\n @exprience = Exprience.new(params[:exprience])\[email protected]=user\n respond_to do |format|\n if @exprience.save\n format.html { redirect_to @exprience, notice: 'Exprience was successfully created.' }\n format.json { render json: @exprience, status: :created, location: @exprience }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exprience.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @election = Election.new(election_params)\n respond_to do |format|\n if @election.save\n format.html { redirect_to [:admin, @election], notice: 'Election was successfully created.' }\n format.json { render :show, status: :created, location: @election }\n else\n format.html { render :new }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def assoziation_params\n params.require(:assoziation).permit(:code, :instructor, :category_id, :courseofstudy_id, :lecture_id)\n end", "def create\n @person = Person.new(person_params)\n @agreement = Agreement.last\n @person.skip_validation = false\n respond_to do |format|\n if @person.save\n @person.agreements << Agreement.last\n if current_user\n if current_user.user?\n current_user.person_id = @person.id\n current_user.save\n end\n end\n format.html { redirect_to @person, notice: 'Uppgifterna lades till. Tack.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n admin_only\n @subject = Subject.new(subject_params)\n\n new_tutor_ids = []\n unless params[:subject][:people_teaching_attributes].blank?\n params[:subject][:people_teaching_attributes].each do |attribute|\n id = attribute[1][:incoming_tutor_id]\n new_tutor_ids << id unless attribute[1][:_destroy] == \"1\"\n end\n end\n\n respond_to do |format|\n if @subject.save\n\n unless new_tutor_ids == []\n new_tutor_ids.each do |id|\n e = ProvidingEnrollment.new\n e.user_id = id\n e.subject_id = @subject.id\n e.save!\n end\n end\n\n format.html { redirect_to @subject, notice: 'Subject was successfully created.' }\n format.json { render :show, status: :created, location: @subject }\n else\n format.html { render :new }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @etude = Etude.new(etude_params)\n\n respond_to do |format|\n if @etude.save\n format.html { redirect_to @etude, notice: 'Etude was successfully created.' }\n format.json { render :show, status: :created, location: @etude }\n else\n format.html { render :new }\n format.json { render json: @etude.errors, status: :unprocessable_entity }\n end\n end\n end", "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 @edesalfact = Edesalfact.new(edesalfact_params)\n\n respond_to do |format|\n if @edesalfact.save\n format.html { redirect_to @edesalfact, notice: 'Edesalfact was successfully created.' }\n format.json { render :show, status: :created, location: @edesalfact }\n else\n format.html { render :new }\n format.json { render json: @edesalfact.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @electoral_district = ElectoralDistrict.new(params[:electoral_district])\n\n respond_to do |format|\n if @electoral_district.save\n format.html { redirect_to @electoral_district, notice: 'Electoral district was successfully created.' }\n format.json { render json: @electoral_district, status: :created, location: @electoral_district }\n else\n format.html { render action: \"new\" }\n format.json { render json: @electoral_district.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @expertise = Expertise.new(expertise_params)\n\n if @expertise.save\n render json: @expertise, status: :created, location: @expertise\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end", "def create\n @education_detail = EducationDetail.new(education_detail_params)\n\n respond_to do |format|\n if @education_detail.save\n format.html { redirect_to @education_detail, notice: 'Education detail was successfully created.' }\n format.json { render :show, status: :created, location: @education_detail }\n else\n format.html { render :new }\n format.json { render json: @education_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to [:admin, @enrollment], notice: 'enrollment was successfully created.' }\n format.json { render :show, status: :created, location: @enrollment }\n else\n format.html { render :new }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = @parent.enrollments.build enrollment_params\n if @enrollment.save\n render :show, status: :created, location: api_v1_mutant_enrollment_url(@enrollment.mutant_id, @enrollment)\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end", "def create\n @attendence = Attendence.new(params[:attendence])\n\n respond_to do |format|\n if @attendence.save\n format.html { redirect_to @attendence, notice: 'Attendence was successfully created.' }\n format.json { render json: @attendence, status: :created, location: @attendence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to @enrollment, notice: 'Matrícula criada com sucesso.' }\n format.json { render :show, status: :created, location: @enrollment }\n else\n format.html { render :new }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @educational_level = EducationalLevel.new(params[:educational_level])\n\n respond_to do |format|\n if @educational_level.save\n format.html { redirect_to @educational_level, notice: 'Educational level was successfully created.' }\n format.json { render json: @educational_level, status: :created, location: @educational_level }\n else\n format.html { render action: \"new\" }\n format.json { render json: @educational_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n professor = Professor.new(professor_params)\n \n if professor.save\n render json: professor.to_json(include: :courses)\n else\n render :json => { :errors => professor.errors }, :status => 422\n end\n end", "def create\n @elder = Elder.new(elder_params)\n\n respond_to do |format|\n if @elder.save\n format.html { redirect_to @elder, notice: 'Se añadió correctamente la información.' }\n format.json { render :show, status: :created, location: @elder }\n else\n format.html { render :new }\n format.json { render json: @elder.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_authors\n text = params[:text]\n puts \"str:#{text}\"\n request = Net::HTTP::Post.new(\"/personality-api/1/add_authors.json\")\n request.basic_auth BmnPersonalityApiSkeletonRor::Application.config.user_name, BmnPersonalityApiSkeletonRor::Application.config.password\n request.set_form_data({ :text => text\n })\n logger.debug(\"request #{request}\");\n response = @http.request(request)\n render :text => response.body\n\n end", "def create\n @designation = Designation.new(params[:designation])\n\n respond_to do |format|\n if @designation.save\n format.html { redirect_to designations_path, notice: 'Designation was successfully created.' }\n format.json { render json: @designation, status: :created, location: @designation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @designation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @exalt = Exalt.new(params[:exalt])\n\n respond_to do |format|\n if @exalt.save\n format.html { redirect_to @exalt, notice: 'Exalt was successfully created.' }\n format.json { render json: @exalt, status: :created, location: @exalt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exalt.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @educate.destroy\n respond_to do |format|\n format.html { redirect_to educates_url, notice: 'Educate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @college = College.new(params[:college])\n\n respond_to do |format|\n if @college.save\n format.html { redirect_to @college, notice: 'College was successfully created.' }\n format.json { render json: @college, status: :created, location: @college }\n else\n format.html { render action: \"new\" }\n format.json { render json: @college.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @election = Election.new(election_params)\n respond_to do |format|\n if @election.save\n @election.users << current_user #add the current user to the users for this election\n format.html { redirect_to user_elections_path, notice: 'Election was successfully created.' }\n format.json { render :show, status: :created, location: @election }\n else\n format.html { render :new }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @digital_edition = DigitalEdition.new(params[:digital_edition])\n\n respond_to do |format|\n if @digital_edition.save\n format.html { redirect_to @digital_edition, notice: 'Digital edition was successfully created.' }\n format.json { render json: @digital_edition, status: :created, location: @digital_edition }\n else\n format.html { render action: \"new\" }\n format.json { render json: @digital_edition.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = Enrollment.new(instructor: true)\n @course = Course.new(course_params)\n @course.enrollments << @enrollment\n current_user.enrollments << @enrollment\n\n respond_to do |format|\n if @enrollment.save and @course.save and current_user.save\n format.html { redirect_to root_url, notice: 'Course was successfully created.' }\n format.json { render action: 'show', status: :created, location: @course }\n else\n format.html { render action: 'new' }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @desease_record = DeseaseRecord.new(desease_record_params)\n\n respond_to do |format|\n if @desease_record.save\n format.html { redirect_to @desease_record.sick, notice: 'Desease record was successfully created.' }\n format.json { render :show, status: :created, location: @desease_record }\n else\n format.html { render :new }\n format.json { render json: @desease_record.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lection = Lection.new(lection_params)\n @lection = current_user.lections.new(lection_params)\n respond_to do |format|\n if @lection.save\n format.html { redirect_to @lection, notice: 'Lection was successfully created.' }\n format.json { render :show, status: :created, location: @lection }\n else\n format.html { render :new }\n format.json { render json: @lection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @educator.update(educator_params)\n format.html { redirect_to @educator, notice: 'Educator was successfully updated.' }\n format.json { render :show, status: :ok, location: @educator }\n else\n format.html { render :edit }\n format.json { render json: @educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @advocacy = Advocacy.new(params[:advocacy])\n\n respond_to do |format|\n if @advocacy.save\n format.html { redirect_to @advocacy, notice: 'Advocacy was successfully created.' }\n format.json { render json: @advocacy, status: :created, location: @advocacy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advocacy.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @educational_detail.destroy\n respond_to do |format|\n format.html { redirect_to educational_details_url, notice: 'Educational detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @enrollment = Enrollment.new(enrollment_params)\n @enrollment.student = Student.find(params[:student_for_enrollment])\n @enrollment.subject = Subject.find(params[:subject])\n @enrollment.year = DateTime.now.year\n\n respond_to do |format|\n if @enrollment.save\n format.html { redirect_to '/students', notice: 'La Cursada se creó exitosamente.' }\n format.json { render :show, status: :created, location: @enrollment }\n else\n format.html { render :new }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admitting = Admitting.new(admitting_params)\n\n if @admitting.save\n render json: @admitting, status: :created, location: @admitting\n else\n render json: @admitting.errors, status: :unprocessable_entity\n end\n end", "def create\n #@enrollment = Enrollment.new(params[:enrollment])\n\n respond_to do |format|\n @enrollment = Enrollment.shard_for( params[:enrollment][:classroom_id] ).create!( params[:enrollment] )\n if @enrollment\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully created.' }\n format.json { render json: @enrollment, status: :created, location: @enrollment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @endurance = Endurance.new(params[:endurance])\n\n respond_to do |format|\n if @endurance.save\n format.html { redirect_to @endurance, notice: 'Endurance was successfully created.' }\n format.json { render json: @endurance, status: :created, location: @endurance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @endurance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @subestation = Subestation.new(subestation_params)\n\n respond_to do |format|\n if @subestation.save\n format.html { redirect_to @subestation, notice: 'Subestation was successfully created.' }\n format.json { render :show, status: :created, location: @subestation }\n else\n format.html { render :new }\n format.json { render json: @subestation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n if current_user && current_user.university_id\n begin \n params[:enrollment][:user_id] = current_user.id \n params[:enrollment][:university_id] = current_user.university_id\n @enrollment = Enrollment.renew( params[:enrollment] )\n render :show\n rescue \n render json: {error: \"Enrollment not created.\"}\n end\n else\n render json: {error: \"Enrollment not created.\"}\n end\n end", "def create\n @education_service_provided_typology = EducationServiceProvidedTypology.new(education_service_provided_typology_params)\n\n respond_to do |format|\n if @education_service_provided_typology.save\n format.html { redirect_to @education_service_provided_typology, notice: 'Education service provided typology was successfully created.' }\n format.json { render action: 'show', status: :created, location: @education_service_provided_typology }\n else\n format.html { render action: 'new' }\n format.json { render json: @education_service_provided_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def educations\r\n @education_levels = Education.find(:all)\r\n end" ]
[ "0.5985395", "0.5958767", "0.5955284", "0.5929506", "0.58746797", "0.5873889", "0.58625704", "0.5855006", "0.5814467", "0.5802802", "0.5754194", "0.57334805", "0.57017183", "0.56983155", "0.56978935", "0.56553966", "0.56525874", "0.5645124", "0.5629646", "0.56071794", "0.56017864", "0.5600769", "0.55649984", "0.55645984", "0.5546613", "0.5522666", "0.54977405", "0.5490397", "0.5482785", "0.5453177", "0.54516274", "0.5427917", "0.54222673", "0.54180294", "0.54164094", "0.5412289", "0.54019105", "0.53975165", "0.53886694", "0.53885555", "0.53657967", "0.5357927", "0.5357927", "0.5346698", "0.5345169", "0.53444606", "0.5327573", "0.5315573", "0.53121513", "0.53094584", "0.53091544", "0.5306376", "0.53009784", "0.5293521", "0.5288842", "0.5283604", "0.52823144", "0.5279304", "0.5279304", "0.5269059", "0.5263142", "0.5255549", "0.5255243", "0.5253826", "0.5253159", "0.5251442", "0.5251405", "0.5250982", "0.52492785", "0.52484626", "0.5248454", "0.5240212", "0.5234059", "0.5233725", "0.5232892", "0.5231257", "0.52143383", "0.5206671", "0.5192972", "0.51927435", "0.5186399", "0.5179963", "0.5179946", "0.51734483", "0.51699364", "0.5165909", "0.516417", "0.51546437", "0.515071", "0.5143961", "0.51402366", "0.5138743", "0.51344407", "0.5132496", "0.51301175", "0.5126739", "0.512576", "0.51238865", "0.5114993", "0.5112746" ]
0.5606241
20
PATCH/PUT /educations/1 or /educations/1.json
def update respond_to do |format| if @education.update(education_params) format.html { redirect_to @education, notice: "Education was successfully updated." } format.json { render :show, status: :ok, location: @education } else format.html { render :edit, status: :unprocessable_entity } format.json { render json: @education.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @educator.update(educator_params)\n format.html { redirect_to @educator, notice: 'Paperwork successfully updated.' }\n format.json { render :show, status: :ok, location: @educator }\n else\n format.html { render :edit }\n format.json { render json: @educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @educator.update(educator_params)\n format.html { redirect_to @educator, notice: 'Educator was successfully updated.' }\n format.json { render :show, status: :ok, location: @educator }\n else\n format.html { render :edit }\n format.json { render json: @educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @elector = Elector.find(params[:id])\n\n if @elector.update(elector_params)\n head :no_content\n else\n render json: @elector.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @educate.update(educate_params)\n format.html { redirect_to @educate, notice: 'Educate was successfully updated.' }\n format.json { render :show, status: :ok, location: @educate }\n else\n format.html { render :edit }\n format.json { render json: @educate.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @educ_info.update(educ_info_params)\n format.html { redirect_to @educ_info, notice: 'Educ info was successfully updated.' }\n format.json { render :show, status: :ok, location: @educ_info }\n else\n format.html { render :edit }\n format.json { render json: @educ_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_entry.update(education_entry_params)\n format.html { redirect_to @education_entry, notice: 'Education entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @education_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @education.update(education_params)\n render :show, status: :ok, location: @education\n else\n render json: @education.errors, status: :unprocessable_entity\n end\n end", "def update\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n if @exprience.update_attributes(params[:exprience])\n format.html { redirect_to @exprience, notice: 'Exprience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exprience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #debugger\n if @enrollment.update(update_params)\n head :no_content\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end", "def update\n\n respond_to do |format|\n if @lecture.update(lecture_params)\n format.html { redirect_to lectures_url }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_service_provided_typology.update(education_service_provided_typology_params)\n format.html { redirect_to @education_service_provided_typology, notice: 'Education service provided typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @education_service_provided_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education.update(education_params)\n format.html { redirect_to educations_url, notice: 'Education was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n @election = Election.find(election_params[:id])\n respond_to do |format|\n if @election.update(election_params)\n format.html { redirect_to user_elections_path, notice: 'Election was successfully updated.' }\n format.json { render :show, status: :ok, location: @election }\n else\n format.html { render :edit }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @educational_detail.update(educational_detail_params)\n format.html { redirect_to statuses_url, notice: 'Educational detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @educational_detail }\n else\n format.html { render :edit }\n format.json { render json: @educational_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @escalation.update(escalation_params)\n format.html { redirect_to @escalation, notice: 'Escalation was successfully updated.' }\n format.json { render :show, status: :ok, location: @escalation }\n else\n format.html { render :edit }\n format.json { render json: @escalation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_accomplishment.update(education_accomplishment_params)\n format.html { redirect_to @education_accomplishment, notice: 'Education accomplishment was successfully updated.' }\n format.json { render :show, status: :ok, location: @education_accomplishment }\n else\n format.html { render :edit }\n format.json { render json: @education_accomplishment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @educator = Educator.find(params[:id])\n ong_desc = params[:ong_desc]\n union_movement_desc = params[:union_movement_desc]\n educator_years = params[:educator_years]\n educator_popular_education_years = params[:educator_popular_education_years]\n respond_to do |format|\n if @educator.update_attributes(params[:educator])\n if [email protected]_participations.first.nil?\n @educator.social_participations.first.save_with_descs(ong_desc, union_movement_desc)\n end\n if [email protected]_education_exps.first.nil?\n @educator.educators_education_exps.first.update_with_years(educator_years, educator_popular_education_years)\n end\n flash[:success] = t('educator.updated')\n format.html { redirect_to(educators_path) }\n format.xml { head :ok }\n else\n if @educator.core_id.nil?\n @rooms = []\n else\n @rooms = Core.find(core_id).rooms\n end\n flash[:error] = t('default_error_message')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @educator.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @emu_person.update(emu_person_params)\n format.html { redirect_to @emu_person, notice: 'Emu person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @emu_person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n if @exalt.update_attributes(params[:exalt])\n format.html { redirect_to @exalt, notice: 'Exalt was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exalt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n @enrollment = Enrollment.find(params[:id])\n\t# give correct user id.\n\t\n respond_to do |format|\n if @enrollment.update_attributes(params[:enrollment])\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @education = Education.where(:resource_id => current_user.id, :id => params[:id]).first\n\n respond_to do |format|\n if @education.update_attributes(params[:education])\n format.html { redirect_to(@education, :notice => 'Education was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @education.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @edu_detail = EduDetail.find(params[:id])\n\n respond_to do |format|\n if @edu_detail.update_attributes(params[:edu_detail])\n format.html { redirect_to @edu_detail, notice: 'Edu detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @edu_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @knowledge = current_user.knowledges.find(params[:id])\n\n respond_to do |format|\n if @knowledge.update_attributes(params[:knowledge])\n format.html { redirect_to @knowledge, notice: 'Knowledge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @knowledge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @enroll = Enroll.find(params[:id])\n if @enroll.update_attributes(params[:enroll])\n render json: JSON.parse(@enroll.to_json)\n else\n render json: JSON.parse(@enroll.errors.to_json)\n end\n end", "def update\n @expertise = Expertise.find(params[:id])\n\n if @expertise.update(expertise_params)\n head :no_content\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end", "def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end", "def update\n respond_to do |format|\n if @lecture.update(lecture_params)\n format.html { redirect_to @lecture, notice: 'Lecture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @lecture.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_detail.update(education_detail_params)\n format.html { redirect_to @education_detail, notice: 'Education detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @education_detail }\n else\n format.html { render :edit }\n format.json { render json: @education_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @endorsement = Endorsement.find(params[:id])\n\n if @endorsement.update(endorsement_params)\n head :no_content\n else\n render json: @endorsement.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @ed.update(ed_params)\n format.html { redirect_to @ed, notice: 'Ed was successfully updated.' }\n format.json { render :show, status: :ok, location: @ed }\n else\n format.html { render :edit }\n format.json { render json: @ed.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @college = College.find(params[:id])\n\n respond_to do |format|\n if @college.update_attributes(params[:college])\n format.html { redirect_to '/colleges', notice: 'College was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @college.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @climber_education.update(climber_education_params)\n format.html { redirect_to @climber_education, notice: 'Climber education was successfully updated.' }\n format.json { render :show, status: :ok, location: @climber_education }\n else\n format.html { render :edit }\n format.json { render json: @climber_education.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @editorial.update(editorial_params)\n format.html { redirect_to @editorial, notice: 'Article was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @editorial.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if election.update_attributes(params[:election] ? election_attributes : {})\n format.html { redirect_to(election, flash: { success: 'Election updated.' }) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => election.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @general_educator.update(general_educator_params)\n format.html { redirect_to @general_educator, notice: 'General educator was successfully updated.' }\n format.json { render :show, status: :ok, location: @general_educator }\n else\n format.html { render :edit }\n format.json { render json: @general_educator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @educacao.update(educacao_params)\n format.html { redirect_to @educacao, notice: 'Educacao was successfully updated.' }\n format.json { render :json => @educacao }\n else\n format.html { render action: 'edit' }\n format.json { render json: @educacao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @elder.update(elder_params)\n format.html { redirect_to @elder, notice: 'Se editó correctamente la información.' }\n format.json { render :show, status: :ok, location: @elder }\n else\n format.html { render :edit }\n format.json { render json: @elder.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @empolyee.update(empolyee_params)\n format.html { redirect_to @empolyee, notice: 'Empolyee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @empolyee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @eou = Eou.find(params[:id])\n\n respond_to do |format|\n if @eou.update_attributes(params[:eou])\n format.html { redirect_to @eou, :notice => 'Eou was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @eou.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @leadership.update(leadership_params)\n format.html { redirect_to @leadership, notice: 'Leadership was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @leadership.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enroll.update(enroll_params)\n format.html { redirect_to @enroll, notice: 'Enroll was successfully updated.' }\n format.json { render :show, status: :ok, location: @enroll }\n else\n format.html { render :edit }\n format.json { render json: @enroll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enroll.update(enroll_params)\n format.html { redirect_to @enroll, notice: 'Enroll was successfully updated.' }\n format.json { render :show, status: :ok, location: @enroll }\n else\n format.html { render :edit }\n format.json { render json: @enroll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrollment.update(enrollment_params)\n format.html { redirect_to @enrollment, notice: 'Matrícula editada com sucesso.' }\n format.json { render :show, status: :ok, location: @enrollment }\n else\n format.html { render :edit }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @election.update(election_params)\n format.html { redirect_to @election, notice: \"Election was successfully updated.\" }\n format.json { render :show, status: :ok, location: @election }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @edu_doc=EduDoc.new(edu_doc_params)\n respond_to do |format|\n if @edu_doc.save!\n format.html { redirect_to @edu_doc, notice: \"Edu doc was successfully updated.\" }\n format.json { render :index, status: :ok, location: @edu_doc }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @edu_doc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education_class.update(education_class_params)\n format.html { redirect_to @education_class, notice: 'Education class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @education_class.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n if @employe.update_attributes(params[:employe])\n format.html { redirect_to @employe, notice: 'Employe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n if @exhibition.update_attributes(params[:exhibition])\n format.html { redirect_to @exhibition, notice: 'Exhibition was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exhibition.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n if @enterprise.update_attributes(params[:enterprise])\n format.html { redirect_to \"/enterprises\", notice: 'Enterprise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enterprise.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @election.update(election_params)\n format.html { redirect_to [:admin, @election], notice: 'Election was successfully updated.' }\n format.json { render :show, status: :ok, location: @election }\n else\n format.html { render :edit }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @election.update(election_params)\n format.html { redirect_to @election, notice: 'Election was successfully updated.' }\n format.json { render :show, status: :ok, location: @election }\n else\n format.html { render :edit }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @election.update(election_params)\n format.html { redirect_to @election, notice: 'Election was successfully updated.' }\n format.json { render :show, status: :ok, location: @election }\n else\n format.html { render :edit }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:add_education]\n @options = Organisme.order(\"name\").all.collect do |s| [s.name, s.id] end\n \t# rebuild the education attributes that doesn't have an id\n \tunless params.to_unsafe_hash[:employe][:educations_attributes].blank?\n \t for attribute in params.to_unsafe_hash[:employe][:educations_attributes]\n \t @employe.educations.build(attribute.last.except(:_destroy)) unless attribute.last.has_key?(:id)\n \t end\n \tend\n # add one more empty education attribute\n @employe.educations.build\n render :action => 'edit'\n elsif params[:remove_education]\n @options = Organisme.order(\"name\").all.collect do |s| [s.name, s.id] end\n # collect all marked to delete education ids\n removed_educations = params.to_unsafe_hash[:employe][:educations_attributes].collect { |i, att| att[:id] if (att[:id] && att[:_destroy].to_i == 1) }\n # physically delete the educations from database\n Education.delete(removed_educations)\n flash[:notice] = \"Education removed.\"\n for attribute in params.to_unsafe_hash[:employe][:educations_attributes]\n\n \t# rebuild educations attributes that doesn't have an id and its _destroy attribute is not 1\n @employe.educations.build(attribute.last.except(:_destroy)) if (!attribute.last.has_key?(:id) && attribute.last[:_destroy].to_i == 0)\n end\n render :action => 'edit'\n else\n respond_to do |format|\n if @employe.update(employe_params)\n format.html { redirect_to @employe, notice: 'Employe was successfully updated.' }\n format.json { render :show, status: :ok, location: @employe }\n else\n @options = Organisme.order(\"name\").all.collect do |s| [s.name, s.id] end\n format.html { render :edit }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @applicant.update(applicant_params)\n format.html { redirect_to @applicant, notice: 'Applicant was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @applicant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enroll.update(enroll_params)\n format.html { redirect_to @enroll, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @enroll }\n else\n format.html { render :edit }\n format.json { render json: @enroll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @exemption.update(exemption_params)\n format.html { redirect_to @exemption, notice: 'Exemption was successfully updated.' }\n format.json { render :show, status: :ok, location: @exemption }\n else\n format.html { render :edit }\n format.json { render json: @exemption.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(update_params)\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @education.update(education_params(params[\"education\"]))\n if params[:caller] == 'reg'\n format.html { redirect_to '/registeration_steps?step=3'}\n else\n format.html { redirect_to @education, notice: 'Education was successfully updated.' }\n format.js\n end\n format.json { render :show, status: :ok, location: @education }\n else\n format.html { render :edit }\n format.json { render json: @education.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def update\n @advancement = Advancement.find(params[:id])\n\n respond_to do |format|\n if @advancement.update_attributes(params[:advancement])\n format.html { redirect_to @advancement, notice: 'Advancement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advancement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @alcatel.update(alcatel_params)\n format.html { redirect_to @alcatel, notice: 'Alcatel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @alcatel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @election_type = ElectionType.find(params[:id])\n\n respond_to do |format|\n if @election_type.update_attributes(params[:election_type])\n format.html { redirect_to @election_type, notice: 'Election type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @election_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enterprise.update(enterprise_params)\n format.html { redirect_to @enterprise, notice: 'Enterprise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @enterprise.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n if @attendence.update_attributes(params[:attendence])\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @relation_industry.update(relation_industry_params)\n format.html { redirect_to @relation_industry, notice: 'Relation industry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @relation_industry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrollment.update(enrollment_params)\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrollment }\n else\n format.html { render :edit }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrollment.update(enrollment_params)\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrollment }\n else\n format.html { render :edit }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrollment.update(enrollment_params)\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrollment }\n else\n format.html { render :edit }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrollment.update(enrollment_params)\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrollment }\n else\n format.html { render :edit }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enrollment.update(enrollment_params)\n format.html { redirect_to @enrollment, notice: 'Enrollment was successfully updated.' }\n format.json { render :show, status: :ok, location: @enrollment }\n else\n format.html { render :edit }\n format.json { render json: @enrollment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ecg = Ecg.find(params[:id])\n\n respond_to do |format|\n if @ecg.update_attributes(params[:ecg])\n format.html { redirect_to @ecg, notice: 'Ecg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ecg.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @autore = Autore.find(params[:id])\n\n respond_to do |format|\n if @autore.update_attributes(params[:autore])\n format.html { redirect_to @autore, notice: 'Autore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @autore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Proposal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @resume_collection.update(resume_collection_params)\n format.html { redirect_to @resume_collection, notice: 'Resume collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @resume_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @absence = Absence.find(params[:id])\n\n respond_to do |format|\n if @absence.update_attributes(params[:absence])\n format.html { redirect_to @absence, notice: 'Absence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @attendence.update(attendence_params)\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { render :show, status: :ok, location: @attendence }\n else\n format.html { render :edit }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @attendence.update(attendence_params)\n format.html { redirect_to @attendence, notice: 'Attendence was successfully updated.' }\n format.json { render :show, status: :ok, location: @attendence }\n else\n format.html { render :edit }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @person = Person.find(params[:id])\n\n populate_attributes(@person, params[:person])\n respond_to do |format|\n \n if @person.save && @person.identifiable_entries.each(&:save!)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n safe_params = params.permit(:id, :student_id, event_note: [:text])\n event_note = authorized_or_raise! { EventNote.find(safe_params[:id]) }\n raise Exceptions::EducatorNotAuthorized unless event_note.educator_id == current_educator.id\n\n # Update and also store the revision history\n update_succeeded, event_note_revision = update_note_with_revision(event_note, :text, safe_params[:event_note][:text])\n\n # Error types\n if event_note_revision.nil?\n render json: { errors: event_note_revision.errors.full_messages }, status: 422\n elsif !update_succeeded\n render json: { errors: event_note.errors.full_messages }, status: 422\n else\n serializer = EventNoteSerializer.dangerously_include_restricted_text(event_note)\n render json: serializer.serialize_event_note\n end\n end", "def update\n @election = Election.find(params[:id])\n\n respond_to do |format|\n if @election.update_attributes(params[:election])\n flash[:notice] = 'Election was successfully updated.'\n format.html { redirect_to(@election) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @election.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @employ = Employ.find(params[:id])\n\n respond_to do |format|\n if @employ.update_attributes(params[:employ])\n format.html { redirect_to @employ, notice: 'Employ was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employ.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @intro = Intro.find(params[:id])\n\n @intro.update_attributes(params[:intro])\n\n respond_to do |format|\n if @intro.update_attributes(params[:contact])\n format.html { redirect_to manage_intro_index_url, notice: 'Manage contact was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @intro.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 @assessment = Assessment.find(params[:id])\n\n respond_to do |format|\n if @assessment.update_attributes(params[:assessment])\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @applicant.update(applicant_params)\n update_skills\n format.html { redirect_to @applicant, notice: 'Applicant was successfully updated.' }\n format.json { render :show, status: :ok, location: @applicant }\n else\n format.html { render :edit }\n format.json { render json: @applicant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @responsible.update(responsible_params)\n format.html { redirect_to @responsible, notice: 'Responsavel editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @responsible.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @employee_remunerative_concept = @employee.employee_emunerative_concept.find(params[:id])\n\n respond_to do |format|\n if @employee_remunerative_concept.update_attributes(params[:employee_remunerative_concept])\n format.html { redirect_to([@employee,@employee_remunerative_concept], :notice => 'Employee remunerative concept was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @employee_remunerative_concept.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @university = UniversityDecorator.decorate @employer_study.university\n respond_to do |format|\n if @employer_study.update_attributes(params[:employer_study])\n format.html { redirect_to @employer_study, notice: t2('update.notice') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employer_study.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @empsked = Empsked.find(params[:id])\n\n respond_to do |format|\n if @empsked.update_attributes(params[:empsked])\n format.html { redirect_to @empsked, notice: 'Empsked was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @empsked.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @proposal = Proposal.find(params[:id])\n\n respond_to do |format|\n if @proposal.update_attributes(params[:proposal])\n format.html { redirect_to @proposal, notice: 'Orçamento instantâneo atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client_sex = ClientSex.find(params[:id])\n\n respond_to do |format|\n if @client_sex.update_attributes(params[:client_sex])\n format.html { redirect_to @client_sex, notice: 'Client sex was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_sex.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @instructor.update(instructor_params)\n render json: @instructor\n else\n render json: @instructor.errors\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @expert.update(expert_params)\n format.html { redirect_to @expert, notice: 'Expert was successfully updated.' }\n format.json { render :show, status: :ok, location: @expert }\n else\n format.html { render :edit }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @expert.update(expert_params)\n format.html { redirect_to @expert, notice: 'Expert was successfully updated.' }\n format.json { render :show, status: :ok, location: @expert }\n else\n format.html { render :edit }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_profession.update(user_profession_params)\n format.html { redirect_to @user_profession, notice: 'User profession was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_profession.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @etude.update(etude_params)\n format.html { redirect_to @etude, notice: 'Etude was successfully updated.' }\n format.json { render :show, status: :ok, location: @etude }\n else\n format.html { render :edit }\n format.json { render json: @etude.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @responsavel = Responsavel.find(params[:id])\n\n if @responsavel.update(responsavel_params)\n head :no_content\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @transect.update(transect_params)\n # format.html { redirect_to @transect, notice: 'Transect was successfully updated.' }\n format.html { redirect_to transects_path, notice: 'Transect was successfully updated.' }\n format.json { render :show, status: :ok, location: @transect }\n else\n format.html { render :edit }\n format.json { render json: @transect.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6535016", "0.64650285", "0.6450497", "0.641519", "0.64008754", "0.6315527", "0.6306497", "0.6294004", "0.62910867", "0.62828135", "0.6277845", "0.6275925", "0.6250888", "0.6216633", "0.6210616", "0.6196383", "0.616762", "0.6156594", "0.6138315", "0.6131525", "0.6110002", "0.6109861", "0.6104559", "0.61005294", "0.6099498", "0.60977334", "0.60964173", "0.60628456", "0.60622054", "0.60512996", "0.60412776", "0.60400975", "0.60380566", "0.60363954", "0.6032363", "0.6026846", "0.6023411", "0.6019166", "0.6013649", "0.60082", "0.60076267", "0.60076267", "0.60029584", "0.60006934", "0.59945685", "0.59914976", "0.59871954", "0.59761834", "0.59751546", "0.59725785", "0.59680724", "0.59680724", "0.5962181", "0.5959969", "0.5955799", "0.5946702", "0.5945925", "0.5945577", "0.5941021", "0.5927323", "0.5921518", "0.59204525", "0.5920349", "0.59186345", "0.59113705", "0.59090376", "0.59090376", "0.59090376", "0.59090376", "0.59090376", "0.5905919", "0.59032226", "0.5903146", "0.59011257", "0.58925927", "0.5891184", "0.5891184", "0.58898723", "0.5884273", "0.58825713", "0.58777964", "0.5877351", "0.58766186", "0.5873471", "0.5873154", "0.5871582", "0.5869699", "0.5868173", "0.5867935", "0.5864072", "0.58633596", "0.58592516", "0.58518344", "0.58509815", "0.58509815", "0.5842866", "0.5841899", "0.5840154", "0.5829093", "0.5828391" ]
0.630507
7
DELETE /educations/1 or /educations/1.json
def destroy @education.destroy respond_to do |format| format.html { redirect_to educations_url, notice: "Education was successfully destroyed." } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @educate.destroy\n respond_to do |format|\n format.html { redirect_to educates_url, notice: 'Educate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @educator.destroy\n respond_to do |format|\n format.html { redirect_to educators_url, notice: 'Educator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @educ_info.destroy\n respond_to do |format|\n format.html { redirect_to educ_infos_url, notice: 'Educ info was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education.destroy\n respond_to do |format|\n format.html { redirect_to educations_url, notice: 'Education was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education.destroy\n respond_to do |format|\n format.html { redirect_to educations_url, notice: 'Education was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education = @resume.educations.find(params[:id])\n @education.destroy\n\n respond_to do |format|\n format.html { redirect_to(edit_resume_path(@resume)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @educational_detail.destroy\n respond_to do |format|\n format.html { redirect_to educational_details_url, notice: 'Educational detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_entry.destroy\n respond_to do |format|\n format.html { redirect_to education_entries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @educator = Educator.find(params[:id])\n @educator.destroy\n\n respond_to do |format|\n format.html { redirect_to(educator_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @educacao.destroy\n respond_to do |format|\n format.html { redirect_to educacaos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @general_educator.destroy\n respond_to do |format|\n format.html { redirect_to general_educators_url, notice: 'General educator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @climber_education.destroy\n respond_to do |format|\n format.html { redirect_to climber_educations_url, notice: 'Climber education was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_accomplishment.destroy\n respond_to do |format|\n format.html { redirect_to education_accomplishments_url, notice: 'Education accomplishment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @edu_doc.destroy\n respond_to do |format|\n format.html { redirect_to edu_docs_url, notice: \"Edu doc was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @edu_detail = EduDetail.find(params[:id])\n @edu_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to edu_details_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to enrollments_url, notice: 'Matrícula excluída com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education = Education.where(:resource_id => current_user.id, :id => params[:id]).first\n @education.destory\n\n respond_to do |format|\n format.html { redirect_to(educations_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @educational_level = EducationalLevel.find(params[:id])\n @educational_level.destroy\n\n respond_to do |format|\n format.html { redirect_to educational_levels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @education.destroy\n respond_to do |format|\n format.html { redirect_to educations_url, notice: 'Education was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end", "def destroy\n @exprience = Exprience.find(params[:id])\n @exprience.destroy\n\n respond_to do |format|\n format.html { redirect_to expriences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ed.destroy\n respond_to do |format|\n format.html { redirect_to eds_url, notice: 'Ed was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment = Enrollment.find(params[:id])\n @enrollment.destroy\n\n respond_to do |format|\n format.html { redirect_to enrollments_url }\n format.json { head :no_content }\n end\n end", "def educations_del\r\n edu_profile_id = params[:edu_profile_id]\r\n edu_profile = EducationProfile.find(edu_profile_id, :select => \"id, account_id\")\r\n \r\n return jump_to(\"/errors/forbidden\") unless edu_profile.account_id == session[:account_id]\r\n \r\n EducationProfile.delete(edu_profile_id)\r\n @edu_profile_entry_id = \"edu_profile_#{edu_profile_id}\"\r\n end", "def destroy\n @education_service_provided_typology.destroy\n respond_to do |format|\n format.html { redirect_to education_service_provided_typologies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exhibition = Exhibition.find(params[:id])\n @exhibition.destroy\n\n respond_to do |format|\n format.html { redirect_to exhibitions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_detail.destroy\n respond_to do |format|\n format.html { redirect_to education_details_url, notice: 'Education detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to enrollments_url, notice: 'Enrollment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to enrollments_url, notice: 'Enrollment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to enrollments_url, notice: 'Enrollment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to enrollments_url, notice: 'Enrollment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to enrollments_url, notice: 'Enrollment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @docderivacione.destroy\n respond_to do |format|\n format.html { redirect_to docderivaciones_url, notice: 'Docderivacione was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @elder.destroy\n respond_to do |format|\n format.html { redirect_to elders_url, notice: 'Se eliminó correctamente la información.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to admin_enrollments_url, notice: 'enrollment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @digital_edition = DigitalEdition.find(params[:id])\n @digital_edition.destroy\n\n respond_to do |format|\n format.html { redirect_to digital_editions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @guest_educator.destroy\n respond_to do |format|\n format.html { redirect_to guest_educators_url, notice: 'Guest educator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @escalation.destroy\n respond_to do |format|\n format.html { redirect_to escalations_url, notice: 'Escalation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @educational_institution.destroy\n respond_to do |format|\n format.html { redirect_to educational_institutions_url, notice: 'Educational institution was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @exalt = Exalt.find(params[:id])\n @exalt.destroy\n\n respond_to do |format|\n format.html { redirect_to exalts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @accidente.destroy\n respond_to do |format|\n format.html { redirect_to accidentes_url, notice: 'Accidente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @explaination = Explaination.find(params[:id])\n @explaination.destroy\n\n respond_to do |format|\n format.html { redirect_to explainations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @election = Election.find(params[:id])\n @election.destroy\n respond_to do |format|\n format.html { redirect_to user_elections_path, notice: 'Election was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @addimition = Addimition.find(params[:id])\n @addimition.destroy\n\n respond_to do |format|\n format.html { redirect_to addimitions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @emu_person.destroy\n respond_to do |format|\n format.html { redirect_to emu_people_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_class.destroy\n respond_to do |format|\n format.html { redirect_to education_classes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @enrollment.destroy\n respond_to do |format|\n format.html { redirect_to '/students', notice: 'La Cursada se borró exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @subestation.destroy\n respond_to do |format|\n format.html { redirect_to subestations_url, notice: 'Subestation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_level = EducationLevel.find(params[:id])\n @education_level.destroy\n\n respond_to do |format|\n format.html { redirect_to education_levels_url, :notice => t('controllermessage.delete') }\n format.json { head :no_content }\n end\n end", "def destroy\n @expedition.destroy\n respond_to do |format|\n format.html { redirect_to expeditions_url, notice: 'Expedition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enroll.destroy\n respond_to do |format|\n format.html { redirect_to enrolls_path, notice: 'Test was successfully destroyed.' }\n format.json { head :no_enroll }\n end\n end", "def destroy\n @encuestum = Encuestum.find(params[:id])\n @encuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to encuesta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client_sex = ClientSex.find(params[:id])\n @client_sex.destroy\n\n respond_to do |format|\n format.html { redirect_to client_sexes_url }\n format.json { head :ok }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @edesalfact.destroy\n respond_to do |format|\n format.html { redirect_to edesalfacts_url, notice: 'Edesalfact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @edition = Edition.find(params[:id])\n @edition.destroy\n \n respond_to do |format|\n format.html { redirect_to(editions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @agreement.destroy\n respond_to do |format|\n format.html { redirect_to agreements_url, notice: 'Agreement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enroll = Enroll.find(params[:id])\n @enroll.destroy\n\n respond_to do |format|\n format.html { redirect_to enrolls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @representative.destroy\n respond_to do |format|\n format.html { redirect_to [:admin, :representatives], notice: 'Representative was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @electoral_district = ElectoralDistrict.find(params[:id])\n @electoral_district.destroy\n\n respond_to do |format|\n format.html { redirect_to electoral_districts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @applicant_test.destroy\n respond_to do |format|\n format.html { redirect_to applicant_url(@applicant), notice: \"Test Eliminado Correctamente\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @examan.destroy\n respond_to do |format|\n format.html { redirect_to examen_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @election.destroy\n respond_to do |format|\n format.html { redirect_to elections_url, notice: \"Election was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy \n if @enrollment && @enrollment.destroy \n render json: {success: \"Delete Successfully.\"}, status: 200\n else\n render json: {error: \"Enrollment not deleted.\"}\n end \n end", "def destroy\n @election.destroy\n respond_to do |format|\n format.html { redirect_to elections_url, notice: 'Election was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @election.destroy\n respond_to do |format|\n format.html { redirect_to elections_url, notice: 'Election was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @clinical_dose.destroy\n respond_to do |format|\n format.html { redirect_to clinical_doses_url, notice: 'Clinical dose was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @evangelism.destroy\n respond_to do |format|\n format.html { redirect_to evangelisms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @applicant.destroy\n respond_to do |format|\n format.html { redirect_to applicants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estadocivil.destroy\n respond_to do |format|\n format.html { redirect_to estadocivils_url, notice: 'Estadocivil was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @daw_encuest.destroy\n respond_to do |format|\n format.html { redirect_to daw_encuests_url, notice: 'Daw encuest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @accion.destroy\n respond_to do |format|\n format.html { redirect_to accions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @election.destroy\n respond_to do |format|\n format.html { redirect_to admin_elections_url, notice: 'Election was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @audition.destroy\n respond_to do |format|\n format.html { redirect_to '/audition', notice: 'Audition was successfully destroyed.' }\n format.json { head :no_content }\n end\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 @lecture.destroy\n respond_to do |format|\n format.html { redirect_to lectures_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ocupation.destroy\n respond_to do |format|\n format.html { redirect_to ocupations_url, notice: 'Ocupation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @attestation = Attestation.find(params[:id])\r\n @attestation.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to attestations_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @orden_examan.destroy\n respond_to do |format|\n format.html { redirect_to orden_examen_url, notice: 'Orden examan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @deduction.destroy\n respond_to do |format|\n format.html { redirect_to deductions_url, notice: 'Deduction was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @exhibition.destroy\n respond_to do |format|\n format.html { redirect_to exhibitions_url, notice: 'Exhibition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ecg = Ecg.find(params[:id])\n @ecg.destroy\n\n respond_to do |format|\n format.html { redirect_to ecgs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @attestation.destroy\n respond_to do |format|\n format.html { redirect_to attestations_url, notice: 'Attestation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @enroll.destroy\n respond_to do |format|\n format.html { redirect_to enrolls_url, notice: 'Enroll was successfully destroyed.' }\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 @attendence = Attendence.find(params[:id])\n @attendence.destroy\n\n respond_to do |format|\n format.html { redirect_to attendences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @desgination.destroy\n respond_to do |format|\n format.html { redirect_to desginations_url, notice: 'Desgination was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @book_edition = BookEdition.find(params[:id])\n @book_edition.destroy\n\n respond_to do |format|\n format.html { redirect_to book_editions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @etudiant = Etudiant.find(params[:id])\n @etudiant.destroy\n\n respond_to do |format|\n format.html { redirect_to etudiants_url }\n format.json { head :ok }\n end\n end", "def destroy\n @academic_degree.destroy\n respond_to do |format|\n format.html { redirect_to '/maestricos/prueba?titulo=Grado+Academico&tabla=AcademicDegree' }\n format.json { head :no_content }\n end\n end", "def destroy\n @afformation.destroy\n respond_to do |format|\n format.html { redirect_to afformations_url, notice: 'Afformation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @person = Person.find((params[:person_id]))\n @person_identification_doc = PersonIdentificationDoc.find(params[:id])\n @person_identification_doc.destroy\n\n respond_to do |format|\n format.html { redirect_to person_person_identification_docs_path, :notice => 'Documentação excluída.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @college = College.find(params[:id])\n @college.destroy\n\n respond_to do |format|\n format.html { redirect_to colleges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @instructor1 = Instructor1.find(params[:id])\n @instructor1.destroy\n\n respond_to do |format|\n format.html { redirect_to instructor1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @eou = Eou.find(params[:id])\n @eou.destroy\n\n respond_to do |format|\n format.html { redirect_to eous_url }\n format.json { head :ok }\n end\n end", "def destroy\n \n \n if [email protected]_users\n redirect_to :back, notice: \"You are not authorized to destroy this study\"\n \n else\n @study.destroy\n respond_to do |format|\n format.html { redirect_to studies_url }\n format.json { head :no_content }\n end\n \n end\n \n \n \n end", "def destroy\n @uder.destroy\n respond_to do |format|\n format.html { redirect_to uders_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @estate.destroy\n respond_to do |format|\n format.html { redirect_to estates_url, notice: 'Usunięto' }\n format.json { head :no_content }\n end\n end", "def destroy\n @inspiration.destroy\n respond_to do |format|\n format.html { redirect_to inspirations_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7240971", "0.71797454", "0.70778954", "0.70734257", "0.70734257", "0.7018013", "0.69895476", "0.68607074", "0.6834521", "0.68175495", "0.6783619", "0.6772397", "0.6768961", "0.67619485", "0.6752582", "0.673875", "0.6728924", "0.6712811", "0.6712792", "0.66844714", "0.66789657", "0.666359", "0.66631174", "0.66610414", "0.6633494", "0.6625731", "0.6609843", "0.66054845", "0.66054845", "0.66054845", "0.66054845", "0.66054845", "0.66044986", "0.65994364", "0.6597428", "0.65952253", "0.6592755", "0.65910125", "0.6586595", "0.6582649", "0.6575975", "0.65759254", "0.65739447", "0.65727234", "0.6563871", "0.6561277", "0.6560063", "0.6559138", "0.65476644", "0.65228796", "0.6518641", "0.65165436", "0.6513753", "0.65082467", "0.64921075", "0.64848566", "0.6482867", "0.6477497", "0.6475199", "0.6470353", "0.6469697", "0.64558035", "0.6451075", "0.6447848", "0.644762", "0.64431685", "0.64431685", "0.643976", "0.6438907", "0.64388514", "0.64383465", "0.643693", "0.64349025", "0.6433097", "0.6432094", "0.6431958", "0.6427985", "0.64272344", "0.64271915", "0.64271045", "0.6425219", "0.6424052", "0.64211494", "0.6414428", "0.64080286", "0.6405289", "0.6404796", "0.63992614", "0.6389807", "0.63866204", "0.6384111", "0.6383648", "0.6373486", "0.6372808", "0.63720024", "0.6371583", "0.63704413", "0.6369937", "0.6369779", "0.6369375" ]
0.707934
2
Use callbacks to share common setup or constraints between actions.
def set_education @education = Education.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\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 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 workflow\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 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 before_action \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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; 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 setup(&blk)\n @setup_block = blk\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 callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); 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", "def duas1(action)\n action.call\n action.call\nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def call\n setup_context\n super\n end" ]
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", "0.5312988", "0.529798", "0.52968603", "0.52962637", "0.52577317", "0.5244704", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5233461", "0.52322435", "0.5227552", "0.52224743", "0.5217851", "0.521241", "0.52069896", "0.5206555", "0.5176617", "0.51738507", "0.51725876", "0.51660734", "0.51605034", "0.51571786", "0.5152762", "0.5152164", "0.5151477", "0.5145819", "0.51408994", "0.5134412", "0.5114031", "0.5113695", "0.5113695", "0.5108603", "0.5107358", "0.5090405", "0.50889385", "0.50817686", "0.5081617", "0.50658226", "0.50551206", "0.5051746", "0.5049091", "0.5049091", "0.5034681", "0.5024972", "0.5021291", "0.5016024", "0.50134826", "0.50008893", "0.50000244", "0.4999155", "0.49907947", "0.49907947", "0.49853387", "0.49796683", "0.4979596", "0.49778128", "0.49673793", "0.49662578", "0.49587822", "0.4956063", "0.49550167", "0.49523485", "0.4951614", "0.49452996", "0.49442068", "0.49336892", "0.49306205", "0.49264124", "0.49259305", "0.4925823", "0.49229056", "0.4918999", "0.49171805", "0.49167436", "0.4916559", "0.49153692", "0.49148256" ]
0.0
-1
Only allow a list of trusted parameters through.
def education_params params.require(:education).permit(:year, :institution, :achievement, :user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\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 strong_params\n params.require(:user).permit(param_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 allow_params_authentication!; end", "def whitelisted_args\n args.select &:allowed\n end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def filtered_parameters; end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); 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 param_whitelist\n [:rating, :review]\n end", "def check_params; true; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\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 allowed?(*_)\n true\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 allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\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 permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def valid_params?; 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 url_allowlist=(_arg0); 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 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 list_params\n params.permit(:list_name)\n end", "def valid_params_request?; end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "def safelists; end", "def authorize_own_lists\n authorize_lists current_user.lists\n end", "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "def lists_params\n params.require(:list).permit(:name)\n\n end", "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "def check_params\n true\n end", "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "def filter_parameters; end", "def filter_parameters; end", "def whitelist; end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.permit(:name)\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def permitted_params\n []\n end", "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "def params(list)\n @declared_params = list\n end", "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "def allow(ids); end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "def safelist; end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def valid_for_params_auth?; end", "def default_param_whitelist\n [\"mode\"]\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 shopping_list_params\n params.require(:shopping_list).permit!\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def permitters\n @_parametrizr_permitters || {}\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def url_allowlist; end", "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "def quote_params\n params.permit!\n end" ]
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.6326454", "0.63140553", "0.6299814", "0.62642586", "0.626006", "0.62578833", "0.6236823", "0.6227561", "0.6221758", "0.62200165", "0.620879", "0.61983657", "0.6195055", "0.6172993", "0.6156856", "0.61558664", "0.61521494", "0.6135789", "0.6121145", "0.61118174", "0.60736513", "0.6071645", "0.60632104", "0.60549796", "0.6043906", "0.6034662", "0.60207325", "0.6018568", "0.6016575", "0.60103434", "0.60084206", "0.600763", "0.6007443", "0.6003619", "0.6003619", "0.5995791", "0.5993301", "0.5993231", "0.5984926", "0.597122", "0.5968121", "0.5965808", "0.59640145", "0.59632224", "0.59602356", "0.59332967", "0.5927556", "0.5922805", "0.5909745", "0.5905083", "0.5904304", "0.5893434", "0.58888215", "0.58823985", "0.58823985", "0.58823985", "0.5873434", "0.58619875", "0.58533794", "0.5845531", "0.58426666", "0.58360124", "0.583218", "0.5828041", "0.5827927", "0.5816121", "0.5814705", "0.5812719", "0.581121", "0.5803423", "0.5803423", "0.57995003", "0.5794207", "0.5784923", "0.5781365", "0.5776385", "0.5774859", "0.57671493", "0.5766998", "0.57618684", "0.5758038" ]
0.0
-1
preferred way is to use create/replace to make sure there are no collisions
def force_set_document(key, value, args={}) return nil unless key DocumentStore.force_set_document(key, value, args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace identifier, object\n create(identifier, object)\n end", "def prepareForReuse; end", "def conflicting_or_created_record\n conflict || create\n end", "def sneaky_save!(avoid_insert_conflict: nil)\n sneaky_create_or_update(avoid_insert_conflict: avoid_insert_conflict)\n end", "def replace(*)\n lazy_load # lazy load so that targets are always orphaned\n super\n end", "def replace(*)\n lazy_load # lazy load so that targets are always orphaned\n super\n end", "def recreate!\n delete! rescue nil\n create!\n end", "def overwrite?; end", "def dup_entity (options = {})\n entity = super(options) \n entity.update_attributes(:g_u_i_d => UUID.generate) if options[:gen_new_guids]\n entity.object_type = self.object_type.dup_entity(options) if object_type\n entity.save\n return entity\n end", "def recreate\n drop if exists?\n create\n end", "def sneaky_create(avoid_insert_conflict: nil)\n sneaky_attributes_without_id = sneaky_attributes_values\n .except { |key| key.name == \"id\" }\n\n column_keys = sneaky_attributes_without_id.keys\n .map { |key| \"\\\"#{key.name}\\\"\" } # to avoid conflicts with column names\n .join(\", \")\n\n dynamic_keys = sneaky_attributes_without_id.keys\n .map { |key| \":#{key.name}\" }\n .join(\", \")\n\n constraint = generate_constraint(\n avoid_insert_conflict,\n column_keys,\n dynamic_keys\n )\n\n sql = <<~SQL\n INSERT INTO #{self.class.table_name} ( #{column_keys} )\n VALUES (#{dynamic_keys})\n #{constraint}\n RETURNING *\n SQL\n\n mapping = generate_insert_mapping(sneaky_attributes_without_id)\n data = self.class.unscoped.find_by_sql([sql.squish, mapping.to_h]).first\n\n # To trigger generation of @mutations_from_database variable\n # which is necessary for id_in_database\n data.send(:mutations_from_database)\n\n copy_internal(data, \"@attributes\")\n copy_internal(data, \"@mutations_from_database\")\n copy_internal(data, \"@changed_attributes\")\n copy_internal(data, \"@new_record\")\n copy_internal(data, \"@destroyed\")\n\n !!id\n end", "def create_or_update(ident,attributes={})\n raise \"updating id is not supported\" if attributes[:id] \n unless id = redis.get(\"#{name}:ident:#{ident}\") \n id = redis.incr \"#{name}:id\" #Replica:id\n redis.sadd \"#{name}:all\", id # Replica\n redis.hset colon(name,id), :ident, ident\n redis.set colon(name, :ident, ident ) ,id\n end\n new id, attributes\n end", "def create_dup\n self.generate_key\n new = Mensaje.new(self.attributes.merge(:owner_id =>self.recibe_id))\n self.owner_id ||= self.envia_id\n self.save\n new.owner_id = self.recibe_id\n new.save if (new.valid? && !Mensaje.exists?(:clave => self.clave, :owner_id => new.owner_id))\n end", "def nocreate()\n merge(nocreate: 'true')\n end", "def recreate()\n merge(recreate: 'true')\n end", "def create\n create_or_update\n end", "def create\n create_or_update\n end", "def create_conflict\n controller.create_conflict(resource: resource)\n end", "def dup; return self.class.new(RAtlas::dup(@storage)); end", "def same; end", "def find_and_replace\n existing = ActsAsReplaceable::HelperMethods.find_existing(self)\n\n if existing.length > 1\n raise RecordNotUnique, \"#{existing.length} duplicate #{self.class.model_name.human.pluralize} present in database\"\n end\n\n replace_with(existing.first) if existing.first\n end", "def fcreatefs(name)\n if not fexistf name\n $fframes.add name\n eval \"$#{name} = {'#{name},set'=>#{Set.new}}\"\n eval \"$#{name}['#{name},slots'] = Set.new\"\n return true\n else\n return false\n end\nend", "def create_inverse\n self.class.create(inverse_match)\n end", "def novel_dup_as_maker\n novel_dup('maker',:maker)\n end", "def replace(player1, player2)\n p1 = self.players.find(player1)\n p2 = self.players.find(player2)\n p1.position, p2.position = p2.position, p1.position\n p1.save!\n p2.save!\n end", "def sneaky_save!\n sneaky_create_or_update\n end", "def create; end", "def create; end", "def create; end", "def create; end", "def replace_asset( existing_asset, new_type, attributes={} )\r\n\t\told_el = existing_asset.el\r\n\t\tnew_el = old_el.replace( \"<#{new_type}/>\" ).first\r\n\t\tattributes['id'] = old_el['id']\r\n\t\tattributes.each{ |att,val| new_el[att.to_s] = val }\r\n\t\tasset_for_el( new_el ).tap do |new_asset|\r\n\t\t\tunsupported_attributes = \".//*[name()='Add' or name()='Set'][@ref='##{old_el['id']}']/@*[name()!='ref' and #{new_asset.properties.keys.map{|p| \"name()!='#{p}'\"}.join(' and ')}]\"\r\n\t\t\[email protected](unsupported_attributes).remove\r\n\t\t\trebuild_caches_from_document\r\n\t\tend\r\n\tend", "def replace?\n !existing && !destroyable? && !attributes.blank?\n end", "def store_new(object)\n raise IdentityConflict if contains?(object)\n store(object)\n end", "def find_or_create!()\n end", "def fcreates(fname sname)\n if fexistf fname\n if not eval \"$#{fname}['#{fname},slots'].member? sname\"\n eval \"${fname}['#{fname},slots'].add sname\"\n eval \"${fname}['#{sname},facets'] = Set.new\"\n return true\n else \n return false\n end\n else\n return false\n end\nend", "def make_orphan(record)\n m = Member.find_by_id(record.member_id)\n m.delete if m\n record.reload\nend", "def create\n if @patch_method_used.nil?\n super_create\n else\n @patch_method_used = nil\n end\n end", "def preallocated_make_new\n make_new(:default)\n rescue Exception\n sync{@size[0] -= 1}\n raise\n end", "def treat_reserved_as_conflict; end", "def replace!\n self.class.transaction do\n person.update_attribute :shopping_cart_id, nil\n person.shopping_cart # autocreates shopping cart\n end\n end", "def ensure\n return self if exists?\n return self if Tainers::API.create_or_conflict(@args)\n return nil\n end", "def create(difference)\n nil\n end", "def create\n # USELESS\n end", "def create\n # USELESS\n end", "def rekey_as_needed; end", "def test_Hash_InstanceMethods_replace\n\t\th = {'a'=>100, 'b'=>200}\n\t\tassert_equal({'c'=>300, 'd'=>400}, h.replace({'c'=>300, 'd'=>400}))\n\t\tassert_equal({'c'=>300, 'd'=>400}, h)\n\tend", "def create_without_scope(name); 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 dup\n obj = super\n obj.duplicated_from = self\n obj.resource = self.resource_file\n uhook_duplicated_object(obj)\n\n obj\n end", "def sneaky_save(avoid_insert_conflict: nil)\n begin\n sneaky_create_or_update(avoid_insert_conflict: avoid_insert_conflict)\n rescue ActiveRecord::StatementInvalid\n false\n end\n end", "def replace(other)\n if loaded?\n orphan_resources(self)\n end\n other = other.map { |r| r.kind_of?(Hash) ? new(r) : r }\n relate_resources(other)\n super(other)\n end", "def create_duplicates!(instance)\n\t\t\tset_duplicants_values!(instance,true) # true for creating duplicates\n\t\t\t@duplicated_fieldlets.each{|f| f.save}\n\t\tend", "def recreate_in( new_context, changes = nil )\n clone.acquire_for(new_context)\n end", "def create_or_update(id: nil, update: nil, base: [], components: [],\n remove: [])\n if update\n entity_exists!(update)\n tmp = Morrow.em.create_entity(base: base, components: components)\n Morrow.em.merge_entity(update, tmp)\n Morrow.em.destroy_entity(tmp)\n\n remove.each { |c| remove_component(update, c.to_sym) }\n\n # patch up the metadata\n metadata = get_component!(update, :metadata)\n metadata.base ||= []\n metadata.base += base\n\n debug \"updated entity #{update}\"\n else\n entity = create_entity(id: id, base: base, components: components)\n remove.each { |c| remove_component(entity, c.to_sym) }\n debug \"created entity #{entity}\"\n entity\n end\n end", "def existent; end", "def ensure_unique_in_chain\n self.entity.spots.each { |s| remove_duplicate_blueprint(s) }\n self.entity.apply_to_children do |entity|\n remove_duplicate_blueprint(entity)\n entity.spots.each { |s| remove_duplicate_blueprint(s) }\n end\n end", "def apply_orphan_strategy\n true\n end", "def apply_orphan_strategy\n true\n end", "def duplicable?\n true\n end", "def clone; end", "def clone; end", "def clone; end", "def find_or_create_by\n end", "def find_or_create(owner_class, *args, &block); end", "def _new_id\n @lock.synchronize do\n begin\n # Generate a random number. It's recommended to not store more than\n # 2**62 objects in the same store.\n id = rand(2**64)\n # Ensure that we don't have already another object with this ID.\n end while @in_memory_objects.include?(id) || @db.include?(id)\n\n id\n end\n end", "def create!\n raise NotImplementedError\n end", "def create(*args)\n result = super(*args)\n ensure\n readonly! if result\n end", "def replace( other )\n\t\[email protected]( other )\n\tensure\n\t\t@modified = true\n\tend", "def autorestore; end", "def replace_file(filename, data)\n remove_file filename\n create_file filename, data\nend", "def replace_file(filename, data)\n remove_file filename\n create_file filename, data\nend", "def regenerate( how = nil )\n retouch nil, how\n end", "def create_shape\n id = rand 7\n @cur_y = 0\n @cur_x = 5\n @shape = SHAPES[id].dup\n end", "def create\n _create_or_update(@person)\n end", "def supports_create_or_replace_view?\n true\n end", "def duplicate()\n bug( \"you must override duplicate()\" )\n end", "def instantiate!; end", "def merge_conflict?; end", "def replaced(from, to)\n\t\tsuper if defined? super\n\t\tif (from.distribute? && to.distribute?) && (to.self_owned? || from.self_owned?)\n\t\t unless Distributed.updating?(self) || (Distributed.updating?(from) && Distributed.updating?(to))\n\t\t\tDistributed.each_updated_peer(from) do |peer|\n\t\t\t peer.transmit(:plan_replace, self, from, to)\n\t\t\tend\n\t\t end\n\t\tend\n\t end", "def prepare_reuse_validation_diff(other)\n original = self.reload!.comparable\n reference = other.reload!.comparable\n unique_identifiers.each { |id| reference[id] = original[id] }\n [original, reference]\n end", "def create\n \n end", "def use_insert!\n @use_copy = false\n end", "def _create_record\n tries ||= 1\n transaction(requires_new: true) { super }\n rescue ActiveRecord::RecordNotUnique => e\n raise e unless /uuid_v2/ === e.cause.error\n logger.info \"type=entourages.uuid_v2.not_unique tries=#{tries}\"\n raise e if tries == 3\n self.uuid_v2 = nil\n set_uuid\n tries += 1\n retry\n end", "def test_uniqueness_name\n t = Terrain.find(1)\n t2 = Terrain.create(:name => 'terrain1')\n assert !t2.valid?\n end", "def added_obj(obj)\n dup_obj = obj\n counter = 0\n while @children_hash.key?(dup_obj.name) && counter < 5\n dup_obj.name = \"#{dup_obj.name}_#{rand(1000000)}\"\n counter += 1\n end\n\n dup_obj\n end", "def create_if_not_exists(hash, key, val, name: key.to_sym)\n return if hash.key?(key)\n\n self.class.send(:attr_accessor, name)\n send(\"#{name}=\", val)\n end", "def test_11a\r\n db = build\r\n assert_raise RuntimeError do\r\n db.rename 'image-1.jpg','image-2.jpg'\r\n end\r\n assert File.exists?(db.fetch('image-1.jpg' , :width => 30))\r\n assert File.exists?(db.fetch('image-2.jpg' , :width => 60))\r\n db.rename 'image-1.jpg','image-2.jpg',:force => true\r\n assert_nil db.fetch('image-1.jpg')\r\n assert File.exists?(db.absolute('image-2.jpg',\r\n :width => 30 ))\r\n assert_nil db.fetch('image-2.jpg',\r\n :width => 60,\r\n :resize => false)\r\n end", "def safe_create(id)\n UploadSet.create(id: id)\n rescue ActiveFedora::IllegalOperation\n # This is the exception thrown by LDP when we attempt to\n # create a duplicate object. If we can find the object\n # then we are good to go.\n UploadSet.find(id)\n end", "def shift\n orphan_resource(super)\n end", "def test_collision_democratic\n ev1 = Resman::Event.find(7)\n ev1.alloc_resource 1\n ev1.save\n assert_equal 1, ev1.resource_uses.size\n assert ev1.resource_uses[0].collision == true\n ev2 = Resman::Event.find(4)\n assert ev2.resource_uses[0].collision\n end", "def make_corpse\n if @@corpse_proto == nil\n @@corpse_proto = Tag.find_any_obj(\"do.not.change::corpse.prototype\")[0] # corpse prototype\n end\n # generate a new item based off of the corpse prototype.\n\n o = @@corpse_proto.instance # new corpse\n if ('A'..'Z') === short_desc[0]\n o.name = o.name % self.short_desc\n else\n o.name = o.name % self.short_desc.en.a\n end\n\n in_room.accept(o) # put the object in the same room.\n end", "def replaced_files; end", "def create *args\n expire_selector\n object = create! *args\n rescue DuplicateKeyError, UniquenessError => e\n e.object.errors.add :base, e.message\n e.object\n end", "def rehash() end", "def validate_reuse_preconditions\n return unless self.class.resources.key?(reuse_as)\n\n attributes = unique_identifiers.each_with_object({ proposed: {}, existing: {} }) do |id, attrs|\n proposed = public_send(id)\n existing = self.class.resources[reuse_as][:resource].public_send(id)\n\n next if proposed == existing\n\n attrs[:proposed][id] = proposed\n attrs[:existing][id] = existing\n end\n\n unless attributes[:proposed].empty? && attributes[:existing].empty?\n raise ResourceReuseError, \"Reusable resources must use the same unique identifier(s). \" \\\n \"The #{self.class.name} to be reused as :#{reuse_as} has the identifier(s) #{attributes[:proposed]} \" \\\n \"but it should have #{attributes[:existing]}\"\n end\n end", "def test_duplicate_name_allowed\n type = Type.new(:name => \"Personification\")\n type.metaphor_id = types(:metaphor_9682_type).metaphor_id\n assert type.save\n end", "def supports_create_or_replace_view?\n false\n end", "def will_create_new_hash(**hash)\n hash[:x] = 10 # Change\n p hash\n p hash.object_id \nend", "def fire_duplicate_id(old_entity, new_entity); end", "def test_multiple_updates_on_same_object\n # we start with dhh as owner and alexander as user/creator\n @presentation.name = \"new name\"\n @presentation.owner = @alexander\n @presentation.save\n \n assert_equal \"new name\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @alexander, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n # ---- owner is now alexander, user/creator also alexander\n \n @presentation.name = \"new name 2\"\n @presentation.save\n \n assert_equal \"new name 2\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @alexander, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @alexander.is_creator_of?(@presentation)\n \n # --- no change. owner: alexander, user/creator: alexander.\n \n @presentation.name = \"new name 3\"\n @presentation.user = @dhh\n @presentation.save\n \n assert_equal \"new name 3\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @dhh, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @dhh.is_creator_of?(@presentation)\n \n # --- owner is still alexander, but user/creator is now dhh.\n \n @presentation.name = \"new name 4\"\n @presentation.owner = @dhh\n @presentation.save\n \n assert_equal \"new name 4\", @presentation.name\n assert_equal @dhh, @presentation.owner\n assert_equal @dhh, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @dhh.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @dhh.is_creator_of?(@presentation)\n \n # --- owner is now also dhh, user/creator is still dhh.\n \n @presentation.name = \"new name 5\"\n @presentation.owner = @alexander\n @presentation.save\n # @presentation.reload\n \n assert_equal \"new name 5\", @presentation.name\n assert_equal @alexander, @presentation.owner\n assert_equal @dhh, @presentation.user\n \n assert [email protected]_owner_of?(@presentation)\n assert @alexander.is_owner_of?(@presentation)\n \n assert [email protected]_creator_of?(@presentation)\n assert @dhh.is_creator_of?(@presentation)\n \n \n end", "def test_12a\r\n db = build\r\n db.not_found_image = 'image-1.jpg'\r\n assert_equal 'image-1.jpg',db.not_found_image\r\n assert_equal 'image-1.jpg',db['group1'].not_found_image\r\n assert_equal 'image-1.jpg',db['group1']['group2'].not_found_image\r\n\r\n db['group1'].not_found_image = 'image-2.jpg'\r\n assert_equal 'image-2.jpg',db['group1'].not_found_image\r\n end" ]
[ "0.61222976", "0.58143175", "0.5786557", "0.5651678", "0.56407976", "0.56407976", "0.5626262", "0.5580272", "0.557615", "0.5565731", "0.5546614", "0.5483208", "0.5467056", "0.54599893", "0.54502577", "0.5447695", "0.5447695", "0.54429686", "0.5442114", "0.5423087", "0.54114103", "0.5403856", "0.5362214", "0.53608733", "0.53593296", "0.5353676", "0.53513056", "0.53513056", "0.53513056", "0.53513056", "0.53373957", "0.53228366", "0.5310409", "0.5298591", "0.5280662", "0.5273013", "0.52694005", "0.5268686", "0.5259933", "0.52579695", "0.5256081", "0.5255773", "0.52386457", "0.52386457", "0.5226332", "0.52192485", "0.52154547", "0.5207744", "0.5200975", "0.5187428", "0.5186151", "0.5179362", "0.5171842", "0.5162099", "0.5161585", "0.51586896", "0.51432246", "0.51432246", "0.51413065", "0.5129121", "0.5129121", "0.5129121", "0.51284105", "0.51226103", "0.5116497", "0.5115114", "0.51012206", "0.5088667", "0.5086272", "0.5081416", "0.5081416", "0.508139", "0.50718075", "0.5069968", "0.50671345", "0.50656277", "0.50533366", "0.50481415", "0.5045996", "0.5044686", "0.50360274", "0.5034908", "0.5022841", "0.50187254", "0.50146675", "0.50139433", "0.50123215", "0.5008939", "0.5006973", "0.5006654", "0.49950647", "0.49919754", "0.4989747", "0.49883547", "0.49880165", "0.49863806", "0.498521", "0.49846143", "0.49829578", "0.4981529", "0.49810266" ]
0.0
-1
preferred way is to use create/replace instead of this to make sure there are no collisions
def force_set_document(key, value, args={}) return nil unless key CB.quiet = args[:quiet] || true CB.set(key, value, args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepareForReuse; end", "def replace identifier, object\n create(identifier, object)\n end", "def sneaky_save!(avoid_insert_conflict: nil)\n sneaky_create_or_update(avoid_insert_conflict: avoid_insert_conflict)\n end", "def conflicting_or_created_record\n conflict || create\n end", "def find_and_replace\n existing = ActsAsReplaceable::HelperMethods.find_existing(self)\n\n if existing.length > 1\n raise RecordNotUnique, \"#{existing.length} duplicate #{self.class.model_name.human.pluralize} present in database\"\n end\n\n replace_with(existing.first) if existing.first\n end", "def create_dup\n self.generate_key\n new = Mensaje.new(self.attributes.merge(:owner_id =>self.recibe_id))\n self.owner_id ||= self.envia_id\n self.save\n new.owner_id = self.recibe_id\n new.save if (new.valid? && !Mensaje.exists?(:clave => self.clave, :owner_id => new.owner_id))\n end", "def replace(*)\n lazy_load # lazy load so that targets are always orphaned\n super\n end", "def replace(*)\n lazy_load # lazy load so that targets are always orphaned\n super\n end", "def dup_entity (options = {})\n entity = super(options) \n entity.update_attributes(:g_u_i_d => UUID.generate) if options[:gen_new_guids]\n entity.object_type = self.object_type.dup_entity(options) if object_type\n entity.save\n return entity\n end", "def rekey_as_needed; end", "def recreate!\n delete! rescue nil\n create!\n end", "def overwrite?; end", "def make_orphan(record)\n m = Member.find_by_id(record.member_id)\n m.delete if m\n record.reload\nend", "def dup; return self.class.new(RAtlas::dup(@storage)); end", "def sneaky_create(avoid_insert_conflict: nil)\n sneaky_attributes_without_id = sneaky_attributes_values\n .except { |key| key.name == \"id\" }\n\n column_keys = sneaky_attributes_without_id.keys\n .map { |key| \"\\\"#{key.name}\\\"\" } # to avoid conflicts with column names\n .join(\", \")\n\n dynamic_keys = sneaky_attributes_without_id.keys\n .map { |key| \":#{key.name}\" }\n .join(\", \")\n\n constraint = generate_constraint(\n avoid_insert_conflict,\n column_keys,\n dynamic_keys\n )\n\n sql = <<~SQL\n INSERT INTO #{self.class.table_name} ( #{column_keys} )\n VALUES (#{dynamic_keys})\n #{constraint}\n RETURNING *\n SQL\n\n mapping = generate_insert_mapping(sneaky_attributes_without_id)\n data = self.class.unscoped.find_by_sql([sql.squish, mapping.to_h]).first\n\n # To trigger generation of @mutations_from_database variable\n # which is necessary for id_in_database\n data.send(:mutations_from_database)\n\n copy_internal(data, \"@attributes\")\n copy_internal(data, \"@mutations_from_database\")\n copy_internal(data, \"@changed_attributes\")\n copy_internal(data, \"@new_record\")\n copy_internal(data, \"@destroyed\")\n\n !!id\n end", "def same; end", "def sneaky_save!\n sneaky_create_or_update\n end", "def ensure_unique_in_chain\n self.entity.spots.each { |s| remove_duplicate_blueprint(s) }\n self.entity.apply_to_children do |entity|\n remove_duplicate_blueprint(entity)\n entity.spots.each { |s| remove_duplicate_blueprint(s) }\n end\n end", "def create_or_update(ident,attributes={})\n raise \"updating id is not supported\" if attributes[:id] \n unless id = redis.get(\"#{name}:ident:#{ident}\") \n id = redis.incr \"#{name}:id\" #Replica:id\n redis.sadd \"#{name}:all\", id # Replica\n redis.hset colon(name,id), :ident, ident\n redis.set colon(name, :ident, ident ) ,id\n end\n new id, attributes\n end", "def recreate\n drop if exists?\n create\n end", "def create_conflict\n controller.create_conflict(resource: resource)\n end", "def ensure\n return self if exists?\n return self if Tainers::API.create_or_conflict(@args)\n return nil\n end", "def create_duplicates!(instance)\n\t\t\tset_duplicants_values!(instance,true) # true for creating duplicates\n\t\t\t@duplicated_fieldlets.each{|f| f.save}\n\t\tend", "def recreate()\n merge(recreate: 'true')\n end", "def replace(player1, player2)\n p1 = self.players.find(player1)\n p2 = self.players.find(player2)\n p1.position, p2.position = p2.position, p1.position\n p1.save!\n p2.save!\n end", "def treat_reserved_as_conflict; end", "def sneaky_save(avoid_insert_conflict: nil)\n begin\n sneaky_create_or_update(avoid_insert_conflict: avoid_insert_conflict)\n rescue ActiveRecord::StatementInvalid\n false\n end\n end", "def store_new(object)\n raise IdentityConflict if contains?(object)\n store(object)\n end", "def _new_id\n @lock.synchronize do\n begin\n # Generate a random number. It's recommended to not store more than\n # 2**62 objects in the same store.\n id = rand(2**64)\n # Ensure that we don't have already another object with this ID.\n end while @in_memory_objects.include?(id) || @db.include?(id)\n\n id\n end\n end", "def dup\n obj = super\n obj.duplicated_from = self\n obj.resource = self.resource_file\n uhook_duplicated_object(obj)\n\n obj\n end", "def create\n create_or_update\n end", "def create\n create_or_update\n end", "def create_inverse\n self.class.create(inverse_match)\n end", "def fcreatefs(name)\n if not fexistf name\n $fframes.add name\n eval \"$#{name} = {'#{name},set'=>#{Set.new}}\"\n eval \"$#{name}['#{name},slots'] = Set.new\"\n return true\n else\n return false\n end\nend", "def novel_dup_as_maker\n novel_dup('maker',:maker)\n end", "def rehash() end", "def add_or_find_duplicate(node)\n @nodes[node.path] ||= node\n @nodes[node.path]\n end", "def replace?\n !existing && !destroyable? && !attributes.blank?\n end", "def create\n return super unless mti_class?\n shard_wrangler.cascade_save\n ActiveRecord::IdentityMap.add(self) if ActiveRecord::IdentityMap.enabled?\n @new_record = false\n self.id\n end", "def replace!\n self.class.transaction do\n person.update_attribute :shopping_cart_id, nil\n person.shopping_cart # autocreates shopping cart\n end\n end", "def replace_asset( existing_asset, new_type, attributes={} )\r\n\t\told_el = existing_asset.el\r\n\t\tnew_el = old_el.replace( \"<#{new_type}/>\" ).first\r\n\t\tattributes['id'] = old_el['id']\r\n\t\tattributes.each{ |att,val| new_el[att.to_s] = val }\r\n\t\tasset_for_el( new_el ).tap do |new_asset|\r\n\t\t\tunsupported_attributes = \".//*[name()='Add' or name()='Set'][@ref='##{old_el['id']}']/@*[name()!='ref' and #{new_asset.properties.keys.map{|p| \"name()!='#{p}'\"}.join(' and ')}]\"\r\n\t\t\[email protected](unsupported_attributes).remove\r\n\t\t\trebuild_caches_from_document\r\n\t\tend\r\n\tend", "def added_obj(obj)\n dup_obj = obj\n counter = 0\n while @children_hash.key?(dup_obj.name) && counter < 5\n dup_obj.name = \"#{dup_obj.name}_#{rand(1000000)}\"\n counter += 1\n end\n\n dup_obj\n end", "def duplicate()\n bug( \"you must override duplicate()\" )\n end", "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n # r.id = nil # done by dup\n # r.instance_variable_set(\"@association_cache\", self.instance_variable_get(:association_cache))\n end\n end", "def try_dup\n self.dup\n end", "def use_insert!\n @use_copy = false\n end", "def autorestore; end", "def nocreate()\n merge(nocreate: 'true')\n end", "def shift\n orphan_resource(super)\n end", "def fire_duplicate_id(old_entity, new_entity); end", "def apply_orphan_strategy\n true\n end", "def apply_orphan_strategy\n true\n end", "def populate_handle\n return unless !self.handle.present? || self.generate_handle\n\n self.handle = handle_base.\n gsub(/[^a-zA-Z0-9]/,'-').\n squeeze('-').\n chomp('-')\n \n self.handle = rand(1000000) if self.handle.empty?\n\n\n base = self.handle\n tries = 1\n\n # Create uniqueness\n while(true)\n match = handle_uniqueness_query(base)\n break unless match.present? && match.id != self.id\n\n base = self.handle + '-' + tries.to_s\n tries += 1\n end\n\n self.handle = base\n end", "def replace( other )\n\t\[email protected]( other )\n\tensure\n\t\t@modified = true\n\tend", "def replace(other)\n if loaded?\n orphan_resources(self)\n end\n other = other.map { |r| r.kind_of?(Hash) ? new(r) : r }\n relate_resources(other)\n super(other)\n end", "def find_or_create!()\n end", "def fcreates(fname sname)\n if fexistf fname\n if not eval \"$#{fname}['#{fname},slots'].member? sname\"\n eval \"${fname}['#{fname},slots'].add sname\"\n eval \"${fname}['#{sname},facets'] = Set.new\"\n return true\n else \n return false\n end\n else\n return false\n end\nend", "def preallocated_make_new\n make_new(:default)\n rescue Exception\n sync{@size[0] -= 1}\n raise\n end", "def create\n if @patch_method_used.nil?\n super_create\n else\n @patch_method_used = nil\n end\n end", "def create; end", "def create; end", "def create; end", "def create; end", "def set_or_replace_record(obj)\r\n @records.delete_if {|record| record.id == obj.id }\r\n obj.id ||= (@id_counter += 1)\r\n\r\n # Dup to clean up any extra added pieces, like Errors\r\n @records << obj.dup\r\n\r\n obj\r\n end", "def hash_dup\n save\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 replace( obj )\n\n delete( obj )\n\n self.push obj\n end", "def assign_key!\n key = \"\"\n #in case wasnt stripped before\n name = self.name.strip\n if name.length > 2\n key += name[0..2]\n else\n key += name\n end\n key += (self.team_id % 10).to_s\n key += rand(10).to_s\n\n #avoid duplicates\n while Player.exists?(key: key)\n key += rand(10).to_s\n end\n\n self.update_attribute(:key ,key)\n end", "def test_Hash_InstanceMethods_replace\n\t\th = {'a'=>100, 'b'=>200}\n\t\tassert_equal({'c'=>300, 'd'=>400}, h.replace({'c'=>300, 'd'=>400}))\n\t\tassert_equal({'c'=>300, 'd'=>400}, h)\n\tend", "def addto!(other)\n\t\treplace(addto(other))\n\tend", "def clone; end", "def clone; end", "def clone; end", "def update_target_when_not_assigning(replacement)\n # The associated object will be replaced by the below update if non-nil, so only\n # run the callbacks and state-changing code by passing persist: false in that case.\n _target.destroy(persist: !replacement) if persistable?\n\n # A little explanation on why this is needed... Say we have three assignments:\n #\n # canvas.palette = palette\n # canvas.palette = nil\n # canvas.palette = palette\n # Where canvas embeds_one palette.\n #\n # Previously, what was happening was, on the first assignment,\n # palette was considered a \"new record\" (new_record?=true) and\n # thus palette was being inserted into the database. However,\n # on the third assignment, we're trying to reassign the palette,\n # palette is no longer considered a new record, because it had\n # been inserted previously. This is not exactly accurate,\n # because the second assignment ultimately removed the palette\n # from the database, so it needs to be reinserted. Since the\n # palette's new_record is false, Mongoid ends up \"updating\" the\n # document, which doesn't reinsert it into the database.\n #\n # The change I introduce here, respecifies palette as a \"new\n # record\" when it gets removed from the database, so if it is\n # reassigned, it will be reinserted into the database.\n _target.new_record = true\n end", "def create(difference)\n nil\n end", "def duplicable?\n true\n end", "def prepare_reuse_validation_diff(other)\n original = self.reload!.comparable\n reference = other.reload!.comparable\n unique_identifiers.each { |id| reference[id] = original[id] }\n [original, reference]\n end", "def _create_record\n tries ||= 1\n transaction(requires_new: true) { super }\n rescue ActiveRecord::RecordNotUnique => e\n raise e unless /uuid_v2/ === e.cause.error\n logger.info \"type=entourages.uuid_v2.not_unique tries=#{tries}\"\n raise e if tries == 3\n self.uuid_v2 = nil\n set_uuid\n tries += 1\n retry\n end", "def merge_if_exists!\n t = merge_if_exists || self\n t.save!\n end", "def replace_with! other_street\n self.houses.each do |house|\n if other_house = House.find_by_street_id_and_number(other_street.id, house.number)\n house.replace_with! other_house\n else\n house.street = other_street\n house.save!\n end\n end\n if self.houses.reload.size == 0\n self.destroy\n true\n else\n false\n end\n end", "def regenerate( how = nil )\n retouch nil, how\n end", "def set_new_record(record)\n replace(record)\n end", "def recycle\n self.demolish\n self.build\n\n true\n end", "def create_shape\n id = rand 7\n @cur_y = 0\n @cur_x = 5\n @shape = SHAPES[id].dup\n end", "def sneaky_create\n if self.id.nil? && sneaky_connection.prefetch_primary_key?(self.class.table_name)\n self.id = sneaky_connection.next_sequence_value(self.class.sequence_name)\n end\n\n attributes_values = skeaky_attributes_values\n\n # Remove the id field for databases like Postgres which will raise an error on id being NULL\n if self.id.nil? && !sneaky_connection.prefetch_primary_key?(self.class.table_name)\n attributes_values.reject! { |key,_| key.name == 'id' }\n end\n\n new_id = if attributes_values.empty?\n self.class.unscoped.insert sneaky_connection.empty_insert_statement_value\n else\n self.class.unscoped.insert attributes_values\n end\n\n @new_record = false\n !!(self.id ||= new_id)\n end", "def create_slug\n if new? \n \tlength = 16\n \t# Loop while slug is not unique\n \tbegin\n \t\tself.slug = (0..(length-1)).map{ rand(36).to_s(36) }.join \n \t\tobject = self.class.first(:slug => self.slug) \n \tend while(object != nil)\n end\nend", "def replace_with(child); end", "def check_or_create_for!(hash, key)\n hash[key] = \"\" unless hash.include?(key)\n end", "def duplicate\n my_href = URI.parse(self.href)\n ServerTemplate.new(:href => connection.post(my_href.path + \"/duplicate\"))\n end", "def fix_up_references\n if self.group_type.nil? and !self.group_type_id.nil?\n self.group_type = GroupType.find(self.group_type_id)\n end\n if self.region.nil? and !self.region_id.nil?\n self.region = Region.find(self.region_id)\n end\n end", "def recreate_in( new_context, changes = nil )\n clone.acquire_for(new_context)\n end", "def merge!; end", "def existent; end", "def deep_dup; end", "def find_or_create_by\n end", "def dup_entity (options ={})\n entity = super(options)\n entity.update_attributes(:serial_number => self.send(:serial_number))\n \n entity.manufacturer = self.manufacturer.dup_entity(options) if manufacturer\n entity.model = self.model.dup_entity(options) if model\n entity.valid_network = self.valid_network.dup_entity(options) if valid_network \n entity.save\n return entity\n end", "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n r.instance_variable_set(\"@association_cache\", self.association_cache)\n end\n end", "def merge_conflict?; end", "def __copy_on_write__(*)\n index = @parent_proxy.instance_variable_get(:@set).index(__getobj__) if @parent_proxy\n super.tap do\n CowProxy.debug { \"replace #{index} with proxy obj in parent #{@parent_proxy.name}\" } if index\n @parent_proxy.instance_variable_get(:@set)[index] = self if index\n new_set = __getobj__.instance_variable_get(:@set).dup\n __getobj__.instance_variable_set(:@set, new_set)\n end\n end", "def safe_create(id)\n UploadSet.create(id: id)\n rescue ActiveFedora::IllegalOperation\n # This is the exception thrown by LDP when we attempt to\n # create a duplicate object. If we can find the object\n # then we are good to go.\n UploadSet.find(id)\n end", "def create_or_update\n if self.id.is_a?(Numeric) && self.id.to_i.zero?\n self.id = nil\n @new_record = true\n end\n super\n end" ]
[ "0.61050004", "0.59576637", "0.5795676", "0.5783677", "0.5742637", "0.5725174", "0.5696934", "0.5696934", "0.5637039", "0.5621519", "0.56118476", "0.55736077", "0.5567819", "0.5563574", "0.5563366", "0.5542047", "0.54775226", "0.54725885", "0.5455294", "0.5447595", "0.54337966", "0.5431772", "0.5410917", "0.5401748", "0.54001164", "0.53921384", "0.53719324", "0.5359074", "0.5356395", "0.5348605", "0.5323941", "0.5323941", "0.5321801", "0.53118825", "0.53076357", "0.53045046", "0.5295407", "0.52849066", "0.52847683", "0.5278294", "0.5277359", "0.52582014", "0.5256806", "0.5254701", "0.5249468", "0.5248762", "0.5248088", "0.52418673", "0.5235915", "0.5233753", "0.5226055", "0.5226055", "0.522478", "0.5214608", "0.52132034", "0.5210486", "0.5207812", "0.52035415", "0.52027434", "0.5197271", "0.5197271", "0.5197271", "0.5197271", "0.5194895", "0.5193002", "0.5184189", "0.5157878", "0.5150532", "0.5146041", "0.5144392", "0.51434267", "0.51434267", "0.51434267", "0.5135701", "0.5134447", "0.5132734", "0.5123839", "0.5115073", "0.5109716", "0.5109411", "0.5108634", "0.5101026", "0.5094434", "0.50871533", "0.5085265", "0.5085244", "0.50809646", "0.5077165", "0.50761795", "0.50751024", "0.50749254", "0.5072835", "0.5072575", "0.5070106", "0.5067476", "0.50609016", "0.5059367", "0.50593364", "0.50578445", "0.50524825", "0.50471276" ]
0.0
-1
GET /responses/1 GET /responses/1.xml
def show @problem_set = ProblemSet.find(params[:problem_set_id]) @question = Question.where(:problem_set_id => @problem_set.id, :count=> params[:question_id].to_i).first @response = Response.find(params[:id]) if session[:user_id].nil? session[:redirect_url] = "/problem_sets/#{@problem_set.id}/questions/#{@question.count}/responses/#{@response.id}" redirect_to("/login/") else if session[:user_id].to_i != 126126126126126 flash[:notice] = "NO PERMISSION!" redirect_to :action => "index" else @answer = Answer.find(@response.answer_id) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @response } end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @response = Response.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @response }\n end\n end", "def index\n \t @responses = Response.all\n end", "def index\n @responses = @survey.responses.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @responses }\n end\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def show\n @responses = Response.find(params[:id])\n respond_with @response\n end", "def get(options = {})\n @response_xml = options[:cache_file] ? File.read(options[:cache_file]) : http_get(options)\n response = Response.parse(response_xml, options) do | inner_response, elements |\n parse_reports(inner_response, elements)\n end\n response.response_items.first # there is is only one\n end", "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end", "def index\n @responses = Response.all\n @response = Response.new\n end", "def single_response_summary(id)\n get(\"/response/#{id}\")\n end", "def index\n @responses = Response.all\n puts \"\\n\\n\\n\\nyo dude I think its working \\n\\n\\n\\n\"\n end", "def read(id=nil)\n request = Net::HTTP.new(@uri.host, @uri.port)\n if id.nil?\n response = request.get(\"#{@uri.path}.xml\")\n else\n response = request.get(\"#{@uri.path}/#{id}.xml\")\n end\n\n response.body\n end", "def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @response }\n end\n end", "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def respond_with(file)\n response_path = File.dirname(__FILE__) + \"/../fixtures/response/xml\"\n File.read \"#{response_path}/#{file}.xml\"\nend", "def index\n @requests = Request.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @requests }\n end\n end", "def to_xml\n response\n end", "def show\n @response = Response.find(params[:id])\n end", "def get\n @response = Net::HTTP.get_response(URI(@url))\n end", "def response_xml\r\n @sess.DoRequests(@request_set).ToXMLString\r\n end", "def ping\n @status = Status.find(:first)\n respond_to do |format|\n format.html\n format.xml { render :xml => @status }\n end \n end", "def get_response\n @response = Response.find(params[:response_id])\n end", "def show\n @response = Response.find(params[:id])\n\n respond_with(@response)\n end", "def response\n connection.send(request_method) do |req|\n req.url path\n req.headers['LicenseID'] = client.license_id\n req.headers['Host'] = client.host\n req.headers['Connection'] = 'Keep-Alive'\n req.headers['Expect'] = '100-continue'\n req.headers['Content-Type'] = 'text/xml'\n req.body = body\n end\n end", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def response\n\t\t@response\n\tend", "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "def responses\n @proposal = current_user.proposals.find(params[:id])\n @responses = @proposal.responses\n\n respond_to do |format|\n format.html # responses.html.erb\n format.xml { render :xml => @responses }\n end\n end" ]
[ "0.6611357", "0.65834016", "0.65214777", "0.6380083", "0.6380083", "0.6380083", "0.6380083", "0.6380083", "0.628083", "0.62119764", "0.6200801", "0.6161339", "0.6130926", "0.61021715", "0.6049733", "0.6032557", "0.6001512", "0.5944939", "0.5919158", "0.58811265", "0.5866713", "0.58494455", "0.5840295", "0.5833008", "0.57872355", "0.5773505", "0.5769237", "0.5761967", "0.57536125", "0.5748943", "0.5748734", "0.5748734", "0.5748734", "0.5748734", "0.5748734", "0.5748734", "0.5748734", "0.5748734", "0.57486963", "0.57486963", "0.57486963", "0.57486963", "0.57486963", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.5748589", "0.57349163", "0.57224715", "0.5722262" ]
0.0
-1
GET /responses/new GET /responses/new.xml
def new @problem_set = ProblemSet.find(params[:problem_set_id]) @question = Question.where(:problem_set_id => params[:problem_set_id])[params[:question_id].to_i - 1] if session[:user_id].nil? session[:redirect_url] = "/problem_sets/#{@problem_set.id}/questions/#{@question.count}/responses/new/" redirect_to("/login/") else if session[:user_id].to_i != 126126126126126 flash[:notice] = "NO PERMISSION!" redirect_to :action => "index" else @response = Response.new @answer = Answer.where(:question_id => @question.id) respond_to do |format| format.html # new.html.erb format.xml { render :xml => @response } end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end", "def new\n @response = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @response }\n end\n end", "def new\n @response = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @response }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "def new_rest\n @question_localized = QuestionLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question_localized }\n end\n end", "def new_rest\n @answer_localized = AnswerLocalized.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @answer_localized }\n end\n end", "def new_rest\n @entry_answer = EntryAnswer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_answer }\n end\n end", "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @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.xml { render :xml => @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.xml { render :xml => @request }\n end\n end", "def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end", "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end", "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end", "def new\n @resource = Resource.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "def new\n @response = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @response }\n end\n end", "def new\n @quest_template = QuestTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quest_template }\n end\n end", "def newX\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server }\n end\n end", "def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @page }\n end\n end", "def new\n @quest = Quest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @quest }\n end\n end", "def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end", "def new\n @response_format = ResponseFormat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @response_format }\n end\n end", "def new_rest\n @instrument_version = InstrumentVersion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument_version }\n end\n end", "def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @po }\n end\n end", "def new\n @xml_sample = XmlSample.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @xml_sample }\n end\n end", "def new\n @response = Admin::Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @response }\n end\n end", "def new\n @noun = Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @noun }\n end\n end", "def new\n @old_twit = OldTwit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_twit }\n end\n end", "def new\n @document = Document.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @document }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml \n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end", "def new\n respond_to do |format|\n format.html\n format.xml\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end", "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stat }\n end\n end", "def new\n @click_to_talk = ClickToTalk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @click_to_talk }\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 @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end", "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @question }\n end\n end", "def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "def new \n @how_to = HowTo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @how_to }\n end\n end", "def new\n respond_to do |format|\n format.html { render :layout => 'application' }\n format.xml { render :xml => @recommand }\n end\n end", "def new\n @questao = Questao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @questao }\n end\n end", "def new_rest\n @entry_instrument = EntryInstrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_instrument }\n end\n end", "def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @template }\n end\n end", "def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end", "def new\n @howto = Howto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @howto }\n end\n end", "def new\n @api = Api.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @api }\n end\n end", "def new\n @echo = Echo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @echo }\n end\n end", "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "def new\n @survey = Survey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @survey }\n end\n end", "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end", "def new\n @nota = Nota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nota }\n end\n end", "def new\n @monkey = Monkey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @monkey }\n end\n end", "def new\n @label = Label.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @label }\n end\n end", "def new\n @label = Label.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @label }\n end\n end", "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @protocol = Protocol.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @protocol }\n end\n end", "def new\n @poll = Poll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poll }\n end\n end", "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end", "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end", "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end", "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end", "def new\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end", "def new\n logger.debug 'new_some interesting information'\n @comdty = Comdty.new\n setvariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comdty }\n end\n end", "def new\n @doc = Doc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @doc }\n end\n end", "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @page }\n end\n end", "def new\n @prompt = Prompt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prompt }\n end\n end", "def new\n @new_employee_request = NewEmployeeRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_employee_request }\n end\n end", "def new\n @rep = Rep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rep }\n end\n end", "def new\n @announcer = Announcer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @announcer }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client }\n end\n end", "def new\n @last_id = LastId.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @last_id }\n end\n end", "def new\n @domain = Domain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domain }\n end\n end", "def new\n @http_receive = HttpReceive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @http_receive }\n end\n end", "def new\n @patrimonio = Patrimonio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patrimonio }\n end\n end", "def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end" ]
[ "0.7710032", "0.75292087", "0.7465536", "0.6997893", "0.68774444", "0.6856296", "0.68490314", "0.6823025", "0.6823025", "0.6823025", "0.6800443", "0.67931616", "0.67931616", "0.67634577", "0.67557555", "0.67425245", "0.672749", "0.66938365", "0.66781324", "0.6675242", "0.667123", "0.66592187", "0.6642514", "0.6638725", "0.663033", "0.6624662", "0.66228974", "0.6610292", "0.6601551", "0.6591125", "0.6589252", "0.6588579", "0.65653867", "0.6562297", "0.655266", "0.655266", "0.655266", "0.655266", "0.655266", "0.655266", "0.655266", "0.655266", "0.655266", "0.655266", "0.6545911", "0.6545911", "0.6533016", "0.65286547", "0.65286547", "0.65286547", "0.6525881", "0.65240866", "0.6523186", "0.650606", "0.64881897", "0.6487055", "0.64711434", "0.64691734", "0.6467339", "0.64563984", "0.64552134", "0.6449241", "0.6441904", "0.6441904", "0.6441904", "0.6441904", "0.6441904", "0.6441904", "0.6440199", "0.6440199", "0.64384", "0.6434241", "0.6434241", "0.64316994", "0.6429777", "0.6424773", "0.64205766", "0.64205766", "0.64205766", "0.64205766", "0.64205766", "0.6418142", "0.64167565", "0.641547", "0.6409641", "0.6408289", "0.64052004", "0.64028645", "0.6402787", "0.6402787", "0.6401501", "0.64010483", "0.6399472", "0.639946", "0.6398081", "0.6397896", "0.6397896", "0.6397896", "0.6397896", "0.6397896", "0.6397896" ]
0.0
-1
POST /responses POST /responses.xml
def create if not session[:user_id] session[:user_id] = params[:user_id] redirect_to(problem_set_question_path(session[:prob_id], session[:ques_id])) else @problem_set = ProblemSet.find(params[:problem_set_id]) @question = Question.find(params[:question_id]) @answer = Answer.find(params[:response]) @response = Response.new( :answer_id => @answer.id, :result => @answer.correct, :question_id => @question.id, :problem_set_id => @problem_set.id, :user_id => session[:user_id]) if @problem_set.question_count > @question.count next_question = Question.where(:problem_set_id => @problem_set.id, :count => @question.count + 1).first result = problem_set_question_path(@problem_set.id, next_question.count) else result = "/problem_sets/#{@problem_set.id}/result/" end respond_to do |format| if @response.save format.html { redirect_to(result, :notice => 'Response was successfully created.') } format.xml { render :xml => @response, :status => :created, :location => @response } else format.html { render :action => "new" } format.xml { render :xml => @response.errors, :status => :unprocessable_entity } end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post\n resource.post(request, response)\n end", "def create\n @response = Response.new(params[:response])\n\n respond_to do |format|\n if @resp.save\n flash[:notice] = 'Response was successfully created.'\n format.html { redirect_to(response_url(@questionnaire, @resp)) }\n format.xml { render :xml => @resp, :status => :created, :location => @resp }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resp.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "def create\n @response = Response.new(params[:response])\n @response.ip_address = request.remote_ip\n @response.survey_id = @survey.id\n @response.user_id = current_user\n \n for param in params do\n if param[0] =~ /^question_id_/\n # handle all question parameters\n # $' represents the value of the question_id\n if param[1].is_a? Hash\n # Valid keys include country, option, year, month, day and numeric option_id\n if param[1].has_key? \"year\" && \"month\" && \"day\"\n # concat year, month and day into one answer\n @response.answers.build(:question_id => $', :answer => Date.new(param[1][\"year\"].to_i, param[1][\"month\"].to_i, param[1][\"day\"].to_i) )\n elsif param[1].has_key? \"option\"\n # look up option id for radio & select questions and build answer\n option_id = Option.find_by_label_and_question_id(param[1][\"option\"], $').id\n @response.answers.build(:question_id => $', :answer => param[1][\"option\"], :option_id => option_id)\n elsif param[1].has_key? \"country\"\n # build country answer\n @response.answers.build(:question_id => $', :answer => param[1][\"country\"])\n else\n # build checkbox and likert answers\n param[1].each do |key, value|\n @response.answers.build(:question_id => $', :answer => value, :option_id => key) unless value == \"0\"\n end\n end\n else\n # build answer without option ie text, textarea\n @response.answers.build(:question_id => $', :answer => param[1] ) #unless param[1].blank?\n end \n end\n if param[0] == 'token'\n @response.survey.update_invitation(param[1])\n end\n end\n\n respond_to do |format|\n if @response.save!\n flash[:notice] = 'Response was successfully created.'\n format.html { redirect_to([@survey, @response]) }\n format.xml { render :xml => @response, :status => :created, :location => @response }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @response.errors, :status => :unprocessable_entity }\n end\n end\n rescue ActiveRecord::RecordInvalid => invalid\n render :action => \"new\"\n end", "def http_post(request, response)\n path = request.path\n\n # Only handling xml\n content_type = request.header('Content-Type')\n return nil unless content_type.index('application/xml') || content_type.index('text/xml')\n\n # Making sure the node exists\n begin\n node = @server.tree.node_for_path(path)\n rescue Dav::Exception::NotFound\n return nil\n end\n\n request_body = request.body_as_string\n\n # If this request handler could not deal with this POST request, it\n # will return 'null' and other plugins get a chance to handle the\n # request.\n #\n # However, we already requested the full body. This is a problem,\n # because a body can only be read once. This is why we preemptively\n # re-populated the request body with the existing data.\n request.body = request_body\n\n document_type_box = Box.new('')\n message = @server.xml.parse(request_body, request.url, document_type_box)\n document_type = document_type_box.value\n\n case document_type\n # Dealing with the 'share' document, which modified invitees on a\n # calendar.\n when \"{#{Plugin::NS_CALENDARSERVER}}share\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-calendar-share'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.update_shares(message.set, message.remove)\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n # The invite-reply document is sent when the user replies to an\n # invitation of a calendar share.\n when \"{#{Plugin::NS_CALENDARSERVER}}invite-reply\"\n\n # This only works on the calendar-home-root node.\n return true unless node.is_a?(CalendarHome)\n\n @server.transaction_type = 'post-invite-reply'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n url = node.share_reply(\n message.href,\n message.status,\n message.calendar_uri,\n message.in_reply_to,\n message.summary\n )\n\n response.status = 200\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n if url\n writer = @server.xml.writer\n writer.open_memory\n writer.start_document\n writer.start_element(\"{#{Plugin::NS_CALENDARSERVER}}shared-as\")\n writer.write(Dav::Xml::Property::Href.new(url))\n writer.end_element\n response.update_header('Content-Type', 'application/xml')\n response.body = writer.output_memory\n end\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}publish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-publish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = true\n\n # iCloud sends back the 202, so we will too.\n response.status = 202\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n when \"{#{Plugin::NS_CALENDARSERVER}}unpublish-calendar\"\n # We can only deal with IShareableCalendar objects\n return true unless node.is_a?(IShareableCalendar)\n\n @server.transaction_type = 'post-unpublish-calendar'\n\n # Getting ACL info\n acl = @server.plugin('acl')\n\n # If there's no ACL support, we allow everything\n acl.check_privileges(path, '{DAV:}write') if acl\n\n node.publish_status = false\n\n response.status = 200\n\n # Adding this because sending a response body may cause issues,\n # and I wanted some type of indicator the response was handled.\n response.update_header('X-Sabre-Status', 'everything-went-well')\n\n # Breaking the event chain\n return false\n end\n end", "def post\n response = HTTParty.post(servlet_url,\n :body => to_xml,\n :headers => { 'Content-Type' => 'application/xml' }\n ).response\n\n return Dhl::Shipment::Response.new(response.body)\n rescue Exception => e\n request_xml = if @to_xml.to_s.size>0\n @to_xml\n else\n '<not generated at time of error>'\n end\n\n response_body = if (response && response.body && response.body.to_s.size > 0)\n response.body\n else\n '<not received at time of error>'\n end\n\n log_level = if e.respond_to?(:log_level)\n e.log_level\n else\n :critical\n end\n\n log_request_and_response_xml(log_level, e, request_xml, response_body )\n raise e\n end", "def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend", "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x|\n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x|\n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "def response_xml\r\n @sess.DoRequests(@request_set).ToXMLString\r\n end", "def post_save xml, options={:mapping=>:_default}\n # using REXML's element namespace method doesn't seem to set the namespace correctly...?\n xml.root.add_attributes(\"xmlns\"=>\"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\")\n xml.root.add_namespace \"xsi\", \"http://www.w3.org/2001/XMLSchema-instance\"\n xml.root.add_namespace \"xsd\", \"http://www.w3.org/2001/XMLSchema\"\n # for challengeResponses/response\n xml.each_element(\"//response\") do |x| \n x.add_namespace \"v11\", \"http://schema.intuit.com/platform/fdatafeed/challenge/v1\"\n x.name = \"v11:response\"\n end\n # for challengeResponses root\n xml.each_element(\"//challengeResponses\") do |x| \n x.add_namespace \"v1\", \"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1\"\n x.name = \"challengeResponses\"\n end\n end", "def create\n \n respond_to do |format|\n \n if !params[:questions].nil? \n params[:questions].each {\n |q| \n type = Question.find_by_id(q[0]).question_type\n answer = (type == 2 ? Answer.find_by_id(q[1]).correct : nil)\n Response.new( \n {\n \"question_id\" => q[0],\n \"answer_id\" => type == 2 ? q[1] : nil,\n \"text\" => type == 1 ? q[1] : nil,\n \"user_id\" => current_user.id,\n \"question_group_id\" => params[:response][:question_group_id],\n \"correct\" => answer\n }\n ).save\n }\n format.html { redirect_to '/responses', notice: 'Your responses were successfully saved.' }\n else\n @response = Response.new(params[:response])\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render json: @response, status: :created, location: @response }\n end\n end\n end\n end", "def index\n \t @responses = Response.all\n end", "def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end", "def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to survey_responses_path(@survey), notice: 'Thanks for your response!' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def to_xml\n response\n end", "def response\n connection.send(request_method) do |req|\n req.url path\n req.headers['LicenseID'] = client.license_id\n req.headers['Host'] = client.host\n req.headers['Connection'] = 'Keep-Alive'\n req.headers['Expect'] = '100-continue'\n req.headers['Content-Type'] = 'text/xml'\n req.body = body\n end\n end", "def create\n @response = current_user.responses.build(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to session.delete(:return_to), notice: 'Response was successfully created.' }\n else\n format.html { redirect_to requests_path, notice: 'Response was not saved.' }\n end\n end\n end", "def reply(data)\n res.json(Satz.serializer.dump(data))\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n end", "def index\n @responses = Response.all\n @response = Response.new\n end", "def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to thanks_path, notice: 'Your response was successfully saved.' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def response\n\t\t@response\n\tend", "def responses\n question=Question.find(params[:questionId])\n render :json=> question.response\n end", "def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @response = Admin::Response.new(params[:admin_response])\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render json: @response, status: :created, location: @response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @response = Response.new\n \n reason = Reason.new\n reason.why = params[:response][:reason][:why]\n reason.critique = params[:response][:reason][:critique]\n @response.reasons = [reason]\n\n @response.who = params[:response][:who]\n @response.ip_address = request.remote_ip\n @response.user_agent = request.env['HTTP_USER_AGENT']\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to root_url, notice: 'Your response was successfully submitted! Thanks for taking the time to affect change in our government.' }\n format.json { render json: @response, status: :created, location: @response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def response; end", "def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def xml_serialize(writer)\n responses.each do |response|\n writer.write_element('{DAV:}response', response)\n end\n\n writer.write_element('{DAV:}sync-token', @sync_token) if @sync_token\n end", "def create\n @response = Response.new(params[:response])\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render json: @response, status: :created, location: @response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n puts \"\\n\\n\\nBack where I come from\\n\\n\\n\\n\\n\"\n @response = Response.new(response_params)\n puts \"\\n\\n\\n\\n THESE ARE THE RESPONSE PARAMS \\n\\n\\n\\n\"\n puts response_params\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render action: 'show', status: :created, location: @response }\n else\n format.html { render action: 'new' }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @responses = @survey.responses.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @responses }\n end\n end", "def response_params\n params.require(:response).permit(\n :ip, \n :survey_id, \n :answers_attributes => [\n :id, \n :answer, \n {:resp => []}, \n :survey_id, \n :question_id, \n :response_id, \n :user_id \n ])\n end", "def response\n @response ||= connection.post(query)\n end", "def responses\n @proposal = current_user.proposals.find(params[:id])\n @responses = @proposal.responses\n\n respond_to do |format|\n format.html # responses.html.erb\n format.xml { render :xml => @responses }\n end\n end", "def handle_post\n make_response(201, {message: 'New resource created'})\nend", "def post\n Salesforce.set_http(session[:accesstoken], session[:accessurl])\n \t@response = Salesforce.create_post(params)\n \trespond_to do |format|\n format.json { render :json => @response.to_json}\n # example of multiple reponses mapped to one object\n # format.json { render :json => {:data => @response, :meta => @describe}.to_json}\n \tend\n end", "def handle_post()\n make_response(201, \"New resource created\")\nend", "def create\n question_response = QuestionResponse.build_response_essay(current_user, params)\n\n if question_response.try :save\n render json: { message: \"answer saved\" }\n else\n render json: { message: \"error\" }, status: :unprocessable_entity\n end\n end", "def _send_response resp\n Handler.log.debug \"Sending response : #{resp}\"\n send_data resp.to_s + \"\\n\"\n resp\n end", "def create\n @response = Response.new(response_params)\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to @response, notice: 'Response was successfully created.' }\n format.json { render action: 'show', status: :created, location: @response }\n else\n format.html { render action: 'new' }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def response_params\n params.require(:response).permit(:name, :address, :body, :password)\n end", "def generate_response_xml\n builder = Builder::XmlMarkup.new\n builder.instruct!\n\n builder.imsx_POXEnvelopeResponse(\"xmlns\" => \"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\") do |env|\n env.imsx_POXHeader do |header|\n header.imsx_POXResponseHeaderInfo do |info|\n info.imsx_version \"V1.0\"\n info.imsx_messageIdentifier @message_identifier || IMS::LTI::generate_identifier\n info.imsx_statusInfo do |status|\n status.imsx_codeMajor @code_major\n status.imsx_severity @severity\n status.imsx_description @description\n status.imsx_messageRefIdentifier @message_ref_identifier\n status.imsx_operationRefIdentifier @operation\n end\n end\n end #/header\n env.imsx_POXBody do |body|\n unless unsupported?\n if @operation == OutcomeRequest::READ_REQUEST\n body.tag!(@operation + 'Response') do |request|\n request.result do |res|\n res.resultScore do |res_score|\n res_score.language \"en\" # 'en' represents the format of the number\n res_score.textString @score.to_s\n end\n end #/result\n end\n else\n body.tag!(@operation + 'Response')\n end #/operationResponse\n end\n end #/body\n end\n end", "def response_params\n params.require(:response).permit(:body, :post_id, :user_id)\n end", "def send_request( xml )\n write( xml )\n read\n end", "def create\n\n @survey_response = SurveyResponse.new(survey_response_params)\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to survey_responses_path, notice: 'Survey response was successfully created.' }\n format.json { render :index, status: :created, location: @survey_response }\n else\n format.html { render :new }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n \n end", "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "def do_submission(path, xml = nil)\n if xml.nil?\n form = create(:form, question_types: %w(integer integer))\n form.publish!\n xml = build_odk_submission(form)\n end\n\n # write xml to file\n require 'fileutils'\n FileUtils.mkpath('test/fixtures')\n fixture_file = Rails.root.join('test/fixtures/', ODK_XML_FILE)\n File.open(fixture_file.to_s, 'w') { |f| f.write(xml) }\n\n # Upload and do request.\n uploaded = fixture_file_upload(fixture_file, 'text/xml')\n post(path, {:xml_submission_file => uploaded, :format => 'xml'}, 'HTTP_AUTHORIZATION' => encode_credentials(@user.login, 'password'))\n assigns(:response)\n end", "def service(request, response)\n if @valid_ip\n raise WEBrick::HTTPStatus::Forbidden unless @valid_ip.any? { |ip| request.peeraddr[3] =~ ip }\n end\n\n if request.request_method != \"POST\"\n raise WEBrick::HTTPStatus::MethodNotAllowed,\n \"unsupported method `#{request.request_method}'.\"\n end\n\n raise WEBrick::HTTPStatus::BadRequest if parse_content_type(request['Content-type']).first != \"text/xml\"\n\n length = (request['Content-length'] || 0).to_i\n\n raise WEBrick::HTTPStatus::LengthRequired unless length > 0\n\n data = request.body\n\n raise WEBrick::HTTPStatus::BadRequest if data.nil? or data.size != length\n\n resp = process(data, client_request(request))\n raise WEBrick::HTTPStatus::InternalServerError if resp.nil? or resp.size <= 0\n\n response.status = 200\n response['Content-Length'] = resp.size\n response['Content-Type'] = \"text/xml; charset=utf-8\"\n response.body = resp\n end", "def post_outcome_request\n raise IMS::LTI::InvalidLTIConfigError, \"\" unless has_required_attributes?\n\n res = post_service_request(@lis_outcome_service_url,\n 'application/xml',\n generate_request_xml)\n\n @outcome_response = extend_outcome_response(OutcomeResponse.new)\n @outcome_response.process_post_response(res)\n end", "def request_for_twiml!(path, options = {})\n @current_path = normalize_redirect_path(path)\n\n # Post the query\n rack_test_session_wrapper = Capybara.current_session.driver\n @response = rack_test_session_wrapper.send(options[:method] || :post, @current_path,\n :format => :xml,\n :CallSid => @root_call.sid,\n :From => @root_call.from_number,\n :Digits => formatted_digits(options[:digits].to_s, :finish_on_key => options[:finish_on_key]),\n :To => @root_call.to_number,\n :AnsweredBy => (options[:is_machine] ? \"machine\" : \"human\"),\n :CallStatus => options.fetch(:call_status, \"in-progress\")\n )\n\n # All Twilio responses must be a success.\n raise \"Bad response: #{@response.status}\" unless @response.status == 200\n\n # Load the xml\n data = @response.body\n @response_xml = Nokogiri::XML.parse(data)\n set_xml(@response_xml.at_xpath(\"Response\"))\n end", "def create\n @question_response = QuestionResponse.new(params[:question_response])\n\n respond_to do |format|\n if @question_response.save\n format.html { redirect_to @question_response, notice: 'Question response was successfully created.' }\n format.json { render json: @question_response, status: :created, location: @question_response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(request)\n # sure thing!\n json_response(200, { message: \"This dummy POST endpoint didn't do anything.\" })\n end", "def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end", "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def POST; end", "def create\r\n @survey_response = SurveyResponse.new(params[:survey_response])\r\n\r\n respond_to do |format|\r\n if @survey_response.save\r\n format.html { redirect_to @survey_response, notice: 'Survey response was successfully created.' }\r\n format.json { render json: @survey_response, status: :created, location: @survey_response }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def response\n @response ||= RestClient::Request.execute(\n method: :post,\n url: url,\n user: JabberAdmin.configuration.username,\n password: JabberAdmin.configuration.password,\n payload: payload.to_json\n )\n rescue RestClient::Exception => e\n @response = e.response\n end", "def response\n @response\n end", "def response\n @response\n end", "def responses\n @responses\n end", "def create_questionnaire_response(data)\n attrs = data.to_h.with_indifferent_access\n response = questionnaire_response_service.create(attrs)\n\n response.tap do |resp|\n if resp.response[:code] == SUCCESS_STATUS\n questionnaire_response.tap do |qr|\n qr.user_uuid = user.uuid\n qr.user_account = user.user_account\n qr.appointment_id = attrs.dig(:appointment, :id)\n qr.questionnaire_response_id = resp.resource.id\n qr.user = user\n qr.questionnaire_response_data = data\n\n qr.save\n end\n end\n end\n end", "def create\n @survey_question_response = SurveyQuestionResponse.new(survey_question_response_params)\n respond_to do |format|\n if @survey_question_response.save\n format.html { redirect_to @survey_question_response, notice: 'Survey question response was successfully created.' }\n format.json { render :show, status: :created, location: @survey_question_response }\n else\n format.html { render :new }\n format.json { render json: @survey_question_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @survey_response = SurveyResponse.new(survey_response_params)\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to @survey_response, notice: 'Survey response was successfully created.' }\n format.json { render :show, status: :created, location: @survey_response }\n else\n format.html { render :new }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @response = Response.new(response_params)\n @response.user = 'Anonymous' if @response.user.nil? or @response.user.empty?\n\n respond_to do |format|\n if @response.save\n format.html { redirect_to root_path, notice: 'Response was successfully created.' }\n format.json { render :show, status: :created, location: @response }\n else\n format.html { render :new }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def respond(response)\n @publisher.publish(response)\n end", "def index\n @responses = Response.all\n puts \"\\n\\n\\n\\nyo dude I think its working \\n\\n\\n\\n\"\n end", "def set_responses\n\t\t@responses = Response.where(question_id: params[:id] ) rescue nil\n\tend", "def response\r\n @response\r\n end", "def new_response\n {:success => true}\n end", "def process_request\n api_response = self.class.post(api_url, :body => build_xml)\n puts api_response if @debug\n response = parse_response(api_response)\n if success?(response)\n success_response(api_response, response)\n else\n failure_response(api_response, response)\n end\n end", "def register_response(response, request)\n\n @active_requests[request.id][:arduino_responses][request.address[:name]] = response \n\n # if reponse is to an info_request then register services\n if request.id < 0 \n register_services request \n\n # else handle response like a normal resource request\n else \n requests = @active_requests[request.id][:arduino_requests].length\n responses = @active_requests[request.id][:arduino_responses].length\n puts \"[Controller:register_response] number of requests #{requests}, and responses #{responses}\"\n if responses >= requests\n puts \"[Controller:register_response] responses received, id: #{request.id}, content: #{@active_requests[request.id]}\"\n # process_response(@active_requests[request.id][:arduino_responses], request.id) \n process_response request.id\n # @active_requests.delete(request.id) \n end\n end\n end", "def do_request\n\t\t\tself.response = post_request(options)\n\t\tend", "def received_user_response\n answer = params[:Body]\n phone_number = params[:From]\n\n respondent = Respondent.find_by_phone_number(phone_number.phony_normalized) || raise(RespondentNotFoundError)\n state = respondent.survey_execution_states.find_by(status: [INITIALIZED, IN_PROGRESS]) ||\n raise(SurveyExecutionStateNotFoundError)\n\n survey = state.survey\n question = state.question\n\n if question.response_choices.exists?\n # Lowercase for a case-insensitive comparison against the response choices\n # and persist it this way for consistency\n answer = answer.downcase\n end\n\n survey_response = SurveyResponse.find_or_create_by(survey: survey, respondent: respondent)\n response = Response.new(\n survey_response: survey_response, respondent: respondent, question: question, answer: answer)\n\n if question.is_response_valid?(response)\n response.save!\n next_question = question.next_question(response)\n if next_question.nil?\n message = survey.finished_message\n state.status = FINISHED\n else\n message = next_question.formatted_question_and_responses\n state.question = next_question\n state.status = IN_PROGRESS\n end\n else\n message = 'Invalid response, please try again.'\n state.status = IN_PROGRESS\n end\n state.save\n\n Sms::Client.instance.send(respondent.phone_number, message)\n\n head :ok\n end", "def response\n @response\n end", "def post(request, response)\n NotImplemented\n end", "def post(request, response)\n NotImplemented\n end", "def create\n @survey_response = SurveyResponse.new(params[:survey_response])\n\n respond_to do |format|\n if @survey_response.save\n format.html { redirect_to survey_survey_responses_path(params[:survey_id]), notice: 'Survey response was successfully created.' }\n format.json { render json: @survey_response, status: :created, location: @survey_response }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def to_xml(xml=Builder::XmlMarkup.new)\n attributes = {'ID' => id, 'Version' => version, 'IssueInstant' => issue_instant.in_time_zone.xmlschema}\n attributes['InResponseTo'] = in_response_to unless in_response_to.nil?\n attributes['Destination'] = destination unless destination.nil?\n attributes['Consent'] = consent unless consent.nil?\n attributes = add_xmlns(attributes)\n xml.tag!('samlp:Response', attributes) {\n xml << issuer.to_xml unless issuer.nil?\n xml << signature.to_xml unless signature.nil?\n # TODO: add extensions support\n xml << status.to_xml unless status.nil?\n assertions.each { |assertion| xml << assertion.to_xml }\n encrypted_assertions.each { |encrypted_assertion| xml << encrypted_assertion.to_xml }\n }\n end", "def create\n @response = @bbs_thread.responses.build(response_params)\n\n respond_to do |format|\n if @response.save\n write_session\n\n format.html { redirect_to bbs_thread_path(@bbs_thread.id), notice: t('notice.response.create') }\n format.json { render :show, status: :created, location: @bbs_response }\n else\n format.html { redirect_to bbs_thread_path(@bbs_thread.id), alert: @response.errors.full_messages }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def post(options = {})\n url = build_url(options)\n ret = post_response(url, options)\n ret\n end", "def new\n @response = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @response }\n end\n end", "def commit(xml)\n url = (test? ? test_url : live_url)\n\n response = parse(ssl_post(url, post_data(xml), 'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'))\n\n Response.new(\n success_from(response),\n message_from(response),\n response,\n authorization: authorization_from(response),\n test: test?,\n error_code: error_code_from(response)\n )\n end", "def new\n @resp = Response.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resp }\n end\n end" ]
[ "0.62504095", "0.6156207", "0.6133566", "0.5935353", "0.5925132", "0.5860173", "0.5820687", "0.581216", "0.5797686", "0.57748365", "0.5772565", "0.5762797", "0.57511526", "0.57357574", "0.57157063", "0.567918", "0.5654427", "0.5640099", "0.5635376", "0.5635376", "0.5635376", "0.5635376", "0.5635376", "0.56290066", "0.5625919", "0.55952036", "0.5594201", "0.5583303", "0.5566348", "0.5554234", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.55518657", "0.5543613", "0.5543613", "0.55428064", "0.55364454", "0.5530099", "0.55154485", "0.55138034", "0.54859763", "0.54766285", "0.5465619", "0.54512066", "0.5445779", "0.5431254", "0.54137903", "0.5410727", "0.5410317", "0.54021454", "0.53912884", "0.53750306", "0.5374637", "0.5365679", "0.53608227", "0.5355097", "0.5345916", "0.5343388", "0.5343236", "0.5333474", "0.5312946", "0.53126895", "0.5306699", "0.52997833", "0.5297458", "0.52910805", "0.52910805", "0.5289935", "0.52884483", "0.5279188", "0.5277243", "0.527723", "0.5275944", "0.5270586", "0.52640915", "0.52552587", "0.525331", "0.5253073", "0.525125", "0.52504945", "0.5231867", "0.5227074", "0.52233744", "0.52233744", "0.5223318", "0.5222725", "0.5221796", "0.52085036", "0.5199757", "0.5177519", "0.51758724" ]
0.0
-1
PUT /responses/1 PUT /responses/1.xml
def update @response = Response.find(params[:id]) @problem_set = ProblemSet.find(params[:problem_set_id]) @question = Question.find(params[:question_id]) respond_to do |format| if @response.update_attributes(params[:response]) format.html { redirect_to(@response, :notice => 'Response was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @response.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def update\n\n respond_to do |format|\n if @response.update_attributes(params[:response])\n flash[:notice] = 'Response was successfully updated.'\n format.html { redirect_to([@survey, @response]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @response.errors, :status => :unprocessable_entity }\n end\n end\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def update\n @response = Response.find(params[:id])\n\n respond_to do |format|\n if @response.update_attributes(params[:response])\n format.html { redirect_to(@response, notice: 'Response was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\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 update\n @request = Request.find_by_id(params[:request_id])\n @response = @request.responses.find(params[:id])\n respond_to do |format|\n if @response.update_attributes(response_params)\n format.html { redirect_to session.delete(:return_to), notice: 'Response was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end", "def update\n @response = Response.find(params[:id])\n\n respond_to do |format|\n if @response.update_attributes(params[:response])\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end", "def put!\n request! :put\n end", "def put(request, response)\n @resource.put(request, response)\n end", "def put(request, response)\n write(request.body)\n Created\n end", "def put(request, response)\n write(request.body)\n Created\n end", "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.json { render :json => 'Question updated OK' }\n format.xml { head :ok }\n else\n format.json { render :json => @question.errors }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to survey_response_path(params[:survey_id], @response.id), notice: 'Response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n # returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|\n returning connection.put(element_path(prefix_options), to_ssj, self.class.headers) do |response|\n load_attributes_from_response(response)\n end\n end", "def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend", "def test_put\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 contents = last_response.body\n contents_id = contents['_id']\n\n data = File.read 'sample-traces/1.json'\n put(\"/traces/#{contents_id}\", data, 'CONTENT_TYPE': 'application/json')\n contents = last_response.body\n\n assert_equal contents_id, contents['_id']\n end", "def updateX\n @server = Server.find(params[:id])\n\n respond_to do |format|\n if @server.update_attributes(params[:server])\n format.html { redirect_to(@server, :notice => 'Server was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @response = Response.find(params[:id])\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def save\n @client.patch(@endpoint, :content=>@changed)\n return nil\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @question_response = QuestionResponse.find(params[:id])\n\n respond_to do |format|\n if @question_response.update_attributes(params[:question_response])\n format.html { redirect_to @question_response, notice: 'Question response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_response.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 @response = Admin::Response.find(params[:id])\n\n respond_to do |format|\n if @response.update_attributes(params[:admin_response])\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { render :show, status: :ok, response: @response }\n else\n format.html { render :edit }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_putpoi_update_valid\n nd = create(:node)\n cs_id = nd.changeset.id\n user = nd.changeset.user\n amf_content \"putpoi\", \"/1\", [\"#{user.email}:test\", cs_id, nd.version, nd.id, nd.lon, nd.lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/1\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 1, result[4]\n\n # Now try to update again, with a different lat/lon, using the updated version number\n lat = nd.lat + 0.1\n lon = nd.lon - 0.1\n amf_content \"putpoi\", \"/2\", [\"#{user.email}:test\", cs_id, nd.version + 1, nd.id, lon, lat, nd.tags, nd.visible]\n post :amf_write\n assert_response :success\n amf_parse_response\n result = amf_result(\"/2\")\n\n assert_equal 5, result.size\n assert_equal 0, result[0]\n assert_equal \"\", result[1]\n assert_equal nd.id, result[2]\n assert_equal nd.id, result[3]\n assert_equal nd.version + 2, result[4]\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end", "def update\n respond_to do |wants|\n if @question.update_attributes(params[:question])\n flash[:notice] = 'Question was successfully updated.'\n wants.html { redirect_to(@question) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @response.update(response_params)\n format.html { redirect_to @response, notice: \"Response was successfully updated.\" }\n format.json { render :show, status: :ok, location: @response }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @q_response = QResponse.find(params[:id])\n\n respond_to do |format|\n if @q_response.update_attributes(params[:q_response])\n format.html { redirect_to @q_response, notice: 'Q response was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @q_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n # actions\n path = URI(@endpoint).path\n action = URI(@req.request_uri).path.sub(path, '').split('/')\n action -= ['']\n if action.include?('_history')\n @actions = [action[0], '_history']\n else\n @actions = [action[0]]\n end\n\n # search param\n req_query = URI(@req.request_uri).query\n unless req_query.nil?\n @req_params = URI::decode_www_form(req_query).to_h\n end\n\n # requst method\n if @req.request_method == \"GET\" and @actions.include? '_history'\n @req_method = 'vread'\n elsif @req.request_method == \"GET\" and @req_params != nil\n @req_method = 'search-type'\n elsif @req.request_method == \"PUT\"\n @req_method = 'update'\n elsif @req.request_method == \"POST\"\n @req_method = 'create'\n else\n @req_method = 'read'\n end\n\n # interaction\n int1 = Interaction.last type: @actions[0], code: @req_method\n if int1.nil?\n @present = 0\n else\n @present = int1.id\n @intCode = int1.valueCode\n end\n end", "def update\n @response = Response.find(params[:id])\n\n respond_to do |format|\n if @response.update_attributes(params[:response])\n if @response.run && @response.run.return_url\n # send the data back to the portal\n data = [{\n \"type\" => \"open_response\",\n \"question_id\" => \"1\",\n \"answer\" => params[:response][:answer]\n }]\n bearer_token = 'Bearer %s' % current_user.token\n HTTParty.post(@response.run.return_url, :body => data.to_json, :headers => {\"Authorization\" => bearer_token, \"Content-Type\" => 'application/json'})\n end\n format.html { redirect_to @response, notice: 'Response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @response.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(path, options={})\n request :put, path, options\n end", "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "def update\n @xml_sample = XmlSample.find(params[:id])\n \n respond_to do |format|\n format.html do\n @xml_sample = XmlSample.update_attributes(params[:xml_sample])\n if @xml_sample.save\n return redirect_to @xml_sample, notice: 'Xml sample was successfully updated.'\n else\n return render action: \"new\"\n end\n end\n format.xml do\n rexml = REXML::Document.new(params[\"xml\"])\n attr = Hash.from_xml(rexml.to_s)\n if @xml_sample.update_attributes(attr[\"xmlsample\"])\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n else\n xml = {msg: \"failed\", status: \"NG\"}.to_xml\n end\n return render xml: xml\n end\n end\n end", "def update_rest\n @answer_localized = AnswerLocalized.find(params[:id])\n\n respond_to do |format|\n if @answer_localized.update_attributes(params[:answer_localized])\n flash[:notice] = 'AnswerLocalized was successfully updated.'\n format.html { redirect_to(@answer_localized) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @answer_localized.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n @survey_response = SurveyResponse.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @survey_response.update_attributes(params[:survey_response])\r\n format.html { redirect_to @survey_response, notice: 'Survey response 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: @survey_response.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n put :update\n end", "def test_put_success\n put \"/blah\", @test_obj do |response|\n assert response.ok?, \"Update test object failed\"\n end\n end", "def update\n @server_rack = ServerRack.find(params[:id])\n\n respond_to do |format|\n if @server_rack.update_attributes(params[:server_rack])\n format.html { redirect_to(@server_rack, :notice => 'Server rack was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @server_rack.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_with []\n end", "def update_rest\n @instrument_version = InstrumentVersion.find(params[:id])\n\n respond_to do |format|\n if @instrument_version.update_attributes(params[:instrument_version])\n flash[:notice] = 'InstrumentVersion was successfully updated.'\n format.html { redirect_to(@instrument_version) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_version.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @method1 = Method1.find(params[:id])\n\n respond_to do |format|\n if @method1.update_attributes(params[:method1])\n format.html { redirect_to(@method1, :notice => 'Method1 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @method1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(*args)\n request :put, *args\n end", "def update\n respond_to do |format|\n if @api_v1_resource.update(api_v1_resource_params)\n format.html { redirect_to @api_v1_resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_resource }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @v1_question.update(v1_question_params)\n render json: @v1_question, status: :ok\n else\n render json: get_errors, status: :unprocessable_entity\n end\n end", "def http_put(request, response)\n body = request.body_as_stream\n path = request.path\n\n # Intercepting Content-Range\n if request.header('Content-Range')\n # An origin server that allows PUT on a given target resource MUST send\n # a 400 (Bad Request) response to a PUT request that contains a\n # Content-Range header field.\n #\n # Reference: http://tools.ietf.org/html/rfc7231#section-4.3.4\n fail Exception::BadRequest, 'Content-Range on PUT requests are forbidden.'\n end\n\n # Intercepting the Finder problem\n expected = request.header('X-Expected-Entity-Length').to_i\n if expected > 0\n # Many webservers will not cooperate well with Finder PUT requests,\n # because it uses 'Chunked' transfer encoding for the request body.\n #\n # The symptom of this problem is that Finder sends files to the\n # server, but they arrive as 0-length files in PHP.\n #\n # If we don't do anything, the user might think they are uploading\n # files successfully, but they end up empty on the server. Instead,\n # we throw back an error if we detect this.\n #\n # The reason Finder uses Chunked, is because it thinks the files\n # might change as it's being uploaded, and therefore the\n # Content-Length can vary.\n #\n # Instead it sends the X-Expected-Entity-Length header with the size\n # of the file at the very start of the request. If this header is set,\n # but we don't get a request body we will fail the request to\n # protect the end-user.\n\n # Only reading first byte\n first_byte = body.read(1)\n unless first_byte\n fail Exception::Forbidden, 'This server is not compatible with OS/X finder. Consider using a different WebDAV client or webserver.'\n end\n\n # The body needs to stay intact, so we copy everything to a\n # temporary stream.\n\n new_body = StringIO.new\n new_body.write(first_byte)\n IO.copy_stream(body, new_body)\n new_body.rewind\n\n body = new_body\n end\n\n if @server.tree.node_exists(path)\n node = @server.tree.node_for_path(path)\n\n # If the node is a collection, we'll deny it\n unless node.is_a?(IFile)\n fail Exception::Conflict, 'PUT is not allowed on non-files.'\n end\n\n etag = Box.new\n return false unless @server.update_file(path, body, etag)\n etag = etag.value\n\n response.update_header('Content-Length', '0')\n response.update_header('ETag', etag) if etag\n response.status = 204\n else\n # If we got here, the resource didn't exist yet.\n etag = Box.new\n unless @server.create_file(path, body, etag)\n # For one reason or another the file was not created.\n return false\n end\n etag = etag.value\n\n response.update_header('Content-Length', '0')\n response.update_header('ETag', etag) if etag\n response.status = 201\n end\n\n # Sending back false will interupt the event chain and tell the server\n # we've handled this method.\n false\n end", "def template_update(id, type, filename)\n check_id_or_raise id\n check_template_type_or_raise type\n check_filename_or_raise filename\n response = http_request_multipart :put, @base_url + \"/templates/#{id}.xml\", 200,\n { :provider_key => @provider_key,\n :draft => File.read(filename), \n :multipart => true}\n puts 'at update call'\n _id, _updated_at = parse_response response, type\n response = http_request :put, \"#{@base_url}/templates/#{id}/publish\", 200,\n { :params => { :provider_key => @provider_key } }\n puts 'at publish call'\n parse_response response, 'page'\n end", "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end", "def update\n @t1 = T1.find(params[:id])\n\n respond_to do |format|\n if @t1.update_attributes(params[:t1])\n flash[:notice] = 'T1 was successfully updated.'\n format.html { redirect_to(@t1) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @t1.errors, :status => :unprocessable_entity }\n end\n end\n end", "def response\n parse_request\n do_something\n put_response\n end", "def update\n head :ok\n end", "def update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}/volumes\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.request_uri)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n\n end", "def update\n @reqinfo = Reqinfo.find(params[:id])\n\n respond_to do |format|\n if @reqinfo.update_attributes(params[:reqinfo])\n flash[:notice] = 'Reqinfo was successfully updated.'\n format.html { redirect_to(@reqinfo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reqinfo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to(@question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n @survey_response = SurveyResponse.find(params[:id])\n\n respond_to do |format|\n if @survey_response.update_attributes(params[:survey_response])\n format.html { redirect_to survey_survey_responses_path(params[:survey_id]), notice: 'Survey response was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey_response.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(path, options={})\n url = build_url path, options\n body, mime = build_payload options\n headers = (options[:headers] || {}).merge :content_type => mime\n Response.new(@client[url].put body, headers)\n rescue RestClient::Exception => e\n Response.new e.response\n end", "def update\n @request = Request.find(params[:id])\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n format.html { redirect_to(@request, :notice => 'Prestamo actualizado.') }\n else\n format.xml { render :xml => @request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_mod\n if params[:title] != nil && params[:content] != nil\n @question.title = params[:title]\n @question.content = params[:content]\n\n question_json = @question.to_h.to_json\n\n url = @httpIp+'/pet.com/api/question/updateQuestion'\n uri = URI(url)\n res = Net::HTTP.post(uri, question_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to questions_path\n end\n end", "def update\n @ontology = SYMPH::Ontology.find(params[:id])\n\n respond_to do |format|\n if @ontology.update_attributes(params[:ontology])\n flash[:notice] = 'Ontology was successfully updated.'\n format.html { redirect_to(ontologies_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ontology.errors, :status => :unprocessable_entity }\n end\n end\n\t\n end", "def update\n @quest = Quest.find(params[:id])\n\n respond_to do |format|\n if @quest.update_attributes(params[:quest])\n format.html { redirect_to(@quest, :notice => 'Quest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @quest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @request = Request.find(params[:id])\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n format.html { redirect_to(@request, :notice => 'Request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @request = Request.find(params[:id])\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n format.html { redirect_to(@request, :notice => 'Request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(response, url)\n return response if ApiClient.config.hydra\n attributes = ApiClient::Parser.response(response, url)\n hash = remove_root(attributes)\n hash = hash.merge({ 'response' => attributes })\n self.attributes = hash\n self\n end", "def put(path, request_options = {}, resource_options = {})\n response(:put, resource(resource_options)[path], request_options)\n end", "def put(path, options={})\n response = request(path, :put, options)\n validate response\n responsed_response = parse response\n data = { headers: response.headers, body: parsed_response }\n end", "def put(path, options = {})\n request(:put, path, options)\n end", "def put(path, options = {})\n request(:put, path, options)\n end", "def render_put\n respond_to do |wants| \n wants.html {render :to_xml => 'PUT.xml.builder', :layout => false, :status => 200}\n wants.json {render :to_json => 'PUT.xml.builder', :status => 200}\n wants.xml {render :to_xml => 'PUT.xml.builder', :layout => false, :status => 200}\n wants.yaml {render :to_yaml => 'PUT.xml.builder', :status => 200}\n end \n end", "def _update(type, current_name, metadata={})\n type = type.to_s.camelize\n request :update do |soap|\n soap.body = {\n :metadata => {\n :current_name => current_name,\n :metadata => prepare(metadata),\n :attributes! => { :metadata => { 'xsi:type' => \"ins0:#{type}\" } }\n }\n }\n end\n end", "def update\n @verb = Verb.find(params[:id])\n\n if @verb.update(verb_params)\n head :no_content\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end", "def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end", "def update\n @question = Question.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to api_v1_question_path(@question), notice: 'Question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question.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 put(request, response)\n NotImplemented\n end", "def put(request, response)\n NotImplemented\n end", "def update\n respond_to do |format|\n\n format.json { render json: Axis.find(params[:id]).update( name: params[:name]) }\n end\n\n # end\n end", "def update\n @questao = Questao.find(params[:id])\n\n respond_to do |format|\n if @questao.update_attributes(params[:questao])\n format.html { redirect_to(@questao, :notice => 'Questao was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @questao.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put\n RestClient.put(url, @body, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end", "def update(response, url)\n return response if ApiKits.config.hydra\n attributes = ApiKits::Parser.response(response, url)\n hash = remove_root(attributes)\n hash = hash.merge({ 'response' => attributes })\n self.attributes = hash\n self\n end", "def test_set\n req = c.set(\"/foo\", \"bar\", 123, &blk)\n\n assert_sent(req.tag, :verb => V::SET, :cas => 123, :path => \"/foo\", :value => \"bar\")\n assert_recv(reply(req.tag, :cas => 123))\n end", "def put(path = '/files/', params = {})\n request :put, path, params\n end", "def update\n @service_request = ServiceRequest.find(params[:id])\n\n respond_to do |format|\n if @service_request.update_attributes(params[:service_request])\n format.html { redirect_to(@service_request, :notice => 'Service request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @service_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end", "def create_update_volumes(username, token, workset_name, volume_ids)\n\n #<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n #<volumes xmlns=\"http://registry.htrc.i3.illinois.edu/entities/workset\">\n # <volume>\n # <id>9999999</id>\n # </volume>\n # <volume>\n # <id>3333333</id>\n # </volume>\n # </volumes>\n volumes_xml =\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"yes\\\"?>\" +\n \"<volumes xmlns=\\\"http://registry.htrc.i3.illinois.edu/entities/workset\\\">\";\n\n for id in volume_ids\n volumes_xml += \"<volume><id>#{id}</id></volume>\"\n end\n volumes_xml += \"</volumes>\"\n\n\n # curl -v --data @new_volumes.xml -X PUT \\\n # -H \"Content-Type: application/vnd.htrc-volume+xml\" \\\n # -H \"Accept: application/vnd.htrc-volume+xml\" \\\n # http://localhost:9763/ExtensionAPI-0.1.0/services/worksets/workset1/volumes?user=fred\n\n url = URI.parse(\"#{APP_CONFIG['registry_url']}/worksets/#{workset_name}\")\n http = Net::HTTP.new(url.host, url.port)\n if Rails.env.development?\n http.set_debug_output($stdout)\n end\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Put.new(url.path)\n request[\"Content-Type\"] = \"application/vnd.htrc-volume+xml\"\n request.add_field(\"Authorization\", \"Bearer #{token}\")\n\n request.body = volumes_xml\n response = http.request(request)\n\n #xml = response.body\n\n case response\n when Net::HTTPUnauthorized then\n raise Exceptions::SessionExpiredError.new(\"Session expired. Please login again\")\n when Net::HTTPSuccess then\n # Do nothing\n else\n raise Exceptions::SystemError.new(\"Error retrieving worksets (HTTP #{response.code})\")\n end\n end" ]
[ "0.65792966", "0.6283583", "0.61865425", "0.6160115", "0.61238897", "0.6104857", "0.59766275", "0.5972306", "0.59721243", "0.5808603", "0.57450926", "0.5711256", "0.5698454", "0.5674579", "0.5653516", "0.56380016", "0.5578995", "0.5578995", "0.5573072", "0.5565632", "0.55566883", "0.55401826", "0.5534203", "0.55327684", "0.551398", "0.55050427", "0.54921633", "0.5481135", "0.5481135", "0.544489", "0.54402155", "0.5439586", "0.5413069", "0.5405708", "0.54029167", "0.54029167", "0.54029167", "0.54029167", "0.54015356", "0.5397835", "0.5397784", "0.53877515", "0.53834975", "0.5365083", "0.5360616", "0.5338354", "0.53332114", "0.5331599", "0.532623", "0.53123343", "0.53093743", "0.53085065", "0.5307145", "0.5298662", "0.52912694", "0.5291091", "0.5285172", "0.52843875", "0.5278158", "0.52776706", "0.5261089", "0.52563554", "0.5247071", "0.52462834", "0.5237352", "0.5233939", "0.52320796", "0.5212367", "0.5212202", "0.5195449", "0.5189405", "0.5185347", "0.51771027", "0.5175721", "0.5163292", "0.5160756", "0.5156332", "0.5156332", "0.51529366", "0.51526785", "0.51498914", "0.5145413", "0.5145413", "0.51446694", "0.514349", "0.5134032", "0.51286954", "0.5128262", "0.51267016", "0.5124978", "0.5124978", "0.5120953", "0.5119842", "0.51178956", "0.5116865", "0.5116458", "0.5115959", "0.5108554", "0.5101773", "0.51009136" ]
0.6076822
6
DELETE /responses/1 DELETE /responses/1.xml
def destroy @problem_set = ProblemSet.find(params[:problem_set_id]) @question = Question.find(params[:question_id]) @response = Response.find(params[:id]) @response.destroy respond_to do |format| format.html { redirect_to(problem_set_question_responses_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to(responses_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def destroy\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to(survey_responses_url(@survey)) }\n format.xml { head :ok }\n end\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def delete(id)\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def destroy\n @resp.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end", "def destroy\n @respuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @response = Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @response = Admin::Response.find(params[:id])\n @response.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_responses_url }\n format.json { head :no_content }\n end\n end", "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 delete\n start { |connection| connection.request http :Delete }\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "def destroy\n @reqinfo = Reqinfo.find(params[:id])\n @reqinfo.destroy\n\n respond_to do |format|\n format.html { redirect_to(reqinfos_url) }\n format.xml { head :ok }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "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 deletef\n url = prefix + \"deletef\" + id_param\n return response(url)\n end", "def deleteRequest\n\n end", "def destroy\n @request = Request.find(params[:id])\n @request_items = @request.request_items\n @request_items.each do |ri|\n ri.destroy\n end\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to(requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @xml_sample = XmlSample.find(params[:id])\n @xml_sample.destroy\n\n respond_to do |format|\n format.html { redirect_to xml_samples_url }\n format.xml do\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n return render xml: xml\n end\n end\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 http_delete(request, response)\n path = request.path\n\n return false unless @server.emit('beforeUnbind', [path])\n\n @server.tree.delete(path)\n\n @server.emit('afterUnbind', [path])\n\n response.status = 204\n response.update_header('Content-Length', '0')\n\n # Sending back false will interupt the event chain and tell the server\n # we've handled this method.\n false\n end", "def destroy\n @expectation = RiGse::Expectation.find(params[:id])\n @expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to(expectations_url) }\n format.xml { head :ok }\n end\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @service_request = ServiceRequest.find(params[:id])\n @service_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(service_requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy_rest\n @entry_answer = EntryAnswer.find(params[:id])\n @entry_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(entry_answers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\r\n @survey_response = SurveyResponse.find(params[:id])\r\n @survey_response.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to survey_responses_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @appointment_request = AppointmentRequest.find(params[:id])\n @appointment_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(appointment_requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @q_response = QResponse.find(params[:id])\n @q_response.destroy\n\n respond_to do |format|\n format.html { redirect_to q_responses_url }\n format.json { head :ok }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @t1 = T1.find(params[:id])\n @t1.destroy\n\n respond_to do |format|\n format.html { redirect_to(t1s_url) }\n format.xml { 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 @verb.destroy\n\n head :no_content\n end", "def delete_questions\n response = Request.delete_request(URL_QUESTION)\n if response.success?\n redirect '/upload-csv'\n end\nend", "def destroy\n @taxirequest = Taxirequest.find(params[:id])\n @taxirequest.destroy\n\n respond_to do |format|\n format.html { redirect_to taxirequests_url }\n format.json { head :no_content }\n end\n end", "def destroyX\n @server = Server.find(params[:id])\n @server.destroy\n\n respond_to do |format|\n format.html { redirect_to(servers_url) }\n format.xml { head :ok }\n end\n end", "def delete\n Iterable.request(conf, base_path).delete\n end", "def delete(path)\n request(:delete, path)\n end", "def delete!\n request! :delete\n end", "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end", "def destroy\n @survey_response = SurveyResponse.find(params[:id])\n @survey_response.destroy\n\n respond_to do |format|\n format.html { redirect_to survey_survey_responses_path(params[:survey_id]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @question_response = QuestionResponse.find(params[:id])\n @question_response.destroy\n\n respond_to do |format|\n format.html { redirect_to question_responses_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def test_delete_not_found\n request = Http::Request.new('DELETE', '/file2')\n response = self.request(request)\n\n assert_equal(\n 404,\n response.status,\n \"Incorrect status code. Response body: #{response.body_as_string}\"\n )\n end", "def destroy1\n @todo = Todo.find(params[:id])\n @todo.destroy\n\n respond_to do |format|\n format.html { redirect_to(todos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @correspondence = Correspondence.find(params[:id])\n @correspondence.destroy\n\n respond_to do |format|\n format.html { redirect_to(correspondences_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to(surveys_path) }\n format.xml { head :ok }\n end\n end", "def destroy\n @bottle = Bottle.find(params[:id])\n @bottle.destroy\n\n respond_to do |format|\n format.html { redirect_to(bottles_url) }\n format.xml { head :ok }\n end\n end", "def delete!\n connection.delete(\n path: resource_path,\n status: 204\n ).data\n end", "def destroy\n @server_rack = ServerRack.find(params[:id])\n @server_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to(server_racks_url) }\n format.xml { head :ok }\n end\n end", "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end", "def destroy\n#status_url(Status.find_by_survey_id(protocol.access_code)\n #@p = ResponseSet.where(:user_id => current_user)\n #@protocol = user_id.find_by_survey_id(protocol.access_code)\n #@p = ResponseSet.where(:question_id => @title_questions).first.string_value\n p= ResponseSet.where(:access_code => params[:id])\n p.first.destroy\n \n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @survey_answer = SurveyAnswer.find(params[:id])\n @survey_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(survey_answers_url) }\n format.xml { head :ok }\n end\n end", "def destroy_rest\n @answer_localized = AnswerLocalized.find(params[:id])\n @answer_localized.destroy\n\n respond_to do |format|\n format.html { redirect_to(answer_localizeds_url) }\n format.xml { head :ok }\n end\n end", "def delete\n @res = DialResult.find(params[:id])\n\[email protected]\n respond_to do |format|\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\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 @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to(surveys_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to(surveys_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to(surveys_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to(surveys_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @quest = Quest.find(params[:id])\n @quest.destroy\n\n respond_to do |format|\n format.html { redirect_to(quests_url) }\n format.xml { head :ok }\n end\n end", "def delete\n delete_from_server single_url\n end", "def destroy\n @differentiator_answer = DifferentiatorAnswer.find(params[:id])\n @differentiator_answer.destroy\n\n respond_to do |format|\n format.html { redirect_to(differentiator_answers_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url, notice: 'Response was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url, notice: 'Response was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url, notice: 'Response was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url, notice: 'Response was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url, notice: 'Response was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @response.destroy\n respond_to do |format|\n format.html { redirect_to responses_url, notice: \"Response was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete\n api_client.delete(url)\n end", "def destroy\n @envelope = Envelope.find(params[:id])\n @envelope.destroy\n\n respond_to do |format|\n format.html { redirect_to(envelopes_url) }\n format.xml { head :ok }\n end\n end", "def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end", "def destroy\n @questao = Questao.find(params[:id])\n @questao.destroy\n\n respond_to do |format|\n format.html { redirect_to(questoes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reply.destroy\n\n head :no_content\n end", "def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def destroy\n @method1 = Method1.find(params[:id])\n @method1.destroy\n\n respond_to do |format|\n format.html { redirect_to(method1s_url) }\n format.xml { head :ok }\n end\n end" ]
[ "0.7279104", "0.71932954", "0.70773745", "0.69844586", "0.69844586", "0.6975257", "0.6908023", "0.6900086", "0.6899077", "0.6836118", "0.6818586", "0.6818586", "0.6810788", "0.6763918", "0.66575164", "0.66140133", "0.66140133", "0.66140133", "0.66008335", "0.66008335", "0.66006905", "0.6587657", "0.65477526", "0.65284115", "0.6494239", "0.648313", "0.64825416", "0.64811456", "0.6479515", "0.6479515", "0.6479515", "0.6479515", "0.6429334", "0.64268357", "0.6420223", "0.64085627", "0.64085627", "0.64085627", "0.64085627", "0.63958627", "0.6387503", "0.638578", "0.6356246", "0.63555187", "0.63541204", "0.6353401", "0.63514596", "0.63368374", "0.63259196", "0.63229686", "0.6320072", "0.6316063", "0.63144094", "0.6311988", "0.63016456", "0.63007015", "0.6300498", "0.6297592", "0.6280939", "0.6277019", "0.62718827", "0.62718666", "0.62592465", "0.6256111", "0.62399113", "0.62349033", "0.62317795", "0.6226434", "0.62245476", "0.62173754", "0.62162447", "0.62040496", "0.6202497", "0.6200621", "0.6197683", "0.61914545", "0.61912644", "0.6187624", "0.6186625", "0.6186174", "0.6186174", "0.6186174", "0.6186174", "0.61833555", "0.61753255", "0.6174664", "0.6169245", "0.6169245", "0.6169245", "0.6169245", "0.6169245", "0.6168186", "0.61662346", "0.61613226", "0.61559063", "0.61508805", "0.61463773", "0.6145479", "0.61451113", "0.6144005" ]
0.6487527
25
People that merged (not necessarily through pull requests) up to months_back from the time the built PR was created. if months_back is nil, don't take create time into consideration
def merger_team(pr, months_back = nil) recently_merged = prs.find_all do |b| close_reason[b[:github_id]] != :unknown and (months_back.nil? ? true : b[:created_at].to_i > (pr[:created_at].to_i - months_back * 30 * 24 * 3600)) end.map do |b| b[:github_id] end q = <<-QUERY select u1.login as merger from reduced_users u, reduced_projects p, reduced_pull_requests pr, reduced_pull_request_history prh, reduced_users u1 where prh.action = 'closed' and prh.actor_id = u1.id and prh.pull_request_id = pr.id and pr.base_repo_id = p.id and p.owner_id = u.id and u.login = ? and p.name = ? and pr.pullreq_id = ? QUERY log q recently_merged.map do |pr_num| a = db.fetch(q, pr[:login], pr[:project_name], pr_num).first if not a.nil? then a[:merger] else nil end end.select {|x| not x.nil?}.uniq end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merger_team(pr, months_back)\n @close_reason.map do |k,v|\n created_at = @prs.find{|x| x[:github_id] == k}\n [created_at[:created_at], v[2]]\n end.find_all do |x|\n x[0].to_i > (pr[:created_at].to_i - months_back * 30 * 24 * 3600)\n end.map do |x|\n x[1]\n end.select{|x| x != ''}.uniq\n end", "def commits_last_x_months(pr, exclude_pull_req, months_back)\n q = <<-QUERY\n select count(c.id) as num_commits\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and pr.id=?\n QUERY\n\n if exclude_pull_req\n q << ' and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)'\n end\n\n db.fetch(q, pr[:id]).first[:num_commits]\n end", "def pushed_within(months, collection=repos)\n (collection - no_push).select { |r| r.pushed_at >= months.months.ago }\n end", "def committer_team(pr, months_back)\n q = <<-QUERY\n select distinct(u.login)\n from commits c, project_commits pc, pull_requests pr, users u, pull_request_history prh\n where pr.base_repo_id = pc.project_id\n and not exists (select * from pull_request_commits where commit_id = c.id)\n and pc.commit_id = c.id\n and pr.id = ?\n and u.id = c.committer_id\n and u.fake is false\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and c.created_at < prh.created_at;\n QUERY\n db.fetch(q, pr[:id]).all\n end", "def commits_last_x_months(pr_id, exclude_pull_req, months)\n q = <<-QUERY\n select count(c.id) as num_commits\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months} MONTH)\n and pr.id=?\n QUERY\n\n if exclude_pull_req\n q << ' and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)'\n end\n q << ';'\n\n if_empty(db.fetch(q, pr_id).all, :num_commits)\n end", "def commits_on_pr_files(pr, months_back)\n\n oldest = Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 30 * months_back)\n pr_against = pull_req_entry(pr[:id])['base']['sha']\n commits = commit_entries(pr[:id])\n\n commits_per_file = commits.flat_map { |c|\n c['files'].map { |f|\n [c['sha'], f['filename']]\n }\n }.group_by {|c|\n c[1]\n }\n\n commits_per_file.keys.reduce({}) do |acc, filename|\n commits_in_pr = commits_per_file[filename].map{|x| x[0]}\n\n walker = Rugged::Walker.new(repo)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(pr_against)\n\n commit_list = walker.take_while do |c|\n c.time > oldest\n end.reduce([]) do |acc1, c|\n if c.diff(paths: [filename.to_s]).size > 0 and\n not commits_in_pr.include? c.oid\n acc1 << c.oid\n end\n acc1\n end\n acc.merge({filename => commit_list})\n end\n end", "def months_ago(months)\n if months >= self.month\n change(:year => self.year - 1, :month => 12).months_ago(months - self.month)\n else\n change(:year => self.year, :month => self.month - months)\n end\n end", "def committer_team(pr, months_back = nil)\n q = <<-QUERY\n select distinct(u.login) as committer\n from reduced_commits c, reduced_project_commits pc, reduced_pull_requests pr, reduced_users u, reduced_pull_request_history prh\n where pr.base_repo_id = pc.project_id\n and not exists (select * from reduced_pull_request_commits where commit_id = c.id)\n and pc.commit_id = c.id\n and pr.id = ?\n and u.id = c.committer_id\n and u.fake is false\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n QUERY\n if !months_back.nil?\n q += \" and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\"\n end\n log q\n db.fetch(q, pr[:id]).all.map{|x| x[:committer]}\n end", "def commits_on_pr_files(pr, months_back)\n\n oldest = Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 30 * months_back)\n commits = commit_entries(pr, at_open = true)\n\n commits_per_file = commits.flat_map { |c|\n unless c[:files].nil?\n JSON.parse(c[:files]).map { |f|\n [c[:sha], f[\"filename\"]]\n }\n else\n []\n end\n }.select{|x| x.size > 1}.group_by {|c|\n c[1]\n }\n\n commits_per_file.keys.reduce({}) do |acc, filename|\n commits_in_pr = commits_per_file[filename].map{|x| x[0]} # get the shas of pr related commits\n\n walker = Rugged::Walker.new(git)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(pr[:base_commit])\n\n commit_list = walker.select do |c|\n c.time > oldest\n end.reduce([]) do |acc1, c|\n if c.diff(paths: [filename.to_s]).size > 0 and\n not commits_in_pr.include? c.oid # (oid is the object id - c.oid gets the commit sha). this commit is not part of pr's commits\n acc1 << c.oid\n end\n acc1\n end\n acc.merge({filename => commit_list})\n end\n end", "def commits_on_files_touched(pr, months_back)\n commits_on_pr_files(pr, months_back).reduce([]) do |acc, commit_list|\n acc + commit_list[1]\n end.flatten.uniq.size\n end", "def main_team_member?(pr, months_back)\n (committer_team(pr, months_back) + merger_team(pr, months_back)).uniq.include? requester(pr)\n end", "def associated_months\n result = [] # expect no months if no dates\n years = associated_years\n \n\t start_date = event_start\n\t start_date = entry_deadline if is_opportunity?\n\t \t \n start_month_year = Time.parse(\"01/#{start_date}.month/#{start_date}.year\") if !start_date.blank?\n finish_month_year = Time.parse(\"01/#{event_finish}.month/#{event_finish}.year\") if !event_finish.blank?\n \n #this is the case when we only have a start month\n if !start_month_year.blank? and finish_month_year.blank?\n result << start_date.month\n #this is the tricky one...\n elsif !start_month_year.blank? and !finish_month_year.blank?\n delta_year = event_finish.year - start_date.year # year\n \n #if the range spans an entire year we have all the months\n if (delta_year) > 1\n result = [1,2,3,4,5,6,7,8,9,10,11,12]\n #this is the case of months being in the same year\n elsif delta_year == 0\n puts start_month_year.month\n puts finish_month_year.month\n for m in start_month_year.month..finish_month_year.month\n result << m\n end\n \n #this is the annoying one, going over new year\n elsif delta_year == 1\n #add months to year end\n for month in start_month_year.month..12\n result << month\n end\n \n #add months from start of year\n for month in 1.. finish_month_year.month\n result << month\n end \n end\n result\n end\n \n \n \n \n result\n end", "def prior_interaction_issue_events(pr, months_back)\n q = <<-QUERY\n select count(distinct(i.id)) as num_issue_events\n from issue_events ie, pull_request_history prh, pull_requests pr, issues i\n where ie.actor_id = prh.actor_id\n and i.repo_id = pr.base_repo_id\n and i.id = ie.issue_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and ie.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and ie.created_at < prh.created_at\n and prh.pull_request_id = ?\n QUERY\n db.fetch(q, pr[:id]).first[:num_issue_events]\n end", "def biblreview_postponed_until\n postpone_date = postpone_dates.where(deleted_at: nil).where(\"postponed_until > (?)\", DateTime.now).first\n if postpone_date\n return postpone_date.postponed_until\n else\n return nil\n end\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 months_ago(months)\n advance(months: -months)\n end", "def merch_month\n # TODO: This is very inefficient, but less complex than strategic guessing\n # maybe switch to a binary search or something\n @merch_month ||= (1..12).detect do |num|\n date_calc.end_of_month(start_of_year.year, num) >= date && date >= date_calc.start_of_month(start_of_year.year, num)\n end\n end", "def months_since(months)\n advance(months: months)\n end", "def researchers_without_xaccount()\n last_month = Time.now - 1.month\n #People.\n end", "def process_pull_request(pr, lang)\n\n # Statistics across pull request commits\n stats = pr_stats(pr)\n merged = !pr[:merged_at].nil?\n git_merged, merge_reason, merge_person = @close_reason[pr[:github_id]]\n\n # Count number of src/comment lines\n src = src_lines(pr[:id].to_f)\n\n if src == 0 then raise Exception.new(\"Bad src lines: 0, pr: #{pr[:github_id]}, id: #{pr[:id]}\") end\n\n months_back = 3\n commits_incl_prs = commits_last_x_months(pr, false, months_back)\n prev_pull_reqs = prev_pull_requests(pr,'opened')\n\n # Create line for a pull request\n {\n :pull_req_id => pr[:id],\n :project_name => \"#{pr[:login]}/#{pr[:project_name]}\",\n :lang => lang,\n :github_id => pr[:github_id],\n :created_at => Time.at(pr[:created_at]).to_i,\n :merged_at => merge_time(pr, merged, git_merged),\n :closed_at => Time.at(pr[:closed_at]).to_i,\n :lifetime_minutes => pr[:lifetime_minutes],\n :mergetime_minutes => merge_time_minutes(pr, merged, git_merged),\n :merged_using => merge_reason.to_s,\n :conflict => conflict?(pr),\n :forward_links => forward_links?(pr),\n :team_size => team_size_at_open(pr, months_back),\n :num_commits => num_commits(pr),\n :num_commits_open => num_commits_at_open(pr),\n :num_pr_comments => num_pr_comments(pr),\n :num_issue_comments => num_issue_comments(pr),\n :num_commit_comments => num_commit_comments(pr),\n :num_comments => num_pr_comments(pr) + num_issue_comments(pr) + num_commit_comments(pr),\n :num_participants => num_participants(pr),\n :files_added => stats[:files_added],\n :files_deleted => stats[:files_removed],\n :files_modified => stats[:files_modified],\n :files_changed => stats[:files_added] + stats[:files_modified] + stats[:files_removed],\n :src_files => stats[:src_files],\n :doc_files => stats[:doc_files],\n :other_files => stats[:other_files],\n :perc_external_contribs => commits_last_x_months(pr, true, months_back) / commits_incl_prs,\n :sloc => src,\n :src_churn => stats[:lines_added] + stats[:lines_deleted],\n :test_churn => stats[:test_lines_added] + stats[:test_lines_deleted],\n :commits_on_files_touched => commits_on_files_touched(pr, months_back),\n :commits_to_hottest_file => commits_to_hottest_file(pr, months_back),\n :test_lines_per_kloc => (test_lines(pr[:id]).to_f / src.to_f) * 1000,\n :test_cases_per_kloc => (num_test_cases(pr[:id]).to_f / src.to_f) * 1000,\n :asserts_per_kloc => (num_assertions(pr[:id]).to_f / src.to_f) * 1000,\n :watchers => watchers(pr),\n :requester => requester(pr),\n :closer => closer(pr),\n :merger => merge_person,\n :prev_pullreqs => prev_pull_reqs,\n :requester_succ_rate => if prev_pull_reqs > 0 then prev_pull_requests(pr, 'merged').to_f / prev_pull_reqs.to_f else 0 end,\n :followers => followers(pr),\n :intra_branch => if intra_branch?(pr) == 1 then true else false end,\n :main_team_member => main_team_member?(pr, months_back),\n :social_connection_tsay => social_connection_tsay?(pr),\n :hotness_vasilescu => hotness_vasilescu(pr, months_back),\n :team_size_vasilescu => team_size_vasilescu(pr, months_back),\n :description_complexity => description_complexity(pr),\n :workload => workload(pr),\n :prior_interaction_issue_events => prior_interaction_issue_events(pr, months_back),\n :prior_interaction_issue_comments => prior_interaction_issue_comments(pr, months_back),\n :prior_interaction_pr_events => prior_interaction_pr_events(pr, months_back),\n :prior_interaction_pr_comments => prior_interaction_pr_comments(pr, months_back),\n :prior_interaction_commits => prior_interaction_commits(pr, months_back),\n :prior_interaction_commit_comments => prior_interaction_commit_comments(pr, months_back),\n :first_response => first_response(pr),\n :ci_latency => ci_latency(pr),\n :ci_errors => ci_errors?(pr),\n :ci_test_failures => ci_test_failures?(pr),\n }\n end", "def generate_client_birth_and_join_date(years)\n joined_fund_date = Faker::Date.between(from: 20.days.ago, to: 1.month.ago)\n rand_day_diff = rand(30) # generate a random number 0..29\n # guaranteed one month after and random date upto another month\n client_birth_date = joined_fund_date.years_ago(years) \n current_month = Date.today.month \n if client_birth_date.month < 7\n # we make it sep \n puts(\"generate client_birth_date: #{client_birth_date}, month is #{client_birth_date.month}\")\n month_diff = 11 - client_birth_date.month\n client_birth_date = client_birth_date.advance(months: month_diff)\n puts(\"Changed date forced in after July: #{client_birth_date}, month is #{client_birth_date.month}\")\n end\n \n if (client_birth_date.month == current_month)\n # we make it different to before or after\n puts(\"Make it different from current month\")\n if current_month == 12\n client_birth_date.advance(months: -1)\n else \n client_birth_date.advance(months: 1)\n end\n end\n \n puts(\"Generated client_birth_date: #{client_birth_date}\")\n\n return client_birth_date, joined_fund_date\n end", "def team_size_vasilescu(pr, months_back)\n (committer_team(pr, months_back) + merger_team(pr, months_back)).uniq.size\n end", "def set_contributor_until\n self.contributer_until = \"Oct 1 2011\"\n self.content_contributer_until = \"Oct 1 2011\"\n end", "def db_fix_merged_at(db, client, issues, org, repo)\n issues.each do |item|\n if(item.pull_request)\n # sqlite queries much cheaper than github requests, so protect from unnecessary github requests\n countRow = db[\"SELECT COUNT(id) FROM pull_requests WHERE org=? AND repo=? AND pr_number=? AND merged_at IS NOT NULL\", org, \"#{repo}\", item.number.to_s]\n count = countRow.first[:count]\n if(count == 0)\n pr=client.pull_request( \"#{org}/#{repo}\", item.number )\n if(pr.merged_at)\n db_update_pull_request(db, pr, org, repo)\n end\n end\n end\n end\n end", "def billable_hours_for_issue_and_user_previous_month\n return @billable_hours_for_issue_and_user_previous_month if defined?(@billable_hours_for_issue_and_user_previous_month)\n\n @billable_hours_for_issue_and_user_previous_month = nil\n\n return @billable_hours_for_issue_and_user_previous_month if issue_id.blank? || user_id.blank?\n\n date_filter = Date.today.prev_month\n\n scope_for_time_entries = TimeEntry.\n where(:issue_id => self.issue_id).\n where(:user_id => self.user_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month)\n\n cf = self.class.billable_custom_field\n total = cf.format.total_for_scope(cf, scope_for_time_entries)\n @billable_hours_for_issue_and_user_previous_month = cf.format.cast_total_value(cf, total)\n end", "def prev_pull_requests(pr, action)\n\n if action == 'merged'\n q = <<-QUERY\n select pr.pullreq_id, prh.pull_request_id as num_pull_reqs\n from pull_request_history prh, pull_requests pr\n where prh.action = 'opened'\n and prh.created_at < (select min(created_at) from pull_request_history prh1 where prh1.pull_request_id = ? and prh1.action = 'opened')\n and prh.actor_id = (select min(actor_id) from pull_request_history prh1 where prh1.pull_request_id = ? and prh1.action = 'opened')\n and prh.pull_request_id = pr.id\n and pr.base_repo_id = (select pr1.base_repo_id from pull_requests pr1 where pr1.id = ?);\n QUERY\n\n pull_reqs = db.fetch(q, pr[:id], pr[:id], pr[:id]).all\n pull_reqs.reduce(0) do |acc, pull_req|\n if not @close_reason[pull_req[:pullreq_id]].nil? and @close_reason[pull_req[:pullreq_id]][1] != :unknown\n acc += 1\n end\n acc\n end\n else\n q = <<-QUERY\n select pr.pullreq_id, prh.pull_request_id as num_pull_reqs\n from pull_request_history prh, pull_requests pr\n where prh.action = ?\n and prh.created_at < (select min(created_at) from pull_request_history prh1 where prh1.pull_request_id = ?)\n and prh.actor_id = (select min(actor_id) from pull_request_history prh1 where prh1.pull_request_id = ? and action = ?)\n and prh.pull_request_id = pr.id\n and pr.base_repo_id = (select pr1.base_repo_id from pull_requests pr1 where pr1.id = ?);\n QUERY\n db.fetch(q, action, pr[:id], pr[:id], action, pr[:id]).all.size\n end\n end", "def create_merge_request\n author_id, author_found = user_finder.author_id_for(pull_request)\n\n description = MarkdownText\n .format(pull_request.description, pull_request.author, author_found)\n\n # This work must be wrapped in a transaction as otherwise we can leave\n # behind incomplete data in the event of an error. This can then lead\n # to duplicate key errors when jobs are retried.\n MergeRequest.transaction do\n attributes = {\n iid: pull_request.iid,\n title: pull_request.truncated_title,\n description: description,\n source_project_id: project.id,\n target_project_id: project.id,\n source_branch: pull_request.formatted_source_branch,\n target_branch: pull_request.target_branch,\n state: pull_request.state,\n milestone_id: milestone_finder.id_for(pull_request),\n author_id: author_id,\n assignee_id: user_finder.assignee_id_for(pull_request),\n created_at: pull_request.created_at,\n updated_at: pull_request.updated_at\n }\n\n # When creating merge requests there are a lot of hooks that may\n # run, for many different reasons. Many of these hooks (e.g. the\n # ones used for rendering Markdown) are completely unnecessary and\n # may even lead to transaction timeouts.\n #\n # To ensure importing pull requests has a minimal impact and can\n # complete in a reasonable time we bypass all the hooks by inserting\n # the row and then retrieving it. We then only perform the\n # additional work that is strictly necessary.\n merge_request_id = GithubImport\n .insert_and_return_id(attributes, project.merge_requests)\n\n merge_request = project.merge_requests.find(merge_request_id)\n\n # These fields are set so we can create the correct merge request\n # diffs.\n merge_request.source_branch_sha = pull_request.source_branch_sha\n merge_request.target_branch_sha = pull_request.target_branch_sha\n\n merge_request.keep_around_commit\n merge_request.merge_request_diffs.create\n\n merge_request.id\n end\n rescue ActiveRecord::InvalidForeignKey\n # It's possible the project has been deleted since scheduling this\n # job. In this case we'll just skip creating the merge request.\n end", "def commits_to_hottest_file(pr, months_back)\n a = commits_on_pr_files(pr, months_back).map{|x| x}.sort_by { |x| x[1].size}\n a.last[1].size\n end", "def month_depot\n \"#{depot.name} \"+\"#{issue_date.strftime(\"%b\")} \"+\"#{issue_date.year}\"\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 commits_in_month(date)\n start_date = date.beginning_of_month.beginning_of_day\n end_date = date.end_of_month.end_of_day\n return commits_between(start_date, end_date)\n end", "def create_merge_request\n author_id, author_found = user_finder.author_id_for(pull_request)\n\n description = MarkdownText\n .format(pull_request.description, pull_request.author, author_found)\n\n attributes = {\n iid: pull_request.iid,\n title: pull_request.truncated_title,\n description: description,\n source_project_id: project.id,\n target_project_id: project.id,\n source_branch: pull_request.formatted_source_branch,\n target_branch: pull_request.target_branch,\n state: pull_request.state,\n milestone_id: milestone_finder.id_for(pull_request),\n author_id: author_id,\n assignee_id: user_finder.assignee_id_for(pull_request),\n created_at: pull_request.created_at,\n updated_at: pull_request.updated_at\n }\n\n create_merge_request_without_hooks(project, attributes, pull_request.iid)\n end", "def commit_closest_earlier_pr(pr)\n walker = Rugged::Walker.new(git)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(git.head.target)\n result = walker.reduce([]) do |acc, commit|\n if commit.time < pr[:created_at]\n acc << commit.oid\n else\n acc\n end\n end\n result.size > 0 ? result[0] : nil\n end", "def closed_pull_requests(github_api)\n closed_pull_requests = github_api.pull_requests(full_name, state: 'closed')\n closed_pull_requests.collect do |pr|\n\n was_merged = !!(pr['merged_at'])\n closed = (pr['state'] == 'closed')\n open_time = Chronic.parse(pr['created_at'].to_s).to_time\n close_time = Chronic.parse(pr['closed_at'].to_s).to_time\n\n user = pr['user']\n # Ensure that the user exists before trying to continue\n next unless user\n login = user['login']\n from_community = !(github_api.organization_member?('puppetlabs', login))\n\n Hash[\"pr_number\" => pr['number'],\n \"repo_name\" => name,\n \"repo_owner\" => owner,\n \"merge_status\" => was_merged,\n \"time_closed\" => close_time,\n \"time_opened\" => open_time,\n \"from_community\" => from_community,\n \"closed_v_open\" => closed]\n end\n end", "def process_pull_requests(merge_pretest_success)\n pull_requests = []\n mergeability_in_flux = false\n pull_request_statuses = Hash.new { |h,k| h[k] = Hash.new { |h2,k2| h2[k2] = {} } }\n $repo_to_pull_regex.keys.each do |repo|\n $stderr.puts \"\\nProcessing repo '#{repo}'\"\n pull_request_statuses[:closed_prs][repo] = \"#{GITHUB_BASE_URL}/#{Properties['github_user']}/#{repo}/pulls?q=is%3Apr+is%3Aclosed\"\n list_pull_requests(repo).each do |req|\n id = req['number']\n $stderr.puts \"Analyzing pull request: #{GITHUB_BASE_URL}/#{Properties['github_user']}/#{repo}/pull/#{id}\"\n\n branch = req['base']['ref']\n\n # We only want to consider pull requests into branches we care about\n if $branches.include?(branch) || $branches.include?('*')\n\n $stderr.puts \" Updated at: #{req['updated_at']}\"\n # We only want to consider pull requests that have been modified in\n # the last twelve hours, to stop us from doing extra work when we\n # don't need to. Also, just to ensure that we don't forget a pull\n # request forever on accident, there is a 10% chance we'll consider\n # a pull request even if it is inactive\n if Time.now - Time.parse(req['updated_at']) < (12*60*60) || (rand(20) < 1)\n login = req['user']['login']\n comments = nil\n # Skip if it's not mergeable\n mergeable = is_mergeable?(id, repo)\n $stderr.puts \" Mergeable: #{mergeable}\"\n if mergeable\n comments = get_comments(id, repo) if comments.nil?\n set_mergeable(id, repo, login, comments)\n else\n if set_not_mergeable(id, repo, login) == MERGEABLE\n mergeability_in_flux = true\n end\n next\n end\n\n comments = get_comments(id, repo) if comments.nil?\n\n # We only want to consider pull requests where the last trigger we found\n # is from a trusted user\n permission_denied = Array.new(Properties['settings'].length, false)\n # Has a merge or test been requested by a trusted user?\n Properties['settings'].values.each_with_index do |settings, i|\n updated_at, changed_after_eval = get_updated_at(req, comments, settings)\n trigger_regex = /\\[#{settings['name']}\\]/i\n if req['title'] =~ trigger_regex || req['body'] =~ trigger_regex\n if user_trusted?(login, repo, settings)\n pull_requests << [req, updated_at, changed_after_eval, comments, settings]\n permission_denied[i] = false\n next\n else\n $stderr.puts \" User '#{login}' not trusted\"\n permission_denied[i] = true\n end\n end\n\n comments = sort_comments(comments)\n comments.each do |comment|\n if comment['body'] =~ trigger_regex\n comment_login = comment['user']['login']\n if user_trusted?(comment_login, repo, settings)\n pull_requests << [req, updated_at, changed_after_eval, comments, settings]\n permission_denied[i] = false\n break\n else\n $stderr.puts \" User '#{comment_login}' not trusted\"\n permission_denied[i] = true\n end\n end\n end\n end\n if permission_denied.include? true\n create_or_update_comment(id, repo, ACTION_PREFIX, ACTION_NOT_TEAM, comments)\n end\n else\n $stderr.puts \" Skipping due to age and inactivity\"\n end\n else\n create_or_update_comment(id, repo, ACTION_PREFIX, ACTION_UNSUPPORTED_BRANCH)\n end\n end\n end\n\n if mergeability_in_flux\n $stderr.puts \"Waiting till next run to see if mergeability is in flux\"\n exit\n end\n\n # Consider the pull requests we have deemed valid in\n # order of the time they were last updated, oldest first\n sorted_pull_requests = pull_requests.sort_by do |req_info|\n req_info[1]\n end\n\n skipped_count = {}\n $branches.each do |branch|\n skipped_count[branch] = {}\n end\n\n # If we're only allowing sequential tests in this tag, we want to find\n # any pull request in the 'running tests' state and signal that there\n # is a test running.\n sorted_pull_requests.each do |req_info|\n req = req_info[0]\n comments = req_info[3]\n settings = req_info[4]\n branch = req['base']['ref']\n\n if !settings['allow_multiple']\n comments.each do |comment|\n begin\n fields = extract_bot_comment_fields(comment['body'], settings)\n if (comment['user']['login'] == Properties['bot_github_user']) && fields[:state] == :running\n submitted_tests = submitted_tests_for_branch(branch)\n submitted_tests[settings['name']] = true\n break\n end\n rescue Exception => e\n next\n end\n end\n end\n end\n\n sorted_pull_requests.each do |req_info|\n # Process the pull request\n req = req_info[0]\n updated_at = req_info[1]\n changed_after_eval = req_info[2]\n comments = req_info[3]\n settings = req_info[4]\n branch = req['base']['ref']\n repo = req['base']['repo']['name']\n\n process_pull_request(req, updated_at, changed_after_eval, comments, settings, merge_pretest_success)\n\n submitted_tests = submitted_tests_for_branch(branch)\n\n if !settings['allow_multiple'] && submitted_tests[settings['name']]\n # If we're only allowing sequential tests on this tag and there is a test running,\n # and we are waiting to test, we need to correctly determine the position in the\n # test queue that we are at and post it in a bot comment on the pull request\n comments = get_comments(req['number'], repo)\n\n bot_comment = get_comment_with_prefix(req['number'], repo, settings['test_prefix'], comments)\n if bot_comment\n fields = extract_bot_comment_fields(bot_comment['body'], settings)\n if (waiting_in_queue_state?(fields[:state]))\n skipped_count_branch = skipped_count[branch] ? skipped_count[branch] : skipped_count['*']\n skipped_count_branch[settings['name']] = 0 if skipped_count_branch[settings['name']].nil?\n skipped_count_branch[settings['name']] += 1\n queued_comment = compose_bot_comment(settings['test_prefix'], :state => :wait_in_queue, :content => waiting_in_queue_comment_segment(skipped_count_branch[settings['name']].to_s))\n pull_request_statuses[:enqueued][req['html_url']][:title] = req['title'].force_encoding(\"UTF-8\")\n pull_request_statuses[:enqueued][req['html_url']][:queue_pos] = skipped_count_branch[settings['name']]\n pull_request_statuses[:enqueued][req['html_url']][:repo] = repo\n create_or_update_comment(req['number'], repo, settings['test_prefix'], queued_comment , comments)\n $stderr.puts \" Pull ##{req['number']} in repo '#{repo}' is at build position ##{skipped_count_branch[settings['name']]}\"\n # Get ahead of the game and pretest requests\n if settings['pretest_settings_key'] && settings['pretest_comment'] && settings['pretest_queue_threshold'] && (skipped_count_branch[settings['name']] >= settings['pretest_queue_threshold'])\n trusted_trigger_time, _ = get_trusted_trigger_time(req, comments, Properties['settings'][settings['pretest_settings_key']])\n create_or_update_comment(req['number'], repo, settings['pretest_comment'].gsub('[', '\\[').gsub(']', '\\]'), settings['pretest_comment'], comments) unless trusted_trigger_time\n end\n elsif fields[:state] == :running\n pull_request_statuses[:running][req['html_url']][:title] = req['title'].force_encoding(\"UTF-8\")\n pull_request_statuses[:running][req['html_url']][:status] = \"merging\"\n pull_request_statuses[:running][req['html_url']][:repo] = repo\n end\n end\n end\n end\n # Commit merge queue records to disk\n IO.write(MERGE_QUEUE_RECORD, pull_request_statuses.to_json, {:mode => 'w'})\n end", "def work_months_options(user=@curr_user, include_all=false)\n min_year, min_year_month, max_year, max_year_month = WorkEntry.min_max_dates_for_user(user)\n months = if min_year == 0 && max_year == 0\n []\n else\n (year_and_month_to_int(min_year, min_year_month) .. year_and_month_to_int(max_year, max_year_month)).collect { |year_month|\n [year_month_int_to_str(year_month), year_month]\n }.reverse\n end\n months = [['All', '']] + months if include_all\n months\n end", "def itemsOfThisMonth\n @due_items.sort!{|x,y| x.dueDate <=> y.dueDate}\n @due_items.select!{|item| item.done? == 'Item incomplete'}\n @anniversary_items.select!{|item| item.month}\n @incomplete_and_month = @due_items.concat(@anniversary_items)\n end", "def pr_production\n prs = @deploy.changeset.pull_requests\n return nil if prs.empty?\n\n prs.sum { |pr| @deploy.updated_at.to_i - pr.created_at.to_i } / prs.size\n end", "def list_all_not_completed_this_month\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 + show_not_completed_items\n end", "def merged_with_git?(pr)\n\n #1. Commits from the pull request appear in the master branch\n q = <<-QUERY\n\t select c.sha\n from pull_request_commits prc, commits c\n\t where prc.commit_id = c.id\n\t\t and prc.pull_request_id = ?\n QUERY\n db.fetch(q, pr[:id]).each do |x|\n unless @all_commits.select { |y| x[:sha].start_with? y }.empty?\n return [true, :commits_in_master]\n end\n end\n\n #2. The PR was closed by a commit (using the Fixes: convention).\n # Check whether the commit that closes the PR is in the project's\n # master branch\n unless @closed_by_commit[pr[:github_id]].nil?\n sha = @closed_by_commit[pr[:github_id]]\n unless @all_commits.select { |x| sha.start_with? x }.empty?\n return [true, :fixes_in_commit]\n end\n end\n\n comments = issue_comments(pr[:login], pr[:project_name], pr[:github_id])\n\n comments.reverse.take(3).map { |x| x['body'] }.uniq.each do |last|\n # 3. Last comment contains a commit number\n last.scan(/([0-9a-f]{6,40})/m).each do |x|\n # Commit is identified as merged\n if last.match(/merg(?:ing|ed)/i) or \n last.match(/appl(?:ying|ied)/i) or\n last.match(/pull[?:ing|ed]/i) or\n last.match(/push[?:ing|ed]/i) or\n last.match(/integrat[?:ing|ed]/i) \n return [true, :commit_sha_in_comments]\n else\n # Commit appears in master branch\n unless @all_commits.select { |y| x[0].start_with? y }.empty?\n return [true, :commit_sha_in_comments]\n end\n end\n end\n\n # 4. Merg[ing|ed] or appl[ing|ed] as last comment of pull request\n if last.match(/merg(?:ing|ed)/i) or \n last.match(/appl(?:ying|ed)/i) or\n last.match(/pull[?:ing|ed]/i) or\n last.match(/push[?:ing|ed]/i) or\n last.match(/integrat[?:ing|ed]/i) \n return [true, :merged_in_comments]\n end\n end\n\n [false, :unknown]\n end", "def month_lock_defaulters\n defoulters =[]\n beginning_date_of_last_month = Time.now.last_month.beginning_of_month\n end_date_of_last_month = Time.now.last_month.end_of_month\n expected_hrs = expected_time(beginning_date_of_last_month, end_date_of_last_month)\n puts \"+++++++++++#{Time.now}++++++++++++++expected_hrs = +++#{expected_hrs}++++++\"\n users = User.where.not(:id=>[User.find(1),User.find(288),],:status=>3)\n\n users.each do |user|\n hrs = TimeEntry.where(:user=>user).where(\"spent_on >= ? AND spent_on <= ?\", (beginning_date_of_last_month), (end_date_of_last_month) ).sum(:hours)\n\n if (user.email_address != nil && (expected_hrs > hrs))\n defoulters.push({id:user.id,firstname:user.firstname,:lastname=>user.lastname,hours:hrs,email:user.email_address.address})\n end\n end\n defoulters.uniq\n\n end", "def merged_with_git?(pr)\n\n #1. Commits from the pull request appear in the master branch\n q = <<-QUERY\n\t select c.sha\n from pull_request_commits prc, commits c\n\t where prc.commit_id = c.id\n\t\t and prc.pull_request_id = ?\n QUERY\n db.fetch(q, pr[:id]).each do |x|\n unless @all_commits.select { |y| x[:sha].start_with? y }.empty?\n return [true, :commits_in_master]\n end\n end\n\n #2. The PR was closed by a commit (using the Fixes: convention).\n # Check whether the commit that closes the PR is in the project's\n # master branch\n unless @closed_by_commit[pr[:github_id]].nil?\n sha = @closed_by_commit[pr[:github_id]]\n if not @all_commits.select { |x| sha.start_with? x }.empty?\n return [true, :fixes_in_commit]\n end\n end\n\n comments = issue_comments(pr[:login], pr[:project_name], pr[:github_id])\n\n comments.reverse.take(3).map { |x| x['body'] }.uniq.each do |last|\n # 3. Last comment contains a commit number\n last.scan(/([0-9a-f]{6,40})/m).each do |x|\n # Commit is identified as merged\n if last.match(/merg(?:ing|ed)/i) or \n last.match(/appl(?:ying|ied)/i) or\n last.match(/pull[?:ing|ed]/i) or\n last.match(/push[?:ing|ed]/i) or\n last.match(/integrat[?:ing|ed]/i) \n return [true, :commit_sha_in_comments]\n else\n # Commit appears in master branch\n unless @all_commits.select { |y| x[0].start_with? y }.empty?\n return [true, :commit_sha_in_comments]\n end\n end\n end\n\n # 4. Merg[ing|ed] or appl[ing|ed] as last comment of pull request\n if last.match(/merg(?:ing|ed)/i) or \n last.match(/appl(?:ying|ed)/i) or\n last.match(/pull[?:ing|ed]/i) or\n last.match(/push[?:ing|ed]/i) or\n last.match(/integrat[?:ing|ed]/i) \n return [true, :merged_in_comments]\n end\n end\n\n [false, :unknown]\n end", "def monthly(options = {})\n branch options.merge(every: :month)\n end", "def monthly(options = {})\n branch options.merge(every: :month)\n end", "def billable_hours_for_issue_previous_month\n return @billable_hours_for_issue_previous_month if defined?(@billable_hours_for_issue_previous_month)\n\n @billable_hours_for_issue_previous_month = nil\n\n return @billable_hours_for_issue_previous_month if issue_id.blank?\n\n date_filter = Date.today.prev_month\n\n scope_for_time_entries = TimeEntry.\n where(:issue_id => self.issue_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month)\n\n cf = self.class.billable_custom_field\n total = cf.format.total_for_scope(cf, scope_for_time_entries)\n @billable_hours_for_issue_previous_month = cf.format.cast_total_value(cf, total)\n end", "def process_pull_request(pr, lang)\n\n # Statistics across pull request commits\n stats = pr_stats(pr[:id])\n\n merged = ! pr[:merged_at].nil?\n git_merged = false\n merge_reason = :github\n\n if not merged\n git_merged, merge_reason = merged_with_git?(pr)\n end\n\n # Count number of src/comment lines\n src = src_lines(pr[:id].to_f)\n\n if src == 0 then raise Exception.new(\"Bad number of lines: #{0}\") end\n\n commits_last_3_month = commits_last_x_months(pr[:id], false, 3)[0][:num_commits]\n prev_pull_reqs = prev_pull_requests(pr[:id],'opened')[0][:num_pull_reqs]\n\n # Create line for a pull request\n {\n :pull_req_id => pr[:id],\n :project_name => \"#{pr[:login]}/#{pr[:project_name]}\",\n :lang => lang,\n :github_id => pr[:github_id],\n :created_at => Time.at(pr[:created_at]).to_i,\n :merged_at => merge_time(pr, merged, git_merged),\n :closed_at => Time.at(pr[:closed_at]).to_i,\n :lifetime_minutes => pr[:lifetime_minutes],\n :mergetime_minutes => merge_time_minutes(pr, merged, git_merged),\n :merged_using => merge_reason.to_s,\n :conflict => conflict?(pr[:login], pr[:project_name], pr[:github_id]),\n :forward_links => forward_links?(pr[:login], pr[:project_name], pr[:github_id]),\n :team_size => team_size_at_open(pr[:id], 3)[0][:teamsize],\n :num_commits => num_commits(pr[:id])[0][:commit_count],\n :num_commit_comments => num_comments(pr[:id])[0][:comment_count],\n :num_issue_comments => num_issue_comments(pr[:id])[0][:issue_comment_count],\n :num_comments => num_comments(pr[:id])[0][:comment_count] + num_issue_comments(pr[:id])[0][:issue_comment_count],\n :num_participants => num_participants(pr[:id])[0][:participants],\n :files_added => stats[:files_added],\n :files_deleted => stats[:files_removed],\n :files_modified => stats[:files_modified],\n :files_changed => stats[:files_added] + stats[:files_modified] + stats[:files_removed],\n :src_files => stats[:src_files],\n :doc_files => stats[:doc_files],\n :other_files => stats[:other_files],\n :perc_external_contribs => ((commits_last_3_month - commits_last_x_months(pr[:id], true, 3)[0][:num_commits]) * 100) / commits_last_3_month,\n :sloc => src,\n :src_churn => stats[:lines_added] + stats[:lines_deleted],\n :test_churn => stats[:test_lines_added] + stats[:test_lines_deleted],\n :commits_on_files_touched => commits_on_files_touched(pr[:id], Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 90)),\n :test_lines_per_kloc => (test_lines(pr[:id]).to_f / src.to_f) * 1000,\n :test_cases_per_kloc => (num_test_cases(pr[:id]).to_f / src.to_f) * 1000,\n :asserts_per_kloc => (num_assertions(pr[:id]).to_f / src.to_f) * 1000,\n :watchers => watchers(pr[:id])[0][:num_watchers],\n :requester => requester(pr[:id])[0][:login],\n :prev_pullreqs => prev_pull_reqs,\n :requester_succ_rate => if prev_pull_reqs > 0 then prev_pull_requests(pr[:id], 'merged')[0][:num_pull_reqs].to_f / prev_pull_reqs.to_f else 0 end,\n :followers => followers(pr[:id])[0][:num_followers],\n :intra_branch => if intra_branch?(pr[:id])[0][:intra_branch] == 1 then true else false end,\n :main_team_member => if main_team_member?(pr[:id])[0][:main_team_member] == 1 then true else false end\n }\n end", "def due_by\n #occurring_days = ae_definition.occurring_days\n dob = profile.kids_type.birthdate.to_date\n dob + (ae_definition.occurring_days + ae_definition.due_by_days )\n end", "def summary(picked, unpicked)\n return if version.monthly?\n return if picked.empty? && unpicked.empty?\n\n message = []\n\n if picked.any?\n message << <<~MSG\n Successfully picked the following merge requests:\n\n #{markdown_list(picked.collect(&:url))}\n MSG\n end\n\n if unpicked.any?\n message << <<~MSG\n Failed to pick the following merge requests:\n\n #{markdown_list(unpicked.collect(&:url))}\n MSG\n end\n\n create_merge_request_comment(target, message.join(\"\\n\"))\n end", "def commits_between(from, to)\n if from.nil? || to.nil?\n @repo.commits(\"master\", 1000000)\n else\n @repo.commits(\"master\", 1000000).select {|c| c.date > from && c.date <= to}\n end \n end", "def current_paid_contributer?\n return !(self.paid_contributer_until.blank?) && self.paid_contributer_until >= Time.now\n end", "def last_commit_month es\n es.map {|e| e.date.month_start }.sort.last\nend", "def add_contribution_time time_amount\n if current_contributer?\n self.contributer_until += time_amount\n else\n self.contributer_until = Time.now + time_amount\n end\n end", "def months_between(checkin, checkout)\n start = checkin.year * 100 + checkin.month\n finish = checkout.year * 100 + checkout.month\n table.where{year * 100 + month >= start}\n .where{year * 100 + month <= finish}\n end", "def cumulative_years\n if deleted_at && deleted_at.year > created_at.year\n (created_at.year...deleted_at.year).to_a\n elsif deleted_at\n []\n else\n (created_at.year..Date.today.year).to_a\n end\n end", "def query_pull_requests\n # This line is where we want to add :accept => 'application/vnd.github.shadow-cat-preview+json' for draft PRs\n pull_requests = github_query(@client) { @client.pull_requests(@repository, :state => 'open', :per_page => 50) }\n\n @pull_request_details = []\n\n pull_requests.each do |p|\n issue = github_query(@client) { @client.issue(@repository, p.number) }\n\n $logger.debug(\"Issue loaded: #{issue}\")\n\n notification_users = Set.new\n\n notification_users << issue.assignee.login if issue.assignee\n\n notification_users << p.user.login if p.user.login\n\n aging_pull_requests_notify = true\n aging_pull_requests_num_days = 7\n\n # TODO: p.head.repo can be null if the fork repo is deleted. Need to protect that here.\n if p.head.repo.nil?\n $logger.info(\"Skipping potential PR (#{p.number}): Forked repo is null (deleted?)\")\n else\n begin\n pb = PotentialBuild.new(@client, @token, p.head.repo.full_name, nil, p.head.sha, p.head.ref, p.head.user.login, nil, nil, p.number, p.base.repo.full_name, p.base.ref)\n configured_notifications = pb.configuration.notification_recipients\n unless configured_notifications.nil?\n $logger.debug(\"Merging notifications user: #{configured_notifications}\")\n notification_users.merge(configured_notifications)\n end\n\n aging_pull_requests_notify = pb.configuration.aging_pull_requests_notification\n aging_pull_requests_num_days = pb.configuration.aging_pull_requests_numdays\n\n if p.head.repo.full_name == p.base.repo.full_name\n $logger.info(\"Skipping pull-request originating from head repo: #{p.number}\")\n else\n $logger.info(\"Found an external PR to add to potential_builds: #{p.number}\")\n @potential_builds << pb\n end\n rescue DecentCIKnownError => e\n $logger.info(\"Skipping potential PR (#{p.number}): #{e}\")\n rescue => e\n $logger.info(\"Skipping potential PR (#{p.number}): #{e} #{e.backtrace}\")\n end\n end\n # TODO: Should this be here?\n @pull_request_details << {\n :id => p.number,\n :creator => p.user.login,\n :owner => (issue.assignee ? issue.assignee.login : nil),\n :last_updated => issue.updated_at,\n :repo => @repository,\n :notification_users => notification_users,\n :aging_pull_requests_notification => aging_pull_requests_notify,\n :aging_pull_requests_numdays => aging_pull_requests_num_days\n }\n end\n end", "def date_for(issue_or_pull)\n DateTime.parse(issue_or_pull[\"created_at\"])\n end", "def no_recent_plagiarism\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem) and return\n end\n end", "def dmail_inactive_approvers!\n days_until_next_month = (Date.current.next_month.beginning_of_month - Date.current).to_i\n return unless days_until_next_month <= 21\n\n inactive_approvers.each do |user|\n Dmail.create_automated(to: user, title: \"You will lose approval privileges soon\", body: <<~BODY)\n You've approved fewer than #{MINIMUM_APPROVALS} posts in the past\n #{APPROVAL_PERIOD.inspect}. You will lose your approval privileges in\n #{days_until_next_month} #{\"day\".pluralize(days_until_next_month)}\n unless you have approved at least #{MINIMUM_APPROVALS} posts by the end\n of the month.\n BODY\n end\n end", "def calc_months_till\n (calc_days_till / 31.0).round(2)\n end", "def join_project_updated_on_needed_for_order?(order_options=nil)\n return false unless order_options\n\n order_options.include?('project_updated_on')\n end", "def get_date_for_status_change(from_status, to_status)\n selected_version = self.versions.select {|x| YAML.load(x.object_changes)[\"status\"] == [from_status, to_status] }\n !selected_version.empty? ? selected_version.last.created_at : 0\n end", "def pull_requests_from_github\n @github.search_issues(\"is:pr state:open user:#{ORGANISATION}\").items\n end", "def contributions_in_last_24_hrs\n contributions_in_time_range()\n end", "def past_participle; end", "def team_hitting_pull_up\n return nil unless pull_up?\n team1.stats.wins > team2.stats.wins ? team1 : team2\n end", "def merger(pr)\n q = <<-QUERY\n select u.login as login\n from issues i, issue_events ie, users u\n where i.pull_request_id = ?\n and ie.issue_id = i.id\n and ie.action = 'merged'\n and u.id = ie.actor_id\n QUERY\n merger = db.fetch(q, pr[:id]).first\n\n if merger.nil?\n # If the PR was merged, then it is safe to assume that the\n # closer is also the merger\n if not @close_reason[pr[:github_id]].nil? and @close_reason[pr[:github_id]][1] != :unknown\n closer(pr)\n else\n ''\n end\n else\n merger[:login]\n end\n end", "def team_size_at_open(pr, interval_months)\n q = <<-QUERY\n select count(distinct author_id) as teamsize\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{interval_months} MONTH)\n and pr.id=?;\n QUERY\n db.fetch(q, pr[:id]).first[:teamsize]\n end", "def quarterly_committers(start_month, year=Time.now.year)\n \"git log --since='#{start_month}/1/#{year}' --until='#{start_month + 2}/31/#{year}' | git shortlog -n -s\"\nend", "def flagged_case_responded_to_in_time_for_stats_purposes?\n responding_team_assignment_date = transitions.where(\n event: \"assign_responder\",\n ).last.created_at.to_date\n\n disclosure_approval_date = transitions.where(\n event: \"approve\",\n acting_team_id: default_clearance_team.id,\n ).last.created_at.to_date\n\n internal_deadline = @deadline_calculator.internal_deadline_for_date(\n correspondence_type, responding_team_assignment_date\n )\n\n internal_deadline >= disclosure_approval_date\n end", "def create\n\n student_totals_asc = StudentTotal.all.order('date ASC')\n student_totals_desc = StudentTotal.all.order('date DESC')\n\n start_date = Date.parse params[:date]\n total_at_year_start = 0\n total_at_year_end = student_totals_asc.last.lives_improved\n\n student_totals_asc.each do |i|\n if i.date < start_date\n total_at_year_start = i.lives_improved\n end\n end\n\n student_totals_desc.each do |i|\n if i.date > start_date\n total_at_year_end = i.lives_improved\n end\n end\n\n extra_months_total = (total_at_year_end - total_at_year_start) * (start_date.month / 12.0)\n\n @person_lives_improved = student_totals_asc.last.lives_improved - (total_at_year_start + extra_months_total)\n\n end", "def publish_month_and_year\n [publish_on.month, publish_on.year]\n end", "def calculate_dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n end", "def all_journals_and_statements_must_be_before_reconciliation_date\n return unless reconciled_at.present?\n if @order_details.any? { |od| od.journal_or_statement_date.beginning_of_day > reconciled_at }\n errors.add(:reconciled_at, :after_all_journal_dates)\n end\n end", "def pad!\n start = start.beginning_of_month if start\n finish = finish.end_of_month if finish\n end", "def n_commits(date)\n 30\nend", "def get_postponement_date(options)\n subscription_date = options.fetch(:subscription_date)\n first_renewal_date = options.fetch(:first_renewal_date)\n merchant_cutoff_day = options.fetch(:merchant_cutoff_day)\n max_delay = options.fetch(:max_delay)\n is_shippable = options.fetch(:is_shippable)\n\n return nil unless is_shippable\n\n first_mcd = get_first_merchant_cutoff_date(subscription_date, merchant_cutoff_day)\n postponement_end = first_mcd + max_delay\n\n (first_mcd..postponement_end).include_with_range?(first_renewal_date) ? postponement_end + 1.day : nil\n end", "def team_size_at_open(pr_id, interval_months)\n q = <<-QUERY\n select count(distinct author_id) as teamsize\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{interval_months} MONTH)\n and pr.id=?;\n QUERY\n db.fetch(q, pr_id).all\n end", "def last_inspection_two\n sorted = self.inspections.sort{|a,b| a.created_at <=> b.created_at}\n sorted.last\n end", "def merge_version?\n version_merge_window.present? && last_version.present? && last_version.updater == updater && last_version.created_at > version_merge_window.ago\n end", "def oldest_date_for(issues_or_pulls)\n issues_or_pulls.map {|x| DateTime.parse(x['created_at']) }.sort.first\n end", "def billable_hours_for_user_previous_month\n return @billable_hours_for_user_previous_month if defined?(@billable_hours_for_user_previous_month)\n\n @billable_hours_for_user_previous_month = nil\n\n return @billable_hours_for_user_previous_month if user_id.blank?\n\n date_filter = Date.today.prev_month\n\n scope_for_time_entries = TimeEntry.\n where(:project_id => self.project_id).\n where(:user_id => self.user_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month)\n\n cf = self.class.billable_custom_field\n total = cf.format.total_for_scope(cf, scope_for_time_entries)\n @billable_hours_for_user_previous_month = cf.format.cast_total_value(cf, total)\n end", "def release_pr_check\n\n result = CheckResult.new(\"Release PR Check Result\")\n\n ## PR should be sent from `develop` branch\n result.message << \"Head Branch check |\"\n is_from_develop = github.branch_for_head == \"develop\"\n if is_from_develop\n result.message += \":o:\\n\"\n else\n fail \"Please send the PR from `develop` branch.\"\n result.message += \":x:\\n\"\n result.errors += 1\n end\n\n ## PR should be sent to `master` branch\n result.message << \"Base Branch check |\"\n is_to_master = github.branch_for_base == \"master\"\n if is_to_master\n result.message += \":o:\\n\"\n else\n fail \"Please send the PR to `master` branch.\"\n result.message += \":x:\\n\"\n result.errors += 1\n end\n\n ## Release modification check\n release_modification_check_into_result(result)\n\n return result\n\nend", "def commitment_period_origin\n I18n.l(created_at.advance(months: subscription_plan.commitment_period).to_date)\n end", "def calc_years_till\n (calc_months_till / 12.00).round(2)\n end", "def initial_window_months(order)\n order.total > 0 ? 1 : 12\n end", "def no_recent_plagiarism\n if @submission.user == current_user.sk\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem, :sub => @submission) and return\n end\n end\n end", "def spent_hours_for_issue_and_user_previous_month\n return @spent_hours_for_issue_and_user_previous_month if defined?(@spent_hours_for_issue_and_user_previous_month)\n\n @spent_hours_for_issue_and_user_previous_month = nil\n\n return @spent_hours_for_issue_and_user_previous_month if issue_id.blank? || user_id.blank?\n\n date_filter = Date.today.prev_month\n\n @spent_hours_for_issue_and_user_previous_month = TimeEntry.\n where(:issue_id => self.issue_id).\n where(:user_id => self.user_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month).\n sum(:hours)\n end", "def out_of_date\n last_order_detail = self.order_details.order(\"created_at DESC\").first\n last_priced = self.product_prices.order(\"created_at DESC\").first\n\n if last_order_detail.nil?\n last_date = self.updated_at\n else\n last_date = last_order_detail.updated_at\n end\n\n if last_priced.present?\n if last_date < last_priced.created_at\n last_date = last_priced.created_at\n end\n end\n\n return (self.stock <= 0 and last_date < Time.now - 6.months)\n end", "def pull_reqs(project)\n q = <<-QUERY\n select u.login as login, p.name as project_name, pr.id, pr.pullreq_id as github_id,\n a.created_at as created_at, b.created_at as closed_at,\n\t\t\t (select created_at\n from pull_request_history prh1\n where prh1.pull_request_id = pr.id\n and prh1.action='merged' limit 1) as merged_at,\n timestampdiff(minute, a.created_at, b.created_at) as lifetime_minutes,\n\t\t\ttimestampdiff(minute, a.created_at, (select created_at\n from pull_request_history prh1\n where prh1.pull_request_id = pr.id and prh1.action='merged' limit 1)\n ) as mergetime_minutes\n from pull_requests pr, projects p, users u,\n pull_request_history a, pull_request_history b\n where p.id = pr.base_repo_id\n\t and a.pull_request_id = pr.id\n and a.pull_request_id = b.pull_request_id\n and a.action='opened' and b.action='closed'\n\t and a.created_at < b.created_at\n and p.owner_id = u.id\n and p.id = ?\n\t group by pr.id\n order by pr.pullreq_id desc;\n QUERY\n db.fetch(q, project[:id]).all\n end", "def develop_pr_check\n\n result = CheckResult.new(\"Develop PR Check Result\")\n\n ## PR should be sent from a branch that begins with `feature/`, `refactor/`, `fix/`, `issue/` or `version/`\n result.message << \"Head Branch check |\"\n is_from_feature = github.branch_for_head.start_with?(\"feature/\")\n is_from_refactor = github.branch_for_head.start_with?(\"refactor/\")\n is_from_fix = github.branch_for_head.start_with?(\"fix/\")\n is_from_issue = github.branch_for_head.start_with?(\"issue/\")\n is_from_version = github.branch_for_head.start_with?(\"version/\")\n if is_from_feature || is_from_refactor || is_from_fix || is_from_issue || is_from_version\n result.message << \":o:\\n\"\n else\n fail \"Please send the PR from a from a branch that begins with `feature/`, `refactor/`, `fix/`, `issue/` or `version/`.\"\n result.message << \":x:\\n\"\n result.errors += 1\n end\n\n ## PR should be sent to `develop` branch\n result.message << \"Base Branch check |\"\n is_to_develop = github.branch_for_base == \"develop\"\n if is_to_develop\n result.message << \":o:\\n\"\n else\n fail \"Please send the PR to `develop` branch.\"\n result.message << \":x:\\n\"\n result.errors += 1\n end\n\n ## If PR is sent from a branch that begins with `version/`, do a release modification check\n if is_from_version\n release_modification_check_into_result(result)\n end\n\n ## PR shouldn't contain any merge commits\n result.message << \"Merge Commits check |\"\n contains_merge_commits = git.commits.any? { |c| c.parents.length > 1 }\n unless contains_merge_commits\n result.message << \":o:\\n\"\n else\n fail \"Please don't contain any merge commits in the branch. Consider Rebase if required.\"\n result.message << \":x:\\n\"\n result.errors += 1\n end\n\n ## PR should have less than 1000 lines of modifications if possible.\n result.message << \"Modification Volumn check |\"\n is_fix_too_big = git.lines_of_code > 1_000\n unless is_fix_too_big\n result.message << \":o:\\n\"\n else\n warn \"Too many modifications. Please consider splitting the PR if possible.\"\n result.message << \":heavy_exclamation_mark:\\n\"\n result.warnings += 1\n end\n\n return result\n\nend", "def due_date\n students = self.accessible_students \n return nil if students.length == 0\n\n date = students.first.due_date\n students.find_each do |student|\n if student.due_date \n if !date || student.due_date > date\n date = student.due_date\n end\n end\n end\n\n date\n end", "def month\n self.founded.strftime(\"%B\")\n end", "def submitted_after_collection_date?\n grouping_due_date = collection_date\n revision = nil\n access_repo do |repo|\n # get the last revision that changed the assignment repo folder after the due date; some repos may not be able to\n # optimize by due_date (returning nil), so a check with revision.server_timestamp is always necessary\n revision = repo.get_revision_by_timestamp(Time.current, assignment.repository_folder, grouping_due_date)\n end\n !(revision.nil? || revision.server_timestamp <= grouping_due_date)\n end", "def overdue_by\n @overdue_str = \"minutes\"\n \n overdue = (((self.is_due?) ? (Time.zone.now - self.datetime) : (self.datetime - Time.zone.now)) / 60).to_i \n\n if overdue > 60\n overdue /= 60\n @overdue_str = \"hours\"\n if overdue > 24\n overdue /= 24\n @overdue_str = \"days\"\n if overdue > 7\n overdue /= 7\n @overdue_str = \"weeks\"\n if overdue > 4\n overdue /= 4\n @overdue_str = \"months\"\n end\n end\n end\n end\n \n @overdue_str = @overdue_str[0..-2] if overdue == 1\n \n overdue\n end", "def last_month_dates\n {\n init_date: Date.today.ago(1.month).beginning_of_month&.to_s,\n end_date: Date.today.ago(1.month).end_of_month&.to_s\n }\n end", "def days_committed(yearmonth = '*')\n if yearmonth == '*'\n begda = self.planbeg\n endda = self.planend\n else\n month = get_month_beg_end(yearmonth)\n begda = month[:first_day]\n endda = month[:last_day]\n end\n # All commitments must be between begin and end dates of the project (or, for this month)\n commitments = Teamcommitment::find(:all, :conditions => [\"yearmonth >= ? and yearmonth <= ? and project_id = ? and status = ?\", begda, endda, self.id, Teamcommitment::StatusAccepted])\n \n days_committed = 0\n commitments.each do |commitment|\n days_committed += commitment.days \n end\n\n return days_committed\n end", "def pull_reqs(project, github_id = -1)\n q = <<-QUERY\n select u.login as login, p.name as project_name, pr.id, pr.pullreq_id as github_id,\n a.created_at as created_at, b.created_at as closed_at,\n\t\t\t (select created_at\n from pull_request_history prh1\n where prh1.pull_request_id = pr.id\n and prh1.action='merged' limit 1) as merged_at,\n timestampdiff(minute, a.created_at, b.created_at) as lifetime_minutes,\n\t\t\ttimestampdiff(minute, a.created_at, (select created_at\n from pull_request_history prh1\n where prh1.pull_request_id = pr.id and prh1.action='merged' limit 1)\n ) as mergetime_minutes\n from pull_requests pr, projects p, users u,\n pull_request_history a, pull_request_history b\n where p.id = pr.base_repo_id\n\t and a.pull_request_id = pr.id\n and a.pull_request_id = b.pull_request_id\n and a.action='opened' and b.action='closed'\n\t and a.created_at < b.created_at\n and p.owner_id = u.id\n and p.id = ?\n QUERY\n\n if github_id != -1\n q += \" and pr.pullreq_id = #{github_id} \"\n end\n q += 'group by pr.id order by pr.pullreq_id desc;'\n\n db.fetch(q, project[:id]).all\n end", "def author_is_up_to_date(author, github_issue)\n author.name == github_issue[\"title\"] && author.bio == github_issue[\"body\"]\n end", "def follow_up_patients_by_month\n date_truncate_string = date_truncate_sql('blood_pressures', 'recorded_at', period: 'month')\n\n @follow_up_patients_by_month ||=\n BloodPressure\n .select('facilities.id AS facility_id',\n date_truncate_string,\n 'count(blood_pressures.id) AS blood_pressures_count')\n .left_outer_joins(:user)\n .left_outer_joins(:patient)\n .joins(:facility)\n .where(facility: @facility)\n .where(deleted_at: nil)\n .group('master_users.id', date_truncate_string)\n .where(\"patients.recorded_at < #{date_truncate_string}\")\n .order('master_users.id')\n .distinct\n .count('patients.id')\n\n group_by_user_and_date(@follow_up_patients_by_month, :follow_up_patients_by_month)\n end", "def pre_submission_date_status\n 'New Announcement'\n end" ]
[ "0.7629515", "0.6281422", "0.6254648", "0.6060206", "0.5967748", "0.59566426", "0.57506216", "0.57431036", "0.570729", "0.56563514", "0.56417954", "0.5641268", "0.5569643", "0.552081", "0.5494232", "0.54296106", "0.53806823", "0.53354704", "0.5262917", "0.5236211", "0.52231055", "0.5216604", "0.52040976", "0.5168685", "0.5167977", "0.51389796", "0.51027906", "0.5074852", "0.50737256", "0.5066687", "0.50637764", "0.50578475", "0.5008533", "0.49987575", "0.49908915", "0.49750394", "0.4959311", "0.49592152", "0.49563652", "0.49500746", "0.49390665", "0.49379092", "0.49373806", "0.49373806", "0.49146515", "0.4910515", "0.48927495", "0.48834687", "0.4882829", "0.48742497", "0.48715732", "0.48664385", "0.48499826", "0.48493132", "0.4846396", "0.4841156", "0.48363936", "0.48237512", "0.48184586", "0.4815886", "0.48090616", "0.4808532", "0.4807606", "0.48071566", "0.4802592", "0.48007426", "0.48006356", "0.47998962", "0.47962496", "0.47927737", "0.47834197", "0.47772864", "0.47758198", "0.47572875", "0.47555354", "0.47535777", "0.47521466", "0.4751853", "0.474962", "0.47402743", "0.47387153", "0.47360867", "0.47331345", "0.47320494", "0.47305548", "0.47292435", "0.47194964", "0.4719445", "0.47191143", "0.4719027", "0.4711555", "0.47112107", "0.4708554", "0.470655", "0.47012228", "0.46928552", "0.46877778", "0.46843082", "0.46793014", "0.46743688" ]
0.7125968
1
People that committed (not through pull requests) up to months_back from the time the PR was created. if months_back is nil, don't take create time into consideration
def committer_team(pr, months_back = nil) q = <<-QUERY select distinct(u.login) as committer from reduced_commits c, reduced_project_commits pc, reduced_pull_requests pr, reduced_users u, reduced_pull_request_history prh where pr.base_repo_id = pc.project_id and not exists (select * from reduced_pull_request_commits where commit_id = c.id) and pc.commit_id = c.id and pr.id = ? and u.id = c.committer_id and u.fake is false and prh.pull_request_id = pr.id and prh.action = 'opened' and c.created_at < prh.created_at QUERY if !months_back.nil? q += " and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)" end log q db.fetch(q, pr[:id]).all.map{|x| x[:committer]} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merger_team(pr, months_back)\n @close_reason.map do |k,v|\n created_at = @prs.find{|x| x[:github_id] == k}\n [created_at[:created_at], v[2]]\n end.find_all do |x|\n x[0].to_i > (pr[:created_at].to_i - months_back * 30 * 24 * 3600)\n end.map do |x|\n x[1]\n end.select{|x| x != ''}.uniq\n end", "def commits_last_x_months(pr, exclude_pull_req, months_back)\n q = <<-QUERY\n select count(c.id) as num_commits\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and pr.id=?\n QUERY\n\n if exclude_pull_req\n q << ' and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)'\n end\n\n db.fetch(q, pr[:id]).first[:num_commits]\n end", "def pushed_within(months, collection=repos)\n (collection - no_push).select { |r| r.pushed_at >= months.months.ago }\n end", "def merger_team(pr, months_back = nil)\n recently_merged = prs.find_all do |b|\n close_reason[b[:github_id]] != :unknown and\n (months_back.nil? ? true : b[:created_at].to_i > (pr[:created_at].to_i - months_back * 30 * 24 * 3600))\n end.map do |b|\n b[:github_id]\n end\n\n q = <<-QUERY\n select u1.login as merger\n from reduced_users u, reduced_projects p, reduced_pull_requests pr, reduced_pull_request_history prh, reduced_users u1\n where prh.action = 'closed'\n and prh.actor_id = u1.id\n and prh.pull_request_id = pr.id\n and pr.base_repo_id = p.id\n and p.owner_id = u.id\n and u.login = ?\n and p.name = ?\n and pr.pullreq_id = ?\n QUERY\n log q\n\n recently_merged.map do |pr_num|\n a = db.fetch(q, pr[:login], pr[:project_name], pr_num).first\n if not a.nil? then a[:merger] else nil end\n end.select {|x| not x.nil?}.uniq\n\n end", "def committer_team(pr, months_back)\n q = <<-QUERY\n select distinct(u.login)\n from commits c, project_commits pc, pull_requests pr, users u, pull_request_history prh\n where pr.base_repo_id = pc.project_id\n and not exists (select * from pull_request_commits where commit_id = c.id)\n and pc.commit_id = c.id\n and pr.id = ?\n and u.id = c.committer_id\n and u.fake is false\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and c.created_at < prh.created_at;\n QUERY\n db.fetch(q, pr[:id]).all\n end", "def commits_last_x_months(pr_id, exclude_pull_req, months)\n q = <<-QUERY\n select count(c.id) as num_commits\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months} MONTH)\n and pr.id=?\n QUERY\n\n if exclude_pull_req\n q << ' and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)'\n end\n q << ';'\n\n if_empty(db.fetch(q, pr_id).all, :num_commits)\n end", "def months_ago(months)\n if months >= self.month\n change(:year => self.year - 1, :month => 12).months_ago(months - self.month)\n else\n change(:year => self.year, :month => self.month - months)\n end\n end", "def months_since(months)\n advance(months: months)\n end", "def months_ago(months)\n advance(months: -months)\n end", "def commits_on_pr_files(pr, months_back)\n\n oldest = Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 30 * months_back)\n pr_against = pull_req_entry(pr[:id])['base']['sha']\n commits = commit_entries(pr[:id])\n\n commits_per_file = commits.flat_map { |c|\n c['files'].map { |f|\n [c['sha'], f['filename']]\n }\n }.group_by {|c|\n c[1]\n }\n\n commits_per_file.keys.reduce({}) do |acc, filename|\n commits_in_pr = commits_per_file[filename].map{|x| x[0]}\n\n walker = Rugged::Walker.new(repo)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(pr_against)\n\n commit_list = walker.take_while do |c|\n c.time > oldest\n end.reduce([]) do |acc1, c|\n if c.diff(paths: [filename.to_s]).size > 0 and\n not commits_in_pr.include? c.oid\n acc1 << c.oid\n end\n acc1\n end\n acc.merge({filename => commit_list})\n end\n end", "def prior_interaction_issue_events(pr, months_back)\n q = <<-QUERY\n select count(distinct(i.id)) as num_issue_events\n from issue_events ie, pull_request_history prh, pull_requests pr, issues i\n where ie.actor_id = prh.actor_id\n and i.repo_id = pr.base_repo_id\n and i.id = ie.issue_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and ie.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and ie.created_at < prh.created_at\n and prh.pull_request_id = ?\n QUERY\n db.fetch(q, pr[:id]).first[:num_issue_events]\n end", "def commits_on_files_touched(pr, months_back)\n commits_on_pr_files(pr, months_back).reduce([]) do |acc, commit_list|\n acc + commit_list[1]\n end.flatten.uniq.size\n end", "def researchers_without_xaccount()\n last_month = Time.now - 1.month\n #People.\n end", "def commits_on_pr_files(pr, months_back)\n\n oldest = Time.at(Time.at(pr[:created_at]).to_i - 3600 * 24 * 30 * months_back)\n commits = commit_entries(pr, at_open = true)\n\n commits_per_file = commits.flat_map { |c|\n unless c[:files].nil?\n JSON.parse(c[:files]).map { |f|\n [c[:sha], f[\"filename\"]]\n }\n else\n []\n end\n }.select{|x| x.size > 1}.group_by {|c|\n c[1]\n }\n\n commits_per_file.keys.reduce({}) do |acc, filename|\n commits_in_pr = commits_per_file[filename].map{|x| x[0]} # get the shas of pr related commits\n\n walker = Rugged::Walker.new(git)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(pr[:base_commit])\n\n commit_list = walker.select do |c|\n c.time > oldest\n end.reduce([]) do |acc1, c|\n if c.diff(paths: [filename.to_s]).size > 0 and\n not commits_in_pr.include? c.oid # (oid is the object id - c.oid gets the commit sha). this commit is not part of pr's commits\n acc1 << c.oid\n end\n acc1\n end\n acc.merge({filename => commit_list})\n end\n end", "def main_team_member?(pr, months_back)\n (committer_team(pr, months_back) + merger_team(pr, months_back)).uniq.include? requester(pr)\n end", "def biblreview_postponed_until\n postpone_date = postpone_dates.where(deleted_at: nil).where(\"postponed_until > (?)\", DateTime.now).first\n if postpone_date\n return postpone_date.postponed_until\n else\n return nil\n end\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 set_contributor_until\n self.contributer_until = \"Oct 1 2011\"\n self.content_contributer_until = \"Oct 1 2011\"\n end", "def new_user?\n self.created_at > 1.month.ago\n end", "def billable_hours_for_issue_and_user_previous_month\n return @billable_hours_for_issue_and_user_previous_month if defined?(@billable_hours_for_issue_and_user_previous_month)\n\n @billable_hours_for_issue_and_user_previous_month = nil\n\n return @billable_hours_for_issue_and_user_previous_month if issue_id.blank? || user_id.blank?\n\n date_filter = Date.today.prev_month\n\n scope_for_time_entries = TimeEntry.\n where(:issue_id => self.issue_id).\n where(:user_id => self.user_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month)\n\n cf = self.class.billable_custom_field\n total = cf.format.total_for_scope(cf, scope_for_time_entries)\n @billable_hours_for_issue_and_user_previous_month = cf.format.cast_total_value(cf, total)\n end", "def previous\n if @date.month - 1 == 0\n Month.new(12,@date.year-1)\n else\n Month.new(@date.month-1,@date.year)\n end\n end", "def current_paid_contributer?\n return !(self.paid_contributer_until.blank?) && self.paid_contributer_until >= Time.now\n end", "def month_before(a_time)\nend", "def team_size_vasilescu(pr, months_back)\n (committer_team(pr, months_back) + merger_team(pr, months_back)).uniq.size\n end", "def generate_client_birth_and_join_date(years)\n joined_fund_date = Faker::Date.between(from: 20.days.ago, to: 1.month.ago)\n rand_day_diff = rand(30) # generate a random number 0..29\n # guaranteed one month after and random date upto another month\n client_birth_date = joined_fund_date.years_ago(years) \n current_month = Date.today.month \n if client_birth_date.month < 7\n # we make it sep \n puts(\"generate client_birth_date: #{client_birth_date}, month is #{client_birth_date.month}\")\n month_diff = 11 - client_birth_date.month\n client_birth_date = client_birth_date.advance(months: month_diff)\n puts(\"Changed date forced in after July: #{client_birth_date}, month is #{client_birth_date.month}\")\n end\n \n if (client_birth_date.month == current_month)\n # we make it different to before or after\n puts(\"Make it different from current month\")\n if current_month == 12\n client_birth_date.advance(months: -1)\n else \n client_birth_date.advance(months: 1)\n end\n end\n \n puts(\"Generated client_birth_date: #{client_birth_date}\")\n\n return client_birth_date, joined_fund_date\n end", "def commits_in_month(date)\n start_date = date.beginning_of_month.beginning_of_day\n end_date = date.end_of_month.end_of_day\n return commits_between(start_date, end_date)\n end", "def commits_to_hottest_file(pr, months_back)\n a = commits_on_pr_files(pr, months_back).map{|x| x}.sort_by { |x| x[1].size}\n a.last[1].size\n end", "def billable_hours_for_issue_previous_month\n return @billable_hours_for_issue_previous_month if defined?(@billable_hours_for_issue_previous_month)\n\n @billable_hours_for_issue_previous_month = nil\n\n return @billable_hours_for_issue_previous_month if issue_id.blank?\n\n date_filter = Date.today.prev_month\n\n scope_for_time_entries = TimeEntry.\n where(:issue_id => self.issue_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month)\n\n cf = self.class.billable_custom_field\n total = cf.format.total_for_scope(cf, scope_for_time_entries)\n @billable_hours_for_issue_previous_month = cf.format.cast_total_value(cf, total)\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 n_commits(date)\n 30\nend", "def new?\n if created_at > Time.now - 1.month\n return true\n end\n end", "def associated_months\n result = [] # expect no months if no dates\n years = associated_years\n \n\t start_date = event_start\n\t start_date = entry_deadline if is_opportunity?\n\t \t \n start_month_year = Time.parse(\"01/#{start_date}.month/#{start_date}.year\") if !start_date.blank?\n finish_month_year = Time.parse(\"01/#{event_finish}.month/#{event_finish}.year\") if !event_finish.blank?\n \n #this is the case when we only have a start month\n if !start_month_year.blank? and finish_month_year.blank?\n result << start_date.month\n #this is the tricky one...\n elsif !start_month_year.blank? and !finish_month_year.blank?\n delta_year = event_finish.year - start_date.year # year\n \n #if the range spans an entire year we have all the months\n if (delta_year) > 1\n result = [1,2,3,4,5,6,7,8,9,10,11,12]\n #this is the case of months being in the same year\n elsif delta_year == 0\n puts start_month_year.month\n puts finish_month_year.month\n for m in start_month_year.month..finish_month_year.month\n result << m\n end\n \n #this is the annoying one, going over new year\n elsif delta_year == 1\n #add months to year end\n for month in start_month_year.month..12\n result << month\n end\n \n #add months from start of year\n for month in 1.. finish_month_year.month\n result << month\n end \n end\n result\n end\n \n \n \n \n result\n end", "def calculate_dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n end", "def expiration_month\n @months = [\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n end", "def due_date\n self.created_at.to_date + 7\n end", "def billable_hours_for_user_previous_month\n return @billable_hours_for_user_previous_month if defined?(@billable_hours_for_user_previous_month)\n\n @billable_hours_for_user_previous_month = nil\n\n return @billable_hours_for_user_previous_month if user_id.blank?\n\n date_filter = Date.today.prev_month\n\n scope_for_time_entries = TimeEntry.\n where(:project_id => self.project_id).\n where(:user_id => self.user_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month)\n\n cf = self.class.billable_custom_field\n total = cf.format.total_for_scope(cf, scope_for_time_entries)\n @billable_hours_for_user_previous_month = cf.format.cast_total_value(cf, total)\n end", "def quarterly_committers(start_month, year=Time.now.year)\n \"git log --since='#{start_month}/1/#{year}' --until='#{start_month + 2}/31/#{year}' | git shortlog -n -s\"\nend", "def add_contribution_time time_amount\n if current_contributer?\n self.contributer_until += time_amount\n else\n self.contributer_until = Time.now + time_amount\n end\n end", "def make_premium(month_number)\n self.premium_expiry_date = Time.now + month_number.to_i.months\n self.save\n end", "def month_depot\n \"#{depot.name} \"+\"#{issue_date.strftime(\"%b\")} \"+\"#{issue_date.year}\"\n end", "def hotness_vasilescu(pr, months_back)\n commits_per_file = commits_on_pr_files(pr, months_back).map{|x| x[1].size}.sort\n med = commits_per_file[commits_per_file.size/2]\n med / commits_last_x_months(pr, true, months_back).to_f\n end", "def months_since(date)\n\t\t\tmonths = ((::Time.zone.today.year - date.year) * 12) + (::Time.zone.today.month - date.month)\n\t\t\tmonths -= 1 if ::Time.zone.today.day < date.day\n\t\t\tmonths\n\t\tend", "def merch_month\n # TODO: This is very inefficient, but less complex than strategic guessing\n # maybe switch to a binary search or something\n @merch_month ||= (1..12).detect do |num|\n date_calc.end_of_month(start_of_year.year, num) >= date && date >= date_calc.start_of_month(start_of_year.year, num)\n end\n end", "def monthly(options = {})\n branch options.merge(every: :month)\n end", "def monthly(options = {})\n branch options.merge(every: :month)\n end", "def out_of_date\n last_order_detail = self.order_details.order(\"created_at DESC\").first\n last_priced = self.product_prices.order(\"created_at DESC\").first\n\n if last_order_detail.nil?\n last_date = self.updated_at\n else\n last_date = last_order_detail.updated_at\n end\n\n if last_priced.present?\n if last_date < last_priced.created_at\n last_date = last_priced.created_at\n end\n end\n\n return (self.stock <= 0 and last_date < Time.now - 6.months)\n end", "def initial_window_months(order)\n order.total > 0 ? 1 : 12\n end", "def trend_points_for_creation_date(obj)\n if obj.created_at > 1.day.ago then 50\n elsif obj.created_at > 1.week.ago then 25\n elsif obj.created_at > 2.weeks.ago then 10\n elsif obj.created_at > 3.weeks.ago then 3\n else 0\n end\nend", "def no_recent_plagiarism\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem) and return\n end\n end", "def dmail_inactive_approvers!\n days_until_next_month = (Date.current.next_month.beginning_of_month - Date.current).to_i\n return unless days_until_next_month <= 21\n\n inactive_approvers.each do |user|\n Dmail.create_automated(to: user, title: \"You will lose approval privileges soon\", body: <<~BODY)\n You've approved fewer than #{MINIMUM_APPROVALS} posts in the past\n #{APPROVAL_PERIOD.inspect}. You will lose your approval privileges in\n #{days_until_next_month} #{\"day\".pluralize(days_until_next_month)}\n unless you have approved at least #{MINIMUM_APPROVALS} posts by the end\n of the month.\n BODY\n end\n end", "def overdue_by\n @overdue_str = \"minutes\"\n \n overdue = (((self.is_due?) ? (Time.zone.now - self.datetime) : (self.datetime - Time.zone.now)) / 60).to_i \n\n if overdue > 60\n overdue /= 60\n @overdue_str = \"hours\"\n if overdue > 24\n overdue /= 24\n @overdue_str = \"days\"\n if overdue > 7\n overdue /= 7\n @overdue_str = \"weeks\"\n if overdue > 4\n overdue /= 4\n @overdue_str = \"months\"\n end\n end\n end\n end\n \n @overdue_str = @overdue_str[0..-2] if overdue == 1\n \n overdue\n end", "def spent_hours_for_issue_and_user_previous_month\n return @spent_hours_for_issue_and_user_previous_month if defined?(@spent_hours_for_issue_and_user_previous_month)\n\n @spent_hours_for_issue_and_user_previous_month = nil\n\n return @spent_hours_for_issue_and_user_previous_month if issue_id.blank? || user_id.blank?\n\n date_filter = Date.today.prev_month\n\n @spent_hours_for_issue_and_user_previous_month = TimeEntry.\n where(:issue_id => self.issue_id).\n where(:user_id => self.user_id).\n where(:tyear => date_filter.year).\n where(:tmonth => date_filter.month).\n sum(:hours)\n end", "def due_date\n students = self.accessible_students \n return nil if students.length == 0\n\n date = students.first.due_date\n students.find_each do |student|\n if student.due_date \n if !date || student.due_date > date\n date = student.due_date\n end\n end\n end\n\n date\n end", "def cumulative_years\n if deleted_at && deleted_at.year > created_at.year\n (created_at.year...deleted_at.year).to_a\n elsif deleted_at\n []\n else\n (created_at.year..Date.today.year).to_a\n end\n end", "def previous!\n if @date.month - 1 == 0\n @date = Date.new(@date.year-1,12,1)\n else\n @date = Date.new(@date.year,@date.month-1,1)\n end\n end", "def past_due?\n self.updated_at.to_date > self.due_date\n end", "def months_since(date)\n return (DateTime.now - date.to_datetime).to_i*(12/365.25)\n end", "def created_before_proposal_deadline\n errors.add(:base, \"The proposal deadline has passed.\") if\n DateTime.now > Quarter.active_quarter.project_proposal_deadline\n end", "def burn_after_in_future\n if burn_after_date and burn_after_date < Time.now\n errors.add(:burn_after_date, \n \"#{burn_after_date} cannot be in the past, but you can destroy it now.\")\n end\n end", "def last_commit_month es\n es.map {|e| e.date.month_start }.sort.last\nend", "def itemsOfThisMonth\n @due_items.sort!{|x,y| x.dueDate <=> y.dueDate}\n @due_items.select!{|item| item.done? == 'Item incomplete'}\n @anniversary_items.select!{|item| item.month}\n @incomplete_and_month = @due_items.concat(@anniversary_items)\n end", "def release_before_date?\n # All PermissionTemplate embargoes are dynamically determined release before dates\n release_period == RELEASE_TEXT_VALUE_BEFORE_DATE || release_max_embargo?\n end", "def commit_messages\n t= DateTime.now - 10\n time = t.strftime('%Y-%m-%d') \n @commits = @client.commits_since(\"LingduoKong/final\", time )\n return @commits\n end", "def not_in_past\n if due_date < Date.current || start_date < Date.current\n errors.add(:base, \"Cannot create reservation in the past\\n\")\n end\n end", "def month_lock_defaulters\n defoulters =[]\n beginning_date_of_last_month = Time.now.last_month.beginning_of_month\n end_date_of_last_month = Time.now.last_month.end_of_month\n expected_hrs = expected_time(beginning_date_of_last_month, end_date_of_last_month)\n puts \"+++++++++++#{Time.now}++++++++++++++expected_hrs = +++#{expected_hrs}++++++\"\n users = User.where.not(:id=>[User.find(1),User.find(288),],:status=>3)\n\n users.each do |user|\n hrs = TimeEntry.where(:user=>user).where(\"spent_on >= ? AND spent_on <= ?\", (beginning_date_of_last_month), (end_date_of_last_month) ).sum(:hours)\n\n if (user.email_address != nil && (expected_hrs > hrs))\n defoulters.push({id:user.id,firstname:user.firstname,:lastname=>user.lastname,hours:hrs,email:user.email_address.address})\n end\n end\n defoulters.uniq\n\n end", "def time_of_last_pr\n client = Octokit::Client.new(access_token: @options[:creds], per_page: 50)\n last_pr = client.list_issues('ansible/ansible',\n creator: 'modular-magician',\n sort: 'created', direction: 'asc').first\n\n # Return 1 day ago as default if no PRs have been created.\n return (Time.now - (3600 * 24)).iso8601 unless last_pr\n\n # Timestamp is ISO 8601 by default.\n last_pr[:created_at].iso8601\nend", "def training_sessions_remaining_this_month\n end", "def create\n\n student_totals_asc = StudentTotal.all.order('date ASC')\n student_totals_desc = StudentTotal.all.order('date DESC')\n\n start_date = Date.parse params[:date]\n total_at_year_start = 0\n total_at_year_end = student_totals_asc.last.lives_improved\n\n student_totals_asc.each do |i|\n if i.date < start_date\n total_at_year_start = i.lives_improved\n end\n end\n\n student_totals_desc.each do |i|\n if i.date > start_date\n total_at_year_end = i.lives_improved\n end\n end\n\n extra_months_total = (total_at_year_end - total_at_year_start) * (start_date.month / 12.0)\n\n @person_lives_improved = student_totals_asc.last.lives_improved - (total_at_year_start + extra_months_total)\n\n end", "def due_to_cannot_be_in_the_past\n if dueTo.present? && dueTo < Date.today\n errors.add(:dueTo, \"can't be in the past\")\n end\n end", "def check_release_datetime\n\t\tif self.release_datetime > Date.today + 3.months\n\t\t\tself.errors.add(:release_datetime, \"Cannot be greater than 3 months\")\n\t\tend\t\n\tend", "def month\n MONTHS[@created_at.month-1]\n end", "def this_month(limit: 5, markdown: false, rank: :top) \r\n \r\n puts 'inside this_mponth'.info if @debug\r\n coins = sort_coins('30d', limit: limit, rank: rank)\r\n build_table coins, markdown: markdown\r\n\r\n end", "def reports\n @seek_month_start = DateTime.new(params[:year].to_i, params[:month].to_i, 1, 0, 0, 0)\n @seek_month_end = DateTime.new(params[:year].to_i, (params[:month].to_i + 1) % 13 + 1, 1, 0, 0, 0)\n @employees = []\n Employee.all.order(last_name: :asc).each do |e|\n @employees << e if e.started_at < @seek_month_end\n end\n end", "def >>(months)\n y, m = (@year * 12 + (@month - 1) + months).divmod(12)\n m, = (m + 1) .divmod(1)\n d = @day\n d -= 1 until self.class.valid?(y, m, d)\n self.class.new(y,m,d)\n end", "def get_date_for_status_change(from_status, to_status)\n selected_version = self.versions.select {|x| YAML.load(x.object_changes)[\"status\"] == [from_status, to_status] }\n !selected_version.empty? ? selected_version.last.created_at : 0\n end", "def all_journals_and_statements_must_be_before_reconciliation_date\n return unless reconciled_at.present?\n if @order_details.any? { |od| od.journal_or_statement_date.beginning_of_day > reconciled_at }\n errors.add(:reconciled_at, :after_all_journal_dates)\n end\n end", "def past?\n due_on < Date.today\n end", "def month_before(a_time) \n a_time - 28 * 24 * 60 * 60\nend", "def due_by\n #occurring_days = ae_definition.occurring_days\n dob = profile.kids_type.birthdate.to_date\n dob + (ae_definition.occurring_days + ae_definition.due_by_days )\n end", "def commits_between(from, to)\n if from.nil? || to.nil?\n @repo.commits(\"master\", 1000000)\n else\n @repo.commits(\"master\", 1000000).select {|c| c.date > from && c.date <= to}\n end \n end", "def no_recent_plagiarism\n if @submission.user == current_user.sk\n s = current_user.sk.submissions.where(:problem => @problem, :status => :plagiarized).order(:last_comment_time).last\n if !s.nil? && s.last_comment_time.to_date + 6.months > Date.today\n redirect_to problem_path(@problem, :sub => @submission) and return\n end\n end\n end", "def advance_months(months)\n advance_to_date(to_date >> months)\n end", "def past_participle; end", "def commit_closest_earlier_pr(pr)\n walker = Rugged::Walker.new(git)\n walker.sorting(Rugged::SORT_DATE)\n walker.push(git.head.target)\n result = walker.reduce([]) do |acc, commit|\n if commit.time < pr[:created_at]\n acc << commit.oid\n else\n acc\n end\n end\n result.size > 0 ? result[0] : nil\n end", "def not_in_past\n return unless due_date < Time.zone.today || start_date < Time.zone.today\n errors.add(:base, \"Cannot create reservation in the past.\\n\")\n end", "def age_of_file\n return nil unless primary_match.present?\n create_date = primary_match[\"individual\"][\"individual_name\"][\"create_date\"]\n return nil unless create_date.present?\n now = DateTime.now\n create_date = create_date.to_date\n (now.year * 12 + now.month) - (create_date.year * 12 + create_date.month)\n end", "def check_out(due_date)\n\n if @due_date == nil\n @due_date = 0\n end\n\n @due_date += 7\n\n end", "def\n check_out(due_date)\n\n if @due_date == nil\n @due_date = 0\n end\n\n @due_date += 7\n\n end", "def is_past_3_months(date)\n #http://stackoverflow.com/questions/9428605\n monthDifference = (Time.now.year * 12 + Time.now.month) - (date.year * 12 + date.month)\n monthDifference.between?(0, 2)\n end", "def months_between(checkin, checkout)\n start = checkin.year * 100 + checkin.month\n finish = checkout.year * 100 + checkout.month\n table.where{year * 100 + month >= start}\n .where{year * 100 + month <= finish}\n end", "def index\n if @current_user.birth_date\n #setup values for month picker\n @available_months = @current_member.progresses.kept\n .pluck(:start)\n .map{ |d| d.beginning_of_month }\n .uniq\n else\n flash[:error] = \"Add your birth date first.\"\n redirect_to edit_user_path(@current_user)\n end\n end", "def paid_thru_now\n # Turn off March 1 of year following paid year\n paid_thru_year >= (Date.today - 59).year\n end", "def contributions_in_last_24_hrs\n contributions_in_time_range()\n end", "def username_changed_more_than_one_month_ago\n errors.add(:username, \"^You cannot change your username more than once a month\") if self.username_changed? && self.username_changed_at > 1.month.ago\n end", "def test_return_months_and_years\n assert_equal OrderAccount.months, (1..12).to_a\n assert_equal OrderAccount.years, (Date.today.year..9.years.from_now.year).to_a\n end", "def prev_month(months = 1)\n advance(months: -months)\n end", "def overdue?\n due < Date.current\n end", "def checkin_before_6_months\n return if dates_blank\n if checkin_at >= (Date.today + 6.months)\n self.errors.add(:checkin_at, ': Should be less than or equal to 6 months')\n end\n end", "def list_all_not_completed_this_month\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 + show_not_completed_items\n end", "def years_until_retirement\n @retirement_age.to_i - @current_age.to_i\n end" ]
[ "0.72327995", "0.65584755", "0.6424126", "0.6356405", "0.62760776", "0.60861886", "0.60754174", "0.5970819", "0.5953093", "0.5898598", "0.5798232", "0.5768537", "0.57659304", "0.5731905", "0.5495602", "0.5482154", "0.54321533", "0.5351258", "0.5346539", "0.53366613", "0.5303059", "0.5272433", "0.52709323", "0.5269218", "0.52685773", "0.5260684", "0.52306914", "0.5227279", "0.5198329", "0.51921874", "0.5184965", "0.51748884", "0.5160017", "0.514939", "0.5136751", "0.5119832", "0.5092261", "0.50882494", "0.5087191", "0.50865746", "0.50865436", "0.5085584", "0.50823325", "0.50816816", "0.50816816", "0.5074829", "0.50706106", "0.50513905", "0.5051275", "0.5044337", "0.5036153", "0.5031401", "0.50262153", "0.5023979", "0.5022324", "0.5020777", "0.5020741", "0.500982", "0.50087374", "0.500044", "0.49990368", "0.4987366", "0.4981758", "0.49789238", "0.4975365", "0.4972205", "0.496771", "0.4966326", "0.49649742", "0.49613586", "0.49545607", "0.49542192", "0.49526945", "0.4952561", "0.49524093", "0.49516454", "0.49451584", "0.49375767", "0.493615", "0.49295473", "0.49284628", "0.49240404", "0.49228287", "0.4921269", "0.49188176", "0.4917916", "0.49110135", "0.49109957", "0.49088597", "0.49080756", "0.49069685", "0.48984122", "0.48975164", "0.48899922", "0.4879999", "0.4879699", "0.4877887", "0.48750415", "0.48720342", "0.48717928" ]
0.59545904
8
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.postman.reject_email.subject
def reject_email(email) @greeting = "Hi" mail to: email, subject: "Your ASES Application Decision" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subject\n self['subject'] || msg['subject']\n end", "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "def message_subject=(value)\n @message_subject = value\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "def subject\n @mail.subject\n end", "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "def subject=(subject); @message_impl.setSubject subject; end", "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def subject=(string)\n set('Subject', string)\n end", "def user_rejected_email(course, user)\n ActsAsTenant.without_tenant do\n @course = course\n end\n @recipient = user\n\n I18n.with_locale(@recipient.locale) do\n mail(to: @recipient.email, subject: t('.subject', course: @course.title))\n end\n end", "def subject\n message.subject\n end", "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "def headers\n { subject: \"#{I18n.t('cms.contact_form.subject_prefix')}: #{reason}: #{subject}\",\n to: Account.current.preferred_support_email,\n from: Account.current.preferred_support_email,\n reply_to: %(\"#{name}\" <#{email}>) }\n end", "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end", "def devalert(subject, body='', extra_to=[])\n recipients = CONTACT_EMAIL_ACCOUNTS\n if RAILS_ENV == 'production'\n extra_to = [extra_to] if extra_to.is_a?(String)\n recipients = [recipients].concat(extra_to).join(',')\n end\n @subject = subject\n @body = {:msg => body}\n @recipients = recipients\n @from = ALERT_EMAIL_DEV\n @sent_on = Time.now\n @headers = {}\n end", "def rejected(request)\n @request = request\n mail to: @request.user.email, subject: default_i18n_subject(id: @request.id)\n end", "def email_subject(form)\n \"#{form.type_of_enquiry} - #{reference}\"\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def message_subject\n return @message_subject\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "def subject\n 'Report a problem'.freeze\n end", "def subject_name\n subject_full_name\n end", "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "def subject_name\n return @subject_name\n end", "def set_subject(subject)\n\t\tend", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def subject_alternative_name\n extensions[R509::Cert::Extensions::SubjectAlternativeName]\n end", "def subject_name=(value)\n @subject_name = value\n end", "def subject\n self['subject']\n end", "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "def email_verification_subject(token, server_hostname, protocol)\n \"#{server_hostname} e-mail verification\"\n end", "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "def headers\n {\n subject: \"[#{Setting.site_name}] Neue Quelle eingesendet\",\n to: Setting.email,\n reply_to: email,\n from: Setting.get('from'),\n }\n end", "def get_subject_name\n subject_name = subject_header.text.sub! 'Subject:', ''\n subject_name = subject_name.strip!\n subject_name\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def normalize_subject_name\n self.subject = subject.downcase.titleize\n end", "def email_subject(&blk)\n @email_subject_block = blk if blk\n @email_subject_block\n end", "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "def set_subject_and_message(form, subject, message)\n raise Impostor::MissingTemplateMethodError.new(\"set_subject_and_message must be implemented\")\n end", "def rejected\n RequestMailer.rejected\n end", "def missing_user(email)\n\t\tmail(to: email.to_s, subject: \"Password reset request\")\n\tend", "def from_email\n AppConfig[:pui_request_email_fallback_from_address]\n end", "def invite_subject\n \"Your invitation to #{org_name.possessive} Creative Difference Dashboard\"\n end", "def email_prefix\n @email_prefix || '[Exception] '\n end", "def project_email?(email)\n email.subject =~ PROJECT_SUBJECT\n end", "def role_request_rejected(instance_user, message)\n @instance_user = instance_user\n @recipient = instance_user.user\n\n ActsAsTenant.without_tenant do\n @instance = instance_user.instance\n @message = message\n end\n\n I18n.with_locale(instance_user.user.locale) do\n mail(to: instance_user.user.email, subject: t('.subject'))\n end\n end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "def subject\n map_field(:subject)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end", "def password_reset_notice (email, accounts)\n @from = Bolt::Config.email_from\n @recipients = email\n @subject = \"Reset your password for #{Bolt::Config.application_name}\"\n @body = {:accounts => accounts}\n end", "def rejected_loan(loan, options = {})\n to_email = 'MB Servicing <[email protected]>'\n subject = (Rails.env == 'development') ? \"TESTING -- MBWEB/TSS: #{options[:reason]} Loan Notification\" : \"MBWEB/TSS: #{options[:reason]} Loan Notification\"\n @loan = loan\n @options = options\n mail(:to => to_email, :subject => subject) do |format|\n format.text\n end\n end", "def subject_alternative_names\n @_subject_alternative_names ||= begin\n if attribute = read_attributes_by_oid('extReq', 'msExtReq')\n set = OpenSSL::ASN1.decode(attribute.value)\n seq = set.value.first\n if sans = seq.value.collect { |asn1ext| OpenSSL::X509::Extension.new(asn1ext).to_a }.detect { |e| e.first == 'subjectAltName' }\n sans[1].gsub(/DNS:/,'').split(', ')\n else\n []\n end\n else\n []\n end\n end\n end", "def subject; @message_impl.getSubject; end", "def validate_subject\n errors << 'invalid email domain' unless domain_valid?\n end", "def headers\n { subject: \"#{site_name} contact form\", to: site_email, from: email }\n end", "def reject_user\n ProjectUserMailer.reject_user\n end", "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "def instauser_reject_email(user_id)\n @user = Instauser.find_by(id: user_id)\n mail(to: @user.email, subject: 'Thanks for joining Capish!')\n end", "def subject_with_formatting\n (self.subject.blank?) ? 'N/A' : self.subject\n end", "def i18n_label\n \"email.#{name}_label\"\n end", "def validate_subject\n if @subject.nil?\n puts \"No subject, skipping\"\n raise StandardError, \"No subject\"\n else\n @title.strip\n end\n end", "def SetSubject(subject)\n\t\t#Subject of document\n\t\t@subject = subject\n\tend", "def set_title\n @title = t(:message_2, :scope => [:controller, :exams])\n end", "def mmm_test_subj_call\n ->(candidate) { I18n.t('email.test_monthly_mail_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def suppress_reminders?\n [\n SUBJECT_CSP_TEACHER_CON,\n SUBJECT_CSP_FIT,\n SUBJECT_CSD_TEACHER_CON,\n SUBJECT_CSD_FIT\n ].include? subject\n end", "def message_for(key,options={})\n handwritten_message || I18n.translate(key, {:scope => 'activerecord.errors.messages'}.merge(options))\n end", "def headers\n {\n :subject => \"#{subject}\",\n :to => \"[email protected]\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def prompt_message(pre)\n @greeting = \"Hi\"\n @pre = pre\n @prompt = pre.prompt\n\n mail to: \"#{@pre.user.email}\",\n subject: \"#{@prompt.name}\"\n end", "def get_subject\n\t\tend", "def subject=(subject)\n self.subjects = [subject]\n end", "def headers\n {\n :subject => \"澄清:對於#{candidate_name}的#{record_type}\",\n # :to => \"[email protected]\",\n :to => Setting.email.clarify,\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def bounce_notice_text(reason)\n case reason\n when :invalid\n 'Invalid e-mail or password'\n when :expired\n 'Password expired. Please click \"Forget password\"'\n when :blocked\n 'Account blocked. Please verify your e-mail address'\n end\n end", "def question_notification(asker, subject, details)\n @asker = asker\n @subject = subject\n @details = details\n\n mail to: \"Alex Yang <[email protected]>\",\n from: \"BaseRails <[email protected]>\",\n subject: \"#{asker} posted a new question on BaseRails\"\n end", "def subject\n title \n end", "def welcome_email(resource)\n \n @resource = resource\n\n mail :to => @resource.email, :from => \"[email protected]\", :subject => \"Subject line\"\n \n end", "def headers\n {\n :subject => \"Contact Form:#{subject}\",\n :to => Sufia::Engine.config.contact_email, \n :from => Sufia::Engine.config.from_email\n }\n end", "def build_email_kase(options={})\n EmailKase.new({\n :kase => self,\n :subject => \"%{name} wants to know what you think\".t % {:name => self.person.casualize_name}\n }.merge(options))\n end" ]
[ "0.67341834", "0.67223066", "0.66650224", "0.66178936", "0.66082585", "0.6521546", "0.652035", "0.6479755", "0.6478398", "0.64651394", "0.63472366", "0.633526", "0.63203436", "0.63082427", "0.6226839", "0.61381406", "0.60977274", "0.60828424", "0.60763305", "0.602071", "0.59892035", "0.59680057", "0.59506553", "0.5881581", "0.5881581", "0.5881581", "0.5881581", "0.58748275", "0.5873833", "0.5873833", "0.5873833", "0.5873833", "0.5873833", "0.5873833", "0.5873833", "0.5873833", "0.58451486", "0.584325", "0.5836761", "0.58356327", "0.58250415", "0.5823235", "0.5817603", "0.5805533", "0.58027226", "0.5755002", "0.5730499", "0.57191217", "0.5709856", "0.56777465", "0.56594944", "0.56473964", "0.56473964", "0.56473964", "0.56473964", "0.56473964", "0.56473964", "0.56413555", "0.56216633", "0.56111526", "0.56020445", "0.5586544", "0.5581808", "0.554755", "0.55379516", "0.5534813", "0.5525174", "0.55139524", "0.5510812", "0.5507276", "0.5494737", "0.5488315", "0.54861665", "0.54769915", "0.5474923", "0.54731995", "0.5453293", "0.54456866", "0.54296035", "0.5421802", "0.54153985", "0.5403084", "0.5388974", "0.53884274", "0.53854114", "0.53833157", "0.5380683", "0.5353582", "0.5334198", "0.5330281", "0.5317779", "0.5317568", "0.53129315", "0.5309432", "0.53012055", "0.52977145", "0.5295682", "0.52768886", "0.52705395", "0.5264694" ]
0.61616987
15
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.postman.first_round_email.subject
def first_round_email(email) @greeting = "Hi" mail to: email, subject: "Your ASES Application Decision" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject\n self['subject'] || msg['subject']\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "def subject\n @mail.subject\n end", "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "def message_subject=(value)\n @message_subject = value\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject=(subject); @message_impl.setSubject subject; end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end", "def subject=(string)\n set('Subject', string)\n end", "def subject_name\n subject_full_name\n end", "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "def subject\n message.subject\n end", "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "def subject_name\n return @subject_name\n end", "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "def subject\n self['subject']\n end", "def get_subject_name\n subject_name = subject_header.text.sub! 'Subject:', ''\n subject_name = subject_name.strip!\n subject_name\n end", "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "def message_subject\n return @message_subject\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def subject; @message_impl.getSubject; end", "def subject_name=(value)\n @subject_name = value\n end", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def email_subject(form)\n \"#{form.type_of_enquiry} - #{reference}\"\n end", "def set_title\n @title = t(:message_2, :scope => [:controller, :exams])\n end", "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_subject(subject)\n\t\tend", "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "def subject\n title \n end", "def mmm_test_subj_call\n ->(candidate) { I18n.t('email.test_monthly_mail_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def get_subject\n\t\tend", "def normalize_subject_name\n self.subject = subject.downcase.titleize\n end", "def subject_with_formatting\n (self.subject.blank?) ? 'N/A' : self.subject\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject_alternative_name\n extensions[R509::Cert::Extensions::SubjectAlternativeName]\n end", "def email_subject(&blk)\n @email_subject_block = blk if blk\n @email_subject_block\n end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end", "def SetSubject(subject)\n\t\t#Subject of document\n\t\t@subject = subject\n\tend", "def message\n if subject && !subject.empty?\n subject + \"\\n\" + body\n else\n body\n end\n end", "def title\r\n fail \"There are no messages yet\" if self.messages.size == 0\r\n\r\n @messages[0].subject.size == 0 ? \"No title\" : @messages[0].subject\r\n end", "def headers\n { subject: \"#{I18n.t('cms.contact_form.subject_prefix')}: #{reason}: #{subject}\",\n to: Account.current.preferred_support_email,\n from: Account.current.preferred_support_email,\n reply_to: %(\"#{name}\" <#{email}>) }\n end", "def subject(options)\n case [options[:person], options[:plurality]]\n when %i[first singular]\n 'I'\n when %i[first plural]\n 'we'\n when %i[second singular], %i[second plural]\n 'you'\n when %i[third singular]\n 'he'\n when %i[third plural]\n 'they'\n end\n end", "def first_subject\n subject\n end", "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def konsalt_mail params\n build_params params\n send_email t('emails.konsalta_mail.subject')\n end", "def default_i18n_subject(interpolations = {})\n ''\n end", "def headers\n {\n :subject => %(#{subject}),\n :to => Contact.first.email,\n :body => %(#{message}),\n :from => %(\"#{email}\")\n }\n end", "def subject\n map_field(:subject)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "def adhoc_test_subj_call\n ->(candidate) { I18n.t('email.test_adhoc_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def custom_mail( user, subject, title, contents )\n @user = user\n @host = GogglesCore::AppConstants::WEB_MAIN_DOMAIN_NAME\n @contents = contents\n @title = title\n #subject: \"[#{ GogglesCore::AppConstants::WEB_APP_NAME }@#{ @host }] #{ subject }\",\n mail(\n subject: \"#{ subject } [#{GogglesCore::AppConstants::WEB_APP_NAME}]\",\n to: user.email,\n date: Time.now\n )\n end", "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "def headers\n {\n :subject => \"#{subject}\",\n :to => \"[email protected]\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def email_us(subject, body)\n unless ENV['RACK_ENV'] == 'development'\n recipient = \"The Awesome Team <[email protected]>\"\n\n # First, instantiate the Mailgun Client with your API key\n mg_client = Mailgun::Client.new ENV['MAILGUN_PRIVATE']\n\n # Define your message parameters\n message_params = { from: '[email protected]',\n to: recipient,\n subject: subject,\n html: body,\n text: Nokogiri::HTML(body).text\n }\n\n # Send your message through the client\n mg_client.send_message 'sandboxa148f93a5c5f4813a81365d1b873ee8f.mailgun.org', message_params\n end # unless ENV['RACK_ENV'] == 'development'\n end", "def set_subject_and_message(form, subject, message)\n raise Impostor::MissingTemplateMethodError.new(\"set_subject_and_message must be implemented\")\n end", "def subject(*extra)\n subject = \"\"\n subject << \"#{@project.name} | \" if @project\n subject << extra.join(' | ') if extra.present?\n subject\n end", "def headers\n {\n subject: \"[#{Setting.site_name}] Neue Quelle eingesendet\",\n to: Setting.email,\n reply_to: email,\n from: Setting.get('from'),\n }\n end", "def sender_email_to_title_and_name\n known_emails = [Notifier.help_email, Notifier.search_filter_email, Notifier.message_email, Notifier.signup_email,\n Notifier.newsletter_email, Notifier.admin_email, Notifier.contact_email, Notifier.info_email,\n Notifier.feedback_email, Notifier.press_email].map {|m| Notifier.unprettify(m)}\n if known_emails.include?(self.sender_email)\n \"kann-ich-klagen.de\"\n elsif ps = Person.find_by_email(self.sender_email)\n ps.title_and_name\n else\n self.sender_email\n end\n end", "def set_title\n @title = t(:message_0, :scope => [:controller, :scholarships])\n end", "def prompt_message(pre)\n @greeting = \"Hi\"\n @pre = pre\n @prompt = pre.prompt\n\n mail to: \"#{@pre.user.email}\",\n subject: \"#{@prompt.name}\"\n end", "def setup_email(user)\n @recipients = user.email\n @body[:user] = user\n @from = FROM_EMAIL\n @subject = case ENV['RAILS_ENV'] \n when 'development': \"[YourApp Development] \"\n when 'staging': \"[YourApp Staging] \"\n else \"[YourApp] \"\n end\n @sent_on = Time.now\n headers \"Reply-to\" => FROM_EMAIL\n end", "def subject_titles\n @subject_titles ||= sw_subject_titles\n end", "def subject\n @subject\n end", "def subject\n @subject\n end", "def i18n_label\n \"email.#{name}_label\"\n end", "def subject_name\n subject&.name\n end", "def headers\n {\n :subject => \"澄清:對於#{candidate_name}的#{record_type}\",\n # :to => \"[email protected]\",\n :to => Setting.email.clarify,\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def email_verification_subject(token, server_hostname, protocol)\n \"#{server_hostname} e-mail verification\"\n end", "def raf_submitted(study_subject)\n#\t\t@greeting = \"Hi\"\n\t\t@study_subject = study_subject\n\n\t\tmail to: \"[email protected]\"\n\t\tmail cc: [\"[email protected]\", \"[email protected]\"]\n\t\tmail subject: \"TEST [CCLS Patient Notification Received] Identifier: #{@study_subject.icf_master_id_to_s}\"\n\tend", "def build_email_kase(options={})\n EmailKase.new({\n :kase => self,\n :subject => \"%{name} wants to know what you think\".t % {:name => self.person.casualize_name}\n }.merge(options))\n end", "def headers\n { subject: \"#{site_name} contact form\", to: site_email, from: email }\n end", "def subject\n @subject\n end", "def alert_preamble\n text = user ? user.email : ''\n text += \" [#{company.name}]\" if company\n text\n end", "def invite_subject\n \"Your invitation to #{org_name.possessive} Creative Difference Dashboard\"\n end", "def validate_subject\n if @subject.nil?\n puts \"No subject, skipping\"\n raise StandardError, \"No subject\"\n else\n @title.strip\n end\n end", "def headers\n {\n :subject => \"Contact Form:#{subject}\",\n :to => Sufia::Engine.config.contact_email, \n :from => Sufia::Engine.config.from_email\n }\n end", "def set_subject\n url = Settings.hqva_mobile.url\n icn = user.icn\n appointment_id = data[:appointment_id]\n\n {\n use: SUBJECT_USE,\n value: \"#{url}/appointments/v1/patients/#{icn}/Appointment/#{appointment_id}\"\n }\n end", "def headers\n {\n :subject => %(<#{subject}>),\n\t\t\t:to => %(#{to}),\n :from => \"[email protected]\"\n }\n end" ]
[ "0.7400115", "0.7283536", "0.7065765", "0.70454586", "0.7006847", "0.69586855", "0.6958134", "0.6928366", "0.6907777", "0.6906616", "0.68791604", "0.68710226", "0.6869364", "0.6836125", "0.67405045", "0.6694067", "0.66846067", "0.66758597", "0.66560847", "0.66388935", "0.6609991", "0.6590083", "0.6555975", "0.6541066", "0.64619696", "0.64448595", "0.6444155", "0.6444155", "0.6444155", "0.6444155", "0.6431035", "0.6420202", "0.6398421", "0.6359107", "0.63536984", "0.63488555", "0.6344618", "0.6344618", "0.6344618", "0.6344618", "0.6344618", "0.6344618", "0.6344618", "0.6344618", "0.6296888", "0.6280446", "0.6268083", "0.62679696", "0.62025416", "0.61596775", "0.6156392", "0.615167", "0.615167", "0.615167", "0.615167", "0.615167", "0.615167", "0.61311305", "0.6115654", "0.6103995", "0.610082", "0.6057328", "0.6055054", "0.60495365", "0.6023953", "0.6018786", "0.60106736", "0.5995083", "0.59885305", "0.59424245", "0.59400403", "0.59335303", "0.59016263", "0.5887309", "0.5860944", "0.58599615", "0.58500904", "0.5845914", "0.5844337", "0.582794", "0.5797429", "0.5791464", "0.5790955", "0.5780681", "0.57804847", "0.5773001", "0.5773001", "0.5767376", "0.5759684", "0.5754522", "0.57489103", "0.5748366", "0.5743889", "0.57437414", "0.57407564", "0.57398623", "0.57129055", "0.571107", "0.5706888", "0.57057756", "0.5688593" ]
0.0
-1
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.postman.second_round_email.subject
def second_round_email(email) @greeting = "Hi" mail to: email, subject: "Your ASES Application Decision" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject\n self['subject'] || msg['subject']\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "def message_subject=(value)\n @message_subject = value\n end", "def subject=(subject); @message_impl.setSubject subject; end", "def subject\n @mail.subject\n end", "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end", "def subject=(string)\n set('Subject', string)\n end", "def subject\n message.subject\n end", "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "def subject_name\n subject_full_name\n end", "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "def message_subject\n return @message_subject\n end", "def subject_name\n return @subject_name\n end", "def subject\n self['subject']\n end", "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "def get_subject_name\n subject_name = subject_header.text.sub! 'Subject:', ''\n subject_name = subject_name.strip!\n subject_name\n end", "def subject; @message_impl.getSubject; end", "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "def email_subject(form)\n \"#{form.type_of_enquiry} - #{reference}\"\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def subject_name=(value)\n @subject_name = value\n end", "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "def set_subject(subject)\n\t\tend", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_title\n @title = t(:message_2, :scope => [:controller, :exams])\n end", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def get_subject\n\t\tend", "def subject_alternative_name\n extensions[R509::Cert::Extensions::SubjectAlternativeName]\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def subject\n title \n end", "def email_subject(&blk)\n @email_subject_block = blk if blk\n @email_subject_block\n end", "def mmm_test_subj_call\n ->(candidate) { I18n.t('email.test_monthly_mail_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def subject(options)\n case [options[:person], options[:plurality]]\n when %i[first singular]\n 'I'\n when %i[first plural]\n 'we'\n when %i[second singular], %i[second plural]\n 'you'\n when %i[third singular]\n 'he'\n when %i[third plural]\n 'they'\n end\n end", "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end", "def normalize_subject_name\n self.subject = subject.downcase.titleize\n end", "def set_subject_and_message(form, subject, message)\n raise Impostor::MissingTemplateMethodError.new(\"set_subject_and_message must be implemented\")\n end", "def SetSubject(subject)\n\t\t#Subject of document\n\t\t@subject = subject\n\tend", "def konsalt_mail params\n build_params params\n send_email t('emails.konsalta_mail.subject')\n end", "def subject_with_formatting\n (self.subject.blank?) ? 'N/A' : self.subject\n end", "def message\n if subject && !subject.empty?\n subject + \"\\n\" + body\n else\n body\n end\n end", "def subject\n map_field(:subject)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "def headers\n { subject: \"#{I18n.t('cms.contact_form.subject_prefix')}: #{reason}: #{subject}\",\n to: Account.current.preferred_support_email,\n from: Account.current.preferred_support_email,\n reply_to: %(\"#{name}\" <#{email}>) }\n end", "def custom_mail( user, subject, title, contents )\n @user = user\n @host = GogglesCore::AppConstants::WEB_MAIN_DOMAIN_NAME\n @contents = contents\n @title = title\n #subject: \"[#{ GogglesCore::AppConstants::WEB_APP_NAME }@#{ @host }] #{ subject }\",\n mail(\n subject: \"#{ subject } [#{GogglesCore::AppConstants::WEB_APP_NAME}]\",\n to: user.email,\n date: Time.now\n )\n end", "def email_verification_subject(token, server_hostname, protocol)\n \"#{server_hostname} e-mail verification\"\n end", "def email_us(subject, body)\n unless ENV['RACK_ENV'] == 'development'\n recipient = \"The Awesome Team <[email protected]>\"\n\n # First, instantiate the Mailgun Client with your API key\n mg_client = Mailgun::Client.new ENV['MAILGUN_PRIVATE']\n\n # Define your message parameters\n message_params = { from: '[email protected]',\n to: recipient,\n subject: subject,\n html: body,\n text: Nokogiri::HTML(body).text\n }\n\n # Send your message through the client\n mg_client.send_message 'sandboxa148f93a5c5f4813a81365d1b873ee8f.mailgun.org', message_params\n end # unless ENV['RACK_ENV'] == 'development'\n end", "def subject(*extra)\n subject = \"\"\n subject << \"#{@project.name} | \" if @project\n subject << extra.join(' | ') if extra.present?\n subject\n end", "def second_round_email\n Postman.second_round_email\n end", "def subject\n @subject\n end", "def subject\n @subject\n end", "def set_subject\n url = Settings.hqva_mobile.url\n icn = user.icn\n appointment_id = data[:appointment_id]\n\n {\n use: SUBJECT_USE,\n value: \"#{url}/appointments/v1/patients/#{icn}/Appointment/#{appointment_id}\"\n }\n end", "def headers\n {\n :subject => %(#{subject}),\n :to => Contact.first.email,\n :body => %(#{message}),\n :from => %(\"#{email}\")\n }\n end", "def first_subject\n subject\n end", "def headers\n {\n :subject => \"#{subject}\",\n :to => \"[email protected]\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def subject\n @subject\n end", "def default_i18n_subject(interpolations = {})\n ''\n end", "def subject_titles\n @subject_titles ||= sw_subject_titles\n end", "def headers\n { subject: \"#{site_name} contact form\", to: site_email, from: email }\n end", "def send_message_to_company(recipientEmail, fromEmail, subjectEmail, bodyMessage)\n @subject = subjectEmail\n @body[\"body_message\"] = bodyMessage\n @body[\"sent_to\"] = recipientEmail\n @recipients = recipientEmail\n @from = fromEmail\n @content_type = \"text/html\"\n @headers = {}\n end", "def named_subject\n map_field(:named_subject)&.map { |a| a.gsub(/ \\$[a-z] /, ' ') }\n end", "def raf_submitted(study_subject)\n#\t\t@greeting = \"Hi\"\n\t\t@study_subject = study_subject\n\n\t\tmail to: \"[email protected]\"\n\t\tmail cc: [\"[email protected]\", \"[email protected]\"]\n\t\tmail subject: \"TEST [CCLS Patient Notification Received] Identifier: #{@study_subject.icf_master_id_to_s}\"\n\tend", "def headers\n {\n subject: \"[#{Setting.site_name}] Neue Quelle eingesendet\",\n to: Setting.email,\n reply_to: email,\n from: Setting.get('from'),\n }\n end", "def i18n_label\n \"email.#{name}_label\"\n end", "def invite_subject\n \"Your invitation to #{org_name.possessive} Creative Difference Dashboard\"\n end", "def title\r\n fail \"There are no messages yet\" if self.messages.size == 0\r\n\r\n @messages[0].subject.size == 0 ? \"No title\" : @messages[0].subject\r\n end", "def setup_email(user)\n @recipients = user.email\n @body[:user] = user\n @from = FROM_EMAIL\n @subject = case ENV['RAILS_ENV'] \n when 'development': \"[YourApp Development] \"\n when 'staging': \"[YourApp Staging] \"\n else \"[YourApp] \"\n end\n @sent_on = Time.now\n headers \"Reply-to\" => FROM_EMAIL\n end", "def subject(*args)\n subject = \"#{Settings['application']['name']} | \"\n subject << args.join(' ') if args.present?\n subject\n end", "def headers\n {\n :subject => %(<#{subject}>),\n\t\t\t:to => %(#{to}),\n :from => \"[email protected]\"\n }\n end", "def subject_name\n subject&.name\n end", "def build_email_kase(options={})\n EmailKase.new({\n :kase => self,\n :subject => \"%{name} wants to know what you think\".t % {:name => self.person.casualize_name}\n }.merge(options))\n end", "def headers\n {\n :subject => \"Message from WebsiteOne\",\n :to => \"[email protected]\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def subject\n raise \"Override #subject in the service class\"\n end", "def headers\n {\n :subject => \"澄清:對於#{candidate_name}的#{record_type}\",\n # :to => \"[email protected]\",\n :to => Setting.email.clarify,\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def headers\n {\n :subject => \"Contact Form:#{subject}\",\n :to => Sufia::Engine.config.contact_email, \n :from => Sufia::Engine.config.from_email\n }\n end" ]
[ "0.7323762", "0.7307878", "0.7194845", "0.70432377", "0.69531965", "0.69468546", "0.6920641", "0.68654954", "0.6847382", "0.6846045", "0.6813904", "0.6806319", "0.6802816", "0.68010646", "0.67940706", "0.67171264", "0.66831803", "0.66424847", "0.6608241", "0.6586665", "0.65595406", "0.6559289", "0.6559182", "0.64493066", "0.64412457", "0.6439218", "0.63907284", "0.63739955", "0.63726056", "0.6371415", "0.6371415", "0.6371415", "0.6371415", "0.6370919", "0.63694155", "0.6340877", "0.62985843", "0.62985843", "0.62985843", "0.62985843", "0.62985843", "0.62985843", "0.62985843", "0.62985843", "0.626995", "0.62657344", "0.6228042", "0.6198879", "0.6198223", "0.6198223", "0.6198223", "0.6198223", "0.6198223", "0.6198223", "0.61745685", "0.61530644", "0.61458343", "0.6135866", "0.6095349", "0.60785174", "0.6059932", "0.6054524", "0.60544294", "0.60476494", "0.6015915", "0.5956811", "0.59367114", "0.5936341", "0.59002876", "0.589926", "0.58938265", "0.58263415", "0.5820154", "0.5817453", "0.57920605", "0.57920605", "0.5774475", "0.5774407", "0.5767346", "0.5735364", "0.57345784", "0.5730231", "0.5727106", "0.5713597", "0.5711846", "0.57013065", "0.5685155", "0.568162", "0.5679439", "0.5672212", "0.5658505", "0.56525785", "0.56514525", "0.56478167", "0.5643269", "0.56378925", "0.5636336", "0.5626436", "0.562471", "0.56196946" ]
0.5652793
91
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.postman.accept_email.subject
def accept_email(email) @greeting = "Hi" mail to: email, subject: "Your ASES Application Decision" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "def subject\n self['subject'] || msg['subject']\n end", "def message_subject=(value)\n @message_subject = value\n end", "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end", "def subject() self.headers[\"Subject\"] || \"[NO SUBJECT]\" end", "def subject\n @mail.subject\n end", "def subject=(subject); @message_impl.setSubject subject; end", "def subject=(string)\n set('Subject', string)\n end", "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end", "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def setSubject(subject)\n @fields['subject'] = subject\n self\n end", "def subject\n message.subject\n end", "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "def subject\n self['subject']\n end", "def set_subject(subject)\n\t\tend", "def email_subject(form)\n \"#{form.type_of_enquiry} - #{reference}\"\n end", "def subject_name=(value)\n @subject_name = value\n end", "def subject\n @subject ||= \"(sans sujet)\"\n if @no_header_subject.nil?\n \"#{header_subject}#{@subject}\"\n else\n @subject\n end\n end", "def subject(options = {})\n options = { :capitalize => true, :case => Grammar::Case::SUBJECT }.merge(options)\n pronoun_or_noun(@subject, @audience, options)\n end", "def headers\n { subject: \"#{I18n.t('cms.contact_form.subject_prefix')}: #{reason}: #{subject}\",\n to: Account.current.preferred_support_email,\n from: Account.current.preferred_support_email,\n reply_to: %(\"#{name}\" <#{email}>) }\n end", "def subject_name\n return @subject_name\n end", "def subject_name\n subject_full_name\n end", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def message_subject\n return @message_subject\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject=(value)\n @subject = value\n end", "def subject_for(template, attributes = {})\n subject = EmailTemplate.subject_for(template)\n subject = I18n.t(\"email_templates.#{template}.default_subject\") if subject.nil?\n subject = \"No Subject\" if subject.nil?\n Florrick.convert(subject, add_default_attributes(attributes))\n end", "def email_verification_subject(token, server_hostname, protocol)\n \"#{server_hostname} e-mail verification\"\n end", "def choose_subject(action, params = {})\n scope = [:mailers, mailer_name, action]\n key = :subject\n experiment_name = \"#{mailer_name}_mailer_#{action}_subject\".to_sym\n if experiment_active?(experiment_name)\n scope << key\n key = ab_test(experiment_name)\n end\n params.merge!(scope: scope)\n I18n.t(key, params)\n end", "def email_subject(&blk)\n @email_subject_block = blk if blk\n @email_subject_block\n end", "def SetSubject(subject)\n\t\t#Subject of document\n\t\t@subject = subject\n\tend", "def translate(mapping, key)\n I18n.t(:\"notifications_subject\", :scope => [:eventifier, :notifications, key],\n :default => [:subject, key.to_s.humanize])\n end", "def subject_alternative_name\n extensions[R509::Cert::Extensions::SubjectAlternativeName]\n end", "def headers\n { subject: \"#{site_name} contact form\", to: site_email, from: email }\n end", "def headers\n {\n subject: \"[#{Setting.site_name}] Neue Quelle eingesendet\",\n to: Setting.email,\n reply_to: email,\n from: Setting.get('from'),\n }\n end", "def get_subject\n\t\tend", "def subject; @message_impl.getSubject; end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def get_subject_name\n subject_name = subject_header.text.sub! 'Subject:', ''\n subject_name = subject_name.strip!\n subject_name\n end", "def project_email?(email)\n email.subject =~ PROJECT_SUBJECT\n end", "def invite_subject\n \"Your invitation to #{org_name.possessive} Creative Difference Dashboard\"\n end", "def subject\n title \n end", "def set_subject_and_message(form, subject, message)\n raise Impostor::MissingTemplateMethodError.new(\"set_subject_and_message must be implemented\")\n end", "def normalize_subject_name\n self.subject = subject.downcase.titleize\n end", "def set_title\n @title = t(:message_2, :scope => [:controller, :exams])\n end", "def headers\n {\n :subject => \"Contact Form:#{subject}\",\n :to => Sufia::Engine.config.contact_email, \n :from => Sufia::Engine.config.from_email\n }\n end", "def headers\n {\n :subject => \"#{subject}\",\n :to => \"[email protected]\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def headers\n {\n :subject => %(#{subject}),\n :to => Contact.first.email,\n :body => %(#{message}),\n :from => %(\"#{email}\")\n }\n end", "def mmm_test_subj_call\n ->(candidate) { I18n.t('email.test_monthly_mail_subject_initial_input', candidate_account_name: candidate.account_name) }\n end", "def subject\n map_field(:subject)&.map { |a| a.gsub(/ \\$[a-z] /, '--') }\n end", "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end", "def setup_email(user)\n @recipients = user.email\n @body[:user] = user\n @from = FROM_EMAIL\n @subject = case ENV['RAILS_ENV'] \n when 'development': \"[YourApp Development] \"\n when 'staging': \"[YourApp Staging] \"\n else \"[YourApp] \"\n end\n @sent_on = Time.now\n headers \"Reply-to\" => FROM_EMAIL\n end", "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "def welcome_email(resource)\n \n @resource = resource\n\n mail :to => @resource.email, :from => \"[email protected]\", :subject => \"Subject line\"\n \n end", "def set_subject\n url = Settings.hqva_mobile.url\n icn = user.icn\n appointment_id = data[:appointment_id]\n\n {\n use: SUBJECT_USE,\n value: \"#{url}/appointments/v1/patients/#{icn}/Appointment/#{appointment_id}\"\n }\n end", "def headers\n {\n :subject => \"澄清:對於#{candidate_name}的#{record_type}\",\n # :to => \"[email protected]\",\n :to => Setting.email.clarify,\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "def email_us(subject, body)\n unless ENV['RACK_ENV'] == 'development'\n recipient = \"The Awesome Team <[email protected]>\"\n\n # First, instantiate the Mailgun Client with your API key\n mg_client = Mailgun::Client.new ENV['MAILGUN_PRIVATE']\n\n # Define your message parameters\n message_params = { from: '[email protected]',\n to: recipient,\n subject: subject,\n html: body,\n text: Nokogiri::HTML(body).text\n }\n\n # Send your message through the client\n mg_client.send_message 'sandboxa148f93a5c5f4813a81365d1b873ee8f.mailgun.org', message_params\n end # unless ENV['RACK_ENV'] == 'development'\n end", "def setup_email(options)\n @recipients = options[:recipients]\n @from = options[:from] || SocialNewsConfig[\"email_addrs\"][\"support\"] \n @cc = options[:cc] || ''\n @bcc = options[:bcc] || ''\n @subject = SUBJECT_PREFIX + (options[:subject] || 'No Subject')\n @body = options[:body] || {}\n @headers = options[:headers] || {}\n @charset = options[:charset] || 'utf-8'\n end", "def email_subject\n sponsor_name = @config.plan.sponsor_name\n display_date = @date.to_s()\n if @config.div_id.present?\n email_subject = \"Payroll report for #{sponsor_name} for division #{@config.division_name}: #{display_date}\"\n else\n email_subject = \"Payroll report for #{sponsor_name}: #{display_date}\"\n end\n return email_subject\n end", "def headers\n {\n :subject => %(<#{subject}>),\n\t\t\t:to => %(#{to}),\n :from => \"[email protected]\"\n }\n end", "def custom_mail( user, subject, title, contents )\n @user = user\n @host = GogglesCore::AppConstants::WEB_MAIN_DOMAIN_NAME\n @contents = contents\n @title = title\n #subject: \"[#{ GogglesCore::AppConstants::WEB_APP_NAME }@#{ @host }] #{ subject }\",\n mail(\n subject: \"#{ subject } [#{GogglesCore::AppConstants::WEB_APP_NAME}]\",\n to: user.email,\n date: Time.now\n )\n end", "def prompt_message(pre)\n @greeting = \"Hi\"\n @pre = pre\n @prompt = pre.prompt\n\n mail to: \"#{@pre.user.email}\",\n subject: \"#{@prompt.name}\"\n end", "def headers\n {\n :subject => \"Contact from website\",\n :to => Site.current.preferred_contact_email,\n :from => %(\"#{lastname}\" <#{email}>)\n }\n end", "def headers\n {\n :subject => \"Contact from website\",\n :to => Site.current.preferred_contact_email,\n :from => %(\"#{lastname}\" <#{email}>)\n }\n end", "def subject\n @subject\n end", "def subject\n @subject\n end", "def build_email_kase(options={})\n EmailKase.new({\n :kase => self,\n :subject => \"%{name} wants to know what you think\".t % {:name => self.person.casualize_name}\n }.merge(options))\n end", "def subject_titles\n @subject_titles ||= sw_subject_titles\n end", "def konsalt_mail params\n build_params params\n send_email t('emails.konsalta_mail.subject')\n end", "def headers\r\n {\r\n :subject => \"JP Health Insurance Contact Form\",\r\n :to => [\"[email protected]\", \"[email protected]\", \"[email protected]\"],\r\n :from => %(\"#{name}\" <#{email}>)\r\n }\r\n end", "def i18n_label\n \"email.#{name}_label\"\n end", "def question(member, subject, content)\n @content = content\n\n mail to: member.email, subject: subject\n end", "def subject_with_formatting\n (self.subject.blank?) ? 'N/A' : self.subject\n end", "def subject=(subject)\n self.subjects = [subject]\n end", "def subject\n @subject\n end", "def headers\r\n {\r\n :subject => \"My Contact Form\",\r\n :to => \"[email protected]\",\r\n :from => %(\"#{name}\" <#{email}>)\r\n }\r\n end", "def team_invite_email(email, origin_id, team)\n @invitee_name = User.with_email(email).name\n @inviter_name = Profile.find_by_user_id(origin_id).name\n @team_name = team.name\n @partition_name = TeamPartition.find_by_id(team.partition_id).name\n subject = \"#{team.course.number} Team Invite\"\n mail from: \"Igor staff <#{SmtpServer.first.user_name}>\", to: email,\n subject: subject\n end", "def subject\n 'Report a problem'.freeze\n end", "def subject_contains=(value)\n @subject_contains = value\n end", "def headers\n {\n :subject => \"Message from WebsiteOne\",\n :to => \"[email protected]\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end" ]
[ "0.7105351", "0.7104342", "0.71019906", "0.70898575", "0.7073604", "0.7072669", "0.704648", "0.694429", "0.68222576", "0.6802428", "0.67607385", "0.6745693", "0.6596819", "0.64904445", "0.64786154", "0.6452022", "0.6452022", "0.6452022", "0.6452022", "0.6452022", "0.6452022", "0.6452022", "0.6452022", "0.64516455", "0.64360267", "0.64360267", "0.64360267", "0.64360267", "0.64241403", "0.6375612", "0.63430303", "0.633477", "0.63261735", "0.63096225", "0.62752336", "0.6269527", "0.6260532", "0.62391245", "0.62286186", "0.61917764", "0.6183674", "0.61834615", "0.61834615", "0.61834615", "0.61834615", "0.61834615", "0.61834615", "0.6122106", "0.60775816", "0.60669124", "0.6059493", "0.6010639", "0.5974286", "0.5943309", "0.5943294", "0.5937016", "0.5936795", "0.5929945", "0.5929649", "0.59183544", "0.5912312", "0.5887169", "0.58807904", "0.58784264", "0.58704406", "0.58679426", "0.5861018", "0.5820004", "0.5812621", "0.5806207", "0.57788646", "0.57706124", "0.5757471", "0.5748766", "0.5744059", "0.57371897", "0.57186645", "0.5700699", "0.5696689", "0.56915224", "0.56541884", "0.5637842", "0.56297517", "0.56264704", "0.56264704", "0.56166834", "0.56166834", "0.56159693", "0.5589475", "0.5582881", "0.5582724", "0.5579487", "0.5579444", "0.5577268", "0.5567801", "0.55672646", "0.55335605", "0.5530778", "0.5530487", "0.55248934", "0.55162233" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_product @product = Product.find_by( :id => 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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\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 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 workflow\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 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 before_action \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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; 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 setup(&blk)\n @setup_block = blk\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 callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); 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", "def duas1(action)\n action.call\n action.call\nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def call\n setup_context\n super\n end" ]
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", "0.5312988", "0.529798", "0.52968603", "0.52962637", "0.52577317", "0.5244704", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5233461", "0.52322435", "0.5227552", "0.52224743", "0.5217851", "0.521241", "0.52069896", "0.5206555", "0.5176617", "0.51738507", "0.51725876", "0.51660734", "0.51605034", "0.51571786", "0.5152762", "0.5152164", "0.5151477", "0.5145819", "0.51408994", "0.5134412", "0.5114031", "0.5113695", "0.5113695", "0.5108603", "0.5107358", "0.5090405", "0.50889385", "0.50817686", "0.5081617", "0.50658226", "0.50551206", "0.5051746", "0.5049091", "0.5049091", "0.5034681", "0.5024972", "0.5021291", "0.5016024", "0.50134826", "0.50008893", "0.50000244", "0.4999155", "0.49907947", "0.49907947", "0.49853387", "0.49796683", "0.4979596", "0.49778128", "0.49673793", "0.49662578", "0.49587822", "0.4956063", "0.49550167", "0.49523485", "0.4951614", "0.49452996", "0.49442068", "0.49336892", "0.49306205", "0.49264124", "0.49259305", "0.4925823", "0.49229056", "0.4918999", "0.49171805", "0.49167436", "0.4916559", "0.49153692", "0.49148256" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def product_params params.require(:product).permit(:name, :description, :price, :stock) 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 get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\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 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 specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "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 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 special_device_list_params\n params.require(:special_device_list).permit(:name)\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 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.7123669", "0.7054077", "0.69472784", "0.6902165", "0.6736001", "0.671985", "0.6687218", "0.6676269", "0.66602534", "0.6556639", "0.6527985", "0.645892", "0.645072", "0.64494324", "0.6445436", "0.64350927", "0.6415061", "0.6415061", "0.6393001", "0.6378958", "0.6378958", "0.63741165", "0.636044", "0.63547933", "0.6285727", "0.6278816", "0.6246161", "0.6227885", "0.6225383", "0.622309", "0.62118614", "0.6209478", "0.6176166", "0.6172476", "0.6169111", "0.6158942", "0.6143792", "0.6136175", "0.6123085", "0.6108703", "0.6100308", "0.60760003", "0.6054003", "0.60426265", "0.6036683", "0.6029898", "0.6020772", "0.6020169", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.60176134", "0.6006716", "0.6003403", "0.6001569", "0.5995689", "0.5994206", "0.599406", "0.5985532", "0.59828365", "0.5977637", "0.59767246", "0.5970349", "0.59662646", "0.5966073", "0.5966073", "0.5957612", "0.5951802", "0.5950822", "0.59498274", "0.5942674", "0.59319496", "0.5931201", "0.59265846", "0.59238476", "0.5918484", "0.59172106", "0.59133804", "0.59125537", "0.59080327", "0.59065026", "0.5906122", "0.59027356", "0.59009796", "0.589672", "0.5895543", "0.5893694" ]
0.0
-1
GET /insider_deals/1 GET /insider_deals/1.json
def show @insider_deal = InsiderDeal.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @insider_deal } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def meals\n get(\"/user/#{@user_id}/meals.json\")\n end", "def show_deal(id)\n get(\"deals/#{id}\")\n end", "def deal_detail(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"deals/#{id}\", params)\n end", "def index\n respond_with(deals)\n end", "def show\n @deals_wizard = DealsWizard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deals_wizard }\n end\n end", "def _state_deals(state_id)\n get('state/deals', state_id, options: { type: :array })\n end", "def all_deals(**args)\n params = parameters(args) do\n optional_params :user_id, :filter_id, :stage_id, :status, :start, :limit, :sort, :owned_by_you\n end\n request(:get, 'deals', params)\n end", "def show_deals(search = nil, **params)\n params[:search] = search\n\n get('deals', params)\n end", "def index\n @meals = Meal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meals }\n end\n end", "def show\n # @deal = Deal.find(params[:id], :include => [:retailer, :advertiser, {:retailer => :account}] )\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deal }\n end\n end", "def show\n @deal = Deal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deal }\n end\n end", "def show\n @deal = Deal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deal }\n end\n end", "def show\n @deal = Deal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deal }\n end\n end", "def new\n @insider_deal = InsiderDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insider_deal }\n end\n end", "def show\n @redeemed_deal = RedeemedDeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redeemed_deal }\n end\n end", "def meal\n @meals = Meal.all\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @meals, :only => [:id, :name, :price], :include => { :items => {:only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}} }\n end\n end", "def get_deals_count\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/deals/count\"\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\" => \"APIMATIC 2.0\",\r\n \"accept\" => \"application/json\",\r\n \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers\r\n\r\n #Error handling using HTTP status codes\r\n if !(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 show\n @dental = Dental.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dental }\n end\n end", "def show\n @meal = Meal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @meal }\n end\n end", "def index\n # get meals from the user\n @meals = @user.meals\n # create a new meal for the ajax form to use\n @meal = Meal.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meals }\n end\n end", "def index\n @dutydeals = Dutydeal.all\n end", "def show\n @rateddeal = Rateddeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rateddeal }\n end\n end", "def index\n @deals = Deal.where(account_id: current_user.account_id)\n end", "def show\n @inspiration = Inspiration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end", "def details\n @daily_deal = DailyDeal.find(params[:id])\n respond_to do |format|\n format.json do\n render with_api_version\n end\n end\n end", "def show\n @diary = current_user.diaries.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diary }\n end\n end", "def index\n @meals = Meal.all\n end", "def index\n @indication_for_meals = IndicationForMeal.all\n end", "def show\n @inspiration = Inspiration.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @inspiration }\n end\n end", "def list\n meals = @meals_repository.all\n @view.list(meals)\n end", "def show\n @drip = Drip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drip }\n end\n end", "def show\n puts \"user: #{@current_user.json_hash[:id]}\"\n @dinner = @current_user.hosted_dinners.find_by(id: params[:id])\n @dinner ||= @current_user.attended_dinners.find_by(id: params[:id])\n @dinner ||= @current_user.invited_dinners.find_by(id: params[:id])\n if @dinner\n render :json => @dinner.all_info\n end\n end", "def show\n @diary = Diary.find(params[:id])\n\n # respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @diary }\n \n end", "def show\n # @retailer = Retailer.find(params[:id], :include => [:deals, :advertisements, :account] )\n respond_to do |format|\n format.html # show.html.erb\n format.json # show.json.rabl\n end\n end", "def destroy\n @insider_deal = InsiderDeal.find(params[:id])\n @insider_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to insider_deals_url }\n format.json { head :no_content }\n end\n end", "def show\n @internship = Internship.find(params[:id])\n @diaries = Diary.where(:internship_id => @internship.id).paginate(:page => params[:page]).order('id DESC')\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @internship }\n end\n end", "def show\n @meal_profile = MealProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meal_profile }\n end\n end", "def deals\n if params[:range] == \"10000000\"\n ts_deals = Deal.filtered_url_search(\n :category => params[:category] == \"all\" ? nil : params[:category],\n :query => params[:q],\n :lat => params[:lat],\n :lon => params[:long],\n :range => params[:range] || Deal::MAX_RANGE,\n :age => Deal::MAX_AGE.days,\n :page => params[:page])\n else\n ts_deals = Deal.filtered_search(\n :category => params[:category] == \"all\" ? nil : params[:category],\n :query => params[:q],\n :lat => params[:lat],\n :lon => params[:long],\n :range => params[:range] || Deal::MAX_RANGE,\n :age => Deal::MAX_AGE.days,\n :page => params[:page])\n end\n \n @deals = Array.new\n ts_deals.map do |deal|\n if deal.hidden == false\n @deals.push deal\n end\n end\n \n puts \"SEARCH DEAL COUNT:#{@deals.count}\"\n options = { :minimal => true }\n options[:current_user] = current_user if current_user\n render :json => @deals.compact.as_json(options)\n end", "def show\n @disease = Disease.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disease }\n end\n end", "def show\n donation = Donation.find_by(id: params[:id])\n render json: donation.as_json\n end", "def show\n render json: @diet, status: 200, root: true\n end", "def all_deals\n ids = [333621]\n @buildings = Building.find(ids)\n @building_names = ['The Sky']\n @deal_msgs = ['One month free on 13 month lease']\n @images_list = [653870]\n if check_cookie\n @cookies = cookies[:listing_ids].split(\",\")\n end\n end", "def show\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meal }\n end\n end", "def index\n @title = \"Deals\"\n if is_company?\n @company = Company.find_by_user_id(current_user.id)\n @deals = @company.deals\n else\n @deals = Deal.all.sort{|a,b| b.popularity <=> a.popularity} #most popular first\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @deals }\n end\n end", "def index\n @office_deals = OfficeDeal.all.page params[:page]\n end", "def show\n @ingredience = Ingredience.find(params[:id])\n @meals = Meal.find(:all, :conditions => ['ingredience_id =?', @ingredience.id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ingredience }\n end\n end", "def show\n @kf_diary = Kf::Diary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_diary }\n end\n end", "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "def show \n @inmate = Inmate.find(params[:id])\n render json: @inmate\n end", "def show\n respond_with DisIndiastate.find(params[:id])\n end", "def show\n @advertisement = Advertisement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advertisement }\n end\n end", "def index\n @q = Deal.ransack(params[:q])\n @deals = @q.result.includes(:organization, :pic).page(params[:page])\n end", "def index\n @deals = Deal.where(:status => \"published\")\n end", "def index\n @appeals = @conference.appeals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appeals }\n end\n end", "def show \n @meal = Meal.where(id: params[:id])\n end", "def index\n @meals = current_user.meals\n end", "def index\n @meals = current_user.meals\n end", "def show\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @meal }\n end\n end", "def index\n @deseases = Desease.order(:id)\n\n render json: @deseases\n end", "def show\n @institucional = Institucional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institucional }\n end\n end", "def show\n @diet = @profile.diets.includes(:food_line_items).find(params[:id])\n @food_line_item = FoodLineItem.new\n @food_line_items = @diet.food_line_items\n respond_with @diets\n end", "def index\n if session[:meal_id].nil?\n redirect_to meals_path\n else\n @meal = Meal.find(session[:meal_id]) \n @meal_dishes = @meal.meal_dishes\n end \n end", "def show\n @yahoo_deal = YahooDeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @yahoo_deal }\n end\n end", "def show\n @income_entry = IncomeEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @income_entry }\n end\n end", "def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def show\n @nail_salon = NailSalon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nail_salon }\n end\n end", "def show\n @meal = Meal.find(params[:id])\n end", "def show\n @meal = Meal.find(params[:id])\n end", "def show\n @meal = Meal.find(params[:id])\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appeal }\n end\n end", "def index\n @daily_deals = DailyDeal.all\n end", "def show\n @bidding = Bidding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bidding }\n end\n end", "def show\n @meal = Meal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.js # show.js.erb\n format.json { render json: @meal }\n end\n end", "def show\n respond_to do |format|\n format.html\n format.json { render json: { advertisements: @advertisements } }\n end\n end", "def list\n display_meals\n end", "def show\n @meal = Meal.find(params[:meal_id]) if params[:meal_id]\n @recipe = @meal.recipes.find(params[:id]) if @meal\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def show\n respond_with(deal)\n end", "def show\n @illness = Illness.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @illness }\n end\n end", "def show\n @ledger_entry = LedgerEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ledger_entry }\n end\n end", "def index\n @book_deals = BookDeal.all\n end", "def index\n @dealers = Dealer.all\n end", "def index\n @dealers = Dealer.all\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interest }\n end\n end", "def index\n puts \"user: #{@current_user.json_hash[:id]}\"\n hosted_dinners = []\n attended_dinners = []\n @hosted_dinners = @current_user.hosted_dinners.where('starts_at >= ?', \"#{Time.now}\").order(starts_at: :asc).each do |dinner|\n hosted_dinners << dinner.all_info\n end\n @attended_dinners = @current_user.attended_dinners.where('starts_at >= ?', \"#{Time.now}\").order(starts_at: :asc).each do |dinner|\n attended_dinners << dinner.all_info\n end\n render json: {\n hosting: hosted_dinners,\n attending: attended_dinners\n }\n end", "def show\n @page = 'doll'\n @doll = Doll.find(params[:id])\n @pin = Pin.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doll }\n end\n end", "def show\n @purchasing_ad = PurchasingAd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchasing_ad }\n end\n end", "def index_hosting\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.hosted_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end", "def show\n respond_with DisAlcoholInteraction.find(params[:id])\n end", "def show\n render json: @dice\n end", "def menu\n foods = current_user.restaurant.meals.where(meal_type: 0)\n drinks = current_user.restaurant.meals.where(meal_type: 1)\n render json: {foods: foods, drinks: drinks, is_success: true}, status: :ok\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "def show\n @payments = Payment.find(params[:id]) \n render json: @payments\n end", "def new\n @deals_wizard = DealsWizard.new\n \n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deals_wizard }\n end\n end", "def index\n @meals = current_user.meals.all\n end", "def show\n @getadvice = Getadvice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @getadvice }\n end\n end", "def show\n render json: @admitting\n end", "def show\n @dinosaur = Dinosaur.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dinosaur }\n end\n end", "def show\n @includes_drink = IncludesDrink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @includes_drink }\n end\n end" ]
[ "0.7412967", "0.71145", "0.67918414", "0.669748", "0.6598033", "0.6585533", "0.6582518", "0.6530764", "0.6454494", "0.64372647", "0.64152926", "0.64152926", "0.64152926", "0.64042854", "0.63962364", "0.6380398", "0.63709396", "0.6348071", "0.63344115", "0.6306824", "0.6272823", "0.62656796", "0.6248493", "0.62432903", "0.62223476", "0.6209175", "0.6161481", "0.6154887", "0.61539084", "0.61537206", "0.6100778", "0.6090205", "0.607735", "0.6065498", "0.60614425", "0.60576856", "0.6055485", "0.60392874", "0.6033387", "0.6031674", "0.6025881", "0.6018793", "0.60168505", "0.6013486", "0.6009806", "0.6009657", "0.60045654", "0.60020745", "0.5970703", "0.5964195", "0.59599566", "0.59577066", "0.5956253", "0.5948135", "0.59472644", "0.59444684", "0.5943624", "0.59418166", "0.59418166", "0.5940182", "0.5938543", "0.5932775", "0.59117013", "0.5908704", "0.59072363", "0.5905793", "0.58979744", "0.5890232", "0.58882654", "0.58882654", "0.58882654", "0.5883589", "0.5875414", "0.5875243", "0.58752275", "0.5874273", "0.58524144", "0.5837572", "0.5836653", "0.58349025", "0.583274", "0.5824793", "0.5818497", "0.5818497", "0.58135056", "0.5806601", "0.5797296", "0.5793171", "0.5792257", "0.5791294", "0.57895505", "0.5788874", "0.5787569", "0.578592", "0.57767045", "0.5766006", "0.5763482", "0.5761762", "0.5759999", "0.5748072" ]
0.7190072
1
GET /insider_deals/new GET /insider_deals/new.json
def new @insider_deal = InsiderDeal.new respond_to do |format| format.html # new.html.erb format.json { render json: @insider_deal } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @deal = Deal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deal }\n end\n end", "def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meal }\n end\n end", "def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meal }\n end\n end", "def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @meal }\n end\n end", "def new\n @dental = Dental.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dental }\n end\n end", "def new\n @inspiration = Inspiration.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @inspiration }\n end\n end", "def new\n @drip = Drip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drip }\n end\n end", "def new\n @rateddeal = Rateddeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rateddeal }\n end\n end", "def new\n @journal = @journals.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @journal }\n end\n end", "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lease }\n end\n end", "def new\n @redeemed_deal = RedeemedDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @redeemed_deal }\n end\n end", "def new\n @deals_wizard = DealsWizard.new\n \n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deals_wizard }\n end\n end", "def new\n @holding = Holding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holding }\n end\n end", "def new\n @holding = Holding.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @holding }\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 @nail_salon = NailSalon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nail_salon }\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 @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def new\n @advertise = Advertise.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertise }\n end\n end", "def new\n # @advertisement = Advertisement.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "def new\n @disease = Disease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @disease }\n end\n end", "def new\n @discount = Discount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discount }\n end\n end", "def new\n @discount = Discount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discount }\n end\n end", "def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "def new\n @advertisement = Advertisement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "def new\n # @deal = Deal.new\n @deal.skeleton_flag = 1 # set up as a skeleton record\n @deal.preview_flag = 1 # set up as a preview\n @deal.featured_flag = 2 # start out as non-valid value as a placeholder\n @deal.name = \"New_Preview_Deal_#{Time.now.to_f}\"\n @deal.num_offered = 0\n # @deal.name = \"New_Preview_Deal_#{Time.now.strftime(\"%m/%d/%Y - %I:%M:%S%P\")}\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deal }\n end\n end", "def new\n @meal_profile = MealProfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @meal_profile }\n end\n end", "def new\n @lead = Lead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lead }\n end\n end", "def new\n @deal = Deal.new\n @pn = protocol_number\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deal }\n end\n end", "def new\n @income_entry = IncomeEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @income_entry }\n end\n end", "def new\n @illness = Illness.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @illness }\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 @life_insurance = LifeInsurance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @life_insurance }\n end\n end", "def new\n respond_with(deal)\n end", "def new\n @page = 'newdoll'\n @doll = current_user.dolls.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @doll }\n end\n end", "def new\n fetch_data\n @payment = Payment.new(:payment_date => Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end", "def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end", "def new\n @ad = Ad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ad }\n end\n end", "def new\n @diary = Diary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @diary }\n format.js\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 @yahoo_deal = YahooDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @yahoo_deal }\n end\n end", "def new\n @ledger_entry = LedgerEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ledger_entry }\n end\n end", "def new\n @creative = Creative.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creative }\n end\n end", "def new\n @payable = Payable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payable }\n end\n end", "def new\n @getadvice = Getadvice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @getadvice }\n end\n end", "def new\n @insurer = Insurer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insurer }\n end\n end", "def new\n @income = Income.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @income }\n end\n end", "def new\n @buy_in = BuyIn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @buy_in }\n end\n end", "def new\n @withdrawal = Withdrawal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @withdrawal }\n end\n end", "def new\n @includes_drink = IncludesDrink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @includes_drink }\n end\n end", "def new\n @auction = Auction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auction }\n end\n end", "def new_lead\n @lead = Lead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lead }\n end\n end", "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def new\n @loan = Loan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loan }\n end\n end", "def new\n @assist = Assist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assist }\n end\n end", "def new\n @assay = Assay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @assay }\n end\n end", "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow }\n end\n end", "def new\n @landing = Landing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @landing }\n end\n end", "def new\n @institucional = Institucional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institucional }\n end\n end", "def new\n @fundraiser = Fundraiser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fundraiser }\n end\n end", "def new\n @interesting = Interesting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interesting }\n end\n end", "def new\n @entry = Entry.new\n\n render json: @entry\n end", "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\n end\n end", "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\n end\n end", "def new\n @verse = Verse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verse }\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 @training_deal = TrainingDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @training_deal }\n end\n end", "def new\n @disbursement = Disbursement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @disbursement }\n end\n end", "def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end", "def new\n @explaination = Explaination.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @explaination }\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 @addre = Addre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @addre }\n end\n end", "def new\n @endurance = Endurance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @endurance }\n end\n end", "def new\n @journal = Journal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json :@journal }\n end\n end", "def new\n @annex = Annex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @annex }\n end\n end", "def new\n @checkout = Checkout.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @checkout }\n end\n end", "def new\n @checkout = Checkout.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @checkout }\n end\n end", "def new\n @dinosaur = Dinosaur.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dinosaur }\n end\n end", "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end", "def new\n @apprentice = Apprentice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @apprentice }\n end\n end", "def new\n @advert = Advert.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advert }\n end\n end", "def new\n @pokeparty = Pokeparty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pokeparty }\n end\n end", "def new\n @wanted = Wanted.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wanted }\n end\n end", "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end", "def new\n @borrower = Borrower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrower }\n end\n end", "def new\n post = Post.new\n render json: post\n end", "def new\n @advertisment = Advertisment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisment }\n end\n end", "def new\n @deed = Deed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deed }\n end\n end", "def new\n @law = Law.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @law }\n end\n end", "def new\n @paise = Paise.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paise }\n end\n end", "def new\n @unpaid_debt = UnpaidDebt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unpaid_debt }\n end\n end" ]
[ "0.7199966", "0.7170282", "0.7170282", "0.711566", "0.70683414", "0.69980395", "0.69536483", "0.6943725", "0.6940352", "0.69215024", "0.68828124", "0.68227285", "0.6812683", "0.6812683", "0.681171", "0.6795089", "0.67920256", "0.6788213", "0.67855793", "0.6744758", "0.6739235", "0.67270815", "0.6726531", "0.67208874", "0.6697786", "0.6697786", "0.66964304", "0.66964304", "0.66964304", "0.6695264", "0.66878533", "0.66788834", "0.6673104", "0.667142", "0.6665036", "0.665402", "0.6642239", "0.6638571", "0.6636388", "0.6622143", "0.66204906", "0.66204906", "0.66101235", "0.6609229", "0.660676", "0.66041064", "0.6601872", "0.65820736", "0.6578577", "0.65760607", "0.656426", "0.6555829", "0.6551886", "0.65414846", "0.65399337", "0.6538952", "0.6529103", "0.6529103", "0.6529103", "0.6528885", "0.65208447", "0.65192825", "0.6516718", "0.65109426", "0.6510579", "0.65097886", "0.650921", "0.6493294", "0.6484047", "0.64768666", "0.64768666", "0.64768666", "0.6476196", "0.64729744", "0.6467853", "0.6466005", "0.64592427", "0.64536065", "0.6453063", "0.6449795", "0.6448469", "0.6444145", "0.64438725", "0.64438725", "0.644058", "0.64392835", "0.64392835", "0.64392835", "0.64380634", "0.64335454", "0.6430285", "0.64297056", "0.6427645", "0.6427645", "0.64267695", "0.64248073", "0.6421091", "0.641664", "0.6414659", "0.64138657" ]
0.76673234
0
POST /insider_deals POST /insider_deals.json
def create end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_deal(**args)\n params = parameters(args) do\n required_params :title\n optional_params :title, :value, :currency, :user_id, :person_id, :org_id, :stage_id, :status, :probability, :lost_reason, :add_time, :visible_to\n end\n request(:post, 'deals', params)\n end", "def new\n @insider_deal = InsiderDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insider_deal }\n end\n end", "def destroy\n @insider_deal = InsiderDeal.find(params[:id])\n @insider_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to insider_deals_url }\n format.json { head :no_content }\n end\n end", "def deal_detail(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"deals/#{id}\", params)\n end", "def meals\n get(\"/user/#{@user_id}/meals.json\")\n end", "def show\n @insider_deal = InsiderDeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @insider_deal }\n end\n end", "def save\n\t\t@@deals << self\n\tend", "def _state_deals(state_id)\n get('state/deals', state_id, options: { type: :array })\n end", "def all_deals(**args)\n params = parameters(args) do\n optional_params :user_id, :filter_id, :stage_id, :status, :start, :limit, :sort, :owned_by_you\n end\n request(:get, 'deals', params)\n end", "def index\n respond_with(deals)\n end", "def delete_deals(**args)\n params = parameters(args) do\n required_params :ids\n optional_params :ids\n end\n request(:delete, 'deals', params)\n end", "def create\n @deal = Deal.new(deal_params)\n @deal.account_id = current_user.account_id\n\n respond_to do |format|\n if @deal.save\n format.html { redirect_to account_deals_path(current_user.account_id), notice: 'Deal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @deal }\n else\n format.html { render action: 'new' }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \t@business = Business.find(params[:business_id])\n \tdeal = @business.deals.create(deal_params)\n \tdeal.save\n \tif deal.save\n \t flash[:notice] = \"Successfully created deal!\"\n \t\tredirect_to business_path(@business)\n \t\telse\n \t\t flash[:error] = deal.errors.full_messages.join(\", \")\n \t\t redirect_to root_path\n \tend\n end", "def new\n @deals_wizard = DealsWizard.new\n \n \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deals_wizard }\n end\n end", "def create\n flash[:notice] = 'The deal was successfully created.' if deal.save\n respond_with(deal)\n end", "def create\n @deals_wizard = DealsWizard.new(params[:deals_wizard])\n \n respond_to do |format|\n if @deals_wizard.save\n format.html { redirect_to edit_deal_path(:id => params[:deals_wizard][:deal_id]) , notice: 'Deal was successfully created.' }\n# format.html { redirect_to @deals_wizard, notice: 'Deals wizard was successfully created.' }\n format.json { render json: @deals_wizard, status: :created, location: @deals_wizard }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deals_wizard.errors, status: :unprocessable_entity }\n end\n end\n end", "def show_deal(id)\n get(\"deals/#{id}\")\n end", "def index\n # get meals from the user\n @meals = @user.meals\n # create a new meal for the ajax form to use\n @meal = Meal.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meals }\n end\n end", "def create\n @desease = Desease.new(desease_params)\n\n if @desease.save\n render json: @desease, status: :ok\n else\n render json: @desease.errors, status: :unprocessable_entity\n end\n end", "def show\n @deals_wizard = DealsWizard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deals_wizard }\n end\n end", "def new\n @redeemed_deal = RedeemedDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @redeemed_deal }\n end\n end", "def create_deals_search body, from: nil, size: nil\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/deals/search\"\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\r\n \"from\" => from,\r\n \"size\" => size,\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\" => \"APIMATIC 2.0\",\r\n \"accept\" => \"application/json\",\r\n \"content-type\" => \"application/json; charset=utf-8\",\r\n \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.post query_url, headers:headers, parameters:body.to_json\r\n\r\n #Error handling using HTTP status codes\r\n if !(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 daily_deal_params\n params.require(:daily_deal).permit(:DealerID, :DealerName, :DealerCategory, :IsDealerFavorite?, :DealerTargetUrl, :logo)\n end", "def create\n @hotdeal = current_user.hotdeals.build(hotdeal_params)\n\n respond_to do |format|\n if @hotdeal.save\n format.html { redirect_to @hotdeal, notice: 'Hotdeal was successfully created.' }\n format.json { render :show, status: :created, location: @hotdeal }\n else\n format.html { render :new }\n format.json { render json: @hotdeal.errors, status: :unprocessable_entity }\n end\n end\n end", "def show_deals(search = nil, **params)\n params[:search] = search\n\n get('deals', params)\n end", "def create\n @dealer = Dealer.new(dealer_params)\n respond_to do |format|\n if @dealer.save\n format.html { redirect_to @dealer, notice: 'Dealer was successfully created.' }\n format.json { render :show, status: :created, location: @dealer }\n else\n format.html { render :new }\n format.json { render json: @dealer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dealer = Dealer.new(dealer_params)\n\n respond_to do |format|\n if @dealer.save\n format.html { redirect_to @dealer, notice: 'Dealer was successfully created.' }\n format.json { render :show, status: :created, location: @dealer }\n else\n format.html { render :new }\n format.json { render json: @dealer.errors, status: :unprocessable_entity }\n end\n end\n end", "def all_deals\n ids = [333621]\n @buildings = Building.find(ids)\n @building_names = ['The Sky']\n @deal_msgs = ['One month free on 13 month lease']\n @images_list = [653870]\n if check_cookie\n @cookies = cookies[:listing_ids].split(\",\")\n end\n end", "def index\n @dutydeals = Dutydeal.all\n end", "def create\n @indication_for_meal = IndicationForMeal.new(indication_for_meal_params)\n\n respond_to do |format|\n if @indication_for_meal.save\n format.html { redirect_to @indication_for_meal, notice: 'Indication for meal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @indication_for_meal }\n else\n format.html { render action: 'new' }\n format.json { render json: @indication_for_meal.errors, status: :unprocessable_entity }\n end\n end\n end", "def deal_params\n params.require(:deal).permit(:id, :stylist_agree, :scrub_agree, :paid, :profile_id, :user_id, :offer_id, :buyer)\n end", "def create\n @item_adicional = ItemAdicional.new(item_adicional_params)\n\n respond_to do |format|\n if @item_adicional.save\n format.html { redirect_to @item_adicional, notice: 'Item adicional was successfully created.' }\n format.json { render :show, status: :created, location: @item_adicional }\n else\n format.html { render :new }\n format.json { render json: @item_adicional.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @redeemed_deal = RedeemedDeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redeemed_deal }\n end\n end", "def create(params = {})\n wrapped_params = { insurance: params }\n @client.make_request(:post, 'insurances', MODEL_CLASS, wrapped_params)\n end", "def merge_deals(id:, **args)\n params = parameters(args) do\n required_params :merge_with_id\n optional_params :merge_with_id\n end\n request(:put, \"deals/#{id}/merge\", params)\n end", "def get_deals_count\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/deals/count\"\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\" => \"APIMATIC 2.0\",\r\n \"accept\" => \"application/json\",\r\n \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers\r\n\r\n #Error handling using HTTP status codes\r\n if !(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 new\n @rateddeal = Rateddeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rateddeal }\n end\n end", "def create\n @dealer = Dealer.new(dealer_params)\n\n respond_to do |format|\n if @dealer.save\n format.html { redirect_to @dealer, notice: 'Dealer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dealer }\n else\n format.html { render action: 'new' }\n format.json { render json: @dealer.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n # @retailer = Retailer.find(params[:id], :include => [:deals] )\n if [email protected]\n @retailer.destroy\n else\n flash[:notice] = \"That Retailer cannot be deleted because it has #{@retailer.deals.size} deals\"\n end\n respond_to do |format|\n format.html { redirect_to retailers_url }\n format.json { head :ok }\n end\n end", "def accept\n @invite = Invite.find_by(dinner_id: params[:id], invited_id: @current_user.json_hash[:id])\n if @invite\n @acceptance = AttendeeDinner.new\n @acceptance.dinner_id = @invite.dinner_id\n @acceptance.attendee_id = @invite.invited_id\n if @acceptance.valid?\n @acceptance.save\n @invite.delete\n render json: @acceptance\n else\n puts @acceptance.errors.messages.inspect\n render status: :bad_request, json: {\n errors: @acceptance.errors.messages\n }\n end\n end\n end", "def new\n respond_with(deal)\n end", "def new\n @deal = Deal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deal }\n end\n end", "def deals\n if params[:range] == \"10000000\"\n ts_deals = Deal.filtered_url_search(\n :category => params[:category] == \"all\" ? nil : params[:category],\n :query => params[:q],\n :lat => params[:lat],\n :lon => params[:long],\n :range => params[:range] || Deal::MAX_RANGE,\n :age => Deal::MAX_AGE.days,\n :page => params[:page])\n else\n ts_deals = Deal.filtered_search(\n :category => params[:category] == \"all\" ? nil : params[:category],\n :query => params[:q],\n :lat => params[:lat],\n :lon => params[:long],\n :range => params[:range] || Deal::MAX_RANGE,\n :age => Deal::MAX_AGE.days,\n :page => params[:page])\n end\n \n @deals = Array.new\n ts_deals.map do |deal|\n if deal.hidden == false\n @deals.push deal\n end\n end\n \n puts \"SEARCH DEAL COUNT:#{@deals.count}\"\n options = { :minimal => true }\n options[:current_user] = current_user if current_user\n render :json => @deals.compact.as_json(options)\n end", "def create\n @rateddeal = Rateddeal.new(params[:rateddeal])\n\n respond_to do |format|\n if @rateddeal.save\n format.html { redirect_to @rateddeal, notice: 'Rateddeal was successfully created.' }\n format.json { render json: @rateddeal, status: :created, location: @rateddeal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rateddeal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @disclaimer = Disclaimer.new(params[:disclaimer])\n @disclaimers = Disclaimer.all\n\n respond_to do |format|\n if @disclaimer.save\n @disclaimers = Disclaimer.all\n format.html { redirect_to presets_path, notice: 'Disclaimer was successfully created.' }\n format.json { render json: @disclaimer, status: :created, location: @disclaimer }\n format.js\n else\n format.html { redirect_to presets_path, notice: 'Disclaimer was successfully created.' }\n format.json { render json: @disclaimer.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def create\n @deal = Deal.new(deal_params)\n @deal.user_id = current_user.id\n\n respond_to do |format|\n if @deal.save\n format.html { redirect_to @deal, notice: 'Deal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @deal }\n else\n format.html { render action: 'new' }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if session[:meal_id].nil?\n redirect_to meals_path\n else\n @meal = Meal.find(session[:meal_id]) \n @meal_dish = @meal.meal_dishes.new(meal_dish_params)\n end \n\n respond_to do |format|\n if @meal_dish.save\n format.html { redirect_to meal_dishes_url, notice: 'Meal dish was successfully created.' }\n format.json { render action: 'show', status: :created, location: @meal_dish }\n else\n format.html { render action: 'new' }\n format.json { render json: @meal_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @descuento_adicional = DescuentoAdicional.new(descuento_adicional_params)\n\n respond_to do |format|\n if @descuento_adicional.save\n format.html { redirect_to @descuento_adicional, notice: 'Descuento adicional was successfully created.' }\n format.json { render :show, status: :created, location: @descuento_adicional }\n else\n format.html { render :new }\n format.json { render json: @descuento_adicional.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @suffereded_disease = SufferededDisease.new(suffereded_disease_params)\n\n respond_to do |format|\n if @suffereded_disease.save\n format.html { redirect_to @suffereded_disease, notice: \"Suffereded disease was successfully created.\" }\n format.json { render :show, status: :created, location: @suffereded_disease }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @suffereded_disease.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @deal = @pic.deals.new(deal_params)\n respond_to do |format|\n if @deal.save\n send_notification(@deal, self)\n format.html { redirect_to @pic.belongable.organization, notice: 'Deal was successfully created.' }\n format.json { render :show, status: :created, location: @deal }\n else\n format.html { render :new }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @advertisement = current_user.advertisements.new(advertisement_params)\n @advertisement.status = INACTIVE\n respond_to do |format|\n if @advertisement.save\n \n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n message = \"Heyy new advertisement: #{@advertisement.title} is added by #{current_user.user_profile.name}\"\n User.get_customer_dealer(message)\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n num_days = (Date.parse(params['rent_info']['end_date']).mjd - Date.parse(params['rent_info']['start_date']).mjd) \n total = num_days * params['rent_info']['price_per_day']\n # byebug\n if User.find(params['rent_info']['owner_id'])\n user = User.find(params['rent_info']['owner_id'])\n user.money_made += total \n user.save\n end\n\n renter_post = RenterPost.create(\n renter_id: params['rent_info']['renter_id'],\n post_id: params['rent_info'][\"post_id\"],\n start_date: params['rent_info'][\"start_date\"],\n end_date: params['rent_info'][\"end_date\"],\n status: params['rent_info'][\"status\"]\n )\n if renter_post \n render json: renter_post\n else\n render json: {error: \"Could not create Renter Post\"}\n end\n end", "def create\n @diary_entry = DiaryEntry.new(diary_entry_params)\n\n respond_to do |format|\n if @diary_entry.save\n format.html { redirect_to @diary_entry, notice: 'Diary entry was successfully created.' }\n format.json { render :show, status: :created, location: @diary_entry }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @diary_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_deal(id:, **args)\n params = parameters(args) do\n optional_params :title, :value, :currency, :user_id, :person_id, :org_id, :stage_id, :status, :probability, :lost_reason, :visible_to\n end\n request(:put, \"deals/#{id}\", params)\n end", "def create\n @adopter = Adopter.new(adopter_params)\n\n if @adopter.save\n render json: @adopter, status: :created, location: @adopter\n else\n render json: @adopter.errors, status: :unprocessable_entity\n end\n end", "def meal\n @meals = Meal.all\n\n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @meals, :only => [:id, :name, :price], :include => { :items => {:only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}} }\n end\n end", "def create\n @diary_entry = DiaryEntry.new(diary_entry_params)\n\n respond_to do |format|\n if @diary_entry.save\n format.html { redirect_to @diary_entry, notice: 'Diary entry was successfully created.' }\n format.json { render :show, status: :created, location: @diary_entry }\n else\n format.html { render :new }\n format.json { render json: @diary_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @indication_for_meal.destroy\n respond_to do |format|\n format.html { redirect_to indication_for_meals_url }\n format.json { head :no_content }\n end\n end", "def update_deal(id, params)\n put(\"deals/#{id}\", deal: params)\n end", "def create\n @diary = Diary.create!(params[:diary])\n respond_to do |format|\n format.html { redirect_to diaries_url }\n format.js\n end\n end", "def index\n @indication_for_meals = IndicationForMeal.all\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 create\n @indicator_federation = IndicatorFederation.new(indicator_federation_params)\n\n respond_to do |format|\n if @indicator_federation.save\n format.html { redirect_to @indicator_federation.indicator}\n format.json { render :show, status: :created, location: @indicator_federation }\n else\n format.html { render :new }\n format.json { render json: @indicator_federation.errors, status: :unprocessable_entity }\n end\n end\n end", "def add\n meal_name = @view.ask_name\n meal_price = @view.ask_price.to_i\n new_meal = Meal.new({name: meal_name, price: meal_price})\n @meals_repository.add(new_meal)\n end", "def destroy\n @deals_wizard = DealsWizard.find(params[:id])\n @deals_wizard.destroy\n\n respond_to do |format|\n format.html { redirect_to deals_wizards_url }\n format.json { head :no_content }\n end\n end", "def pipeline_deals(id:, **args)\n params = parameters(args) do\n optional_params :filter_id, :user_id, :everyone, :stage_id, :start, :limit, :get_summary, :totals_convert_currency\n end\n request(:get, \"pipelines/#{id}/deals\", params)\n end", "def new\n @disease = Disease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @disease }\n end\n end", "def create\n @diary_entry = DiaryEntry.new(diary_entry_params)\n current_user.diary_entries << @diary_entry\n\n respond_to do |format|\n if @diary_entry.save\n format.html { redirect_to @diary_entry, notice: 'Diary entry was successfully created.' }\n format.json { render action: 'show', status: :created, location: @diary_entry }\n else\n format.html { render action: 'new' }\n format.json { render json: @diary_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n # @deal = Deal.find(params[:id], :include => [:retailer, :advertiser, {:retailer => :account}] )\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deal }\n end\n end", "def create\n @kf_diary = Kf::Diary.new(params[:kf_diary])\n\n respond_to do |format|\n if @kf_diary.save\n format.html { redirect_to kf_diaries_url({:page => params[:page]}), notice: 'Diary was successfully created.' }\n format.json { render json: @kf_diary, status: :created, location: @kf_diary }\n else\n format.html { render action: \"new\" }\n format.json { render json: @kf_diary.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @diary = DiaryEntry.new(diary_params)\n\n respond_to do |format|\n if @diary.save\n format.html { redirect_to @diary, notice: 'Diary entry was successfully created.' }\n format.json { render :show, status: :created, location: @diary }\n else\n format.html { render :new }\n format.json { render json: @diary.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n render json: @admitting\n end", "def create\n render json: Dish.create(dish_params)\n end", "def create\n @article = Article.new(article_params)\n\n json_parse = JSON.parse(@article.advertisement)\n ad_hash = json_parse.map { |data|\n ApplicationController.helpers.a8_parse(data)\n }\n ad_hash_json = ActiveSupport::JSON.encode(ad_hash)\n @article[:advertisement] = ad_hash_json\n\n respond_to do |format|\n if @article.save\n format.html { redirect_to @article, notice: 'Article was successfully created.' }\n format.json { render :show, status: :created, location: @article }\n else\n format.html { render :new }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # @deal = Deal.new(params[:deal])\n respond_to do |format|\n if @deal.save\n # @deal.skeleton_flag = 0 # so the \"Save\" button appears at the bottom of the form after the create\n # badge = make_badge( @deal.badge_text.strip, @deal )\n @deal.update_attribute( :skeleton_flag, 0 ) # no longer a skeleton, which was just used to be able to conditionally validate in the model\n @deal.update_attribute( :preview_flag, 1 ) # if params[:commit] == \"Preview\"# mark as a \"preview\"\n format.html { redirect_to @deal, notice: \"Deal was successfully created.\" }\n format.json { render json: @deal, status: :created, location: @deal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @dental = Dental.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dental }\n end\n end", "def new\n @drip = Drip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drip }\n end\n end", "def create_rental(options = {})\n post(:rentals, rentals: [options]).pop\n end", "def destroy\n @rateddeal = Rateddeal.find(params[:id])\n @rateddeal.destroy\n\n respond_to do |format|\n format.html { redirect_to rateddeals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @redeemed_deal = RedeemedDeal.find(params[:id])\n @redeemed_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to redeemed_deals_url }\n format.json { head :no_content }\n end\n end", "def deal_params\n params.require(:deal).permit(:profile_id, :item_id, :bye, :sell, :status, :messenger, :paid, :ransom, :comment, :payment_method, :h, :w, :l, :weight)\n end", "def update\n @insider_deal = InsiderDeal.find(params[:id])\n\n respond_to do |format|\n if @insider_deal.update_attributes(params[:insider_deal])\n format.html { redirect_to @insider_deal, notice: 'Insider deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @insider_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @deed = Deed.create(deed_params)\n\n if @deed.save\n render json: @deed, status: :created, location: @deed\n else\n render json: @deed.errors, status: :unprocessable_entity\n end\n end", "def deal_params\n params.require(:deal).permit(:restaurant, :category, :content)\n end", "def deal_params\n params.require(:deal).permit(:name, :status, :budget, :responsible, :notes, :task, :account_id)\n end", "def create\n @deal = Deal.new(deal_params)\n\n respond_to do |format|\n if @deal.save(validate: false)\n format.html { redirect_to @deal, notice: 'Deal was successfully created.' }\n format.json { render :show, status: :created, location: @deal }\n else\n format.html { render :new }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def like(meal)\n self.customer_meals.create!(meal_id: meal.id)\n end", "def invite\n @invite = Invite.new\n @invite.invited_id = params[:invited_id]\n @invite.dinner_id = params[:id]\n if @invite.valid?\n @invite.save\n render json: @invite\n else\n puts @invite.errors.messages.inspect\n render status: :bad_request, json: {\n errors: @invite.errors.messages\n }\n end\n end", "def create\n @daily_deal = DailyDeal.new(daily_deal_params)\n\n respond_to do |format|\n if @daily_deal.save\n format.html { redirect_to @daily_deal, notice: 'Daily deal was successfully created.' }\n format.json { render :show, status: :created, location: @daily_deal }\n else\n format.html { render :new }\n format.json { render json: @daily_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @advertise = Advertise.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertise }\n end\n end", "def create\n # @advertisement = Advertisement.new(params[:advertisement])\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render json: @advertisement, status: :created, location: @advertisement }\n else\n format.html { render action: \"new\", notice: 'Advertisement was NOT successfully created.' }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @advertisement = Advertisement.new(params[:advertisement])\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully created.' }\n format.json { render json: @advertisement, status: :created, location: @advertisement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n # @advertisement = Advertisement.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @advertisement }\n end\n end", "def delete_deal(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:delete, \"deals/#{id}\", params)\n end", "def create\n @inspiration = Inspiration.new(params[:inspiration])\n \n respond_to do |format|\n if @inspiration.save\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully created.' }\n format.json { render json: @inspiration, status: :created, location: @inspiration }\n else\n format.html { render action: \"new\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find(params[:user])\n @animal = Animal.find(params[:animal])\n @interest = Interest.new(user_id: @user.id, animal_id: @animal.id, date: Date.today)\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to :back, notice: 'You sent an interest to the animal' }\n format.json { head :no_content }\n else\n format.html { redirect_to animals_url, notice: @interest.errors.full_messages[0] }\n format.json { head :no_content }\n end\n end\n end", "def new\n # @deal = Deal.new\n @deal.skeleton_flag = 1 # set up as a skeleton record\n @deal.preview_flag = 1 # set up as a preview\n @deal.featured_flag = 2 # start out as non-valid value as a placeholder\n @deal.name = \"New_Preview_Deal_#{Time.now.to_f}\"\n @deal.num_offered = 0\n # @deal.name = \"New_Preview_Deal_#{Time.now.strftime(\"%m/%d/%Y - %I:%M:%S%P\")}\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @deal }\n end\n end", "def show\n @rateddeal = Rateddeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rateddeal }\n end\n end", "def create\n @office_deal = OfficeDeal.new(office_deal_params)\n\n respond_to do |format|\n if @office_deal.save\n format.html { redirect_to @office_deal, notice: 'Office deal was successfully created.' }\n format.json { render :show, status: :created, location: @office_deal }\n else\n format.html { render :new }\n format.json { render json: @office_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @advertisement = current_user.ads.new(advertisement_params)\n\n respond_to do |format|\n if @advertisement.save\n format.html { redirect_to app_advertisements_url, notice: 'Advertisement was successfully created.' }\n format.json { render :show, status: :created, location: @advertisement }\n else\n format.html { render :new }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @redeemed_deal = RedeemedDeal.new(params[:redeemed_deal])\n\n respond_to do |format|\n if @redeemed_deal.save\n format.html { render json: {:success => true, :status_code => 200, :message => \"You have redeemed the coupon successfully\"}}\n format.json { render json: {:success => true, :status_code => 200, :message => \"You have redeemed the coupon successfully\"}}\n format.xml { render xml: {:success => true, :status_code => 200, :message => \"You have redeemed the coupon successfully\"}}\n else\n format.html { render json: {:success => false, :status_code => 400, :message => \"Error in redeeming coupon\"}}\n format.json { render json: {:success => false, :status_code => 400, :message => \"Error in redeeming coupon\"}}\n format.xml { render xml: {:success => false, :status_code => 400, :message => \"Error in redeeming coupon\"}}\n end\n end\n end" ]
[ "0.63605803", "0.6168347", "0.60774106", "0.59992594", "0.59076625", "0.5889277", "0.58401847", "0.582287", "0.575156", "0.5708979", "0.5652409", "0.5634795", "0.5625492", "0.5609421", "0.5551504", "0.5489959", "0.54839295", "0.5475055", "0.54646707", "0.5435021", "0.54192626", "0.54171145", "0.5392427", "0.5344016", "0.53234124", "0.53099465", "0.52956694", "0.52821356", "0.52621955", "0.5259067", "0.5257366", "0.5247641", "0.524561", "0.52395463", "0.5232806", "0.522716", "0.5226326", "0.5222369", "0.52215713", "0.52130455", "0.52127576", "0.52072275", "0.5204553", "0.5181271", "0.51718915", "0.51658714", "0.5164833", "0.51499957", "0.5149586", "0.51451063", "0.51393914", "0.5136227", "0.51314354", "0.5129841", "0.51265854", "0.51263666", "0.51255894", "0.512557", "0.51110137", "0.51096606", "0.51093096", "0.5105108", "0.5103223", "0.510279", "0.50985587", "0.50957835", "0.5085723", "0.5076152", "0.50745934", "0.5068878", "0.5068455", "0.50656074", "0.50650936", "0.5064786", "0.5061232", "0.5057175", "0.50556135", "0.505514", "0.5047096", "0.5044756", "0.5042934", "0.5041855", "0.5037539", "0.5033185", "0.50308514", "0.5029501", "0.50262517", "0.50182486", "0.5017057", "0.5002491", "0.5001858", "0.5001412", "0.500126", "0.49963224", "0.4993679", "0.4991915", "0.49908063", "0.49832246", "0.49828905", "0.49813882", "0.49795848" ]
0.0
-1
PUT /insider_deals/1 PUT /insider_deals/1.json
def update @insider_deal = InsiderDeal.find(params[:id]) respond_to do |format| if @insider_deal.update_attributes(params[:insider_deal]) format.html { redirect_to @insider_deal, notice: 'Insider deal was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @insider_deal.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_deal(id, params)\n put(\"deals/#{id}\", deal: params)\n end", "def update_deal(id:, **args)\n params = parameters(args) do\n optional_params :title, :value, :currency, :user_id, :person_id, :org_id, :stage_id, :status, :probability, :lost_reason, :visible_to\n end\n request(:put, \"deals/#{id}\", params)\n end", "def destroy\n @insider_deal = InsiderDeal.find(params[:id])\n @insider_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to insider_deals_url }\n format.json { head :no_content }\n end\n end", "def update\n @deal = Deal.find(params[:id])\n \n respond_to do |format|\n if @deal.update_attributes(params[:deal])\n format.html { redirect_to @deal, notice: 'Deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @deal = Deal.find(params[:id])\n\n respond_to do |format|\n if @deal.update_attributes(params[:deal])\n format.html { redirect_to @deal, notice: 'Deal was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @day.update(meals: params[:meals])\n #respond_to do |format|\n #if @day.update(day_params)\n #format.html { redirect_to @day, notice: 'Day was successfully updated.' }\n #format.json { render :show, status: :ok, location: @day }\n #else\n #format.html { render :edit }\n #format.json { render json: @day.errors, status: :unprocessable_entity }\n #end\n #end\n end", "def update\n respond_to do |format|\n if @deal.update(deal_params)\n format.html { redirect_to account_deals_path(current_user.account_id), notice: 'Deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @deals_wizard = DealsWizard.find(params[:id])\n\n respond_to do |format|\n if @deals_wizard.update_attributes(params[:deals_wizard])\n format.html { redirect_to @deals_wizard, notice: 'Deals wizard was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deals_wizard.errors, status: :unprocessable_entity }\n end\n end\n end", "def deal_detail(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"deals/#{id}\", params)\n end", "def update\n flash[:notice] = 'The deal was successfully updated.' if deal.update_attributes(params[:deal])\n respond_with(deal)\n end", "def show\n @insider_deal = InsiderDeal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @insider_deal }\n end\n end", "def update\n respond_to do |format|\n if @deal.update(deal_params)\n format.html { redirect_to @deal, notice: 'Deal was successfully updated.' }\n format.json { render :show, status: :ok, location: @deal }\n else\n format.html { render :edit }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_with Expense.update(params[:id], expense_params), status: 204\n end", "def new\n @insider_deal = InsiderDeal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @insider_deal }\n end\n end", "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "def update\n @adopter = Adopter.find(params[:id])\n\n if @adopter.update(adopter_params)\n head :no_content\n else\n render json: @adopter.errors, status: :unprocessable_entity\n end\n end", "def save\n\t\t@@deals << self\n\tend", "def set_deal\n @deal = Deal.find_by(id: params[:id])\n end", "def update\n authorize! :create, @deal\n \n respond_to do |format|\n if @deal.update(deal_params)\n @deal.update_top_industry\n format.html { redirect_to deals_path, notice: 'DEAL đã được sửa thành công!' }\n format.json { render :show, status: :ok, location: @deal }\n else\n format.html { render :edit }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @deal.update(deal_params)\n format.html { redirect_to @deal, notice: 'Deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @deal = Deal.find(params[:id])\n\n respond_to do |format|\n if @deal.update_attributes(params[:deal])\n format.html { redirect_to(@deal, :notice => 'Deal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @deal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @indication_for_meal.update(indication_for_meal_params)\n format.html { redirect_to @indication_for_meal, notice: 'Indication for meal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @indication_for_meal.errors, status: :unprocessable_entity }\n end\n end\n end", "def show_deal(id)\n get(\"deals/#{id}\")\n end", "def update\n @meal = Meal.find(params[:id])\n\n respond_to do |format|\n if @meal.update_attributes(params[:meal])\n format.html { redirect_to @meal, notice: 'Meal was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @diet.update(diet_params)\n head :no_content, status: 204\n else\n render json: @diet.errors, status: 422\n end\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def set_deal\n @deal = Deal.find(params[:id])\n end", "def update\n respond_to do |format|\n if @office_deal.update(office_deal_params)\n format.html { redirect_to @office_deal, notice: 'Office deal was successfully updated.' }\n format.json { render :show, status: :ok, location: @office_deal }\n else\n format.html { render :edit }\n format.json { render json: @office_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def merge_deals(id:, **args)\n params = parameters(args) do\n required_params :merge_with_id\n optional_params :merge_with_id\n end\n request(:put, \"deals/#{id}/merge\", params)\n end", "def update\n @redeemed_deal = RedeemedDeal.find(params[:id])\n\n respond_to do |format|\n if @redeemed_deal.update_attributes(params[:redeemed_deal])\n format.html { redirect_to @redeemed_deal, notice: 'Redeemed deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @redeemed_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @deal = Deal.find(params[:id])\n\n respond_to do |format|\n if @deal.update_attributes(params[:deal])\n DealRelation.all.each do |dr|\n if !params[dr.name.to_s].nil?\n\n params[dr.name.to_s].each do |deal_contact|\n DealContact.create!(:deal_id => @deal.id, :contact_id => deal_contact.to_i, :deal_relation_id => dr.id)\n end\n end\n end\n format.html { redirect_to deals_path, notice: 'Deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @item_adicional.update(item_adicional_params)\n format.html { redirect_to @item_adicional, notice: 'Item adicional was successfully updated.' }\n format.json { render :show, status: :ok, location: @item_adicional }\n else\n format.html { render :edit }\n format.json { render json: @item_adicional.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @indicator_federation.update(indicator_federation_params)\n format.html { redirect_to @indicator_federation.indicator}\n format.json { render :show, status: :ok, location: @indicator_federation }\n else\n format.html { render :edit }\n format.json { render json: @indicator_federation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @yahoo_deal = YahooDeal.find(params[:id])\n\n respond_to do |format|\n if @yahoo_deal.update_attributes(params[:yahoo_deal])\n format.html { redirect_to @yahoo_deal, notice: 'Yahoo deal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @yahoo_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rateddeal = Rateddeal.find(params[:id])\n\n respond_to do |format|\n if @rateddeal.update_attributes(params[:rateddeal])\n format.html { redirect_to @rateddeal, notice: 'Rateddeal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rateddeal.errors, status: :unprocessable_entity }\n end\n end\n end", "def meals\n get(\"/user/#{@user_id}/meals.json\")\n end", "def update\n @meal = @meal_recipe.meal\n @meal_plan = @meal.day.meal_plan\n @leftover = Leftover.meal_recipe(@meal_recipe).first\n @meal_ingredient = MealIngredient.new\n\n respond_to do |format|\n if params[:meal_recipe][:multiply].present?\n multiply_portions_and_ingredients(params[:meal_recipe][:multiply].to_d)\n end\n\n if params[:meal_recipe][:add].present?\n # @meal_recipe = MealRecipe.find(params[:id])\n @portions = @meal_recipe.portions\n ratio_increase = 1 + 1/@portions\n multiply_portions_and_ingredients(ratio_increase)\n end\n\n \n if @meal_recipe.update(meal_recipe_params)\n format.turbo_stream\n format.html { redirect_to @meal_recipe, notice: \"Meal recipe was successfully updated.\" }\n format.json { render :show, status: :ok, location: @meal_recipe }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @meal_recipe.errors, status: :unprocessable_entity }\n end\n \n end\n end", "def update\n @item = @deal.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to deal_items_url(@deal), notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @expense = Expense.find params.fetch(:id)\n\n if @expense.update(expense_params)\n render json: @expense\n else\n render json: @expense.errors, status: :unprocessable_entity\n end\n end", "def update\n @dental = Dental.find(params[:id])\n\n respond_to do |format|\n if @dental.update_attributes(params[:dental])\n format.html { redirect_to @dental, notice: 'Dental was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # if @bonus.update(bonus_params)\n # render :show, status: :ok, location: @bonus\n # else\n # render json: @bonus.errors, status: :unprocessable_entity\n # end\n end", "def update\n respond_to do |format|\n if @book_deal.update(book_deal_params)\n format.html { redirect_to @book_deal, notice: 'Book deal was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_deal }\n else\n format.html { render :edit }\n format.json { render json: @book_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_deal(**args)\n params = parameters(args) do\n required_params :title\n optional_params :title, :value, :currency, :user_id, :person_id, :org_id, :stage_id, :status, :probability, :lost_reason, :add_time, :visible_to\n end\n request(:post, 'deals', params)\n end", "def update\n @inspiration = current_user.inspirations.find(params[:id])\n\n respond_to do |format|\n if @inspiration.update_attributes(params[:inspiration])\n format.html { redirect_to @inspiration.discussion, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sale = Sale.find(params[:id])\n\n if @sale.update(sale_params)\n head :no_content\n else\n render json: @sale.errors, status: :unprocessable_entity\n end\n end", "def update\n @indicator = Indicator.find(params[:id])\n\n respond_to do |format|\n if @indicator.update_attributes(params[:indicator])\n format.html { redirect_to(@indicator) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @indicator.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @drip = Drip.find(params[:id])\n\n respond_to do |format|\n if @drip.update_attributes(params[:drip])\n format.html { redirect_to @drip, notice: 'Drip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @drip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @inspiration = Inspiration.find(params[:id])\n \n respond_to do |format|\n if @inspiration.update_attributes(params[:inspiration])\n format.html { redirect_to @inspiration, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def set_indication_for_meal\n @indication_for_meal = IndicationForMeal.find(params[:id])\n end", "def update_dealership(req)\n identity = Lynr::Model::Identity.new(dealership(req).identity.email, posted['password'])\n customer = create_customer(identity)\n dealer_dao.save(dealership(req).set(\n 'identity' => identity,\n 'customer_id' => customer.id,\n 'subscription' => Lynr::Model::Subscription.new(\n plan: Lynr.config('app').stripe.plan, status: 'trialing'\n ),\n ))\n end", "def update\n @bubble_tea = BubbleTea.find(params[:id])\n\n if @bubble_tea.update(bubble_tea_params)\n render json: @bubble_tea\n else\n render plain: \"Failed to update drink information\"\n end\n end", "def index\n respond_with(deals)\n end", "def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @inspiration.update(inspiration_params)\n format.html { redirect_to @book, notice: 'Inspiration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @inspiration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dis_alcohol_interaction.update(dis_alcohol_interaction_params)\n format.html { redirect_to @dis_alcohol_interaction, notice: 'Dis alcohol interaction was successfully updated.' }\n format.json { render :show, status: :ok, location: @dis_alcohol_interaction }\n else\n format.html { render :edit }\n format.json { render json: @dis_alcohol_interaction.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @meal.update(meal_params)\n format.html { redirect_to @meal, notice: 'Meal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @daily_deal.update(daily_deal_params)\n format.html { redirect_to @daily_deal, notice: 'Daily deal was successfully updated.' }\n format.json { render :show, status: :ok, location: @daily_deal }\n else\n format.html { render :edit }\n format.json { render json: @daily_deal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @idea = Idea.find(params[:id])\n respond_with(@idea) do |format|\n if @idea.update_attributes(params[:idea])\n format.json { render json: @idea, status: :created, location: @idea }\n else\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @catalog = Catalog.find(params[:id])\n if current_user_self?\n business_deals = params[:business_deals]\n unless business_deals.nil?\n business_deal_ids = Array.new\n business_deals.each_key do |key|\n business_deal_ids << key if key != \"0\"\n end\n @catalog.business_deals = business_deal_ids\n end\n order_statuses = params[:order_statuses]\n unless order_statuses.nil?\n os = ActiveSupport::JSON.decode(order_statuses)\n @catalog.order_statuses = os\n if @catalog.filter_params.nil? || @catalog.filter_params.empty?\n filter_params = Hash.new\n for i in [email protected]_statuses.size-1 do\n status = @catalog.order_statuses[i]\n filter_params[\"#{status['text']}\"] = true \n end\n @catalog.filter_params = { :status => filter_params }\n else\n for i in [email protected]_statuses.size-1 do\n status = @catalog.order_statuses[i]\n @catalog.filter_params[:status][\"#{status['text']}\"] = true \n end\n end\n end\n\n respond_to do |format|\n if @catalog.update_attributes(params[:catalog])\n format.html { redirect_to(@catalog, :notice => t('default.deal_successful') ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @catalog.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to root_url, :alert => t('default.you_not_owner_directory')\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n @dinosaur = Dinosaur.find(params[:id])\n if @dinosaur.update(dinosaur_params)\n head :no_content\n expose @dinosaur\n else\n error!(:invalid_resource, @dinosaur.errors)\n end\n end", "def update_servings\n update_attribute(:servings, DinersMeals.where(meal_id: meals).count)\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n @responsavel = Responsavel.find(params[:id])\n\n if @responsavel.update(responsavel_params)\n head :no_content\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end", "def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single donation based on the id\n donation = Donation.find_by(id: the_id)\n\n # update it\n if donation.update!(\n amount: params[:amount],\n frequency: params[:frequency])\n render json: donation.as_json\n else\n render json: {errors: donation.errors.full_messages}\n end\n end", "def update\n @announcement = Announcement.find(params[:id])\n @announcement.title = params[:title]\n @announcement.description = params[:description]\n @announcement.price = params[:price]\n @announcement.photo = params[:photo]\n @announcement.latitude = params[:latitude]\n @announcement.longitude = params[:longitude]\n @announcement.subcategory_id = params[:subcategory_id]\n @announcement.place = params[:place]\n @announcement.save\n render json:@announcement\n end", "def update\n respond_to do |format|\n if @suffereded_disease.update(suffereded_disease_params)\n format.html { redirect_to @suffereded_disease, notice: \"Suffereded disease was successfully updated.\" }\n format.json { render :show, status: :ok, location: @suffereded_disease }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @suffereded_disease.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n params[:post].merge!(hotdeal_status: Post::HOTDEAL_PENDING) if params[:post][:hotdeal] == \"1\"\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @outlet = Outlet.find(id: params[:outlet][:id])\n\n # respond_to do |format|\n # twitter follower test\n if @outlet.twitter.present?\n credentials = Base64.encode64(\"#{TWITTER_ID}:#{TWITTER_SECRET}\").gsub(\"\\n\", '')\n url = \"https://api.twitter.com/oauth2/token\"\n body = \"grant_type=client_credentials\"\n headers = {\n \"Authorization\" => \"Basic #{credentials}\",\n \"Content-Type\" => \"application/x-www-form-urlencoded;charset=UTF-8\"\n }\n r = HTTParty.post(url, body: body, headers: headers)\n bearer_token = JSON.parse(r.body)['access_token']\n\n api_auth_header = {\"Authorization\" => \"Bearer #{bearer_token}\"}\n url = \"https://api.twitter.com/1.1/users/show.json?screen_name=#{@outlet.twitter}\"\n response = HTTParty.get(url, headers: api_auth_header).body\n parsed_response = JSON.parse(response)\n twitter_followers = parsed_response[\"followers_count\"].to_s\n\n if twitter_followers.present?\n if twitter_followers.length > 3\n twitter_followers = twitter_followers.chop.chop.chop+\"k\"\n end\n @outlet.update(twitter_followers: twitter_followers)\n end\n end\n\n # facebook follower test\n if @outlet.facebook.present?\n url = \"https://graph.facebook.com/#{@outlet.facebook}?fields=fan_count&access_token=#{FACEBOOK_ID}|#{FACEBOOK_SECRET}\"\n facebook_response = HTTParty.get(url)\n parsed_facebook_response = JSON.parse(facebook_response)\n facebook_followers = parsed_facebook_response[\"fan_count\"].to_s\n if facebook_followers.present?\n if facebook_followers.length > 3\n facebook_followers = facebook_followers.chop.chop.chop+\"k\"\n end\n @outlet.update(facebook_likes: facebook_followers)\n end\n end\n\n # insta follower test\n # if @outlet.instagram.present?\n # url = \"https://www.instagram.com/web/search/topsearch/?query=#{@outlet.name}\"\n # insta_response = HTTParty.get url\n # insta_followers = insta_response[\"users\"].first[\"user\"][\"byline\"].chomp(\" followers\")\n # if insta_followers.present?\n # @outlet.update(instagram_followers: insta_followers)\n # end\n # end\n\n\n\n if @outlet.update(outlet_params)\n\n # format.html { redirect_to edit_outlet_path(@outlet), notice: 'Outlet was successfully updated.' }\n render json: {status:\"Update successful\", outlet: @outlet}\n else\n # format.html { render :edit }\n # format.json { render json: @outlet.errors, status: :unprocessable_entity }\n render json: {status:\"Update unsuccessful\", outlet: @outlet, error: Rails.logger.info(@outlet.errors.inspect)}\n end\n # end\n end", "def update\n # @advertisement = Advertisement.find(params[:id])\n respond_to do |format|\n if @advertisement.update_attributes(params[:advertisement])\n format.html { redirect_to @advertisement, notice: 'Advertisement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @advertisement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dutydeal.update(dutydeal_params)\n format.html { redirect_to @dutydeal, notice: 'Dutydeal was successfully updated.' }\n format.json { render :show, status: :ok, location: @dutydeal }\n else\n format.html { render :edit }\n format.json { render json: @dutydeal.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @rateddeal = Rateddeal.find(params[:id])\n @rateddeal.destroy\n\n respond_to do |format|\n format.html { redirect_to rateddeals_url }\n format.json { head :no_content }\n end\n end", "def set_diary_entry\n @diary_entry = DiaryEntry.find(params[:id])\n end", "def update\n if @diet.nil?\n send_error_json(nil, \"Param 'diet' missing\", 400)\n return\n end\n\n if !check_owner()\n send_error_json(@diet.id, 'Unauthorized', 403)\n return\n end\n\n fav = true\n if params['diet'].nil? || params['diet']['favourite'].nil? || params['diet']['favourite']=='false'\n fav = false\n end\n update_hash = {:favourite => fav}\n if params['diet'] && params['diet']['amount']\n update_hash[:amount] = params['diet']['amount'].to_f\n end\n if params['diet'] && params['diet']['food_type_name']\n ft = FoodType.where(name: params['diet']['food_type_name']).first\n if !ft.nil?\n amount = @diet.amount\n if !update_hash[:amount].nil?\n amount = update_hash[:amount].to_f\n end\n update_hash[:food_type_id] = ft.id\n update_hash[:name] = ft.name\n # update_hash[:calories] = amount*ft.kcal\n # update_hash[:carbs] = amount*ft.carb\n # update_hash[:fat] = amount*ft.fat\n # update_hash[:prot] = amount*ft.prot\n else\n send_error_json(@diet.id, \"Invalid food type\", 400)\n return\n end\n\n end\n\n if @diet.update_attributes(update_hash)\n send_success_json(@diet.id, { diet_name: @diet.diet_name})\n else\n send_error_json(@diet.id, @diet.errors.full_messages.to_sentence, 400)\n end\n\n end", "def update\n @desease = Desease.find(params[:id])\n\n for id in params[:symptoms_id] do\n @SOD = SymptomsOfDesease.find_or_create_by(desease_id: params[:id], symptom_id: id) \n end\n\n\n if @desease.update(desease_params)\n render json: @desease, status: :ok\n else\n render json: @desease.errors, status: :unprocessable_entity\n end\n end", "def delete_deals(**args)\n params = parameters(args) do\n required_params :ids\n optional_params :ids\n end\n request(:delete, 'deals', params)\n end", "def update\n @disclaimer = Disclaimer.find(params[:id])\n @disclaimers = Disclaimer.all\n\n respond_to do |format|\n if @disclaimer.update_attributes(params[:disclaimer])\n @disclaimers = Disclaimer.all\n format.html { redirect_to @disclaimer, notice: 'Disclaimer was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disclaimer.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def details\n @daily_deal = DailyDeal.find(params[:id])\n respond_to do |format|\n format.json do\n render with_api_version\n end\n end\n end", "def update\n @nepal = Nepal.find(params[:id])\n\n if @nepal.update(nepal_params)\n head :no_content\n else\n render json: @nepal.errors, status: :unprocessable_entity\n end\n end", "def update\n @incident = Incident.find(params[:id])\n\n if @incident.update(incident_params)\n head :no_content\n else\n render json: @incident.errors, status: :unprocessable_entity\n end\n end", "def update\n @diet = @profile.diets.find(params[:id])\n\n if @diet.update_attributes(params[:diet])\n redirect_to profile_diets_url, notice: 'Diet was successfully updated.'\n else\n render json: @diet.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @incidentfollowup.update(incidentfollowup_params)\n format.html { redirect_to @incidentfollowup, notice: 'Incidentfollowup was successfully updated.' }\n format.json { render :show, status: :ok, location: @incidentfollowup }\n else\n format.html { render :edit }\n format.json { render json: @incidentfollowup.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @descuento_adicional.update(descuento_adicional_params)\n format.html { redirect_to @descuento_adicional, notice: 'Descuento adicional was successfully updated.' }\n format.json { render :show, status: :ok, location: @descuento_adicional }\n else\n format.html { render :edit }\n format.json { render json: @descuento_adicional.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_deal_costs(deal)\n end", "def update\n respond_to do |format|\n if @is_adisease.update(is_adisease_params)\n format.html { redirect_to @is_adisease, notice: 'Is adisease was successfully updated.' }\n format.json { render :show, status: :ok, location: @is_adisease }\n else\n format.html { render :edit }\n format.json { render json: @is_adisease.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @life_insurance.update_attributes(params[:life_insurance])\n format.html { redirect_to @life_insurance, notice: 'Life insurance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @life_insurance.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @indicator.update(indicator_params)\n format.html { redirect_to @indicator, notice: 'Indicator was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @indicator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @indicator.update(indicator_params)\n format.html { redirect_to indicators_url, notice: 'El indicador fue editada con exitó.' }\n format.json { render :show, status: :ok, location: @indicator }\n else\n format.html { render :edit }\n format.json { render json: @indicator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @meal_dish.update(meal_dish_params)\n format.html { redirect_to @meal_dish, notice: 'Meal dish was successfully updated.' }\n format.json { render :show, status: :ok, location: @meal_dish }\n else\n format.html { render :edit }\n format.json { render json: @meal_dish.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interview = Interview.find_by_slug(params[:id])\n\n respond_to do |format|\n if @interview.update_attributes(params[:interview])\n format.html { redirect_to admin_interviews_path, notice: 'Interview was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interview.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_office_deal\n @office_deal = OfficeDeal.find(params[:id])\n end", "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "def index\n # get meals from the user\n @meals = @user.meals\n # create a new meal for the ajax form to use\n @meal = Meal.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @meals }\n end\n end" ]
[ "0.70068854", "0.6845842", "0.6303114", "0.6112209", "0.60578895", "0.6015678", "0.5994354", "0.5973067", "0.59025025", "0.5893698", "0.58505094", "0.57922506", "0.5790554", "0.5773207", "0.57716906", "0.5769531", "0.5755647", "0.57473904", "0.57334137", "0.5710389", "0.5694804", "0.56947905", "0.5674723", "0.5664158", "0.5658818", "0.56430334", "0.56430334", "0.56430334", "0.56430334", "0.56430334", "0.56430334", "0.56430334", "0.5637216", "0.5636322", "0.5587679", "0.5584448", "0.55828303", "0.55809957", "0.5572964", "0.5570364", "0.5566555", "0.5551858", "0.5541355", "0.55385303", "0.5536514", "0.5530699", "0.5517895", "0.5507964", "0.5499211", "0.5498348", "0.54963744", "0.54755944", "0.5449845", "0.5446557", "0.5445851", "0.5442003", "0.54385805", "0.5437856", "0.54355335", "0.5427224", "0.54263836", "0.54163235", "0.5413485", "0.5412163", "0.54083127", "0.5406885", "0.54048276", "0.53948754", "0.53907746", "0.53889424", "0.5385034", "0.5379946", "0.53787035", "0.5376378", "0.5366753", "0.5364632", "0.53488326", "0.5344371", "0.5343043", "0.53424335", "0.5341951", "0.5340506", "0.53404164", "0.5334004", "0.53337204", "0.53249264", "0.5322176", "0.53177094", "0.5317175", "0.5315735", "0.53116643", "0.5310775", "0.5309882", "0.5308768", "0.5306594", "0.53055924", "0.5303731", "0.53026056", "0.52969605", "0.5287565" ]
0.6650477
2
DELETE /insider_deals/1 DELETE /insider_deals/1.json
def destroy @insider_deal = InsiderDeal.find(params[:id]) @insider_deal.destroy respond_to do |format| format.html { redirect_to insider_deals_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_deals(**args)\n params = parameters(args) do\n required_params :ids\n optional_params :ids\n end\n request(:delete, 'deals', params)\n end", "def delete_deal(id)\n delete(\"deals/#{id}\")\n end", "def destroy\n @indication_for_meal.destroy\n respond_to do |format|\n format.html { redirect_to indication_for_meals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @meal.destroy\n\n respond_to do |format|\n format.html { redirect_to meals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @meal = Meal.find(params[:id])\n @meal.destroy\n\n respond_to do |format|\n format.html { redirect_to meals_url }\n format.json { head :no_content }\n end\n end", "def delete_deal(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:delete, \"deals/#{id}\", params)\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n # @deal = Deal.find(params[:id])\n @deal.destroy\n respond_to do |format|\n format.html { redirect_to deals_url }\n format.json { head :ok }\n end\n end", "def destroy\n @dental = Dental.find(params[:id])\n @dental.destroy\n\n respond_to do |format|\n format.html { redirect_to dentals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deals_wizard = DealsWizard.find(params[:id])\n @deals_wizard.destroy\n\n respond_to do |format|\n format.html { redirect_to deals_wizards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deal = Deal.find(params[:id])\n @deal.destroy\n\n respond_to do |format|\n format.html { redirect_to deals_url }\n format.json { head :ok }\n end\n end", "def destroy\n @deal.destroy\n respond_to do |format|\n format.html { redirect_to deals_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @drip = Drip.find(params[:id])\n @drip.destroy\n\n respond_to do |format|\n format.html { redirect_to drips_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @redeemed_deal = RedeemedDeal.find(params[:id])\n @redeemed_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to redeemed_deals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deal = Deal.find(params[:id])\n @deal.destroy\n\n respond_to do |format|\n format.html { redirect_to deals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deal = Deal.find(params[:id])\n @deal.destroy\n\n respond_to do |format|\n format.html { redirect_to deals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @inspiration.destroy\n render json: @inspiration\n end", "def destroy\n @rateddeal = Rateddeal.find(params[:id])\n @rateddeal.destroy\n\n respond_to do |format|\n format.html { redirect_to rateddeals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @meal_dish.destroy\n respond_to do |format|\n format.html { redirect_to meal_dishes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item_adicional.destroy\n respond_to do |format|\n format.html { redirect_to item_adicionals_url, notice: 'Item adicional was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n meal = Meal.find(params[:id])\n meal.destroy\n respond_to do |format|\n format.html { redirect_to meals_url, notice: 'Meal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n # @retailer = Retailer.find(params[:id], :include => [:deals] )\n if [email protected]\n @retailer.destroy\n else\n flash[:notice] = \"That Retailer cannot be deleted because it has #{@retailer.deals.size} deals\"\n end\n respond_to do |format|\n format.html { redirect_to retailers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\nrender json: 1\n end", "def destroy\n @deal = Deal.find(params[:id])\n @deal.destroy\n\n respond_to do |format|\n format.html { redirect_to(deals_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @meal.destroy\n respond_to do |format|\n format.html { redirect_to meals_url, notice: 'Meal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @daily_deal.destroy\n respond_to do |format|\n format.html { redirect_to daily_deals_url, notice: 'Daily deal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @nail_salon = NailSalon.find(params[:id])\n @nail_salon.destroy\n\n respond_to do |format|\n format.html { redirect_to nail_salons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @advertisement = Advertisement.find(params[:id])\n @advertisement.destroy\n respond_to do |format|\n format.html { redirect_to advertisements_url }\n format.json { head :ok }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @dutydeal.destroy\n respond_to do |format|\n format.html { redirect_to dutydeals_url, notice: 'Dutydeal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @diet_dish.destroy\n respond_to do |format|\n format.html { redirect_to diet_dishes_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @rental = Rental.find(params[:id])\n @rental.destroy\n\n respond_to do |format|\n format.html { redirect_to rentals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if @diet.destroy\n head :no_content, status: 200\n else\n render json: @diet.errors, status: 405\n end\n end", "def destroy\n @life_insurance.destroy\n\n respond_to do |format|\n format.html { redirect_to life_insurances_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @institucional = Institucional.find(params[:id])\n @institucional.destroy\n\n respond_to do |format|\n format.html { redirect_to institucionals_url }\n format.json { head :ok }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end \n end", "def destroy\n @donate.destroy\n\n respond_to do |format|\n format.html { redirect_to(donates_url) }\n format.json { head :no_content }\n end\n end", "def destroy\n @donate.destroy\n\n respond_to do |format|\n format.html { redirect_to(donates_url) }\n format.json { head :no_content }\n end\n end", "def destroy\n @dinosaur = Dinosaur.find(params[:id])\n @dinosaur.destroy\n\n respond_to do |format|\n format.html { redirect_to dinosaurs_url }\n format.json { head :ok }\n end\n end", "def destroy\n @cooked_meal.destroy\n respond_to do |format|\n format.html { redirect_to cooked_meals_url, notice: 'Cooked meal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @indicator_federation.destroy\n respond_to do |format|\n format.html { redirect_to @indicator_federation.indicator}\n format.json { head :no_content }\n end\n end", "def destroy\n @life_insurance.destroy\n respond_to do |format|\n format.html { redirect_to life_insurances_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diary = Diary.find(params[:id])\n @diary.destroy\n\n respond_to do |format|\n format.html { redirect_to diaries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diary_entry.destroy\n respond_to do |format|\n format.html { redirect_to diary_entries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @income_entry = IncomeEntry.find(params[:id])\n @income_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to income_entries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deal.destroy\n respond_to do |format|\n format.html { redirect_to deals_url, notice: 'Deal was successfully destroyed.' }\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 @mealplan_meal.destroy\n respond_to do |format|\n format.html { redirect_to mealplan_meals_url, notice: 'Mealplan meal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @indicator.destroy\n respond_to do |format|\n format.html { redirect_to indicators_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @item = @deal.items.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to (deal_items_path(@deal)) }\n format.json { head :no_content }\n end\n end", "def destroy\n @meal = Meal.find(params[:id])\n @meal.destroy\n\n respond_to do |format|\n format.js\n format.html { redirect_to list_path(@list) }\n format.json { head :ok }\n end\n end", "def destroy\n @dis_alcohol_interaction.destroy\n respond_to do |format|\n format.html { redirect_to dis_alcohol_interactions_url, notice: 'Dis alcohol interaction was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @exalt = Exalt.find(params[:id])\n @exalt.destroy\n\n respond_to do |format|\n format.html { redirect_to exalts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @descuento_adicional.destroy\n respond_to do |format|\n format.html { redirect_to descuento_adicionals_url, notice: 'Descuento adicional was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @business_deal = BusinessDeal.find(params[:id])\n @business_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to(business_deals_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @advertisement = Advertisement.find(params[:id])\n @advertisement.destroy\n\n respond_to do |format|\n format.html { redirect_to advertisements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dinosaur.destroy\n head :no_content\n end", "def destroy\n @meal_dish.destroy\n respond_to do |format|\n format.html { redirect_to meal_dishes_url, notice: 'Meal dish was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @office_deal.destroy\n respond_to do |format|\n format.html { redirect_to office_deals_url, notice: 'Office deal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @yahoo_deal = YahooDeal.find(params[:id])\n @yahoo_deal.destroy\n\n respond_to do |format|\n format.html { redirect_to yahoo_deals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @initiative = Initiative.find(params[:id])\n @initiative.destroy\n\n respond_to do |format|\n format.html { render :nothing => true }\n #format.html { redirect_to initiatives_url }\n format.json { head :ok }\n end\n end", "def destroy\n @manage_advertisement.destroy\n respond_to do |format|\n format.html { redirect_to manage_advertisements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @creative.destroy\n respond_to do |format|\n format.html { redirect_to creatives_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diapo = current_church.diapos.find(params[:id])\n @diapo.destroy\n\n respond_to do |format|\n format.html { redirect_to diapos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interesting = Interesting.find(params[:id])\n @interesting.destroy\n\n respond_to do |format|\n format.html { redirect_to interestings_url }\n format.json { head :ok }\n end\n end", "def destroy\n @annex = Annex.find(params[:id])\n @annex.destroy\n\n respond_to do |format|\n format.html { redirect_to annexes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @inspiration.destroy\n respond_to do |format|\n format.html { redirect_to inspirations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @initiative = Initiative.find(params[:id])\n @initiative.destroy\n\n respond_to do |format|\n format.html { redirect_to initiatives_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @meal = Meal.find(params[:id])\n @meal.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_subject_meals_url(@test_subject)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @meal = Meal.find(params[:id])\n @meal.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_subject_meals_url(@test_subject)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @disease = Disease.find(params[:id])\n @disease.destroy\n\n respond_to do |format|\n format.html { redirect_to diseases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ally.destroy\n respond_to do |format|\n format.html { redirect_to allies_url, notice: 'Ally was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @ally.destroy\n respond_to do |format|\n format.html { redirect_to allies_url, notice: 'Ally was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\n @meal = @meal_recipe.meal\n \n @meal_ingredient = MealIngredient.new\n @meal_plan = @meal_recipe.meal.day.meal_plan\n @meal_recipe.destroy\n\n\n respond_to do |format|\n format.turbo_stream\n format.html { redirect_to meal_plan_path(@meal_plan), notice: \"Meal recipe was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @accident_item.destroy\n respond_to do |format|\n format.html { redirect_to accident_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @group_meal = GroupMeal.find(params[:id])\n @group_meal.destroy\n\n respond_to do |format|\n format.html { redirect_to group_meals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_meal.destroy\n respond_to do |format|\n format.html { redirect_to user_meals_url, notice: 'User meal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @alco_drink.destroy\n respond_to do |format|\n format.html { redirect_to alco_drinks_url, notice: 'Alco drink was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @hotdeal.destroy\n respond_to do |format|\n format.html { redirect_to hotdeals_url, notice: 'Hotdeal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end", "def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diary_entry.destroy\n respond_to do |format|\n format.html { redirect_to diary_entries_url, notice: 'Dagbogsnotatet er slettet' }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_initiative.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_initiatives_url, notice: 'Initiative was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @meals_recipe = MealsRecipe.find(params[:id])\n @meals_recipe.destroy\n\n respond_to do |format|\n format.html { redirect_to(meals_recipes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ingredients_nutrient.destroy\n respond_to do |format|\n format.html { redirect_to ingredients_nutrients_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 @meal_profile = MealProfile.find(params[:id])\n @meal_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n loaded = Cloudinary::Uploader.destroy(\"advertises/#{@admin_advertise.id}\", :public_id => \"advertises/#{@admin_advertise.id}\", :invalidate => true)\n @admin_advertise.destroy\n respond_to do |format|\n format.html { redirect_to admin_advertises_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lead_entry.destroy\n respond_to do |format|\n format.html { redirect_to lead_entries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @incidentfollowup.destroy\n respond_to do |format|\n format.html { redirect_to incidentfollowups_url, notice: 'Incidentfollowup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @advertise.destroy\n respond_to do |format|\n format.html { redirect_to advertises_url, notice: \"Advertise was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @dis_ingredient.destroy\n respond_to do |format|\n format.html { redirect_to dis_ingredients_url, notice: 'Dis ingredient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @advertise.destroy\n respond_to do |format|\n format.html { redirect_to advertises_url, notice: 'Advertise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @investable.destroy\n respond_to do |format|\n format.html { redirect_to investables_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @getadvice = Getadvice.find(params[:id])\n @getadvice.destroy\n\n respond_to do |format|\n format.html { redirect_to getadvices_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @investigated.destroy\n respond_to do |format| \n format.json { head :no_content }\n end\n end" ]
[ "0.72750014", "0.7159613", "0.7132272", "0.70671576", "0.69881845", "0.6947858", "0.6928096", "0.6927918", "0.69083047", "0.68798894", "0.68449533", "0.68394977", "0.68361306", "0.68330336", "0.6819761", "0.681649", "0.681649", "0.6807833", "0.68037516", "0.68017596", "0.6776698", "0.6768954", "0.6764178", "0.67563343", "0.674387", "0.67177165", "0.67036825", "0.66840106", "0.6670264", "0.66623485", "0.6660532", "0.6657891", "0.665059", "0.6643915", "0.66415644", "0.66202897", "0.6605003", "0.6597989", "0.65919906", "0.6586694", "0.6586694", "0.65799266", "0.65756327", "0.6569378", "0.6568604", "0.65683246", "0.6566309", "0.6561665", "0.65612507", "0.6558998", "0.6551986", "0.655057", "0.65422535", "0.6541166", "0.65411425", "0.65408283", "0.6537186", "0.6536537", "0.6534929", "0.6525913", "0.65225095", "0.6515809", "0.6511858", "0.6507582", "0.65047634", "0.6504521", "0.64939266", "0.6492314", "0.6490858", "0.6488672", "0.648539", "0.6478636", "0.6478636", "0.64691687", "0.6468777", "0.6468777", "0.6464289", "0.646298", "0.6442969", "0.6442328", "0.6441606", "0.64388305", "0.6436212", "0.64333797", "0.64330006", "0.64320123", "0.6431982", "0.6425682", "0.6424736", "0.6424637", "0.64243865", "0.6422188", "0.64210016", "0.64176625", "0.6417422", "0.6417414", "0.6416777", "0.6416732", "0.641452", "0.6412842" ]
0.7527548
0
Layouts that are required before any other layout can be loaded. This is because other layouts reference these. They cannot extend any layout that isn't defined in itself.
def pre_layouts ['layouts/borders.yml', 'layouts/debug.yml'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _conditional_layout?; end", "def place_in_layout?; end", "def place_in_layout?; end", "def layout\n nil\n end", "def layouts; end", "def layouts; end", "def layout\n nil\n end", "def allow_layout?\n true\n end", "def no_layout?; end", "def static_layout\n nil\n end", "def _implied_layout_name; end", "def default_layout\n nil\n end", "def layout\n lookup_layout\n end", "def set_layout\n @layoutme = 1\n end", "def layout; end", "def register_layout_setup\n @tab = :register\n end", "def layouts\n raise Nanoc3::Errors::DataNotYetAvailable.new('Layouts', true) unless @layouts_loaded\n @layouts\n end", "def all_layout_packages(validate = true)\n default_packages(validate)\n end", "def layout\n self.class.layout || @app.layout\n end", "def layout_available?\n if !@_layout_available\n @_layout_available = @site.layouts.include? @layout\n end\n @_layout_available\n end", "def validate_layout(layout); end", "def kopal_layout_after_body_start\n\n end", "def place_in_layout?\n !(asset_file? || yaml_file? || no_layout?)\n end", "def kopal_layout_before_page_sidebar\n\n end", "def kopal_layout_before_page_header\n\n end", "def kopal_layout_before_page_front\n\n end", "def exempt_from_layout?\n false\n end", "def set_layout\n if request.xhr?\n self.class.layout false\n else\n self.class.layout \"application\"\n end\n end", "def set_layout\n if 1==1\n 'application'\n else\n 'dean'\n end\n end", "def place_in_layout?\n !(asset_file? || no_layout?)\n end", "def set_stall_layout\n return false if request.xhr?\n return Stall.config.default_layout if Stall.config.default_layout\n\n parent_controller = self.class.ancestors.find do |ancestor|\n !ancestor.name.to_s.match(/^Stall::/) && Class === ancestor\n end\n\n parent_controller._layout ||= 'application'\n end", "def kopal_layout_before_page_footer\n\n end", "def app_layout\n layout_content = read_view :application, :folder => 'layouts' #, :type => :erb\n\n [:alert, :notice].each{|name| insert_flash_displayer name}\n end", "def action_has_layout?; end", "def layout\n @layout\n end", "def layouts=(_arg0); end", "def layouts=(_arg0); end", "def kopal_layout_before_page_meta\n\n end", "def require_theme_deps; end", "def layout()\n layout_children()\n end", "def kopal_layout_after_page_header\n\n end", "def kopal_layout_after_page_front\n\n end", "def layout\n @layout ||= layout_class.new(@rack_context)\n end", "def app_layout\n layout_content = read_view :layouts => :application \n [:alert, :notice].each{|name| insert_flash_displayer name, layout_content}\n end", "def ignore_layout(&block)\n @ignore_layout = block\n end", "def get_layout\n layout ||= Spree::Frontend::Config[:layout]\n end", "def layout_children\n \n end", "def default_layout_for_request\n layout =\n case\n when params[:_layout] || params[:layout]\n l = params[:_layout] || params[:layout]\n l == 'false' ? false : l\n when request.xhr? || params[:xhr]\n false\n else\n default_layout\n end\n end", "def ensure_configuration!\n halt haml(:setup, :'layouts/default') unless configured?\n end", "def get_layout\n ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)\n ControllerHelpers::Common is deprecated and will be removed in Spree 5.0.\n DEPRECATION\n return unless defined?(Spree::Frontend)\n\n layout ||= Spree::Frontend::Config[:layout]\n end", "def set_stall_layout\n return false if request.xhr?\n return Stall.config.checkout_layout if Stall.config.checkout_layout\n\n super\n end", "def read_layouts\n base = File.join(self.source, \"_layouts\")\n entries = Dir.entries(base)\n entries = entries.reject { |e| File.directory?(e) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def read_layouts\n base = File.join(self.source, \"_layouts\")\n entries = Dir.entries(base)\n entries = entries.reject { |e| File.directory?(e) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def layout(layout_type)\n\t\t#most content. that is loaded into the artist content area (just content)\n\t\tif layout_type.nil? || layout_type.blank?\n\t\t\t@layout = false\n\t\t\t@hook = \"#content\"\n\t\t#when artist page has to be loaded (logo, nave and content)\n\t\telsif layout_type == \"artist\"\n\t\t\t@layout = \"layouts/artist_admin_and_artist_floating_content.html.erb\"\n\t\t\t@hook = \".dynamicContent\"\n\t\tend\n\tend", "def setup_layouts\n @content_layouts = []\n get_layouts(File.join(::Rails.root.to_s, 'app', 'views', 'layouts')).each do |layout|\n @content_layouts << OpenStruct.new(:name => layout.titleize, :value => layout)\n end\n end", "def custom_layout\n case action_name\n when \"industry_xls\"\n \"no_layout\"\n when \"supplier_profiles\"\n \"no_layout\"\n when \"total_xls\"\n \t \"no_layout\"\n when \"industry_level\"\n \"no_layout\"\n when \"supplier_level\"\n \"no_layout\"\n when \"company_xls\"\n \t\"no_layout\"\n when \"customer_record\"\n \t\"no_layout\"\n when \"most_company_xls\"\n \t\"no_layout\"\n when \"conversion_industry\"\n \t\"no_layout\"\n when \"conversion_company\"\n \t\"no_layout\"\n when \"company_xls\"\n \t\"no_layout\"\t\n when \"suppliers_profiles\"\n \t\"no_layout\"\n when \"registered_suppliers\"\n \t\"no_layout\"\n when \"unregistered_suppliers\"\n \t\"no_layout\"\n when \"all_customers\"\n \t\"no_layout\"\n when \"jagent\"\n \t\"no_layout\"\n when \"sagent\"\n \t\"no_layout\"\n when \"poll\"\n \"no_layout\"\t\n when \"industry_conversion\"\n \"no_layout\"\t\n when \"company_conversion\"\t\t\n \"no_layout\"\n when \"reviews_processed\"\n \"no_layout\"\n when \"agent_output\"\n \"no_layout\"\n when \"agent_performance\"\n \"no_layout\"\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n else\n \"admin\"\n end\n end", "def layout\n return @layout if @layout\n return if no_layout?\n\n @layout = site.layouts[data.layout].tap do |layout|\n unless layout\n Bridgetown.logger.warn \"Generated Page:\", \"Layout '#{data.layout}' \" \\\n \"requested via #{relative_path} does not exist.\"\n end\n end\n end", "def read_layouts\n base, entries = folder_info(\"_layouts\")\n\n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(self, base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def layout_list_with_engine_additions\n plugin_layouts = Rails.plugins.by_precedence.map do |p| \n File.join(p.root, \"app\", \"views\", \"layouts\")\n end\n layout_list_without_engine_additions + Dir[\"{#{plugin_layouts.join(\",\")}}/**/*\"]\n end", "def layout\n case @mode\n when :injector\n \"injector\"\n when :page\n \"application\"\n else\n false\n end\n end", "def get_layout\n layout ||= Spree::Config[:layout]\n end", "def kopal_layout_after_page_sidebar\n\n end", "def ignore_layout?(env)\n @ignore_layout ||= IGNORE_LAYOUT\n @ignore_layout.call(env)\n end", "def set_layout\n\t \treturn \"landing\" if action_name == \"unregistered\"\n\t \tsuper\n\t end", "def layout(new_layout = nil)\n @layout = new_layout if new_layout\n @layout\n end", "def page_layout\n @user = User.current\n @blocks = @user.pref.my_page_layout\n end", "def admin_layout \n @admin_layout\n end", "def viewDidLoad\n if self.class.layout_definition\n name, properties, block = self.class.layout_definition\n layout(view, name, properties, &block)\n end\n\n layoutDidLoad\n end", "def read_layouts\n base = File.join(self.source, \"_layouts\")\n entries = Dir.entries(base)\n entries = entries.reject { |e| e[-1..-1] == '~' }\n entries = entries.reject { |e| File.directory?(File.join(base, e)) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def default_layout\n 'default' if html?\n end", "def layout layout = nil, *actions\n if (layout || layout == false) && configurable?\n @layouts ||= Hash.new\n layout = layout.to_s unless layout == false\n if actions.size == 0\n actions = ['*']\n @master_layout = layout\n end\n actions.each { |a| @layouts[a] = layout }\n end\n @setup[:layouts] ||= @layouts ||\n (@controller.ctrl.slice.view.layout if @controller) || {}\n end", "def layout \n return @layout\n end", "def layout(name=:default, &block)\n @layouts[name] = block\n end", "def set_radiant_layout\n @content_for_header_content = header_content_for_page('diagnostics')\n @content_for_body_class = body_class_for_page('diagnostics')\n @content_for_title_tag = title_tag_for_page('diagnostics')\n \n @radiant_layout = \"Default Layout\"\n end", "def invalid_layout?(layout); end", "def invalid_layout?(layout); end", "def load_layouts\n @layouts = []\n data_sources.each do |ds|\n layouts_in_ds = ds.layouts\n layouts_in_ds.each { |i| i.identifier = File.join(ds.layouts_root, i.identifier) }\n @layouts += layouts_in_ds\n end\n\n @layouts_loaded = true\n end", "def load_layout\n return unless cluster_config\n @all_volumes = {}\n @all_instances = {}\n load_attrs\n load_instances_and_volumes\n end", "def default_layout\n @default_layout ||= (\n IO.read(LIBDIR + \"/templates/layouts/page.mustache\")\n )\n end", "def assert_layout(expected)\n if expected\n assert @layouts.include?(\"layouts/#{expected}\"), \"Expected layout #{expected} in #{@layouts.keys.join(\", \")}\"\n else\n assert @layouts.keys.all? { |k| k.nil? }, \"Expected no layout, but had #{@layouts.inspect}\"\n end\n end", "def on_load\n layout (self.view, :root) do\n\n @title = subview(UILabel, :title)\n @username = subview(UITextField, :username, delegate: self)\n @password = subview(UITextField, :password, delegate: self)\n @login_button = subview(UIButton.custom, :login_button)\n @register_button = subview(UIButton.custom, :register_button)\n\n #auto do\n # metrics 'margin' => 20\n # #metrics '2margin' => 20\n #\n # vertical \"|-50-[title]-75-[username]-margin-[password(==80)]-margin-[login_button(==30)]->=20-[register_button(==40)]-margin-|\"\n # horizontal \"|-[title]-|\"\n # horizontal \"|-margin-[username]-margin-|\"\n # horizontal \"|[password]-margin-|\"\n # horizontal \"|-margin-[login_button]-margin-|\"\n # horizontal \"|-margin-[register_button]-margin-|\"\n #end\n end", "def determine_layout\n 'akinu'\n end", "def admin_layout\n render layout: 'admin_layout'\n end", "def user_layout_setup\n @tab = :user\n end", "def kopal_layout_after_page_meta\n\n end", "def render_layout(output, layout, info); end", "def read_layouts\n self.layouts = []\n layouts_dir = File.join(source_path, \"layouts\")\n entries = Dir.entries(layouts_dir).reject{|f| File.directory?(f)}\n entries.each do |name|\n self.layouts << Layout.new(layouts_dir, name)\n end\n end", "def layout(name=:layout, &block)\n return super(name, &block) if block_given?\n @_layout = name\n end", "def admin_layout\n self.class.layout \"admin\" if current_user && admin?(current_user)\n end", "def default_layout_for_request\n return params[:__layout] if params[:__layout]\n return params[:layout] if params[:layout]\n 'application'\n end", "def layout(sugar)\n # otherwise use standard layout for non moved residues?\n remove_layout(sugar)\n do_initial_layout(sugar)\n setup_scaling(sugar)\n seen_residues = do_chain_layout(sugar)\n seen_residues += do_stubs(sugar,seen_residues)\n do_basic_layout(sugar,seen_residues)\n do_box_layout(sugar)\n do_sibling_bunching(sugar)\n do_center_boxes_more(sugar)\n do_sibling_bunching(sugar)\n do_multi_residue_widening(sugar)\n class << sugar\n alias_method :uncondensed_box, :box\n def box\n box_block = lambda { |r|\n ! r.is_stub?\n }\n return uncondensed_box(&box_block)\n end\n end\n \n end", "def versao_layout_lote\n raise Brcobranca::NaoImplementado, 'Sobreescreva este método na classe referente ao banco que você esta criando'\n end", "def determine_layout\n return @__layout if @__layout\n return false if params[:_no_layout] || request.xhr?\n\n @__layout ||= current_page.layout.try(:template) if current_page.present? \n @__layout ||= 'application/default'\n @__layout\n end", "def default_layout?\n layout_type == \"default\"\n end", "def dynamic_layout\n # ALL THIS SUCKS, I KNOW..\n \n # No layout for AJAX calls\n @layout = if request.xhr? \n nil\n # dialog param = lightview popup\n elsif params[:dialog]\n 'dialog'\n # uses user 'role' name for layout ... bad\n elsif current_user && !current_user.role.nil?\n current_user.role.downcase\n # no user, check for 'about' action\n elsif controller_name == 'about'\n 'about'\n # none of the above, use Rails default\n else\n 'home'\n end\n return nil unless @layout\n \n Rails.logger.debug \"Dyamic layout = #{@layout}\"\n # Layouts further divided by site subdomain: www vs vault\n if current_subdomain == 'vault'\n # Then public vs logged in...ugh\n if current_user\n @layout = 'vault/private/' + @layout\n else\n @layout = 'vault/public/' + @layout\n end\n end\n @layout\n end", "def layout_available?(layout)\n !layout[\"hide\"] && !already_taken?(layout) && available_on_site?(layout)\n end", "def bootstrap\n check_config\n\n Patches::RoutesPatch::prepend\n\n # Rails classes patches\n ActionDispatch::Callbacks.to_prepare do\n unless Redmine::MenuManager::MenuHelper.included_modules.include? RedmineWikipub::Patches::MenuHelperPatch\n Redmine::MenuManager::MenuHelper.send(:include, Patches::MenuHelperPatch)\n end\n unless ApplicationHelper.included_modules.include? RedmineWikipub::Patches::ThemesPatch\n ApplicationHelper.send(:include, Patches::ThemesPatch)\n end\n unless ApplicationHelper.included_modules.include? RedmineWikipub::Patches::ViewHelperPatch\n ApplicationHelper.send(:include, Patches::ViewHelperPatch)\n end\n unless Mailer.included_modules.include? RedmineWikipub::Patches::MailerPatch\n Mailer.send(:include, Patches::MailerPatch)\n end\n unless AccountController.included_modules.include? RedmineWikipub::Patches::AccountControllerPatch\n AccountController.send(:include, Patches::AccountControllerPatch)\n end\n end\n end", "def layouts\n @layouts || site.layouts\n end", "def layout\n yield(layout_for) if block_given?\n layout_for\n end", "def place_in_layouts(content, payload, info)\n output = content.dup\n layout = layouts[document.data[\"layout\"].to_s]\n validate_layout(layout)\n\n used = Set.new([layout])\n\n # Reset the payload layout data to ensure it starts fresh for each page.\n payload[\"layout\"] = nil\n\n while layout\n output = render_layout(output, layout, info)\n add_regenerator_dependencies(layout)\n\n next unless (layout = site.layouts[layout.data[\"layout\"]])\n break if used.include?(layout)\n\n used << layout\n end\n output\n end" ]
[ "0.66217864", "0.65565944", "0.65565944", "0.64124334", "0.6405608", "0.6405608", "0.63531554", "0.62986344", "0.62765014", "0.6244893", "0.6230476", "0.61325073", "0.6119497", "0.61140275", "0.60864526", "0.60819787", "0.603059", "0.60141945", "0.5983115", "0.59819293", "0.59660476", "0.5956136", "0.59470516", "0.59186494", "0.59055763", "0.58991814", "0.58901876", "0.58814466", "0.5879395", "0.5853692", "0.5850985", "0.5826012", "0.58122844", "0.57871854", "0.5761128", "0.575655", "0.575655", "0.57494354", "0.5745946", "0.5719279", "0.56804967", "0.566624", "0.5658202", "0.5649373", "0.5643944", "0.5636466", "0.56330925", "0.56311053", "0.5612329", "0.55969524", "0.559266", "0.55683625", "0.55683625", "0.5564778", "0.55606323", "0.5560247", "0.5549568", "0.5547051", "0.5546076", "0.5542307", "0.5540072", "0.5539557", "0.55374146", "0.55339485", "0.55317533", "0.55276215", "0.55148625", "0.5511598", "0.5510337", "0.5506574", "0.5497973", "0.54966974", "0.5494899", "0.54751027", "0.5457752", "0.5457752", "0.5454724", "0.5452583", "0.54524446", "0.5442915", "0.54356074", "0.54220456", "0.5407527", "0.5405078", "0.540398", "0.5388455", "0.53793365", "0.5374435", "0.5350909", "0.53392833", "0.53285456", "0.53182185", "0.5310993", "0.53087735", "0.5304676", "0.5301165", "0.530102", "0.5296634", "0.529609", "0.5287873" ]
0.62447655
10
Layouts added after print and import specific layouts are included.
def base_layouts ['layouts/constants.yml'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def layouts; end", "def layouts; end", "def place_in_layout?; end", "def place_in_layout?; end", "def print_layouts\n STDOUT.puts @layouts.join(\"\\n\")\n exit 0\n end", "def set_layout\n @layoutme = 1\n end", "def place_in_layouts(content, payload, info)\n output = content.dup\n layout = layouts[document.data[\"layout\"].to_s]\n validate_layout(layout)\n\n used = Set.new([layout])\n\n # Reset the payload layout data to ensure it starts fresh for each page.\n payload[\"layout\"] = nil\n\n while layout\n output = render_layout(output, layout, info)\n add_regenerator_dependencies(layout)\n\n next unless (layout = site.layouts[layout.data[\"layout\"]])\n break if used.include?(layout)\n\n used << layout\n end\n output\n end", "def pre_layouts\n ['layouts/borders.yml', 'layouts/debug.yml']\n end", "def app_layout\n layout_content = read_view :application, :folder => 'layouts' #, :type => :erb\n\n [:alert, :notice].each{|name| insert_flash_displayer name}\n end", "def custom_layout\n case action_name\n when \"industry_xls\"\n \"no_layout\"\n when \"supplier_profiles\"\n \"no_layout\"\n when \"total_xls\"\n \t \"no_layout\"\n when \"industry_level\"\n \"no_layout\"\n when \"supplier_level\"\n \"no_layout\"\n when \"company_xls\"\n \t\"no_layout\"\n when \"customer_record\"\n \t\"no_layout\"\n when \"most_company_xls\"\n \t\"no_layout\"\n when \"conversion_industry\"\n \t\"no_layout\"\n when \"conversion_company\"\n \t\"no_layout\"\n when \"company_xls\"\n \t\"no_layout\"\t\n when \"suppliers_profiles\"\n \t\"no_layout\"\n when \"registered_suppliers\"\n \t\"no_layout\"\n when \"unregistered_suppliers\"\n \t\"no_layout\"\n when \"all_customers\"\n \t\"no_layout\"\n when \"jagent\"\n \t\"no_layout\"\n when \"sagent\"\n \t\"no_layout\"\n when \"poll\"\n \"no_layout\"\t\n when \"industry_conversion\"\n \"no_layout\"\t\n when \"company_conversion\"\t\t\n \"no_layout\"\n when \"reviews_processed\"\n \"no_layout\"\n when \"agent_output\"\n \"no_layout\"\n when \"agent_performance\"\n \"no_layout\"\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n else\n \"admin\"\n end\n end", "def render_layout(output, layout, info); end", "def layout; end", "def app_layout\n layout_content = read_view :layouts => :application \n [:alert, :notice].each{|name| insert_flash_displayer name, layout_content}\n end", "def layout_list_with_engine_additions\n plugin_layouts = Rails.plugins.by_precedence.map do |p| \n File.join(p.root, \"app\", \"views\", \"layouts\")\n end\n layout_list_without_engine_additions + Dir[\"{#{plugin_layouts.join(\",\")}}/**/*\"]\n end", "def _conditional_layout?; end", "def do_layout(payload, layouts)\n end", "def kopal_layout_after_page_sidebar\n\n end", "def kopal_layout_after_page_header\n\n end", "def layout()\n layout_children()\n end", "def print_layout\n [print_layout_application,\n print_layout_landfill_operator, print_layout_waste_producer,\n print_layout_waste_water_details, print_layout_banned_from_landfill,\n print_layout_about_the_waste, print_layout_about_water_content, print_layout_water_treatment,\n print_layout_start_date,\n { code: :sites,\n type: :object },\n print_layout_supporting_document,\n print_layout_declaration]\n end", "def inject_into_layout\n application_layout_path_prefix = 'app/views/layouts/application.html'\n\n api_key = ask 'What is your kit ID (leave blank to specify later):'\n api_key = '- YOUR KIT ID HERE -' if api_key.blank?\n\n layout_templates = { slim: { content: \" = typekit '#{api_key}'\", after: \"head\\n\" }}\n layout_templates[:erb] = { content: \" <%#{layout_templates[:slim][:content].lstrip} %>\", after: \"<head>\\n\" }\n\n layout_templates.each_pair do |lang,options|\n path = ::File.join(destination_root, \"#{application_layout_path_prefix}.#{lang}\")\n if ::File.exists?(path)\n inject_into_file path, after: options[:after] do\n \"#{options[:content]}\\n\"\n end\n end\n end\n end", "def register_layout_setup\n @tab = :register\n end", "def place_in_layouts(content, payload, info); end", "def _implied_layout_name; end", "def kopal_layout_before_page_footer\n\n end", "def render_all_layouts(layouts, payload, info); end", "def kopal_layout_after_body_start\n\n end", "def set_layout\n if %w( print plain ).include? params[:layout]\n params[:layout]\n else\n 'default'\n end\n end", "def layouts=(_arg0); end", "def layouts=(_arg0); end", "def allow_layout?\n true\n end", "def setup_layouts\n @content_layouts = []\n get_layouts(File.join(::Rails.root.to_s, 'app', 'views', 'layouts')).each do |layout|\n @content_layouts << OpenStruct.new(:name => layout.titleize, :value => layout)\n end\n end", "def build_layout\n year = Time.now.year\n add_call('Notification des abonnements électroniques', ->() { notifier })\n add_call(\"Extension des abonnements gratuits et d'échange de l'année #{year - 1}\", ->() { freesubs(year - 1) })\n add_call(\"Extension des abonnements gratuits et d'échange de l'année #{year}\", ->() { freesubs(year) })\n add_call('Création d\\'un abonnement collectif', ->() { collective_manager })\n add_call('Exploitation des abonnements collectifs', ->() { collective_exploitation })\n add_call('Recherche des tiers par facture', ->() { billing_manager })\n add_call('(Pour développeur) Fichiers de requête', ->() { sql_files })\n @layout.add_stretch\n end", "def kopal_layout_after_page_front\n\n end", "def kopal_layout_after_page_footer\n \n end", "def layout_children\n \n end", "def read_layouts\n self.layouts = []\n layouts_dir = File.join(source_path, \"layouts\")\n entries = Dir.entries(layouts_dir).reject{|f| File.directory?(f)}\n entries.each do |name|\n self.layouts << Layout.new(layouts_dir, name)\n end\n end", "def layout\n nil\n end", "def kopal_layout_after_page_meta\n\n end", "def layout\n nil\n end", "def layout(new_layout = nil)\n @layout = new_layout if new_layout\n @layout\n end", "def render_all_layouts(layouts, payload, info)\n renderer.layouts = layouts\n self.output = renderer.place_in_layouts(output, payload, info)\n ensure\n @renderer = nil # this will allow the modifications above to disappear\n end", "def configure_layout\n contributable = (@workflow || @pack || @blob)\n layout = nil\n\n # For testing skins\n if params[\"layout_preview\"]\n layout = Conf.layouts[params[\"layout_preview\"]]\n # Skins on resources\n elsif contributable && contributable.contribution && contributable.contribution.policy\n if contributable.contribution.policy.layout\n layout = Conf.layouts[contributable.contribution.policy.layout]\n if layout.nil?\n logger.error(\"Missing layout for #{contributable.class.name} #{contributable.id}: \"+\n \"#{contributable.contribution.policy.layout}\")\n end\n end\n # Skins on groups, or when in a group context\n elsif (network = @network) || (@context.is_a?(Network) && (network = @context))\n layout = network.layout\n end\n\n # Check skin exists\n if layout && layout[\"layout\"] && !File.exists?(\"#{RAILS_ROOT}/app/views/layouts/#{layout[\"layout\"]}.html.erb\")\n logger.error(\"Missing layout #{RAILS_ROOT}/app/views/layouts/#{layout[\"layout\"]}.html.erb\")\n layout = nil\n end\n\n # Use default skin if all else fails\n if layout.nil?\n @layout = {\"layout\" => 'application', \"stylesheets\" => [Conf.stylesheet]}\n else\n @layout = layout\n end\n\n @layout[\"layout\"]\n end", "def print_layout\n [print_layout_header,\n print_layout_ads_date_of_sale, print_layout_ads_main_address,\n print_layout_non_ads_claiming_amount, print_layout_ads_claiming_amount,\n { code: :taxpayers,\n type: :object },\n print_layout_bank_details,\n print_layout_authenticated_declarations,\n print_layout_unauthenticated_declarations]\n end", "def layout\n @layout\n end", "def kopal_layout_before_page_sidebar\n\n end", "def layout_contents\n @layout = <<-LAYOUT\n blueprint-deploy:\n layout: #{spec_bp_name} # name of the layout file we use\n blueprint : #{spec_bp_name} # name of the default blueprint\n servers:\n - server1:\n name: util\n applications:\n - app1:\n - app2:\n - server2:\n name: review\n applications:\n - app1:\n - app3:\n LAYOUT\n @layout\n end", "def layouts\n raise Nanoc3::Errors::DataNotYetAvailable.new('Layouts', true) unless @layouts_loaded\n @layouts\n end", "def load_layouts\n @layouts = []\n data_sources.each do |ds|\n layouts_in_ds = ds.layouts\n layouts_in_ds.each { |i| i.identifier = File.join(ds.layouts_root, i.identifier) }\n @layouts += layouts_in_ds\n end\n\n @layouts_loaded = true\n end", "def set_layout\n if 1==1\n 'application'\n else\n 'dean'\n end\n end", "def layout\n lookup_layout\n end", "def inside_layout(layout, &block)\n binding = block.binding if BINDING_REQUIRED\n\n layout = Dir.entries('app/views/layouts').detect { |a| /#{layout}/.match(a) }\n @template.instance_variable_set('@content_for_layout', capture(&block))\n concat(\n @template.render(:file => \"#{RAILS_ROOT}/app/views/layouts/#{layout}\", :user_full_path => true),\n binding\n )\n end", "def action_has_layout?; end", "def read_layouts\n base, entries = folder_info(\"_layouts\")\n\n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(self, base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def read_layouts\n base = File.join(self.source, \"_layouts\")\n entries = Dir.entries(base)\n entries = entries.reject { |e| File.directory?(e) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def read_layouts\n base = File.join(self.source, \"_layouts\")\n entries = Dir.entries(base)\n entries = entries.reject { |e| File.directory?(e) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def layout(layout_type)\n\t\t#most content. that is loaded into the artist content area (just content)\n\t\tif layout_type.nil? || layout_type.blank?\n\t\t\t@layout = false\n\t\t\t@hook = \"#content\"\n\t\t#when artist page has to be loaded (logo, nave and content)\n\t\telsif layout_type == \"artist\"\n\t\t\t@layout = \"layouts/artist_admin_and_artist_floating_content.html.erb\"\n\t\t\t@hook = \".dynamicContent\"\n\t\tend\n\tend", "def layout layout = nil, *actions\n if (layout || layout == false) && configurable?\n @layouts ||= Hash.new\n layout = layout.to_s unless layout == false\n if actions.size == 0\n actions = ['*']\n @master_layout = layout\n end\n actions.each { |a| @layouts[a] = layout }\n end\n @setup[:layouts] ||= @layouts ||\n (@controller.ctrl.slice.view.layout if @controller) || {}\n end", "def read_layouts\n base = File.join(self.source, \"_layouts\")\n entries = Dir.entries(base)\n entries = entries.reject { |e| e[-1..-1] == '~' }\n entries = entries.reject { |e| File.directory?(File.join(base, e)) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def generate_layout\n if options.sass?\n directory 'app'\n gem 'compass', '>=0.10.5'\n gem 'compass-960-plugin', '>=0.10.0'\n directory 'config'\n else\n copy_file \"stylesheet.css\", \"public/stylesheets/#{file_name}.css\" if options.stylesheet?\n copy_file \"handheld.css\", \"public/stylesheets/handheld.css\" if options.stylesheet?\n end\n copy_file \"modernizr-1.5.min.js\", \"public/javascripts/modernizr-1.5.min.js\"\n copy_file \"jquery-1.4.2.min.js\", \"public/javascripts/jquery-1.4.2.min.js\"\n copy_file \"dd_belatedpng.js\", \"public/javascripts/dd_belatedpng.js\"\n\n template \"layout.html.erb\", \"app/views/layouts/#{file_name}.html.erb\"\n copy_file 'layout_helper.rb', 'app/helpers/layout_helper.rb'\n end", "def layout\n\n raise \"Missing bulletin for layout object!\" if (! self.bulletin)\n \n raise \"Missing layout style/name for layout object!\" if (! self.name)\n\n # assume everything prepared if this is already set (caching!)\n return @layout if (@layout)\n\n # Load layout from the database\n while (! @layout)\n @layout = TempletLayout.find(:first, \n :conditions => ['templet_id = ? AND name = ?', self.bulletin.templet_id, self.name ])\n if !@layout and self.name == 'print'\n # set to main, if print layout not found\n self.name = 'main'\n elsif not @layout\n raise \"Invalid layout selected!\" if (! @layout) \n end\n end\n \n \n # copy the details accross for the layout\n self.filetype = @layout.filetype\n self.charset = @layout.charset\n \n return @layout\n end", "def _render_layout_for( res )\n return unless res.layout\n lyt = Resources.layouts.find :filename => res.layout\n return if lyt.nil?\n\n _track_rendering(lyt.path) {\n @content = Filters.process(\n self, lyt, ::Webby::Resources::File.read(lyt.path))\n _render_layout_for(lyt)\n }\n end", "def layout_fields\n \n end", "def layout_contents\n layout.render(self)\n end", "def admin_layout \n @admin_layout\n end", "def no_layout?; end", "def render_epub_layouts\n FileList.new(\"#{@LAYOUT_DIR}/epub/**/*.erb\").each do |layout|\n filename = layout.pathmap(\"%{^#{@LAYOUT_DIR},#{@BUILD_DIR}}X\")\n path = filename.pathmap('%d')\n\n FileUtils.mkpath(path) unless File.exists? path\n\n template = ERB.new(File.read(layout), nil, '-')\n File.open(filename, 'w+') do |handle|\n handle.write template.result(binding)\n end\n end\n\n FileList.new(\"#{@LAYOUT_DIR}/html/**/*.erb\").each do |layout|\n filename = layout.pathmap(\"%{^#{@LAYOUT_DIR},#{@BUILD_DIR}}X\")\n path = filename.pathmap('%d')\n\n FileUtils.mkpath(path) unless File.exists? path\n\n template = ERB.new(File.read(layout), nil, '-')\n File.open(filename, 'w+') do |handle|\n handle.write template.result(binding)\n end\n end\n end", "def kopal_layout_before_page_header\n\n end", "def place_in_layout?\n !(asset_file? || yaml_file? || no_layout?)\n end", "def create_defaults\n import_layout(self.layout_dir(:absolute => true))\n import_content(self.content_dir(:absolute => true))\n end", "def ignore_layout(&block)\n @ignore_layout = block\n end", "def validate_layout(layout); end", "def layout(name=:default, &block)\n @layouts[name] = block\n end", "def show\n @layout_details = {\n controller: params[:controller],\n action: params[:action],\n styles: [],\n other_styles: [\"scaffolds\"],\n scripts: [],\n other_scripts: [\"scaffolds\"]\n }\n\tend", "def all_layout_packages(validate = true)\n default_packages(validate)\n end", "def layout\n yield(monitoring_layout)\n monitoring_layout\n end", "def default_layout\n nil\n end", "def define_layout\n if user_signed_in?\n if current_user.student?\n case params['action']\n when \"show\"\n 'information_student' \n when \"events\"\n 'information_student'\n when \"frequency\"\n 'information_student' \n else\n 'student' \n end\n else\n if params['action'] == 'declaration_of_studying'\n 'print'\n else\n if params['action'] == 'daily'\n 'print'\n else\n if params['action'] == 'down_average'\n 'print'\n else\n if params['action'] == 'print'\n 'print'\n else\n if params['action'] == 'report_calendar'\n 'print'\n else\n if params['action'] == 'report_re_enrollments'\n 'print'\n else\n if params['action'] == 'report_schedules'\n 'print' \n else\n if params['action'] == 'report'\n 'print_not_head'\n else\n if params['action'] == 'report_teacher'\n 'print_not_head' \n else\n if params['action'] == 'buy_books'\n 'print_not_head'\n else\n if params['action'] == \"envelopes_for_exams\"\n 'print_not_head' \n else\n if params['controller'] == 'warnings' and params['action'] == 'show'\n 'print' \n else\n if params['controller'] == 'calendars' and params['action'] == 'show'\n nil \n else\n if params['controller'] == 'companies' and params['action'] == 'print_informations'\n 'print_head_javascript'\n else\n \n if params['controller'] == 'companies' and params['action'] == 'students_for_neighborhood'\n \"print\"\n else\n if params['controller'] == 'companies' and params['action'] == 'lists'\n \"print\"\n else\n if params['controller'] == 'companies' and params['action'] == 'students_for_level'\n \"print\"\n else\n nil \n end\n end \n end\n end\n end\n end\n end \n end\n end\n end\n end\n end\n end\n end\n end\n end\n \n end\n end\n else\n \"login\"\n end\n end", "def dynamic_layout\n # ALL THIS SUCKS, I KNOW..\n \n # No layout for AJAX calls\n @layout = if request.xhr? \n nil\n # dialog param = lightview popup\n elsif params[:dialog]\n 'dialog'\n # uses user 'role' name for layout ... bad\n elsif current_user && !current_user.role.nil?\n current_user.role.downcase\n # no user, check for 'about' action\n elsif controller_name == 'about'\n 'about'\n # none of the above, use Rails default\n else\n 'home'\n end\n return nil unless @layout\n \n Rails.logger.debug \"Dyamic layout = #{@layout}\"\n # Layouts further divided by site subdomain: www vs vault\n if current_subdomain == 'vault'\n # Then public vs logged in...ugh\n if current_user\n @layout = 'vault/private/' + @layout\n else\n @layout = 'vault/public/' + @layout\n end\n end\n @layout\n end", "def layout\n @current_layout ||= :default_layout\n send(\"#{@current_layout}\"){ yield }\n end", "def kopal_layout_before_page_front\n\n end", "def read_layouts\n base = options['layouts_path']\n entries = []\n Dir.chdir(base) { entries = filter_entries(Dir['*.*']) }\n \n entries.each do |f|\n name = f.split(\".\")[0..-2].join(\".\")\n self.layouts[name] = Layout.new(base, f)\n end\n rescue Errno::ENOENT => e\n # ignore missing layout dir\n end", "def place_in_layout?\n !(asset_file? || no_layout?)\n end", "def wrap_in_layout #:nodoc:\n if @options[:layout]\n ERB.new(@options[:layout]).result(binding)\n else\n yield\n end\n end", "def static_layout\n nil\n end", "def kopal_layout_before_body_close\n\n end", "def layout_4print\n return '' if @parent.params[:renderer].blank?\n opts = @opts.dup\n opts[:method] = @parent.params[:method]\n klass = (@parent.params[:renderer] + '_renderer').classify\n obj = Kernel.const_get(klass, Class.new).new(@parent, opts)\n# \n html = obj.render_html\n @css << obj.render_css.to_s\n html\nend", "def layout(name)\n $stderr.puts \"Overwriting Layout: #{self.class.def_layout.inspect} with #{name}\"\n @_layout = name\n end", "def page_layout\n @user = User.current\n @blocks = @user.pref.my_page_layout\n end", "def user_layout_setup\n @tab = :user\n end", "def _init_layout\n # when user gives a negative value, we recalc and overwrite so the need to save, for a redraw.\n @saved_width ||= @width\n @saved_height ||= @height\n\n lines = Ncurses.LINES - 1\n columns = Ncurses.COLS - 1\n if @height_pc\n @height = ((lines - @top_margin - @bottom_margin) * @height_pc).floor\n elsif @saved_height <= 0\n @height = lines - @saved_height - @top_margin - @bottom_margin\n end\n $log.debug \" layout height = #{@height} \"\n if @width_pc\n @width = ((columns - @left_margin - @right_margin) * width_pc).floor\n elsif @saved_width <= 0\n # if width was -1 we have overwritten it so now we cannot recalc it. it remains the same\n @width = columns - @saved_width - @left_margin - @right_margin\n end\n $log.debug \" layout wid = #{@width} \"\n # if user has not specified, then get all the objects\n @components ||= @form.widgets.select do |w| w.visible != false && !@ignore_list.include?(w.class.to_s.downcase); end\n $log.debug \" components #{@components.count} \"\n end", "def determine_layout\n 'akinu'\n end", "def admin_layout\n render layout: 'admin_layout'\n end", "def default_layout\n @user = User.current\n # remove block in all groups\n @user.pref[:my_page_layout] = nil\n @user.pref.save\n redirect_to :action => 'page_layout'\n end", "def set_layout\n response_code == 200 ? :\"layouts/application.#{@response.output_format}\" : nil\n end", "def admin_layout\n self.class.layout \"admin\" if current_user && admin?(current_user)\n end", "def layout\n return @layout if @layout\n return if no_layout?\n\n @layout = site.layouts[data.layout].tap do |layout|\n unless layout\n Bridgetown.logger.warn \"Generated Page:\", \"Layout '#{data.layout}' \" \\\n \"requested via #{relative_path} does not exist.\"\n end\n end\n end", "def _write_layout_method\n case @_layout\n when String\n self.class_eval %{def _layout() #{@_layout.inspect} end}\n when Symbol\n self.class_eval %{def _layout() #{@_layout} end}\n when false\n self.class_eval %{def _layout() end}\n else\n self.class_eval %{\n def _layout\n if view_paths.find_by_parts?(\"#{_implied_layout_name}\", {:formats => formats}, \"layouts\")\n \"#{_implied_layout_name}\"\n else\n super\n end\n end\n }\n end\n end", "def index\n @maker_layouts = MakerLayout.all\n end", "def add_footer_widgets\n view_context.render \"shared/widgets\", :context => 'mainlist', :position => 'footer'\n end", "def process_layout(config, widget_name)\n layout = nil\n layout_path = File.join(widget_name, 'layouts', \"#{config['layout']}.html\")\n [\n File.join(@ruhoh.paths.theme, \"widgets\", layout_path),\n File.join(@path, layout_path),\n File.join(@system_path, layout_path)\n ].each do |path|\n layout = path and break if File.exist?(path)\n end\n\n return '' unless layout\n content = File.open(layout, 'r:UTF-8') { |f| f.read }\n Mustache.render(content, {'config' => config})\n end" ]
[ "0.68598837", "0.68598837", "0.66209686", "0.66209686", "0.6521669", "0.6471198", "0.64672756", "0.64308906", "0.6391312", "0.63870806", "0.638481", "0.6361285", "0.63353616", "0.63321793", "0.63163805", "0.6298113", "0.6274739", "0.62632906", "0.62258065", "0.61966306", "0.6172155", "0.61700284", "0.60938716", "0.60843587", "0.6080872", "0.60707134", "0.6065313", "0.6047575", "0.60390836", "0.60390836", "0.6031271", "0.5976653", "0.59704524", "0.5947455", "0.59471214", "0.59386444", "0.59205794", "0.5916744", "0.589918", "0.58950317", "0.58842975", "0.5879392", "0.5860816", "0.5853413", "0.5808455", "0.57985055", "0.57941663", "0.57915527", "0.57758033", "0.5770665", "0.5769374", "0.57457715", "0.57375103", "0.5734043", "0.57266057", "0.57266057", "0.5719924", "0.5711653", "0.5705838", "0.5705285", "0.5698392", "0.5679463", "0.56751335", "0.56420606", "0.56295323", "0.5611816", "0.56025785", "0.5590998", "0.5582617", "0.55691016", "0.55637753", "0.5557593", "0.55544347", "0.5535606", "0.55301046", "0.55286723", "0.55181175", "0.55131036", "0.54836756", "0.54739106", "0.54691863", "0.5464127", "0.54588306", "0.54528147", "0.5449239", "0.5423799", "0.5417175", "0.54130214", "0.5408204", "0.54078376", "0.54047376", "0.53958243", "0.5394537", "0.53917426", "0.53836906", "0.53723323", "0.5361885", "0.5360508", "0.5350882", "0.5340954", "0.5340544" ]
0.0
-1
disable the callbacks that are used for workflow; this ensures that we control sgtate changes, etc better during ingest, and various other
def disable_workflow_callbacks # disable the allocate DOI callback LibraWork.skip_callback( :save, :after, :allocate_doi ) LibraWork.skip_callback( :update, :before, :update_doi ) # disable the email send callback LibraWork.skip_callback( :save, :after, :determine_email_behavior ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disable_callback_methods\n StashEngine::Resource.skip_callback(:create, :after, :init_state_and_version)\n # StashEngine::Resource.skip_callback(:create, :after, :create_share)\n end", "def disable_after_run_callback\n @after_run_callback_disabled = true\n end", "def replicate_disable_callbacks(instance)\n if ::ActiveRecord::VERSION::MAJOR >= 3\n # AR 3.1.x, 3.2.x\n def instance.run_callbacks(*args); yield if block_given?; end\n\n # AR 3.0.x\n def instance._run_save_callbacks(*args); yield if block_given?; end\n def instance._run_create_callbacks(*args); yield if block_given?; end\n def instance._run_update_callbacks(*args); yield if block_given?; end\n def instance._run_commit_callbacks(*args); yield if block_given?; end\n else\n # AR 2.x\n def instance.callback(*args)\n end\n def instance.record_timestamps\n false\n end\n end\n end", "def disable_approval!\n send(:remove_const, :DRAFT_PUNK_IS_SETUP) if const_defined? :DRAFT_PUNK_IS_SETUP\n send(:remove_const, :DRAFT_NULLIFY_ATTRIBUTES) if const_defined? :DRAFT_NULLIFY_ATTRIBUTES\n send(:remove_const, :ALLOW_PREVIOUS_VERSIONS_TO_BE_CHANGED) if const_defined? :ALLOW_PREVIOUS_VERSIONS_TO_BE_CHANGED\n fresh_amoeba do\n disable\n end\n end", "def skip_faye_callbacks\n Protocol.skip_callback :save, :after, :update_faye\n Participant.skip_callback :save, :after, :update_faye\n end", "def save_without_our_callbacks\n @save_without_our_callbacks = true\n save\n end", "def disabled_callbacks?\n @disable_callbacks\n end", "def disable_approval!\n send(:remove_const, :DRAFT_PUNK_IS_SETUP) if const_defined? :DRAFT_PUNK_IS_SETUP\n send(:remove_const, :DRAFT_NULLIFY_ATTRIBUTES) if const_defined? :DRAFT_NULLIFY_ATTRIBUTES\n fresh_amoeba do\n disable\n end\n end", "def save_without_validation_and_callbacks\n #disable callbacks\n @skip_callbacks = true\n save_with_validation(false)\n end", "def suppress_touch_callbacks(name)\n save, touch_callback_statuses[name] = touch_callback_statuses[name], true\n yield\n ensure\n touch_callback_statuses[name] = save\n end", "def disable!\n swap_out_delegator\n end", "def disable\n exclusively do\n @enabled = false\n @manual_toggle = true\n end\n\n save_state\n sync_control { stop_upkeep }\n end", "def without_callbacks\n prev_skip_callbacks = @skip_callbacks\n @skip_callbacks = true\n begin\n ret = yield\n ensure\n @skip_callbacks = prev_skip_callbacks\n end\n ret\n end", "def save_without_callbacks\n Need.skip_callback(:create, :after, :record_create_revision)\n Need.skip_callback(:update, :after, :record_update_revision)\n\n save_status = save\n\n Need.set_callback(:create, :after, :record_create_revision)\n Need.set_callback(:update, :after, :record_update_revision)\n\n save_status\n end", "def disable\n end", "def skip_actions; end", "def without_auditing(&block)\n auditing_was_enabled = auditing_enabled\n disable_auditing\n block.call\n ensure\n enable_auditing if auditing_was_enabled\n end", "def disable!\n tracers.each(&:disable!)\n end", "def without_approval(&block)\n memory = self.class.approvals_active # If we use #approvals_enabled? the global state might be incorrectly applied.\n self.class.approvals_off\n instance_eval &block\n ensure\n self.class.approvals_on if memory\n end", "def disable\n @enabled = false\n end", "def without_auditing\n auditing_was_enabled = auditing_enabled\n disable_auditing\n yield\n ensure\n enable_auditing if auditing_was_enabled\n end", "def disable!\n @enabled = false\n end", "def suppress_events\n self.events_suppressed = true\n yield\n self.events_suppressed = false\n end", "def disable(&block)\n @disable_block = block\n end", "def callback\n false\n end", "def disable_timestamp_callback\n if self.respond_to?(\"updated_at\")\n self.class.skip_callback(:save, :before, :update_timestamps ) if @@_disable_timestamp_count == 0\n @@_disable_timestamp_count += 1\n end\n end", "def ignore_state_changes!\n @ignore_state_changes = true\n end", "def disable!\n @enabled = false\n end", "def turned_off(options = {})\n turn_off!(options)\n\n begin\n yield\n ensure\n turn_on!\n end\n end", "def do_disable(transition)\n Rails.logger.info \"Transitioning #{login} from #{transition.from} to #{transition.to} via #{transition.event} event. Failing rules: #{failing_rules.map(&:name).join(', ')}.\"\n if Rails.application.settings.enforce_rules\n self.disabled_teams = remove_from_organizations\n end\n end", "def circumvent(&process)\n current_callbacks = @original_callbacks.keys.map do |object|\n [object, object.method(@callback_name)]\n end\n\n define_callbacks(@original_callbacks)\n\n begin\n @hooks.circumvent(&process)\n ensure\n define_callbacks(Hash[current_callbacks])\n end\n end", "def skip_reconfirmation_in_callback!; end", "def skip_email_changed_notification!; end", "def disable!\n self.enabled = false\n end", "def deactivate\n (self.class.deactivate_hooks + deactivate_hooks).each do |block|\n block.call self\n end\n end", "def ps_skip_callback?(_action)\n false\n end", "def without_fileclip_callback(&block)\n skip_callback :commit, :after, :process_fileclips!\n yield\n set_callback :commit, :after, :process_fileclips!\n end", "def types_that_skip_validation_and_callbacks\n @types_that_skip_validation_and_callbacks ||= [Task, *Task.descendants, Hearing, CavcRemand]\n end", "def action_disable\n super\n end", "def prepare_save!\n run_callbacks(:save) { false }\n end", "def without_auditing\n auditing_was_enabled = class_auditing_enabled\n disable_auditing\n yield\n ensure\n enable_auditing if auditing_was_enabled\n end", "def disable!\n @disabled = true\n end", "def disabled; end", "def model_reference_disable\n if respond_to? :disabled\n disable! force_save: true\n else\n @was_disabled = 'disabled'\n handle_save_triggers if respond_to? :handle_save_triggers\n end\n end", "def disabled(&_block)\n @disabled = true\n yield\n ensure\n @disabled = false\n end", "def disable_rollback\n data[:disable_rollback]\n end", "def inactivate_stop\n self.is_active = false\n self.send(:update_without_callbacks)\n end", "def skip_counter_callbacks\n SearchgovUrl.skip_callback :create, :after, :_update_counts_after_create\n SearchgovUrl.skip_callback :update, :after, :_update_counts_after_update\n end", "def on_workflow_cancel\n restore_status\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def clear_callbacks\r\n @callbacks = []\r\n end", "def skip_command_callback_nodes\n []\n end", "def transaction_disabled; end", "def disable\n @disabled = true\n end", "def prevent_callback_settings(*cb_method)\n {\n :class_name => self.class.to_s,\n :instance_id => id,\n :method_name => :check_policy_prevent_callback,\n :args => [*cb_method],\n :server_guid => MiqServer.my_guid\n }\n end", "def disable\n @queue << \"disable\"\n end", "def disable_pending_cops=(_arg0); end", "def disable\n \n orignial_state = @enabled\n @enabled = false\n \n if block_given?\n yield\n @enabled = orignial_state\n end\n \n return self\n \n end", "def disable\n disable_features :all\n end", "def clear_callbacks!\n fetch_or_create_callbacks.clear\n end", "def without_revision(&block)\n class_eval do\n CALLBACKS.each do |attr_name|\n alias_method \"orig_#{attr_name}\".to_sym, attr_name\n alias_method attr_name, :empty_callback\n end\n end\n block.call\n ensure\n class_eval do\n CALLBACKS.each do |attr_name|\n alias_method attr_name, \"orig_#{attr_name}\".to_sym\n end\n end\n end", "def stop_intercepting!\n @original_methods.each do |m|\n class_eval do\n alias_method m, \"intercepted_#{m}\"\n remove_method \"intercepted_#{m}\"\n end\n end\n\n class_eval do\n remove_method :synthesis_expectation\n remove_method :synthesis_expectation=\n end\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def deactivate; end", "def disable_threshold\n @enable_threshold = false\n end", "def clear_before_process_callbacks\n @before_process_callbacks = []\n end", "def deactivate()\n end", "def remove_callbacks(options)\n options.reject{|key, value| legacy_keys.include?(key)}\n end", "def activate_stop\n self.is_active = true\n self.send(:update_without_callbacks)\n end", "def reject_without_hooks!( & block )\n\n @without_hooks = true\n\n reject!( & block )\n \n @without_hooks = false\n\n return return_value\n\n end", "def enable_timestamp_callback\n if self.respond_to?(\"updated_at\")\n @@_disable_timestamp_count -= 1\n self.class.set_callback(:save, :before, :update_timestamps ) if @@_disable_timestamp_count == 0\n end\n end", "def disable\n @enabled = false\n disable_output_method if @output_method\n false\n end", "def smart_disable\n return unless $game_switches[Sw::FM_Enabled]\n $game_player.set_follower(nil, true)\n set_player_follower_particles(false)\n $game_switches[Sw::FM_WasEnabled] = $game_switches[Sw::FM_Enabled]\n $game_switches[Sw::FM_Enabled] = false\n end", "def off?; !self.on?; end", "def disable # :nodoc:\n @trace_point.disable\n end", "def skip_confirmation_notification!; end", "def transaction_disabled=(_arg0); end", "def enable!; end", "def disable()\n fail \"#{self} already disabled\" unless @enabled\n @klasses.each_pair do |k,methods|\n methods.each_pair do |method_sym, (old,blk)|\n bound = old.bind(k)\n k.class_eval {define_method method_sym, &bound.to_proc}\n end\n end\n @enabled = false\n end", "def off!\n set(:on => false)\n end", "def disable(*observers, &block)\n set_enablement(false, observers, &block)\n end", "def handle_external_workflow_execution_cancel_requested(event)\n # NOOP\n end", "def no_autostart\n @plezi_autostart = false\n end", "def disable\n admin_only do\n handle_recurring_schedule_failure 'disable', 'disabled' do\n # get the schedule object to be disabled.\n @test = get_test_with_rescue\n @test.active = nil\n @test.save!\n end\n redirect_to action: \"index\"\n end\n end", "def clear_after_process_callbacks\n @after_process_callbacks = []\n end", "def down(&block)\n disable\n yield\n ensure\n enable\n end", "def restore_failure_callback\n @failure_callback = DEFAULT_FAILURE_CALLBACK\n end", "def save_without_auditing\n without_auditing { save }\n end", "def disabled=(_arg0); end", "def disable_tx; @disabled_tx += 1 end", "def enable_tx; @disabled_tx -= 1 end", "def onupdate_unregister(b)\n @onupdate_list.delete b\n if @onupdate_list.empty?\n DFHack.onupdate_active = false\n DFHack.onupdate_minyear = DFHack.onupdate_minyeartick = 0\n end\n end", "def silence_deprecations; end", "def disable!\n @active = false\n change_status(:disabled)\n end", "def skip_command_callback_nodes\n %w[render_cell render around_filter]\n end", "def disabled_lints\n lints.select { |lint, conf| conf['enabled'] === false }.map do |lint,|\n Lint.const_get(lint)\n end\n end", "def handle_disabled\n @was_disabled = true\n cancel_associated_job!\n\n refs_pointing_to_self = ModelReference.find_references_to(self)\n refs_pointing_to_self.update_all(disabled: true)\n end", "def off(callback_name)\n raise(ArgumentError, \"Argument 'callback_name' must be a String.\") unless callback_name.is_a?(String)\n @procs_callback.delete(callback_name)\n return self\nend", "def clear_callbacks!\n _callback_names.each do |callback_name|\n instance_variable_set(:\"@#{callback_name}_callbacks\", nil)\n end\n end" ]
[ "0.7336373", "0.69859374", "0.66282904", "0.6617495", "0.6591407", "0.65790856", "0.650868", "0.64940804", "0.6459439", "0.6358537", "0.6334271", "0.62552506", "0.6249956", "0.6248471", "0.6225756", "0.61620253", "0.6152404", "0.6111194", "0.60100377", "0.5995013", "0.5961907", "0.59511894", "0.5922526", "0.58388567", "0.5837986", "0.5833921", "0.5825771", "0.58198386", "0.58108735", "0.58100986", "0.57770103", "0.57675266", "0.57656866", "0.5764855", "0.5751796", "0.5744017", "0.5741692", "0.57320994", "0.57247424", "0.57155716", "0.5713691", "0.5709979", "0.5694211", "0.56776184", "0.5674798", "0.56655025", "0.56600374", "0.5657252", "0.5656424", "0.56487477", "0.5644377", "0.56325287", "0.5625796", "0.56002754", "0.55745447", "0.55715144", "0.55697834", "0.5565767", "0.5557359", "0.5546215", "0.5537827", "0.55317265", "0.5529696", "0.5529696", "0.55232346", "0.5508812", "0.55046535", "0.5489295", "0.5488401", "0.54747576", "0.54681224", "0.5455875", "0.54499614", "0.54455453", "0.5444149", "0.5433038", "0.54244137", "0.54049784", "0.54005826", "0.5399366", "0.53894776", "0.538191", "0.53813636", "0.5358608", "0.535179", "0.5347952", "0.5328115", "0.5324062", "0.5318547", "0.5312142", "0.53091466", "0.5307779", "0.53055865", "0.5304446", "0.5300422", "0.5300344", "0.52967805", "0.5295318", "0.5293308", "0.52896255" ]
0.84497714
0
the default user for various admin activities
def default_user_email return default_email( DEFAULT_USER ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_user\n users.first\n end", "def default_user\n if (user_id = config.user_id).present?\n User.where(:id => user_id).first\n else\n nil\n end\n end", "def get_user\n @current_user = current_admin || current_user\n end", "def admin_user\n @admin_user ||= User.first\n end", "def default_user\n u = User.find_or_create_by_oauth2(default_oauth2_hash)\n create_user_shop(u)\n u\n end", "def current_user_dev\n @current_user ||= User.new(email: \"[email protected]\", firstname: \"Julius\", username: \"jcVI\", admin: true, admin_collections: [\"global\"])\n end", "def default_user\n ['', '']\n end", "def default_user\r\n [nil, nil]\r\n end", "def super_user\n return nil unless session[:admin_user]\n @current_admin ||= User.find_by_id(session[:admin_user])\n end", "def admin_user\n @admin_user ||= Typus.user_class.find_by_id(session[:typus_user_id])\n end", "def set_default!\n @@default_user = self\n end", "def current_user\n current_admin_user\n end", "def current_user\n current_admin_user\n end", "def current_user_or_admin\n if current_user \n return current_user\n elsif current_admin \n return current_admin\n end \n end", "def set_default_user(user)\n @_default_user = user\n end", "def main_admin\n @@_cache_admin ||= (User.where(email: '[email protected]').take || User.create!(first_name: 'Loverealm', last_name: 'Administrator', email: '[email protected]', password: ENV['LR_SUPER_USERS_PASSWORD'], password_confirmation: ENV['LR_SUPER_USERS_PASSWORD'], roles: [:admin]))\n end", "def username\n \"administrator\"\n end", "def system_user\n User.find_by_name(\"DanbooruBot\") || User.admins.first\n end", "def set_user\n @user = @current_user.admin ? User.find(params['id']) : @current_user\n end", "def admin_user\n if session[:user_id] and session[:position]\n @admin_user = AdminUser.find_by_id(session[:user_id])\n end\n end", "def session_user\n if admin_controller?\n admin_user\n else\n current_user\n end\n end", "def effective_user\n current_user || demo_user\n end", "def admin_user\n \tif current_user.nil?\n \tredirect_to(login_path)\n else\n \tredirect_to(login_path) unless current_user.admin?\n end\n end", "def admin_user\n \tif current_user.nil?\n \tredirect_to(login_path)\n else\n \tredirect_to(login_path) unless current_user.admin?\n end\n end", "def current_user \n #will never return NIL, create a fake user\n #will return the super value (logged in user) OR the guest infos.\n super || guest_user\n end", "def admin_user\n unless admin_user?\n redirect_to login_url\n end\n end", "def current_user\n current_admin\n end", "def set_default_role\n if User.count == 0\n self.global_role = GlobalRole.administrator\n elsif self.global_role.nil?\n self.global_role = GlobalRole.regular_user\n end\n end", "def set_admin_user\n\t@admin_user = current_admin_user\n\tend", "def current_user\n \tsuper || guest_user\n \t#Super quiere decir que exactamente con los valores \n \t#del metodo original sin cambiar nada\n end", "def set_default_role\n if User.count == 0\n self.global_role = GlobalRole.administrator\n else\n self.global_role = GlobalRole.regular_user\n end\n end", "def set_user\n if self.current_user and self.current_user.name == 'admin'\n @user = User.find(params[:id])\n else\n @user = User.find(current_user.id)\n end\n end", "def user\n session[AutoAdmin::AutoAdminConfiguration.admin_model_id] ? AutoAdmin::AutoAdminConfiguration.admin_model.find(session[AutoAdmin::AutoAdminConfiguration.admin_model_id]) : nil\n end", "def set_admin_user\n User.current = User.anonymous_api_admin\n end", "def user\n return Etc.getlogin\n end", "def user\n conf['dashboard']['user']\n end", "def user\n @path = \"/services/Admin\"\n @user ||= Nephophobia::Resource::User.new self\n end", "def make_first_user_admin\n return unless User.count.zero?\n\n self.is_admin = true\n self.approved = true\n end", "def set_admin_user\n @user = User.find(params[:id])\n end", "def set_admin_user\n @user = User.find(params[:id])\n end", "def user\n super || create_user\n end", "def admin_user\n #redirect_to(root_url) unless\n current_user.admin || current_user.super_admin?# || top_layer_administrator\n end", "def current_user\n session[:admin]\n end", "def current_user\n if session[:admin]\n @current_user ||= Admin.find(session[:user_id]) if session[:user_id]\n else\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end\n end", "def default_role\n self.role ||= Roles::USER\n end", "def current_admin_user\n @current_admin_user ||= AdminUser.find_by(id: session[:admin_user_id])\n end", "def set_admin_user\n @admin_user = User.find(params[:id])\n end", "def set_admin_user\n @admin_user = User.find(params[:id])\n end", "def set_admin_user\n @admin_user = User.find(params[:id])\n end", "def set_admin_user\n @admin_user = User.find(params[:id])\n end", "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin? #NB il metodo \"admin?\" è stato aggiunto direttamente da Rails quando alla creazione ha visto che admin è un booleano\n\tend", "def current_user\n core_id = Origen::Users::User.current_user_id\n user = app_users.find { |user| user.core_id == core_id }\n user || User.new(core_id)\n end", "def user\n return @user ? @user : Dotfu.config_user\n end", "def user\n ActiveScaffold::Registry.user_settings[user_settings_key]\n end", "def system_user\n # By convention, the first user is always the system user.\n User.find_by_id(1)\n end", "def current_user\n abort \"You have no current user set!\".yellow unless current_user_exists?\n config.current_user\n end", "def current_user\r\n super || guest_user\r\n end", "def current_user\n @current_user ||= Admin.find_by(id: session[:admin_id]) #Lay session id cho nhung trang tiep theo\n end", "def current_admin_user\n return current_user if current_user.admin?\n nil\n end", "def current_user\r\n super || guest_user\r\n end", "def set_admin_user\n @user = User.find(params[:id])\n end", "def set_admin_user\n @admin_user = Admin::User.find_by_friendly_id(params[:id])\n end", "def current_user\n super || OpenStruct.new(name: \"Guest User\", first_name: \"Guest\",\n last_name: \"User\", email: \"[email protected]\")\n end", "def first_user_hook\n if User.with_role(:admin).count == 0\n self.grant :admin\n else # set editor as default role\n self.grant :editor if self.roles.empty?\n end\n end", "def set_admin_user\n @admin_user = Admin::User.find(params[:id])\n end", "def set_admin_user\n @admin_user = Admin::User.find(params[:id])\n end", "def set_admin_user\n @admin_user = Admin::User.find(params[:id])\n end", "def set_admin_user\n @admin_user = Admin::User.find(params[:id])\n end", "def set_admin_user\n @admin_user = Admin::User.find(params[:id])\n end", "def set_user; end", "def user_from_session\n Admin::User.find(session[:user_id]) if session[:user_id]\n end", "def current_user\n current_admin || current_consumer || current_employee\n end", "def user\n @user ||= (current_user.nil?) ? tmp_user : current_user\n end", "def current_admin\n @current_admin ||= (admin_login || :false)\n end", "def set_user\n\t\tif(session[:role]=='administrator')\n \t\t@user = User.find(params[:id])\n\t\telse\n\t\t\t@user = @current_user\n\t\tend\n end", "def admin_user\n redirect_to(root_path) unless current_user.try(:admin?) || current_user?(@user)\n end", "def set_default_role\n if User.count == 0\n self.role ||= :admin\n else\n self.role ||= :user\n end\n end", "def current_user\n appctrl_set_user()\n return @current_user\n end", "def admin_user\n unless current_user && current_user.admin?\n store_location\n flash[:danger] = \"Please log in as admin.\"\n redirect_to users_url\n end\n end", "def admin_user\n if (!current_user || current_user.username != 'admin')\n redirect_to(root_url)\n end\n end", "def admin_user\n @user = current_user\n redirect_to @user unless @user.admin?\n end", "def admin_name\n self.user.name\n end", "def get_fake_user\n dev_user = User.find_by_uid('dev')\n if dev_user == nil\n dev_user = User.create({ name: 'Development User', email: 'dev@localhost', uid: 'dev' })\n end\n admin_role = Role.find_by_name(\"Administrator\")\n if not dev_user.role == admin_role\n dev_user.role = admin_role\n dev_user.save\n end\n return dev_user\n end", "def current_user\n User::TYPES.each do |mapping|\n user = self.send(\"current_#{mapping.to_s.downcase}\")\n return user unless user.nil?\n end\n end", "def current_user\n # authorization initialization if not run yet\n # (in the case of paper_trial it might not have run)\n authorization_init\n @logged_in_user\n end", "def set_user\n @user = User.find(params[:id])\n redirect_to admin_users_path, alert: 'You are Unauthorized to access that page' if @user.super_admin?\n end", "def admin_user\n redirect_to(root_url) unless current_user.admin? # se current_user.admin for falso redireciona para pagina principal\n end", "def user\n return config[:user] unless config[:user].nil?\n\n require \"train/transports/ssh\"\n Train::Transports::SSH.default_options[:user][:default]\n end", "def determine_default_user_email\n Cadenero.default_user_email = options[\"default-user-email\"].presence ||\n ask(\"What will be the email for the default user owner of the default account? [[email protected]]\").presence ||\n '[email protected]'\n end", "def current_user\n get_from_options_or_controller(:current_user)\n end", "def login_from_config\n self.current_user = User.find(BETY_USER) if defined? BETY_USER\n end", "def admin_user\n unless signed_in?\n store_location\n redirect_to signin_url, notice: \"Please sign in.\" \n return\n end\n\n unless current_user.admin?\n redirect_to boards_path, notice: \"You do not have permission for that.\" \n return\n end\n end", "def real_user\n if user_sudoing?\n @real_user\n else\n current_user\n end\n end", "def current_user\n @current_user ||= Admin.find_by(email: session[:email])\n @current_user ||= Developer.find_by(email: session[:email])\n end", "def set_default_role\n\n\t\tself.role ||= :user\n\n\tend", "def admin_user\n\t\tunless admin? \n\t\t\tflash[:danger] = \"Only administrators have access to this page\"\n\t\t\tredirect_back_or(root_url) \n\t\tend\n\tend", "def admin_user\n redirect_to(root_path) unless (current_user != nil && current_user.admin == true)\n end", "def current_user\n super || guest_user\n end", "def current_user\n super || guest_user\n end", "def current_user\n super || guest_user\n end" ]
[ "0.7851572", "0.781541", "0.76362175", "0.75131553", "0.7493067", "0.7466492", "0.73747045", "0.73410666", "0.73356956", "0.732719", "0.73068404", "0.7218112", "0.7218112", "0.71682733", "0.71344995", "0.7119609", "0.7115692", "0.710015", "0.70796853", "0.7062434", "0.7040629", "0.7034979", "0.7011564", "0.7011564", "0.7010722", "0.70089346", "0.6993169", "0.6989378", "0.69769925", "0.6970453", "0.6963316", "0.6962544", "0.69540733", "0.694739", "0.691679", "0.6903856", "0.6897687", "0.689765", "0.6886291", "0.6886291", "0.68856806", "0.68794936", "0.6876461", "0.68750685", "0.68748707", "0.6873782", "0.68382895", "0.68382895", "0.68382895", "0.68371344", "0.6835639", "0.6830588", "0.6812503", "0.6806741", "0.6792679", "0.6787595", "0.6783936", "0.6781678", "0.6775521", "0.6759871", "0.675401", "0.6748298", "0.67473936", "0.6725559", "0.6717608", "0.6717608", "0.6717608", "0.6717608", "0.6717608", "0.67032206", "0.6694159", "0.66928744", "0.6691932", "0.6689003", "0.6677076", "0.6670186", "0.6661876", "0.6660536", "0.6659442", "0.66417307", "0.6630482", "0.66302425", "0.6627675", "0.6626872", "0.6614209", "0.6606574", "0.6602672", "0.6591259", "0.6586536", "0.6585697", "0.6585298", "0.6584163", "0.6583715", "0.65829253", "0.65797883", "0.6566937", "0.6560416", "0.65471184", "0.65471184", "0.65471184" ]
0.6999327
26
construct a default email address given a computing Id
def default_email( cid ) return "#{cid}@#{DEFAULT_DOMAIN}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_generated_mail_id\n if is_hr_or_info\n formatted_domain = website.gsub(/https:\\/\\/|http:\\/\\//, \"\").gsub(/www\\./, \"\")\n fname = first_name.gsub(/\\s/, \"\")\n lname = last_name.gsub(/\\s/, \"\")\n self.generated_mail_id1 = fname + \".\" + lname + \"@\" + formatted_domain\n self.generated_mail_id2 = lname + \".\" + fname + \"@\" + formatted_domain\n end\n end", "def email_address\n require \"mail\"\n address = Mail::Address.new email\n address.display_name = name.dup\n address.format\n end", "def email\n return Contact.get_default_email self.id\n end", "def generateEmailAddress()\n uuid = SecureRandom.hex(3)\n return \"%s.%[email protected]\" % [uuid, @MAILBOX]\n end", "def email_address\n (email_addresses.where(primary: true).first || email_addresses.first).try(:email) ||\n current_address.try(:email) ||\n permanent_address.try(:email) ||\n user.try(:username)\n end", "def email_address\n authentications.emails.active.first.uid rescue nil\n end", "def rep_email\r\n return if self.assigned_to.nil?\r\n \r\n if (bomb_squad = AppConfig.CUSTOMER_STAFF[self.assigned_to])\r\n return \"\\\"#{name}\\\" <#{bomb_squad_email}>\"\r\n else\r\n raise \"BombSquad \\\"#{self.assigned_to}\\\" is not existing for \\\"#{self.account_num}\\\"\"\r\n end\r\n end", "def email_address\n element_with_value('EMailAddress', opts[:email_address].to_s[0..50])\n end", "def email_address(name=nil)\n Faker::Internet.email(name)\n end", "def as_email_to\n return email if name.nil?\n\n %(#{name} <#{email}>)\n end", "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end", "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end", "def email_address(name=nil)\n Faker::Internet.email(name: name)\n end", "def generate_random_email_address\n random_email_account = SecureRandom.hex(@number_of_random_characters)\n random_domain_name = SecureRandom.hex(@number_of_random_characters)\n return random_email_account + \"@\" + random_domain_name + @email_suffix\n end", "def default_email_address_header\n default_email_address.nil? ? original_email_address_header : default_email_address.to_header\n end", "def md_email(email, al=nil)\n md_el(:email_address, [], { :email => email }, al)\n end", "def partial_email\n @partial_email ||=\n begin\n uid,_,domain = email.partition('@')\n if uid.length < 4\n uid = '*' * uid.length\n elsif uid.length < 8\n uid = uid[0..2] + ('*' * (uid.length - 3))\n else\n uid = uid[0..2] + ('*' * (uid.length - 6)) + uid[-3..-1]\n end\n \"#{uid}@#{domain}\"\n end\n end", "def email(value)\n merge(email: value.to_s)\n end", "def email_address\n api(\"EmailAddress\")\n end", "def address\n @address ||= Mail::Address.new(self.to_s) rescue nil\n end", "def primary_email\n primary_contacts(emails, :email_rank_code, &:first)\n end", "def primary_email\n primary_email_object = emails.find_by(is_primary: true)\n return if primary_email_object.blank?\n\n primary_email_object.address\n end", "def to_ude\n UserDefaultEmail.new self.as_ude_attributes\n end", "def create_email (email_str)\n begin\n email = Email.new(email_str) # Might give conig options\n rescue\n end\nend", "def email_address_field\n $tracer.trace(__method__)\n #unit_test_no_generate: email_address_field, input.id(\"Email\")\n return ToolTag.new(input.id(\"Email\"), __method__, self)\n end", "def identifier\n unless full_name.blank?\n full_name\n else\n email.split('@').join(' from ')\n end\n end", "def email\n if self.alternate_email.blank?\n if self.alumni?\n \"#{self.username}@alumni.calvin.edu\"\n else\n \"#{self.username}@students.calvin.edu\"\n end\n else\n self.alternate_email\n end\n end", "def default_user_email\n return default_email( DEFAULT_USER )\n end", "def email_address_with_name\n \"\\\"#{name}\\\" <#{info.email}>\"\n end", "def official_email\n @net_ldap_entry[:berkeleyeduofficialemail].first\n end", "def adm_email_address_field\n $tracer.trace(__method__)\n return ToolTag.new(input.id(\"/ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_email/\"), __method__)\n end", "def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end", "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "def generate_identifier\n self.identifier = Digest::MD5.hexdigest(\"PersonRecordIdentifier#{email}#{Rails.application.config.try(:hash_salt)}\")[0..254]\n end", "def join_email_address_field\n $tracer.trace(__method__)\n return ToolTag.new(input.id(\"/ctl00_content_ctl00_fragment_17442_ctl01_ctl00_ctl00_ctl05_Email/\"), __method__)\n end", "def gen_email(name)\n firstname = name.split.first\n lastname = name.split.last\n domains = %w(yahoo.com gmail.com privacy.net webmail.com msn.com\n hotmail.com example.com privacy.net)\n return \"#{(firstname + lastname).downcase}\"\\\n \"#{rand(100)}\\@#{domains[rand(domains.size)]}\"\nend", "def idonethis_email\n personal_account? ? \"[email protected]\" : \"#{team}@team.idonethis.com\"\n end", "def email(email, email_label)\n email.blank? ? \"#{Time.now.to_i}@fakeemail#{email_label}.com\" : email\n end", "def sandbox_email_address=(_arg0); end", "def sandbox_email_address=(_arg0); end", "def from_email\n EmailAddress.find(:all).first\n end", "def from_email\n AppConfig[:pui_request_email_fallback_from_address]\n end", "def get_text_address()\n\t\temail = self.phoneNumber.to_s + self.provider\n\t\treturn email\n end", "def email\n multi_email.primary_email_record.try(:email)\n end", "def create_users_email_alias( user_uid, _alias )\n engines_api_system.create_users_email_alias( user_uid,\n { address: \"#{_alias[:local_part]}@#{_alias[:domain]}\" } )\n end", "def email_with_name\n if email\n %Q{\"#{first} #{last}\" <#{email}>}\n end\n end", "def set_email\n @email = params[:id] ? Email.find(params[:id]) : Email.new(email_params)\n end", "def getEmailDefaults(subject, toEmail, ccEmail = nil)\n if Rails.env.eql? 'development'\n subject = \"[BASL-DEV] #{subject}\"\n toEmail = '[email protected]'\n ccEmail = toEmail\n else\n subject = \"[BASL] #{subject}\"\n end\n mailInfo = {\n :to => toEmail,\n :subject => subject,\n :cc => ccEmail\n }\n mailInfo\n end", "def email\n \"#{andrew_id}@andrew.cmu.edu\"\n end", "def email(name: T.unsafe(nil), separators: T.unsafe(nil), domain: T.unsafe(nil)); end", "def email\n if self[:email] && !@email_name\n self[:email]\n elsif self.email_name && self.email_domain\n self[:email] = \"#{self.email_name}@#{self.email_domain}\"\n end\n end", "def email_from\n case self.type\n when 'test'\n \"[email protected]\"\n when 'left','sdm','lcc','cde'\n \"[email protected]\"\n else\n \"[email protected]\"\n end\n end", "def email_as_id\n\t\tself.email.gsub(/[@\\.]/, '-')\n\tend", "def lookup_and_create_account( id )\n\n # lookup locally with the default email\n user = User.find_by_email( User.email_from_cid( id ) )\n return user if user.present?\n\n # if we cannot find them, lookup in LDAP\n user_info = user_info_by_cid( id )\n return nil if user_info.nil?\n\n # now look them up with the located email\n user = User.find_by_email( user_info.email )\n return user if user.present?\n\n # create their account\n return User.new_user( user_info, user_info.email )\n end", "def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end", "def email_address\n self.dig_for_string(\"agentSummary\", \"emailAddress\")\n end", "def modal_email_addr_field\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.input.className(create_ats_regex_string(\"ats-createemailaddr\")), format_method(__method__))\n end", "def generate_default_display_name\n if self.display_name.blank?\n self.display_name = (email.blank? ? \"[no name]\" : self.email.split(\"@\")[0])\n end\n end", "def generate_email\n o = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten\n email = (0...15).map{ o[rand(o.length)] }.join << \"@\" << (0...10).map{ o[rand(o.length)] }.join << \".com\"\n end", "def initialize(email = '')\n self.address = email\n end", "def email(id)\n get(\"/user/emails/#{id}\")\n end", "def office_email_address\n self.dig_for_string(\"agentSummary\", \"office\", \"emailAddress\")\n end", "def email=(v)\n @email = alma_string v\n end", "def email_address\n \"CoursAvenue <#{token}@#{CoursAvenue::Application::MANDRILL_REPLY_TO_DOMAIN}>\"\n end", "def investor_email_address\n return self.user_company_info.blank? ? self.email : self.user_company_info.business_email\n end", "def mailfrom(from_addr); end", "def email\n em = Email.new\n em.host = domain\n em.user = \"info\"\n em\n end", "def new(email_address, config={})\n Address.new(email_address, config)\n end", "def primary_address\n \"[PRIMARY_ADDRESS]\"\n end", "def email\n pull unless @details\n begin\n return @details.email_address.address\n rescue\n return nil\n end\n end", "def initialize(id, email, address)\n @id = id\n @email = email\n @address = address\n end", "def generate_random_email\n # random_number = rand(1000000 .. 9000000)\n random_number = Time.now.getlocal.to_s.delete \"- :\"\n \"ruslan.yagudin+#{random_number}@flixster-inc.com\"\nend", "def casein_config_email_from_address\n\t\t'[email protected]'\n\tend", "def to_email_address\n @to_email_address\n end", "def set_default_email_template\n @default_email_template = DefaultEmailTemplate.find(params[:id])\n end", "def join_reenter_email_address_field\n $tracer.trace(__method__)\n return ToolTag.new(input.id(\"/ctl00_content_ctl00_fragment_17442_ctl01_ctl00_ctl00_ctl05_Email2/\"), __method__)\n end", "def identifier\n name.presence || email.split('@').join(' from ')\n end", "def generate_email_hash\n self.email_hash = Digest::MD5.hexdigest(self.email) if self.email.present?\n end", "def build_from_email(email)\n new do |auth|\n auth.provider = 'email'\n auth.email = email\n auth.uid = email\n end\n end", "def to_email(name) ; \"#{name.gsub(/ /, '.')}@smartergrades.com\".downcase ; end", "def new_email_distribution_group_email_address( distribution_group_name )\n engines_api_system.new_email_distribution_group_email_address distribution_group_name\n end", "def new_email\n e = read_attribute :new_email\n e.present? ? e : email\n end", "def comment_new_email\n NotificationMailer.comment_new_email('[email protected]')\n end", "def email\n preferred_email\n end", "def determine_default_user_email\n Cadenero.default_user_email = options[\"default-user-email\"].presence ||\n ask(\"What will be the email for the default user owner of the default account? [[email protected]]\").presence ||\n '[email protected]'\n end", "def primary_smtp_address=(value)\n @primary_smtp_address = value\n end", "def set_person_email_address\n @person_email_address = PersonEmailAddress.find(params[:id])\n end", "def initialize(input_id, input_email_address, input_delivery_address)\n @id = input_id\n @email = input_email_address\n @address = input_delivery_address\n end", "def initialize(id, email, address)\n @id = id\n @email = email\n @address = address\n end", "def sandbox_email_address; end", "def sandbox_email_address; end", "def encode_email_address( addr )\n\n\t\t\trval = ''\n\t\t\t(\"mailto:\" + addr).each_byte {|b|\n\t\t\t\tcase b\n\t\t\t\twhen ?:\n\t\t\t\t\trval += \":\"\n\t\t\t\twhen ?@\n\t\t\t\t\trval += Encoders[ rand(2) ][ b ]\n\t\t\t\telse\n\t\t\t\t\tr = rand(100)\n\t\t\t\t\trval += (\n\t\t\t\t\t\tr > 90 ? Encoders[2][ b ] :\n\t\t\t\t\t\tr < 45 ? Encoders[1][ b ] :\n\t\t\t\t\t\t\t\t Encoders[0][ b ]\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\t}\n\n\t\t\treturn %{<a href=\"%s\">%s</a>} % [ rval, rval.sub(/.+?:/, '') ]\n\t\tend", "def to_email_address\n @to_email_address\n end", "def email\n if @data.attribute_names.include?(:cmupreferredmail)\n @email ||= @data[:cmupreferredmail].last\n else\n @email ||= @data[:mail].last\n end\n end", "def email_address_link user\n \"<a href=\\\"mailto:#{user.email}\\\">#{user.name} <#{user.email}></a>\"\n end", "def email\n imie = %w(ala ola kasia basia tomek atomek xyz)\n name = %w(kowalski nowak)\n domain = %w(gmail.com hotmail.com yahoo.com)\n [imie[rand(imie.size)], name[rand(name.size)], '@', domain[rand(domain.size)]].join(\"\")\n end", "def assignee_email= email\n \tself.assigned_to = User.find_by_email(email).id\n end", "def meteor_create_initial_email\n add_to_set(emails: build_meteor_mail_hash(email, confirmed?))\n end", "def set_email(email = nil, email_selector = nil, ldap_lookup = nil)\n self.email = email || []\n if email_selector\n # Get the primary email address from the address list\n self.primary_email = email_selector.email(self.email)\n # Get the username from the primary email address\n if ldap_lookup and self.primary_email\n self.username = ldap_lookup.find(self.primary_email)\n else\n self.username = nil\n end\n else\n self.primary_email = nil\n self.username = nil\n end\n end", "def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end" ]
[ "0.67331576", "0.6715855", "0.6645171", "0.6630673", "0.6395465", "0.63555706", "0.6354021", "0.63397956", "0.63042146", "0.62972015", "0.6291707", "0.6291707", "0.6281802", "0.6241662", "0.6191692", "0.6167345", "0.61480343", "0.6112714", "0.6111396", "0.6093498", "0.6084712", "0.60388774", "0.60010064", "0.5994069", "0.59511244", "0.5939523", "0.5923562", "0.5923288", "0.59069735", "0.5906051", "0.5905013", "0.5893704", "0.58915156", "0.58787656", "0.5860079", "0.5857824", "0.58540773", "0.58476", "0.58474296", "0.58474296", "0.5842392", "0.58196497", "0.58079505", "0.58059114", "0.58005124", "0.5796804", "0.5781244", "0.576359", "0.5750756", "0.5747376", "0.57459193", "0.5742029", "0.5730299", "0.57186234", "0.5695349", "0.5691528", "0.5684082", "0.5683067", "0.5677137", "0.5672426", "0.56689215", "0.5666101", "0.566453", "0.56604445", "0.56556296", "0.56413424", "0.5638219", "0.5635642", "0.5631083", "0.5629038", "0.56275475", "0.56219643", "0.561731", "0.56153286", "0.56130904", "0.5606086", "0.5603629", "0.56035554", "0.5600798", "0.5597875", "0.5591274", "0.5585224", "0.5580824", "0.55728334", "0.55676335", "0.5567602", "0.55548567", "0.55474526", "0.55450124", "0.554457", "0.554457", "0.55385333", "0.55270684", "0.55241203", "0.55192465", "0.55140525", "0.5513178", "0.55092216", "0.550545", "0.5501576" ]
0.7266355
0
get a work by the specified ID
def get_work_by_id( work_id ) begin return LibraWork.find( work_id ) rescue => e end return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_work\n client.make_request('/get-work', 'post', params: {})\n end", "def find_work\n work_id = params[:id]\n @work = Work.find_by_id(params[:id])\n head :not_found unless @work\nend", "def get_work(data=nil)\n request('getwork', data)\n end", "def get_work\n works = batched_get( { id: params[:id] } )\n if works.empty?\n render_json_works_response(:not_found )\n else\n # provide fileset information here\n render_json_works_response(:ok, work_transform(works, INCLUDE_FILESETS ) )\n end\n end", "def getwork(data = nil)\n @api.request 'getwork', data\n end", "def getwork(data)\n request :getwork, data\n end", "def find_or_new_work(primary_id, title)\n work_found = Work.where(identifier_ssi: primary_id).last\n return work_found if work_found\n Work.new(\n identifier: primary_id,\n title: title,\n depositor: job_owner,\n admin_set: admin_set_for_work\n )\n end", "def get_job(id)\n conn = @client.get do |req|\n req.url \"/api/v2/job/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end", "def find_worker id\n self.workers.find{ |worker| worker[:id] == id } \n end", "def find_work_order\n if !is_numeric?(params[:id]) || params[:id] == '0'\n render json: :bad_request, status: :bad_request\n else\n @work_order = WorkOrder.find(params[:id]) rescue nil\n render json: :not_found, status: :not_found unless @work_order.present?\n end\n end", "def fetch_job\n @job = Job.find(params.require(:id))\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def set_work\n @work = Work.find(params[:id])\n end", "def find(id)\n res = transmit(\"peek #{id}\")\n Job.new(client, res)\n rescue Beaneater::NotFoundError\n nil\n end", "def find_job(job_id)\n response = HTTParty.get(\"#{@host}/api/jobs/#{job_id}\")\n\n return response['job']\n end", "def getwork(data = nil)\n coind.getwork data\n end", "def fetch(id)\n search(id: id)[:records].first\n end", "def find_by_id(client, id, options: {})\n\n self.new(parse(client.get(\"/tasks/#{id}\", options: options)).first, client: client)\n end", "def set_work\n @work = Work.friendly.find(params[:id])\n end", "def getTaskByID(id) \n ret = nil \n\n @Tasks.each do |task| \n ret = task if task.ID == id\n end \n end", "def fetch(workitem_or_fei)\n\n hfei = Ruote::FlowExpressionId.extract_h(workitem_or_fei)\n\n @context.storage.get('workitems', to_id(hfei))\n end", "def find(id)\n end", "def set_work\n @works_item = Work.find(params[:id])\n end", "def show\n @work_id = params[:id]\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @work }\n end\n end", "def works\n Work.all.select {|work| work.make_id == id}\n end", "def work\n @stats = Hyrax::WorkUsage.new(params[:id])\n end", "def find_work\n\n end", "def job(id, options = {})\n objectify get(\"/job/#{id}\", options)['joblist']['job']\n end", "def find id\n model.find id\n end", "def load_work_order\n @work_order = WorkOrder.accessible_by(current_ability).find(params[:id])\n end", "def find(id); end", "def find(id); end", "def find_by_id(id)\n find(id)\n end", "def find(id)\n where({'id' => \"#{id}\"}).first\n end", "def job(id)\n Job.new(id, self)\n end", "def get_by_id(id)\n if @data == nil\n url = make_url(:fq => \"id:#{id}\")\n\n begin\n @data = Net::HTTP.get(URI.parse(url))\n rescue Exception => e\n @error = \"Unable to connect to #{url}\"\n end\n end\n \n return @data\n end", "def find_by_id(id)\n hash = Backlogjp.base._command \"getProject\", id\n\n Project.new(hash) unless hash.empty?\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.class.name} with ID=#{id}\")\n end", "def getObject(id)\n\t\tdoc.search(\"[@id='#{id}']\").first\n\tend", "def find(id)\n find_by_index(id: id)\n end", "def show\n\t\t@work = Work.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @work }\n\t\tend\n\tend", "def find(id)\n klass.find(id)\n end", "def find_by_id(id)\n find_by_attributes(:id => id).first\n end", "def fetch(id)\n fetch_by_id(id) or raise(ActiveRecord::RecordNotFound, \"Couldn't find #{self.name} with ID=#{id}\")\n end", "def find(id)\n fetch([name, id]) do\n super\n end\n end", "def show\n @workdetails = Workdetail.where(\"task_id = ?\", params[:id])\n @taskid = params[:id]\n @task = Task.where(:id => @taskid).first\n @storyid = @task.story_id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workdetails }\n end\n end", "def find_iteration_by_id(id)\n iterations.find_by_id(id)\n end", "def find(id)\n @data[id]\n end", "def set_work\n @work = Work.find_by(id: params[:id])\n rescue Exception => e\n render_default_error e, 401\n end", "def find(id)\n begin\n @@grid.get(id)\n rescue\n nil\n end\n end", "def find(id)\n sid = id.to_s\n return nil if sid == ''\n return _record_cache[sid] if _record_cache.has_key?(sid) && _class_fetch_states[\"record_#{id}\"] == 'f'\n observer = React::State.current_observer\n record_in_progress = if _record_cache.has_key?(sid)\n _record_cache[sid]\n else\n self.new(id: id)\n end\n record_in_progress_key = \"#{self.to_s}_#{record_in_progress.object_id}\"\n React::State.get_state(observer, record_in_progress_key) if observer\n return _record_cache[sid] if _record_cache.has_key?(sid) && _class_fetch_states[\"record_#{id}\"] == 'i'\n _promise_find(id, record_in_progress).then do\n React::State.set_state(observer, record_in_progress_key, `Date.now() + Math.random()`) if observer\n end\n record_in_progress\n end", "def get_by_id(entry_id)\n fetch(entry_id).shift\n end", "def get_workitem (args)\n\n args.find { |a| a.is_a?(WorkItem) }\n end", "def find_one(id)\n response = request(:get, \"/#{resource_name}/#{id}\")\n #puts response\n construct_record_from_singular(response)\n end", "def get!(id)\n klass.find(:all, params: { id: wrap_key(id) })\n end", "def find(id)\n finder_or_run(:find, id)\n end", "def show\n @work_order = WorkOrder.find(params[:id])\n end", "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 get(id)\n server.get(\"#{name}/#{CGI.escape(id)}\")\n end", "def find_object(project, id)\n find_milestone_with_finder(project, id: id)\n end", "def find(id)\n @entries_by_id[id]\n end", "def find(id)\n repository.find(self, id)\n end", "def find(id)\r\n find_one do |record|\r\n record.id == id\r\n end\r\n end", "def get_by_id(class_name, id)\n @data = get_all()\n for item in @data[class_name]\n if item[\"id\"] == id\n return item\n end\n end\n raise \"#{class_name} id #{id} not found.\"\n end", "def get(id)\n klass.find(:first, params: { klass.primary_key => wrap_key(id) })\n end", "def find(id)\n result = self.class.get(worksheet_url + \"/\" + id).parsed_response\n Record.new(result_attributes(result)) if result.present? && result[\"id\"]\n end", "def find_by_id(id)\n self.select { |record| record.id == id.to_s }.first\n end", "def find_by_id(id)\n self.select { |record| record.id == id.to_s }.first\n end", "def object_by_id(id)\n @lock.synchronize do\n object_by_id_internal(id)\n end\n end", "def find(id)\n find_result\n end", "def search_request_by_id(id)\n @search_requests[id]\n end", "def find_job\n @job = Job.find(params[:job_id])\n end", "def set_work_result\n @work_result = WorkResult.find(params[:id])\n end", "def get_job (job_id)\n\n @cron_jobs[job_id] || @non_cron_jobs[job_id]\n end", "def task(id)\n task_xml = get_object_xml('Task', id)\n error = self.last_error\n if error\n raise Cherby::NotFound.new(\"Cannot find Task '#{id}': #{error}\")\n else\n return Task.new(task_xml.to_s)\n end\n end", "def get(id)\n @service.get(id)\n end", "def find(id)\n raise NotImplementedError\n end", "def find_by_id(id)\n raise NotImplementedError.new\n end", "def find_by_id(id)\n id = id.to_i\n\n @id_hash[id]\n end", "def find(id, params = {}, header = {})\n request = requester.new(:get, \"#{to_url}/#{id}\", {}, params, header)\n build(request.resource)\n end", "def find(id)\n first(\"Id = '#{id}'\")\n end", "def get(id:)\n response = client.get(path(id)).parsed_body\n new(response)\n end", "def get(id, db = database)\n begin\n get!(id, db)\n rescue\n nil\n end\n end", "def find(id)\n @objects[id]\n end", "def find_by_id(client, id, options: {})\n\n self.new(parse(client.get(\"/stories/#{id}\", options: options)).first, client: client)\n end", "def set_pending_work\n @pending_work = PendingWork.find(params[:id])\n end" ]
[ "0.70607543", "0.7024595", "0.69218475", "0.6889775", "0.6687124", "0.66437113", "0.65612954", "0.65611994", "0.6551745", "0.65248555", "0.6515824", "0.6504505", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6499102", "0.6473254", "0.6439068", "0.6423525", "0.6416808", "0.64009976", "0.6392941", "0.63713026", "0.6336702", "0.6309924", "0.6295289", "0.6284207", "0.6280536", "0.62519956", "0.6180165", "0.617368", "0.6171769", "0.61640126", "0.6153198", "0.6153198", "0.6148275", "0.60575986", "0.6056016", "0.6054558", "0.6042146", "0.6033228", "0.6008678", "0.60063845", "0.6001131", "0.5996235", "0.5991226", "0.5984049", "0.5980808", "0.5968458", "0.59586626", "0.59457815", "0.59431607", "0.5940235", "0.5929064", "0.5920698", "0.59164715", "0.5913922", "0.5906633", "0.5902581", "0.58994347", "0.58935595", "0.58774185", "0.58763915", "0.58721656", "0.5865834", "0.5865827", "0.5864958", "0.5864868", "0.5857236", "0.5855278", "0.5855278", "0.58522147", "0.58510554", "0.58427227", "0.5842457", "0.58389497", "0.5837947", "0.58226216", "0.58176756", "0.5813625", "0.58066124", "0.58058023", "0.5801684", "0.58008623", "0.5798331", "0.5797285", "0.5790089", "0.578913", "0.57884675" ]
0.801705
0
download a random cat image
def get_random_image( ) print "getting image... " dest_file = "#{File::SEPARATOR}tmp#{File::SEPARATOR}#{SecureRandom.hex( 5 )}.jpg" Net::HTTP.start( "lorempixel.com" ) do |http| resp = http.get("/640/480/cats/") open( dest_file, "wb" ) do |file| file.write( resp.body ) end end puts "done" return dest_file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def choose_image\n \"banners/#{ rand(35) + 1 }.jpg\"\n end", "def cover_url\n [\"condition_headache.jpeg\",\"condition_chair.jpeg\",\"condition_time.jpeg\",\"condition_med.jpeg\"][rand(4)] \n end", "def randomOctocat\n\t\tcURL($baseURL+\"?random\")\n\tend", "def random_image(query = 'safe, cute', nsfw = false)\n img = get(url: 'search/images', query: \"q=#{query.present? ? query : 'safe, cute'}&sf=random&per_page=1\", nsfw: nsfw)\n\n if img\n img_data = img['images'][0]\n image img_data.id, nsfw if img_data\n end\n end", "def cover\n \"http://lorempixel.com/100/150/\" +\n %w(abstract nightlife transport).sample +\n \"?a=\" + SecureRandom.uuid\n end", "def cover\n 'http://lorempixel.com/400/300/' + %W(abstract nightlife transport).sample + '?a=' + SecureRandom.uuid\n end", "def download_image\n Net::HTTP.start(@uri.host, @uri.port) do |http|\n\tif http.head(@uri.request_uri).code == \"200\"\n\tresp = http.get(@tempo.link)\n\topen(\"public/images/original/#{@original_image_name}\", \"wb\") do |file|\n\t file.write(resp.body)\n\tend\n end\n end\n end", "def load_image(url)\n require 'open-uri'\n temp = Tempfile.new 'split-vertically'\n image = nil\n\n seems_legit = false\n open(temp.path, 'wb') do |file|\n file << open(url).read\n # Images server returns literally \"0\" if no image exists\n seems_legit = file.size > 1\n end\n sleep 0.25 # Let's try to be nice to the images server\n\n Magick::Image.read(temp.path).first if seems_legit\nend", "def sample\n img :src => $imgHostURL + \"/\" + $sampleImg\n end", "def random_default_image\n Random.new.rand(1..6).to_s + '.jpg'\n end", "def rand_banner_img\n [\n 'http://song-dev.qiniudn.com/g0.jpg',\n 'http://song-dev.qiniudn.com/g1.jpg',\n 'http://song-dev.qiniudn.com/g2.jpg',\n 'http://song-dev.qiniudn.com/g3.jpg',\n 'http://song-dev.qiniudn.com/g4.jpg',\n 'http://song-dev.qiniudn.com/g5.jpg',\n 'http://song-dev.qiniudn.com/g6.jpg'\n ].sample\n end", "def download( url )\n image = open( \"#{url}.jpg\" ).read\n File.write @path, image\n end", "def download_image(src_url,dest_path)\n content_type = http_content_type(src_url)\n content_type = content_type.gsub(\"image/\", \"\")\n content_type = content_type.gsub(\"pjpeg\",\"jpg\")\n content_type = content_type.gsub(\"jpeg\",\"jpg\")\n vortex_url = download_resource(src_url,dest_path,content_type)\n return vortex_url\nend", "def generate_png\n img = IMGKit.new(url).to_png\n file = File.new(\"#{id}-full.png\", \"w\", :encoding => 'ascii-8bit')\n file.write(img)\n return file.path\n end", "def run\n ::SimpleHttp.get(@url).tap do |response|\n status, headers, blob = *response\n response[2] = Magick::Image.from_blob(blob).first if status == 200\n end\n end", "def random_image(keyword)\n return { error: 'Please set KEY to environment variable.' } if key_is_ng?\n return { error: 'Please set CSE_ID to environment variable.' } if cse_id_is_ng?\n\n choice(keyword)\n end", "def cover_fetcher\n if ENV['CI']\n File.open('./spec/factories/images/crysis.jpg')\n else\n # TODO: Make the dimensions more random.\n URI.open(\"#{Faker::LoremPixel.image(size: '560x800', is_gray: false)}/\")\n end\nend", "def random_photo\n if params[:city] && !params[:city][:name]\n city = City.find :first, :conditions => {:name => params[:city]}\n @photo = Photo.find :first, :conditions => {:city_id => city.id}\n end\n if !@photo\n @photo = Photo.find(:first, :offset => rand(Photo.all.size))\n end\n @photo['filename'] = \"#{@photo.city.name.gsub(' ','').downcase}.jpg\"\n end", "def get_random_content\n random_content = []\n fetch_all_categories.each do |link_to_send|\n random_content = link_to_send.url\n\n end\n random_content.sample\n end", "def random(opts = {})\n parse_response(Defcli.read_url(random_url), opts)\n end", "def download_from_instagram\n path = File.join(File.dirname(__FILE__),\"tmp/#{@payload['title']}.jpg\") \n File.open(path, \"wb\") do |f| \n f.write HTTParty.get(@payload['photo_url']).parsed_response\n end\n path\n end", "def logo\n rand_num = Random.rand(76) + 1\n \"http://www.biz-logo.com/examples/#{ rand_num < 10 ? \"00\" : \"0\" }#{rand_num}.gif\"\n end", "def robot_image_generator\n img_base_url = 'https://robohash.org/'\n @robot.img_sm = img_base_url + @robot.robot_name + '?size=80x80'\n @robot.img_lg = img_base_url + @robot.robot_name + '?size=300x300'\n end", "def download_image(url, basename, limit = 3)\n raise ArgumentError, 'too many HTTP redirects' if limit == 0\n\n uri = URI(url)\n response = Net::HTTP.get_response(uri)\n\n case response\n when Net::HTTPRedirection\n new_url = response['location']\n download_image(new_url, basename, limit - 1)\n when Net::HTTPSuccess\n extension = File.extname(uri.path)\n local_file = \"#{basename}#{extension}\"\n File.write(\"images/#{local_file}\", response.body)\n @files_images << \"images/#{local_file}\"\n \n # Return the local file on success\n local_file\n end\n\nrescue StandardError => e\n warn \"Error downloading the image: #{e.message}\"\nend", "def docDownloadImage(url, destFile)\n # Fix the image url, it cannot contain spaces.\n url = url.gsub(\" \", \"%20\")\n begin\n open(url) do |f|\n Pathname(destFile).parent.mkpath()\n File.open(destFile,\"wb\") do |file| file.puts(f.read) end\n end\n rescue\n puts \"*** Cannot download image: \" + url.to_s + \" ***\"\n end\nend", "def download_image!(image_url)\n # lazy load libraries\n require 'zlib'\n require 'securerandom'\n require 'rubygems/package'\n\n file_with_ext = File.basename(image_url)\n extract_path = \"/tmp/ankus-downloads-#{SecureRandom.hex}\"\n file_name = case file_with_ext\n when /\\.tar\\.gz$/\n File.basename(file_with_ext, '.tar.gz')\n when /\\.tar$/\n File.basename(file_with_ext, '.tar')\n else\n File.basename(file_with_ext, '.*')\n end\n out = File.open(\"/tmp/#{file_name}-#{SecureRandom.hex}\", 'wb')\n\n FileUtils.mkdir_p extract_path\n\n # Efficient image write\n @log.info \"Downloading #{file_with_ext} file...\"\n streamer = lambda do |chunk, _, _|\n out.write chunk\n end\n Excon.get image_url, :response_block => streamer\n out.close\n @log.info \"Image downloaded to #{out.path}\"\n\n @log.info \"Extracting image contents to #{extract_path}...\"\n packaged_files = []\n Gem::Package::TarReader.new(Zlib::GzipReader.open(out.path)).each do |entry|\n FileUtils.mkdir_p \"#{extract_path}/#{File.dirname(entry.full_name)}\"\n packaged_files << entry.full_name\n File.open \"#{extract_path}/#{entry.full_name}\", 'w' do |f|\n f.write entry.read\n end\n end\n end", "def download_image(url, n, key)\n # Build the relative web path, the full local path, and a temp file path\n web_path = format(\"%s/%8.8x.jpg\", url.host, \"#{key}-#{n}\".hash & 0xFFFFFFFF)\n full_path = IMAGE_PATH + web_path\n temp_path = File.join(File.dirname(full_path), \"temp.img\")\n\n if File.exists?(full_path)\n # If the file exists, don't bother downloading it again\n Log.d(\"Skipping image: #{key}-#{n}\")\n else\n # Else download the image to a temp file\n # AMF - changed logic here to \"get\" the page first to see if it is valid, and then process it if it is\n Log.d(\"Downloading image: #{url} - #{key}-#{n}\")\n FileUtils.mkdir_p(File.dirname(temp_path))\n \n response = @client.get(URI.join(@base, url), nil, @headers) rescue nil\n\t\t\t\n # AMF - checking response.content.size > 1000 weeds out some missing image links\n # that seem to be undetectable \n if response != nil\n if response.status != 404 && response.content.size > 1000\n File.open(temp_path, \"wb\") {|f| f.write(response.content) }\n\n # Process the image using an overridable method\n process_image(temp_path, full_path, IMAGE_MAX_WIDTH * n, IMAGE_MAX_HEIGHT * n)\n\n # Delete the temp file\n File.delete(temp_path)\n else\n Log.d(\"Download failed. Status: #{response.status}, Size: #{response.content.size}\")\n Log.d(\"#{response.content}\")\n return nil\n end\n else\n return nil\n end\n end\n return web_path\n rescue Exception\n Log.e($!)\n return nil\n end", "def download_image\n Net::HTTP.start(\"yuml.me\", 80) do |http|\n http.get(URI.escape(@diagram.get_uri))\n end\n end", "def getStockImage(link)\n dog_page = HTTParty.get(link, :verify => false)\n parsed_dog_page = Nokogiri::HTML(dog_page)\n\n info_table = parsed_dog_page.css(\".biota\")[0]\n \n image = info_table.css(\"img\")[0]\n pic = image != nil ? \"https:#{image['src']}\" : nil\nend", "def index\n\n\n #@link_arr= []\n #(1..2).each do |i|\n # Five00px.new.five_px(i)\n # end\n @image = Unlimited.skip(rand(Unlimited.count)).first\n\n end", "def capture\n for i in 0..49\n\t open(\"tempImages/image#{i}.png\", 'wb') do |file|\n\t file << open('http://hq.cirrusmio.com:82/media/?action=snapshot', http_basic_authentication: [\"admin\", \"admin\"]).read\n\t sleep(0.2)\n\tend\n end\n end", "def download_image(image_url)\n\n filename = \"temp.png\"\n data = image_url_to_base64(image_url)\n decoded_image = decode_base64_string(filename, data)\n write_swap_file(filename, decoded_image)\n\nend", "def download_image(image_url)\n\n filename = \"temp.png\"\n data = image_url_to_base64(image_url)\n decoded_image = decode_base64_string(filename, data)\n write_swap_file(filename, decoded_image)\n\nend", "def fetch_remote_image(filename)\r\n begin\r\n io = open(URI.parse(filename))\r\n def io.original_filename; base_uri.path.split('/').last; end\r\n return io\r\n rescue OpenURI::HTTPError => error\r\n log(\"Image #{filename} retrival returned #{error.message}, so this image was not imported\")\r\n rescue => error\r\n log(\"Image #{filename} could not be downloaded, so was not imported. #{error.message}\")\r\n end\r\n end", "def get_image(image_url)\n # Open webpage and obtain HTML\n url = \"https://www.mariowiki.com\" + image_url\n document = Nokogiri::HTML(open(url))\n\n image_element = document.css('div.fullImageLink a')\n image_path = image_element.attr('href').value\n image = \"https://www.mariowiki.com\" + image_path\n\n return image\nend", "def image\n TmdbImage.new(@imdb_id.gsub(/^tt/, ''), @api_key, @logger, @filespec) rescue nil\n end", "def download_chapter_pics(chapter)\n unless chapter_valid?(chapter)\n $log.error \"chapter not valid\"\n end\n command_template = 'wget --directory-prefix=\"Fullmetal Alchemist/%03d\"' +\n ' http://gc.jumpcn.com/1/g/gang-zhi-lian-jin-shu-shi/%d/%03d.jpg'\n i = 0\n loop do\n i += 1\n system(command_template % [chapter, chapter, i])\n break unless $?.exitstatus == 0\n end\nend", "def download_chapter_pics(chapter)\n unless chapter_valid?(chapter)\n $log.error \"chapter not valid\"\n end\n command_template = 'wget --directory-prefix=\"Naruto/%03d\"' +\n ' http://gc.jumpcn.com/1/h/huo-ying-ren-zhe/%d/%03d.jpg'\n i = 0\n loop do\n i += 1\n system(command_template % [chapter, chapter, i])\n break unless $?.exitstatus == 0\n end\nend", "def random_cocktail\n\trand_cocktail_url = open(\"https://www.thecocktaildb.com/api/json/v1/1/random.php\").read\n\trand_cocktail_json = JSON.parse(rand_cocktail_url)\n\trand_cocktail_json[\"drinks\"][0]\nend", "def diswimage(image_text)\n image_options = image_text.gsub(/#/, '').gsub(/diswimage:/, '').split(':')\n image_title = image_options[0]\n image_extension = image_options[1]\n option_count = image_options[2]\n image_width = image_options[3]\n return \"!{width: #{image_width}px}http://doitidiot.s3.amazonaws.com/#{image_title}-#{rand(option_count)+1}.#{image_extension}!\"\n end", "def image\n MAIN_CDN + \"headshots/current/168x168/#{@id}.jpg\"\n end", "def onlineBitmap(url)\n pbDownloadToFile(url,\"_temp.png\")\n return if !FileTest.exist?(\"_temp.png\")\n self.bitmap = pbBitmap(\"_temp\")\n File.delete(\"_temp.png\")\n end", "def find_normal_image\n return \"Pictures/pcn%04d.png\" % (80 + id)\n end", "def random_product_image_filename\n [\"img_1.png\",\"img_2.png\", \"img_3.png\", \"img_4.jpg\", \"img_5.jpg\", \n \"img_6.jpg\", \"img_7.jpg\", \"img_8.jpg\", \"img_9.jpg\", \"img_10.jpg\" ].shuffle.first\nend", "def down_image(src, dest)\n\turl = URI::parse(src)\n\treq = Net::HTTP::Get.new(url.path)\n\tNet::HTTP.start(url.host, url.port) { |http|\n\t\tresp = http.request( req )\n\t\tcreate_file(resp, dest)\t\t\t\n\t}\nend", "def download_image(image)\r\n dir = File.join(@dirs[:content], image.rel_path)\r\n img = MiniMagick::Image.open(image.uri.to_s)\r\n img.combine_options(:mogrify) do |c|\r\n c.type \"optimize\"\r\n c.colorspace \"Gray\"\r\n c.quality 60\r\n c.resize '450x550>'\r\n end\r\n img.write dir\r\n end", "def host\n self.image_path = Base64.encode64(\n SecureRandom.hex(10) + \n Time.now.to_i.to_s).chomp + \".jpg\"\n\n tempfile = Tempfile.new(image_path)\n file_path = tempfile.path\n\n system(\"wget --no-check-certificate \"\\\n \"-U '#{CONFIG[:user_agent]}' '#{orig_image_url}' \"\\\n \"-T 30 -t 3 \"\\\n \"--output-document '#{file_path}'\")\n\n\n if File.exists? file_path\n\n # Store original image\n #\n FileSystem.store(\n image_path,\n open(file_path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create thumbnail\n #\n image = MiniMagick::Image.open(file_path)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 180,:height => 180})\n\n FileSystem.store(\n thumbnail_path,\n open(image.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n self.is_processed = true\n self.save!\n end\n\n rescue MiniMagick::Invalid => ex\n LoggedException.add(__FILE__,__method__,ex)\n end", "def host\n self.image_path = Base64.encode64(\n SecureRandom.hex(10) + \n Time.now.to_i.to_s).chomp + \".jpg\"\n\n tempfile = Tempfile.new(image_path)\n file_path = tempfile.path\n\n system(\"wget --no-check-certificate \"\\\n \"-U '#{CONFIG[:user_agent]}' '#{orig_image_url}' \"\\\n \"-T 30 -t 3 \"\\\n \"--output-document '#{file_path}'\")\n\n\n if File.exists? file_path\n\n # Store original image\n #\n FileSystem.store(\n image_path,\n open(file_path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create tiny thumbnail\n #\n #image = MiniMagick::Image.open(file_path)\n\n #ImageUtilities.reduce_to_with_image(\n # image,\n # {:width => 180,:height => 180})\n\n #FileSystem.store(\n # thumbnail_path,\n # open(image.path),\n # \"Content-Type\" => \"image/jpeg\",\n # \"Expires\" => 1.year.from_now.\n # strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create square thumbnail\n #\n base = MiniMagick::Image.open(File.join(\n RAILS_ROOT,\n IMAGES[:white_200x200]))\n image = MiniMagick::Image.open(file_path)\n\n base = base.composite(image) do |canvas|\n canvas.gravity \"Center\"\n canvas.geometry \"200x200+0+0\"\n end\n\n FileSystem.store(\n square_path,\n open(base.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create blurred thumbnail\n #\n image = MiniMagick::Image.open(base.path)\n\n image.combine_options do |canvas|\n canvas.blur \"2.5x2.5\"\n end\n\n FileSystem.store(\n blur_path,\n open(image.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n # Create giant thumbnail\n #\n image = MiniMagick::Image.open(file_path)\n\n ImageUtilities.reduce_to_with_image(\n image,\n {:width => 520,:height => 390})\n\n FileSystem.store(\n giant_path,\n open(image.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n\n # Create unit.\n #\n base = MiniMagick::Image.open(File.join(\n RAILS_ROOT,\n IMAGES[:fb_unit_base]))\n overlay = MiniMagick::Image.open(File.join(\n RAILS_ROOT,\n IMAGES[:fb_unit_overlay]))\n image = MiniMagick::Image.open(file_path)\n\n base = base.composite(image) do |canvas|\n canvas.quality \"100\"\n canvas.gravity \"Center\"\n canvas.geometry \"407x407+0+0\"\n end\n\n base = base.composite(overlay) do |canvas|\n canvas.quality \"100\"\n canvas.gravity \"NorthWest\"\n canvas.geometry \"54x54+447+19\"\n end\n\n FileSystem.store(\n unit_path,\n open(base.path),\n \"Content-Type\" => \"image/jpeg\",\n \"Expires\" => 1.year.from_now.\n strftime(\"%a, %d %b %Y %H:%M:%S GMT\"))\n\n self.is_processed = true\n self.save!\n end\n\n rescue MiniMagick::Invalid => ex\n LoggedException.add(__FILE__,__method__,ex)\n end", "def random\n Client.get(\"/colors/random\")\n end", "def random\n Client.get(\"/patterns/random\")\n end", "def get_rand_circuit(name=\"circvit\")\n \n name=name.upcase.scan(/[A-Z]/).join.scan(/[^U]/).join.split(//)\n \n \n family= %w{will belief desire}\n family=family.shuffle\n \n fill = Magick::HatchFill.new(\"Transparent\", \"LightGreen\")\n \n i = Magick::ImageList.new \n i.new_image(333, 333, fill){ self.background_color = \"Transparent\" }\n gc = Magick::Draw.new\n \n \n gc.gravity(Magick::CenterGravity)\n gc.stroke(\"#33cc33\")\n gc.fill(\"#222222\")\n gc.stroke_width(20)\n gc.circle(167, 167, 167, 20)\n gc.stroke(\"#3333cc\")\n gc.fill(\"transparent\")\n gc.stroke_width(2)\n gc.circle(167, 167, 167, 25)\n gc.circle(167, 167, 167, 15)\n gc.circle(167, 167, 167, 22)\n gc.circle(167, 167, 167, 17)\n gc.draw(i)\n\n (0..name.length-1).each do |n|\n i.new_image(333, 333){ self.background_color = \"Transparent\" }\n gc = Magick::Draw.new \n gc.stroke(\"transparent\")\n gc.fill(\"transparent\")\n \n gc.pointsize = (52 + (rand(23)) )\n \n gc.gravity(Magick::CenterGravity)\n f=rand(3)\n gc.font= \"#{Rails.root}/app/assets/fonts/akho#{family[f]}.ttf\" \n gc.text((-rand(72) + rand(72)), (-rand(72) + rand(72)), name[n]).rotate(rand(360))\n gc.fill('red')\n gc.text((-rand(72) + rand(72)), (-rand(72) + rand(72)), name[n]).rotate(rand(360))\n gc.draw(i)\n \n end\n \n \n @Circuit=i.flatten_images\n @Circuit.format = 'png'\n \n \n @circuit_file = \"#{Rails.root}/tmp/circuit-#{name.join}-#{Time.now.to_i}-#{Process.pid}.png\"\n \n \n @Circuit.write('png:'+ @circuit_file)\n \n \n \n \n\n @data_uri = Base64.encode64(@Circuit.to_blob).gsub(/\\n/, \"\") \n @image_tag = '<img alt=\"preview\" src=\"data:image/png;base64,%s\">' % @data_uri\n \n end", "def random_link\n response = get('/random', nil)\n headers = response[:response_headers]\n location = headers[:location]\n\n link_id = location[/\\/tb\\/(.*)/, 1]\n link \"t3_#{link_id}\"\n end", "def logo\n rand_num = rand(1..13)\n \"https://pigment.github.io/fake-logos/logos/medium/color/#{rand_num}.png\"\n end", "def download_resource(loader, src_url)\n # play nice with remote web servers\n sleep(rand / 100) if src_url =~ /^[[:alpha:]]+:/\n begin\n loader.spec_invoke(:data_source, src_url, nil)\n rescue Exception => e\n # FIXME: log\n $stderr.puts \"[NOKOGIRI] Cannot download resource : #{e.message}\"\n $stderr.puts e.backtrace[0,2].join(\"\\n\")\n nil\n end\n end", "def dl_image (url)\n _filename = @img_path + '/' + url.split('/').last\n begin\n if !File.directory?(@img_path)\n require 'fileutils'\n FileUtils::mkdir_p @img_path\n puts \"[INFO] created path '#{@img_path}'\"\n end\n puts \"[INFO] writing image file '#{_filename}'\"\n File.open(_filename, 'wb') do |file|\n file.write open(url).read\n end\n return _filename\n rescue Exception => e\n puts \"[ERROR] in 'DavidGetter#dl_image': #{e}\"\n end\n return nil\n end", "def cover_url\n case self.category\n when \"Nutrition\"\n \"nutrition.jpeg\" \n when \"Activity\"\n \"activity.jpeg\"\n when \"Exercise\"\n \"exercise.jpeg\"\n when \"Rehabilitation\"\n \"rehabilitation.jpeg\"\n when \"Medication\"\n \"medications.jpeg\"\n else\n \"activity.jpeg\"\n end\n end", "def fetch_image(host,old_file,new_file)\n\t`rm #{old_file}` \n\t`mv #{new_file} #{old_file}`\t\n\topen('assets/images/radar/new.png', 'wb') do |file|\n\t\tfile << open('host').read\n\tend\n\tnew_file\nend", "def images_for(category)\n file = \"#{settings.public_folder}/data/#{category}.txt\"\n File.readlines(file).map { |s| File.join '/data', category, s.chomp }\n end", "def save_images(mkd,path)\n regexp_img_links = /!\\[(.*?)\\]\\((.*?)\\)/\n img_dirname = File.basename(path)\n FileUtils.mkdir_p(path,{:mode => 0755})\n client = HTTPClient.new\n mkd.gsub!(regexp_img_links).with_index do |matched,i|\n #save image\n alttext = $1\n imgurl = $2\n $stdout.puts imgurl\n\n ext = File.extname(imgurl).match(/(.*?)(?:\\?.*)?$/)[1]\n filename = (\"%07\\d\" % i)+ext\n filename_fullpath = File.join(path,filename)\n begin\n data=client.get_content(imgurl)\n rescue\n # if we could not get image,we do not edit link.\n next \"![#{alttext}](#{imgurl})\"\n end\n File.open(filename_fullpath,\"w\"){|file| file.write(data)}\n\n #fix the link\n \"![#{alttext}](#{File.join(\"./\",img_dirname,filename)})\"\n end\nend", "def image_url\n # It's just stored in public/data/slug.jpg or whatever the relevant file\n # extension is\n image = Dir[\"public/data/#{slug}.*\"].first.split(\"/\").last\n # That's accessed publicly over the website as /data/slug.jpg or whatever\n \"/data/#{image}\"\n end", "def assign_random_avatar\n self.image_url = \"random_avatars/#{(rand * 9).ceil}.png\" if image_url.nil?\n end", "def show\n\n # Get random gif from Giphy (http://giphy.com)\n response = HTTParty.get('http://api.giphy.com/v1/gifs/search?' +\n 'q=' + @boolio.val.to_s +\n '&api_key=dc6zaTOxFJmzC' + # provided for public beta testing via (https://github.com/Giphy/GiphyAPI#public-beta-key)\n '&limit=1' + # only want 1\n '&offset=' + rand(30).to_s + # pull from the top 10 most relevant images\n '&rating=pg' + # afraid if this is any higher\n '&fmt=json' # seems to return JSON anyway, but just in case\n )\n\n if response.code == 200\n\n # conver to JSON\n json = JSON.parse response.body, object_class: OpenStruct\n\n # set image from returned results\n @image = json.data[0].images if json.data.count > 0\n end\n\n end", "def charcoal\n @photo = Photo.find(params[:id])\n img = Magick::Image.read('public' + @photo.attachment_url).first\n img = img.charcoal(0.0, 1.0)\n img.write('public' + @photo.attachment_url)\n end", "def top_image(url)\n og_image = check_og_image(url)\n apple_image = check_apple_image(url)\n mechanize_search = mechanize_search(url)\n if og_image\n return og_image\n elsif apple_image\n return apple_image\n elsif mechanize_search\n mechanize_search \n # In case all else fails ...\n else\n \"../image-dne.jpg\"\n end\n end", "def download_slideshow\n Down.download bucket_url.url\n end", "def avatar_url\n\t\t\"http://zombitar.com/#{id}.jpg\"\n\tend", "def get_image\n source_file = Item.new(Path.new(params[:source]+\".\"+params[:type]))\n begin\n send_file source_file.path, :filename => source_file.path.basename.to_s, :type => \"image/#{params[:type]}\"\n rescue \n not_found\n end\n end", "def generate_random_images\n file_path = @settings[\"image_path\"]\n\n #clear old cache\n if @settings[\"destroy_captcha_images\"]\n ScalableCaptchaData.connection.execute(\"TRUNCATE TABLE #{ScalableCaptchaData.table_name}\")\n\n #clear local directory for images\n FileUtils.rm_r(file_path) if File.exists? file_path\n end\n \n FileUtils.mkdir file_path unless File.exists? file_path\n \n #generate image accordingly to random number ... and this should be done only once.\n generated_image = Magick::Image.new(110, 30) \n\n @settings[\"image_pool\"].to_i.times do\n @image = generated_image.clone\n \n value = generate_scalable_captcha_data(@settings[\"image_options\"][\"code_type\"])\n key = Digest::SHA1.hexdigest(Time.now.to_s + rand.to_s)\n\n data = ScalableCaptchaData.find_by_key(key) || ScalableCaptchaData.new(:key => key)\n data.value = eval(value)\n data.save\n\n @scalable_captcha_image_options = {\n :scalable_captcha_key => key,\n :color => \"darkblue\",\n :distortion => ScalableCaptcha::ImageHelpers.distortion(@settings[\"image_options\"][\"distortion\"]),\n :image_style => ScalableCaptcha::ImageHelpers.image_style(@settings[\"image_options\"][\"image_style\"])\n }\n set_scalable_captcha_image_style(value)\n\n #save image to local file\n @image = @image.add_noise(Magick::ImpulseNoise)\n @image.write(\"#{@settings[\"image_path\"]}/#{data.id}.gif\")\n puts \"generated: #{@settings[\"image_path\"]}/#{data.id}.gif\"\n sleep(@settings[\"sleep_time\"].to_i)\n end\nend", "def image(id, nsfw = false)\n img = get url: \"images/#{id}\", nsfw: nsfw\n img['image'] if img\n end", "def image_from_url(url)\n self.image.attach(io: URI.open(url), filename: 'generated-sketch.jpg')\n end", "def rip\n # mech = Mechanize.new\n\n tag = folder\n puts \"Downloading Tag: '%s'...\" % tag\n cd_to folder_path(tag)\n\n base_url = url[/https?:..[^\\/]*/]\n next_link = url\n begin\n puts \"Downloading page '%s'...\" % next_link\n # doc = mech.get(next_link)\n doc = doc_for_url(next_link) # mech.get(next_link)\n links = doc.links\n next_link = links.find{|a| a.attributes.any?{|k,v| [k,v] == ['class','next_page'] } }\n next_link &&= base_url + next_link.href\n pages = links.select{|a| a.attributes.any?{|k,v| k == 'class' && v =~ /thumb/ } }\n pages.map do |a|\n puts \"a.href => #{base_url + a.href}\"\n # m = Mechanize.new\n # pg = m.get base_url + a.href\n pg = doc_for_url(base_url + a.href) #m.get base_url + a.href\n img = pg.links.find{|pga| pga.dom_id == 'highres' }\n\n if img == nil\n puts \"CAN NOT FIND #highres on '%s'\" % a.href\n next\n end\n\n filename = \"%s\" % [File.basename(img.href).sub(/\\?.*/,'')]\n\n if File.exists? filename\n puts \"Skip existing file '%s'...\" % filename\n else\n puts \"Saving '%s'...\" % filename\n # m.get(img.href).save_as(filename)\n doc_for_url(img.href).save_as(filename)\n end\n end\n end while next_link\n end", "def download(file_name, options={})\n options['iiprop'] = 'url'\n\n attributes = image_info(file_name, options)\n if attributes\n RestClient.get attributes['url']\n else\n nil\n end\n end", "def getimage\n if @artist.images.empty?\n @image = \"image1.jpg\"\n else\n @image = @artist.images.first[\"url\"]\n end\n end", "def fetch_cover(response, file_name)\n res = response.to_h\n response_url = res['RESPONSE']['ALBUM']['URL']\n title = res['RESPONSE']['ALBUM']['TITLE']\n file_name = file_name || \"#{title}-cover.jpg\"\n\n APIRequest.get_file(response_url, filename)\n end", "def get_image_url(newspaper, date)\n date_path = get_date_path(date)\n\n return \"https://tar.mx/periodicos-mexico/dl/#{date_path}/#{newspaper}_t.jpg\"\nend", "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 image\n #images = Musicbrainz_db.get_cover_art(self.id)[\"images\"]\n\n images = SearchModule.get_cover_art(self.id)\n if images != nil\n return images[\"images\"].first[\"thumbnails\"][\"large\"]\n else\n return 'http://djpunjab.in/cover.jpg'\n end\n end", "def get_timage_from_yd\n if (params['gid'].nil?)\n txt = \"\"\n else\n user = User.find_by_sql(\"select id, dh, yxmc, jm_tag,width,height from timage where id=#{params['gid']};\")\n dh,width,height = user[0]['dh'], user[0]['width'], user[0]['height']\n\n if !File.exists?(\"./dady/img_tmp/#{dh}/\")\n system\"mkdir -p ./dady/img_tmp/#{dh}/\" \n end\n \n convert_filename = \"./dady/img_tmp/#{dh}/\"+user[0][\"yxmc\"].gsub('$', '-').gsub('TIF','JPG').gsub('tif','JPG')\n local_filename = \"./dady/img_tmp/#{dh}/\"+user[0][\"yxmc\"].gsub('$', '-')\n\n if !File.exists?(local_filename)\n user = User.find_by_sql(\"select id, dh, yxmc, jm_tag from timage where id=#{params['gid']};\")\n im_data = get_image_by_gid(params['gid'])\n\n tmpfile = rand(36**10).to_s(36)\n ff = File.open(\"./tmp/#{tmpfile}\",'w')\n ff.write(im_data)\n ff.close\n puts \"./tmp/#{tmpfile} #{local_filename}\"\n if (user[0]['jm_tag'].to_i == 1)\n system(\"decrypt ./tmp/#{tmpfile} #{local_filename}\")\n else\n system(\"scp ./tmp/#{tmpfile} #{local_filename}\")\n end \n system(\"rm ./tmp/#{tmpfile}\")\n end\n \n system(\"convert '#{local_filename}' '#{convert_filename}'\")\n if (convert_filename.upcase.include?'JPG') || (convert_filename.upcase.include?'TIF') || (convert_filename.upcase.include?'TIFF') || (convert_filename.upcase.include?'JPEG') \n imagesize=FastImage.size convert_filename\n \n if imagesize[0].to_i > imagesize[1].to_i\n txt = \"/assets/#{convert_filename}?2\"\n else\n txt = \"/assets/#{convert_filename}?1\"\n end\n else\n txt = \"/assets/#{convert_filename}?2\"\n end\n archive= User.find_by_sql(\"select * from archive where dh='#{dh}';\")\n set_rz(archive[0]['mlh'],'','','','影像查看',params['userid'],user[0][\"yxmc\"],user[0][\"yxmc\"],dh)\n end\n render :text => txt\n end", "def get_image_by_uuid\n @command = :get_image_by_uuid\n # the UUID was the last \"previous argument\"\n image_uuid = @prev_args.peek(0)\n # setup the proper URI depending on the options passed in\n uri = URI.parse(@uri_string + '/' + image_uuid)\n # and get the results of the appropriate RESTful request using that URI\n result = hnl_http_get(uri)\n # finally, based on the options selected, print the results\n print_object_array(hash_array_to_obj_array([result]), \"Image:\")\n end", "def download_image(src_url,dest_path)\n src_url = src_url.gsub(/\\?.*/,'')\n content_type = http_content_type(src_url)\n content_type = content_type.gsub(\"image/\", \"\").gsub(\"jpeg\",\"jpg\")\n content = open(src_url).read\n basename = Pathname.new(src_url).basename.to_s.gsub(/\\..*/,'')\n vortex_url = dest_path + basename + \".\" + content_type\n vortex_url = vortex_url.downcase\n begin\n @vortex.put_string(vortex_url, content)\n rescue Exception => e\n puts e.message\n pp e.backtrace.inspect\n puts \"vortex_url: \" + vortex_url\n exit\n end\n\n # Store a resized image to vortex\n puts \"Nedskalerer bilde: \" + src_url\n content_resized = resize_image(content, content_type,300)\n vortex_url_resized = dest_path + basename + \"_width_300.\" + content_type\n\n vortex_url_resized = vortex_url_resized.downcase\n begin\n @vortex.put_string(vortex_url_resized, content_resized)\n rescue Exception => e\n puts e.message\n pp e.backtrace.inspect\n puts \"vortex_url_resized: \" + vortex_url_resized\n exit\n end\n\n return { :vortex_url_resized => vortex_url_resized, :vortex_url => vortex_url}\nend", "def save_image(url)\n file_name = get_filename(url)\n dir_name = '/vagrant/bookinfo/public/'\n file_path = dir_name + file_name\n\n mechanize = Mechanize.new\n page = mechanize.get(url)\n page.save_as(file_path)\n\n return file_path\n end", "def download_asset(prog_id)\n return download_data(\"http://www.channel4.com/programmes/asset/#{prog_id}\")\n end", "def fetch_map_preview(latitude, longitude, zoom)\n tile = get_tile_number(latitude, longitude, zoom)\n api_url = \"http://tile.openstreetmap.org/#{zoom}/#{tile[:x]}/#{tile[:y]}.png\"\n file_name = \"#{latitude}_#{longitude}_#{zoom}.png\"\n File.new(file_name, File::CREAT)\n Down::NetHttp.download(api_url, destination: \"./#{file_name}\")\n\n file_name\nend", "def get_local_image(uri)\n # local?\n return uri unless uri[0,4] == 'http'\n\n ext = uri.split('.').last\n\n img_folder = './tmp/dl_img'\n Dir.mkdir(img_folder) unless Dir.exist?(img_folder)\n\n local_file = \"#{img_folder}/#{Digest::MD5.hexdigest(uri)}.#{ext}\"\n\n # wget is reliable downloader\n `wget -O #{local_file} #{uri}` unless File.exists?(local_file)\n\n local_file\n end", "def trip(barcode_base, steps=5000) # (1) \r\n\r\n steps.times do # (2) \r\n prng = Random.new\r\n\tbcd = make_mnhn_barcode barcode_base\r\n barcode_base += 1#prng.rand(10)\r\n\ths_url = url_for_mnhn(bcd)\r\n puts hs_url\r\n page = fetch(hs_url)\r\n\tif !page.nil?\r\n image_link = scrape_image_link(page)\r\n\t puts image_link\r\n\t if image_link != \"\"\r\n fetch_image(image_link, bcd)\r\n\t end\r\n\tend\r\n end\r\nend", "def random\n random_card = self.class.get('/cards/random')\n end", "def get_img_all\n while not @end_state\n puts \"Currently downloading: #{@current_title}\"\n get_img\n next_page\n @global_count += 1\n if not @ch_limit.nil? and @global_count == @ch_limit\n @end_state = true\n end\n end\n puts \"Finished downloading!\"\n end", "def download_image(url, directory, id, resize = false)\n uri = URI.parse(URI.escape(url))\n destination = File.join(File.dirname(__FILE__), \"images\", directory)\n filename = File.join(destination, \"#{id}.jpg\")\n\n begin\n Net::HTTP.start(uri.host) do |http|\n resp = http.get(uri.path)\n begin\n f = open(filename, \"wb\")\n http.request_get(uri.path) do |resp|\n resp.read_body do |segment|\n f.write(segment)\n end\n end\n ensure\n f.close\n end\n end\n rescue => e\n puts \"Error downloading #{url}\"\n puts e.message\n resize = false\n end\n \n # Resize the image if nessasary\n if resize\n begin\n resized_filename = File.join(destination, \"#{id}_resized.jpg\")\n ImageList.new(filename).resize_to_fit(SCALE_TO, SCALE_TO).write(resized_filename)\n rescue => e\n puts \"Error resizing image\"\n puts e.message\n end\n end\nend", "def getRndImgFromDir(hash) \n\t\tsetImgDir()\n\t\tfolder_count = getFolderCount(hash[:folder_index]) #Get folder count of directory\n\t\toutput_array = []\n\t\ti = 0;\n\t\twhile i < hash[:count] do\n\t\t hash[:entry_path] = (rand(folder_count * folder_count) % folder_count) + 1\n\t\t file_path = Dir[\"#{DEFAULT_DIRECTORY}/#{hash[:folder_index]}/#{hash[:entry_path]}/#{getRndImgFromSubDir(hash)}*\"]\n\t\t output_array << (file_path.nil? ? \"\" : file_path[0])\n\t\t i +=1;\n\t\tend\n\t\toutput_array\n\t\t\n\t\t#get count of subfolders\n\t\t#Get random value\n\t\t#Call Subdir to get random image\n\tend", "def incremental_image_urls(url)\n log \"method begin\" if $DEBUG\n login if not logged_in?\n log \"logged in\" if $DEBUG\n\n page = agent.get(url)\n log \"got page\" if $DEBUG\n\n links = page.links.select {|l| l.href =~ /wallbase.cc\\/wallpaper/ } \n log \"selected links\" if $DEBUG\n links.each do |l|\n page = l.click\n log \"clicked link\" if $DEBUG\n url = page.image_urls().select {|e| e.match /wallbase2/ }.first\n puts url\n end\n\n end", "def get_file(url); end", "def random(type: nil, tags: [], hidden: false, nsfw: false, file_type: nil)\n tags = tags.map { |t| t.name if t.is_a(Tag) }\n WeebImage.new(API::Toph.random(self, {\n type: type,\n tags: tags,\n hidden: hidden,\n nsfw: nsfw,\n file_type: file_type\n }), self)\n end", "def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend", "def download_protocol_images(page, district_dir, district_id, precinct_id)\n ##################\n # GET HTML PAGE\n ##################\n begin\n @logger_info.info(\"Retrieving: #{page}\")\n agent = Mechanize.new { |agent| agent.user_agent_alias = \"Mac Firefox\" }\n html = agent.get(page).body\n @logger_info.info(\"Retrieved page: #{page}\")\n rescue => e\n @logger_error.error(\"Unable to retrieve: #{page} | #{e}\")\n end\n\n ##################\n # GET IMAGES\n ##################\n doc = Nokogiri::HTML(html)\n images = doc.css(\"img\")\n links = images.map { |i| i['src']}\n amend_count = 1\n\n if links.length > 1\n links.each_with_index do |value,index|\n if index > 0\n img_uri = value.sub('../../','')\n img_url = \"http://#{@url}/#{img_uri}\"\n img_bname = \"#{district_id}-#{precinct_id}\"\n\n begin\n unless File.exists?(\"#{district_dir}#{img_bname}_amendment_#{amend_count}.jpg\")\n @logger_info.info(\"Downloading amendment: #{img_bname}\")\n open(\"#{district_dir}#{img_bname}_amendment_#{amend_count}.jpg\", 'wb') do |pfile|\n puts \"Downloading: #{district_dir}#{img_bname}_amendment_#{amend_count}.jpg\"\n pfile << open(img_url).read\n end\n @logger_info.info(\"Downloaded amendment: #{img_bname}\")\n amend_count += 1\n @amend_counter += 1\n end\n rescue => e\n @logger_error.error(\"Download failed: #{img_bname} | #{e}\")\n next\n end\n end # if index\n end # links\n end\n\n sleep(0)\nend", "def display_img_url(url)\n url.sub(/s90$/, 's360') \n # recipe_response = Faraday.get(\"http://api.yummly.com/v1/api/recipe/#{id}\",\n # _app_id: ENV['YUMMLY_APP_ID'],\n # _app_key: ENV['YUMMLY_APP_KEY'])\n # image = JSON.parse(recipe_response.body)['images'].try(:first)\n # image['hostedLargeUrl'].present? ? image['hostedLargeUrl'] : image['hostedMediumUrl'] if image.present?\n end", "def image_data\n response = nil\n\n Net::HTTP.start(SERVICE_HOST) do |http|\n response = http.get(URI.parse(@url).path + ':medium')\n\n if response.code.to_s =~ /\\A3\\d\\d/\n new_location = URI.parse(response['Location'])\n Net::HTTP.start(new_location.host) do |http|\n response = http.get(new_location.path + '?' + new_location.query)\n end\n end\n end\n\n response.body\n end", "def image(local=1)\n unless cururl.index(Internet_path)\n fail \"You can only do this on a Researchr wikipage\"\n end\n wiki = cururl[22..-1]\n w,dummy = wiki.split(\"?\")\n wikipage = w.gsubs({:all_with => \"_\"}, \":\", \"%3A\", \"%20\").downcase\n\n if local==1\n curfile = File.last_added(\"#{Home_path}/Desktop/Screen*.png\") # this might be different between different OSX versions\n else\n dir = File.last_added_dir(Photostream_path) # this might be different between different OSX versions\n curfile = File.last_added(dir+\"*.JPG\")\n end\n if curfile == nil\n growl(\"No screenshots available\")\n exit\n end\n\n newfilename, pagenum = filename_in_series(\"#{Wiki_path}/data/media/pages/#{wikipage}\",\".png\")\n p newfilename\n if File.exists?(newfilename)\n pbcopy(\"\")\n fail(\"File already exists, aborting!\")\n end\n puts %Q(mv \"#{curfile.strip}\" \"#{newfilename}\")\n `mv \"#{curfile.strip}\" \"#{newfilename}\"`\n if defined?(dir) # if from iCloud\n `rm -rf \"#{dir}\"`\n `sips --resampleWidth 487 #{newfilename}`\n end\n `touch \"#{newfilename}\"` # to make sure it comes up as newest next time we run filename_in_series\n\n pbcopy(\"{{pages:#{wikipage}#{pagenum}.png}}\")\nend", "def fetch(url)\n\tputs \"now fetchin \" + url\n\tresponse = \"\"\n\tfilename = \"cache/\" + url.split(\"/\")[-1]\n\t\n\tbegin\n\t#If the file doesn't exist, download it\n\t if ! File.exists?(filename)\n\t open(url) { |f| response = f.read }\n\t File.open(filename, 'w') {|f| f.write(response) }\n # Give the website a break\n sleep(5)\n\t end\n\t \n # Open the saved file eitherway\n open(filename) { |f| response = f.read }\n\t thedoc = Hpricot(response)\n\n\trescue Exception => e\n\t print e, \"\\n\"\n\t debugger\n\tend\n\treturn thedoc\nend", "def random_url(opts = {})\n if opts[:api] != false\n \"#{API_ROOT}/random\"\n else\n \"#{WWW_ROOT}/random.php\"\n end\n end" ]
[ "0.6988688", "0.6918402", "0.6712526", "0.66827035", "0.65710175", "0.65266716", "0.65016913", "0.6251399", "0.6185399", "0.6150518", "0.60608083", "0.6057675", "0.60356116", "0.6012253", "0.6006735", "0.5994157", "0.5989509", "0.5982584", "0.59241086", "0.58936983", "0.58634156", "0.5833366", "0.58317715", "0.5815416", "0.57544976", "0.5748444", "0.57431424", "0.5736932", "0.5721949", "0.57152426", "0.57089037", "0.5702901", "0.5702901", "0.56847763", "0.5680122", "0.5624484", "0.56185967", "0.55862117", "0.55714357", "0.5556904", "0.5555763", "0.5545058", "0.5538385", "0.55260605", "0.5523941", "0.55177957", "0.5505198", "0.55044055", "0.54887927", "0.54882926", "0.5483355", "0.54732746", "0.5473176", "0.54525995", "0.5451185", "0.54455286", "0.54272103", "0.54229593", "0.54139453", "0.54117024", "0.5398841", "0.5382316", "0.53788745", "0.5375784", "0.537176", "0.53646433", "0.53606296", "0.53554267", "0.5345912", "0.53436893", "0.5331415", "0.5329334", "0.5328695", "0.53196335", "0.530562", "0.53051305", "0.5304549", "0.5296642", "0.52891415", "0.52826685", "0.52695554", "0.52684885", "0.5261173", "0.52567834", "0.5256566", "0.5255534", "0.52527803", "0.5248345", "0.52470326", "0.5242319", "0.5237513", "0.5236197", "0.5230141", "0.52189463", "0.5199495", "0.5194825", "0.5187926", "0.51848155", "0.5182083", "0.51813745" ]
0.79044473
0
get user information from an email address
def user_info_by_email( email ) id = User.cid_from_email( email ) return user_info_by_cid( id ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_by_email(email)\n get(\"get_user_by_email&email=#{email}\")\n end", "def getUserBy_email( email)\n params = Hash.new\n params['email'] = email\n return doCurl(\"get\",\"/user/by_email\",params)\n end", "def by_email address, options={}, headers={}\n params = options.merge({ email: address })\n @connection.get \"users/by_email.json\", params, headers\n end", "def get_user_email\n useremail[:value]\n end", "def get_email(email)\n self.api_get(:email, {:email => email})\n end", "def find_user_by_email email\r\n response = make_request 'GetShopperByEmail', { :email => email }\r\n return unless valid?\r\n response = response.to_hash[:GetShopperByEmailResponse].try(:[], :GetShopperByEmailResult)\r\n { :first_name => response[:FirstName], :last_name => response[:LastName], :rewards_id => response[:ShopperId] } if response\r\n end", "def email_address\n response = get 'v1/market/private/user/email.json'\n response[:email]\n end", "def read_user_emailtoken(emailtoken)\n filter = Net::LDAP::Filter.eq(ENTITY_ATTR_MAPPING[:emailtoken].to_s, emailtoken)\n return search_map_user_fields(filter, 1)[0]\n end", "def for_email(email)\n Iterable.request(conf, \"/users/#{email}\").get\n end", "def select_user_information(mail)\n return get_db_as_hash().execute(\"SELECT * FROM user WHERE mail = ?\", mail).first\n end", "def get_email_address\n response = get_current_user_meta('email')\n email = response['query']['userinfo']['email']\n return if email == ''\n\n email\n end", "def get_data(email)\n if !email.is_a? String\n error = InvalidOptions.new(['Email(String)'], ['Email(String)'])\n raise error\n end\n\n get_request '/profile_lookup/', :person_email => email\n end", "def get_user_by_email(order)\n response = HTTParty.get(\"#{Rails.application.secrets.mapp_integration[:api_endpoint]}\"+\"/user/getByEmail\", headers: headers, query: user_get_by_email_query(order.email))\n user_id_from_response = response.parsed_response[\"id\"]\n\n begin\n if user_id_from_response.nil?\n guest_user_response = Workarea::MappIntegration::MappIntegrationGateway.new.user_creation_for_guest_user(order)\n user_id = guest_user_response.parsed_response[\"id\"]\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id)\n else\n Workarea::MappIntegration::MappIntegrationGateway.new.mapp_integration_for_order_placed(order, user_id_from_response)\n end\n rescue Timeout::Error => e\n Rails.logger.info \"Rescued #{e.message}\"\n end\n end", "def find_user_by_email(auth_token, user_email, origin_oem_str)\n return nil if user_email.blank?\n body = { :auth_token => auth_token }\n options = { body: body.to_json,\n method: :get,\n return_err_value: nil,\n query: {email: user_email,\n origin_oem_str: origin_oem_str}\n }\n user = call_external_service_with_service_token(Aylauth::Settings.user_service_base_url + \"/api/v1/public/users/show_by_email.json\", options)\n return if user.blank?\n return UserData.new(user)\n end", "def get_user_data(email)\n user_id = $db.execute(\"SELECT user_id FROM users WHERE email = ?\", email)[0][\"user_id\"]\n username = $db.execute(\"SELECT username FROM users WHERE email = ?\", email)[0][\"username\"]\n rank = $db.execute(\"SELECT rank FROM users WHERE email = ?\", email)[0][\"rank\"].to_i\n\n return {user_id: user_id, username: username, rank: rank}\nend", "def getUserEmail(userName)\n\n if(userName == nil)\n return \"User not Found!\"\n end\n user = loadUser(userName)\n if user == nil\n return \"User not Found!\"\n end\n return user[\"email\"]\n\n end", "def find_by_email(email)\n sender = Client.get(\"#{path}/find_by_email\", query: { email: email })\n initialize_from_hash(sender['user'])\n end", "def fetch_users_info(emails)\n endpoint = \"/api/#{@version}/user/info/\"\n custom_params = {\n 'emails' => emails.join(',')\n }\n make_get_request(endpoint, custom_params)\n end", "def email\n userid.try(:match, / <(.*@.*)>/).try(:[], 1)\n end", "def find_user_by_email(email: user&.email)\n users = client.list_users(\"active\", {\n filter: email,\n order: \"ascending\",\n page: 1\n })\n\n users.first\n end", "def get_info_from_mail(login_mail)\n\n db = connect_to_db(\"db/db.db\")\n\n db.execute(\"SELECT * FROM users WHERE mail=?\", [login_mail]).first\n end", "def get_user_info(credentials)\n\t \n\n service = Google::Apis::Oauth2V2::Oauth2Service.new\n service.authorization = credentials\n user_info = service.get_userinfo\n\t \n\t if user_info != nil && user_info.id != nil\n\t return user_info\n\t end\n\t raise NoUserIdError, 'Unable to retrieve the e-mail address.'\n\tend", "def email_from_infos\n user_infos.map(&:email).try(:first)\n end", "def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end", "def get_user_by_email(email)\n User.find_by(:email => email)\nend", "def search_for_user_email(username) # :yields: JSON\n begin\n if @@app_token == nil\n raise \"Authentication not provided\"\n end\n uri=URI.parse(@uri_builder.get_user_contents(Api_options::USER::EMAIL,username:username, app_token:@@app_token))\n @uri_builder=nil\n\n HttpHandler.create_http uri\n\n response=HttpHandler.get_response(@@http,uri)\n @response_status=true\n return response\n\n end\n\n\n\n\n\n end", "def get_user_email\n unless auth_hash\n return nil if recaptcha_enabled? && !verify_recaptcha\n return params['email']\n end\n\n case auth_hash.provider\n when 'twitter'\n auth_hash.info.nickname\n when 'github'\n check_user_github_organizations ? auth_hash.info.email : nil\n else\n auth_hash.info.email\n end\n end", "def parse_user(name, email, trailer)\n link_to_user User.find_by_any_email(email),\n name: name,\n email: email,\n trailer: trailer\n end", "def read\n\t\tuser = User.find_by_username(params[:username])\n\t\tif user\n payload = {\n username: user.username,\n first_name: user.first_name,\n last_name: user.last_name,\n created_at: user.created_at.strftime(\"%-m/%-d/%Y\")\n }\n\t\t\tif @current_user and @current_user.id == user.id\n payload[:email_address] = user.email_address\n end\n render status: 200, json: payload\n\t\telse\n\t\t\trender status: 404, json: {error: true}\n\t\tend\n\tend", "def email\n connect\n user = self.class.query('CMD_API_SHOW_USER_CONFIG',\n :user => resource[:username]\n )\n return user[\"email\"]\n end", "def for_user(user)\n find_by(user_email: user.emails)\n end", "def find_email\n val = @email\n return if val.nil? \n val = LdapQuery::Scanner.search(val).as_user_attributes[:email] \n if val.nil?\n errors.add :base, 'Email address not found'\n return false\n end\n @email = val\n xdelegate = User.find_by_email(val.to_s)\n if xdelegate.nil?\n errors.add :base, 'Email does not have an account on this website'\n return false\n else\n self.delegate_user_id = xdelegate.id\n end\n\n end", "def email\n query_params&.dig(:email)\n end", "def email\n return unless @user.loa3?\n\n value_for('emails')&.first\n end", "def get_for_email(email)\n full_path = full_resource_path(\"/email\")\n query_params = MaropostApi.set_query_params({\"contact[email]\" => email})\n \n MaropostApi.get_result(full_path, query_params)\n end", "def user_lookup(email, id = false)\n if id\n send_req({act: :user_lookup, unique_id: email})\n else\n send_req({act: :user_lookup, cloudflare_email: email})\n end\n end", "def get_user_by_email_for_current_tenant(args = {}) \n get(\"/users.json/email/#{args[:email]}\", args)\nend", "def get_user_by_email_for_current_tenant(args = {}) \n get(\"/users.json/email/#{args[:email]}\", args)\nend", "def from_email\n EmailAddress.find(:all).first\n end", "def user_email\n @gapi.user_email\n end", "def get_user_email\n user = User.find(self.user_id)\n user.email\n end", "def identify_user\n user_email = params[:email]\n response = User.identify_user(user_email)\n render json: response\n end", "def show_by_email\n user = User.get_user_by_email(params[:email]) # Obtain the user corresponding to the id\n\n if user != nil # If exist the user in DB\n response = { content: user, message: \"User has been obtained successfully\", status: 200 } # Return the corresponding user\n\n render json: response, status: 200\n else # If not exist data\n response = { content: {}, message: \"User not found\", status: 404 }\n\n render json: response, status: 404 # Return 'not found'\n end\n end", "def findUserByEmail(email)\n method = 'findUser'\n type = User\n args = {:email=>email}\n return_object type,method,args\n end", "def email\n params['email']\n end", "def username_by_email(email)\n request = client.search_users(email)\n if (request[:total_count]).zero?\n raise GithubIntegration::UsernameResolveException, \"User with email '#{email}' was not found\"\n end\n request[:items].first[:login]\n end", "def email_address\n authentications.emails.active.first.uid rescue nil\n end", "def search_user_by_email\n @users = User.get_all_users(current_user).where(email:params[:email], is_active: true).first\n get_tenants_user(@users)\n end", "def hubssolib_get_user_address\n user = self.hubssolib_current_user\n user ? user.user_email : nil\n end", "def find_client_by_email(email)\n rsp = HTTParty.get(HOST + \"/api/v2/desk/people/search?q=#{email}&fields=email&access_token=#{ACCESS_TOKEN}\")\n raise \"Request failed: #{rsp.code}, #{rsp}\" unless rsp.success?\n\n if rsp['results'].length > 0\n rsp['results'][0]['person']['id']\n end\nend", "def search_by_email(email)\n begin\n JSON.parse(RestClient.get construct_url(\"user/search/by_email/#{email}\"))\n rescue RestClient::BadRequest => e \n @last_error = e.http_body\n @last_error_code = e.http_code\n false\n end\n end", "def identify(username_or_email)\n return nil if username_or_email.blank? or username_or_email == 'Public'\n \n if username_or_email =~ /@/ \n active.find_by_email(username_or_email)\n else\n active.find_by_username(username_or_email)\n end \n end", "def userbyemail\n user = User.find_by_email(params[:email])\n \n if user\n render json: user\n else\n render json: { :success => false }\n end\n end", "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end", "def info\n {\n email: username\n }\n end", "def me\n User.find_by_email '[email protected]'\nend", "def user_email\n msg['email'] || entry['email'] || reject['email']\n end", "def get_ldap_user_attributies_by_email_alias(email:, attributes:)\n response = {}\n @treebase = 'dc=UoA,dc=auckland,dc=ac,dc=nz'\n filter = Net::LDAP::Filter.eq( 'objectCategory', 'user' ) & Net::LDAP::Filter.eq('proxyaddresses', \"smtp:#{email}\")\n attr_list = []\n attributes.each { |k, _v| attr_list << k }\n @ldap.search( base: @treebase, filter: filter, attributes: attr_list ) do |entry|\n attributes.each do |attribute, value|\n response[value] = entry[attribute][0].to_s.strip\n end\n return response # Only want the first entry\n end\n return nil\n end", "def get_email()\n email_regex = /\\A([\\w+\\-].?)+@[a-z\\d\\-]+(\\.[a-z]+)*\\.[a-z]+\\z/i\n user_email = \"\"\n loop do\n puts \"\\nEnter your email address to receive scraped data:\"\n user_email = gets.chomp\n break if email_regex.match? user_email\n puts \"Sorry, it's an invalid email address.\"\n end\n return user_email\n end", "def api_get\n handler.get({email: email}, path)\n end", "def get_user(id, email)\n users = @client.query(\"SELECT email, status, encrypted_password, salt, expires_on, verified_at FROM users WHERE id = #{id}\")\n return \"couldn't find user with ID #{id}\" if users.size == 0\n return \"found more than one (#{users.size}) users with ID #{id}\" if users.size > 1\n user = users.first\n address, password, salt, status, expiry = [:email, :encrypted_password, :salt, :status, :expires_on].map { |k| user[k] }\n return \"expected email '#{email}' but got '#{address}'\" unless email == address\n return \"expected status OK but got '#{status}'\" unless status == \"OK\"\n return \"expected password but got nothing\" unless password\n return \"expected 32 character password but got #{password.length}\" unless password.length == 32\n return \"expected salt but got nothing\" unless salt\n return \"expected 32 character salt but got #{salt.length}\" unless salt.length == 32\n status = user[:verified_at].present? ? 'ok' : 'pending'\n { password: password, salt: salt, status: status, expiry: expiry }\n rescue Mysql2::Error => e\n return \"mysql error: #{e.message}\"\n rescue => e\n return \"error: #{e.message}\"\n end", "def search_users(wildcard_email_address)\n filter = Net::LDAP::Filter.eq(ENTITY_ATTR_MAPPING[:email].to_s, wildcard_email_address)\n return search_map_user_fields(filter)\n end", "def email\n (@session[:current_user_details] || {})[:email]\n end", "def get_ldap_user_attributies_by_email(email:, attributes:)\n response = {}\n @treebase = 'dc=UoA,dc=auckland,dc=ac,dc=nz'\n filter = Net::LDAP::Filter.eq( 'objectCategory', 'user' ) & Net::LDAP::Filter.eq('mail', \"#{email}\")\n attr_list = []\n attributes.each { |k, _v| attr_list << k }\n @ldap.search( base: @treebase, filter: filter, attributes: attr_list ) do |entry|\n attributes.each do |attribute, value|\n response[value] = entry[attribute][0].to_s.strip\n end\n return response # Only want the first entry\n end\n return nil\n end", "def getLoginBy_email( email)\n params = Hash.new\n params['email'] = email\n return doCurl(\"get\",\"/login/by_email\",params)\n end", "def email_credential\n user.credentials.where(name: email).first\n end", "def email(id)\n get(\"/user/emails/#{id}\")\n end", "def get_attendee_name_from_email(attemail, companyid, matterid)\n attemail = attemail.chomp\n cnt = Contact.first(:conditions => {:company_id => companyid, :email => attemail})\n usr = User.first(:conditions => {:company_id => companyid, :email => attemail})\n if cnt or usr\n if cnt\n cnt.full_name\n else\n usr.full_name\n end\n end\n end", "def email\n find_by_type('email')\n end", "def query_email(email, params={})\n Validation.validate_email! email\n query email, params\n end", "def fetch_user\n @user = User.where(email: @email).first\n\n return validation_error(\n 'um_srpl_1',\n 'invalid_api_params',\n ['unrecognized_email'],\n GlobalConstant::ErrorAction.default\n ) unless @user.present? && (@user.status == GlobalConstant::User.active_status)\n\n success\n\n end", "def user_email\n session[:user_id]\n end", "def show\n if params[:email]\n @user = User.find_by_email(params[:email] + '.' + params[:format])\n else\n @user = User.find(params[:id])\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "def get_user_email(access_token)\n callback = Proc.new { |r| r.headers['Authorization'] = \"Bearer #{access_token}\"}\n\n graph = MicrosoftGraph.new(base_url: 'https://graph.microsoft.com/v1.0',\n cached_metadata_file: File.join(MicrosoftGraph::CACHED_METADATA_DIRECTORY, 'metadata_v1.0.xml'),\n &callback)\n\n me = graph.me\n email = me.user_principal_name\nend", "def get_user_info\n response = send_method(:get_user_info)\n user_from(response)\n end", "def contact_email\n contact['email_address']\n end", "def username \n #The code below will return the users email however, the split will seperate the email based on the parameters entered into the brackets. The code below will split the email at the @ symbol, resulting in the email changing from [email protected] to example @ example.com. The [0] after the brackets is used to determine the index value of the email that should be displayed. When the email is split each section is provided with an index value, starting at 0. The first part of the email (example) will be given the index of 0. This will result in the code displaying example. The capitalize at the end of the statement is used to caplitalise the first letter of the email address.\n return self.email.split('@')[0].capitalize\n end", "def get_by_email(email)\n record = @dao.search({ 'identity.email' => email }, { limit: 1 })\n translate(record)\n end", "def obtener_identificador_moodle(email)\n params = { 'field' => 'email', 'values[0]' => email }\n usuario = api('core_user_get_users_by_field ', params)\n\n if !usuario.empty?\n id_usuario_moodle = usuario[0]['id'] end\n\n id_usuario_moodle\n end", "def find_with_email email\n raise_simple(:login, \"exceptions.auth.invalid\") unless where(email: email).exists?\n find_by(email: email)\n end", "def get_MIT_people_email()\n \tkerberos = self.email.split('@')[0]\n \tinfo = RestClient.get 'http://web.mit.edu/bin/cgicso?', {:params => {:options => \"general\", :query => kerberos, :output =>'json'}}\n \treturn info.downcase\n\tend", "def email_address\n @data['emailAddress']\n end", "def email\n @json['profile']['email'] rescue nil\n end", "def get_user_info()\n return_map = nil\n if session[:google_unique] != nil && user_credentials.access_token != nil\n return_map = {}\n return_map['email'] = session[:googleemail]\n return_map['sub'] = session[:google_unique]\n return_map['useralias'] = session[:useralias]\n end\n return return_map\nend", "def email\n user.emails.where( email: self.email_id ).first\n end", "def email\n match(/Email\\s+:\\s+([^\\s]+)/)\n end", "def email_in_name(thing)\n return unless thing.include?(\"@\")\n parts = thing.split(\" \")\n emails = parts.reject { |part| !part.include?(\"@\") }\n results = []\n Array(emails).each do |email|\n id = email.split('@')[0]\n results << (login_name(id) || results_hash(mail: [email]))\n end\n results\n end", "def for(email)\n response = Gravatar.http_client.get(url(email, :json), follow_redirect: true)\n\n return nil unless response.ok?\n return nil unless response = JSON.parse(response.body)\n return nil unless response = response['entry'][0] rescue nil\n\n new(response)\n end", "def show\n @ta_as_user = User.find_by(google_email: @teaching_assistant.email)\n end", "def email; @email; end", "def get_user_login_from_email(emails)\n soapmsg = build_soap_envelope do |type, builder|\n if(type == :header)\n else\n builder.GetUserLoginFromEmail {\n builder.parent.default_namespace = @default_ns\n builder.emailXml {\n builder.Users {\n emails.each do |email|\n builder.User(:Email => email)\n end\n }\n }\n }\n end\n end\n soaprsp = Nokogiri::XML(send_soap_request(soapmsg.doc.to_xml))\n ns = {'xmlns' => @default_ns}\n logins = {}\n soaprsp.xpath('//xmlns:GetUserLoginFromEmail/xmlns:User', ns).each do |li|\n logins[li['Email']] = li['Login']\n end\n logins\n end", "def find_by_email(email:)\n users.where(email: email).first\n end", "def get_user_email(role)\n get_user(role).email\n end", "def process_email(email)\n profile = request email\n\n begin\n profile.success\n rescue NoMethodError\n return print '.'\n end\n\n if profile && profile.success != 'nothing_useful'\n profile.inspect\n else\n print '.'\n end\nend", "def get_useremail()\n email = nil\n git_user_email = %x(git config user.email).strip\n email = git_user_email if git_user_email\n email\n end", "def username\n email.match(/[^@]+/).to_s\n end", "def get_user_email(project_id, name)\n begin\n set_super_token\n project = PivotalTracker::Project.find project_id.to_i\n project.memberships.all.select{|m| m.name == name }[0].email\n rescue => e\n raise WrongActivityData.new(\"Can't get email of the Tracker user: #{name} in project id: #{project_id}. \" + e)\n end \n end", "def find(email = nil)\n\n # Search cache\n if self.use_cache\n uid = self.cache[email]\n return uid if uid\n end\n\n # Search LDAP for the email address as given\n filter = Net::LDAP::Filter.eq('mail', email)\n @ldap.search(attributes: ['uid'], base: self.base, filter: filter) do |entry|\n uid = get_uid(email, entry)\n return uid if uid\n end\n\n # The exact email address wasn't found, try the form \"username@domain\" if the username component looks like\n # a username (assumes that usernames do not contain punctuation)\n user, domain = email.split('@')\n unless user.nil? || user.empty? || user.include?('.')\n filter = Net::LDAP::Filter.eq('uid', user)\n @ldap.search(attributes: ['uid'], base: self.base, filter: filter) do |entry|\n uid = get_uid(email, entry)\n return uid if uid\n end\n end\n\n # No matches found\n nil\n\n end", "def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end", "def user\n @user ||= User.find_by(email: email)\n end" ]
[ "0.77538776", "0.7613378", "0.75917184", "0.7409586", "0.7385936", "0.7366133", "0.73501873", "0.7350163", "0.73037636", "0.72684425", "0.7234839", "0.7199344", "0.716516", "0.71455127", "0.7140261", "0.71402013", "0.71342325", "0.712018", "0.71042573", "0.7077971", "0.7045885", "0.7027568", "0.701066", "0.69717157", "0.6943021", "0.6898418", "0.68829554", "0.68586624", "0.683983", "0.6812582", "0.6804671", "0.6799072", "0.67867994", "0.67812616", "0.6772144", "0.6771234", "0.67584014", "0.67584014", "0.67575353", "0.6754798", "0.6753663", "0.6734229", "0.6732924", "0.6730788", "0.6713549", "0.6687042", "0.66865104", "0.6671771", "0.6665208", "0.6665033", "0.66436756", "0.66349834", "0.6628912", "0.6602736", "0.65886265", "0.6587008", "0.6582366", "0.65786964", "0.6576499", "0.65726244", "0.6568738", "0.6565786", "0.6559158", "0.65469253", "0.6540672", "0.65197086", "0.65083253", "0.65070605", "0.6502085", "0.64968324", "0.64889175", "0.648859", "0.64812875", "0.6477745", "0.6475817", "0.6453937", "0.6436904", "0.64299774", "0.6420904", "0.6408566", "0.6398409", "0.6387601", "0.63855857", "0.63785195", "0.6369393", "0.6355618", "0.6352851", "0.6352708", "0.63412815", "0.63399565", "0.633858", "0.63296", "0.6317381", "0.6311258", "0.63042295", "0.63032365", "0.62946635", "0.62945384", "0.6290491", "0.6287137" ]
0.80510473
0
get user information from a computing id
def user_info_by_cid( id ) print "Looking up user details for #{id}..." # lookup the user by computing id user_info = Helpers.lookup_user( id ) if user_info.nil? puts "not found" return nil end puts "done" return user_info end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_user(id)\n client.user(id)\n end", "def user; User.find_by_id(user_id); end", "def get_user_by_id(id)\n $r.hgetall(\"user:#{id}\")\n end", "def user(id)\n @users[id.resolve_id]\n end", "def user\n user_id.get_object\n end", "def user(id)\n self.class.get(\"/user/#{id}\", @options).parsed_response\n end", "def get_user_id(username)\n # .........\n end", "def get_user(id)\n @client.raw('get', \"/config/users/#{id}\")\n end", "def get_user(id)\n @users[id]\n end", "def user_id\n # The user id can't be handled by the method_missing magic from\n # OctocatHerder::Base, since the id method returns the object\n # id.\n @raw['id']\n end", "def get_user_id\n # TODO: #6. Complete the function to return your user id\n user_id = 'Put your user ID here'\n end", "def get_user_id(reaktoruser_id)\n IdStore.get(:reaktoruser, reaktoruser_id)\n end", "def user_by_id(user_id)\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Picking user ID #{user_id.inspect} from pool\"\n users.select { |user| user[:id] == user_id.to_i }.first\n end", "def get_user_details\n\t\tid = params[:id]\n\t\tTheCityAdmin::AdminApi.connect(Rcplugin::CITY_ADMIN_SECRET,Rcplugin::CITY_USER_TOKEN)\n\t\t@user = TheCityAdmin::User.load_by_id(id)\n\tend", "def get_user(user_id:)\n parse(JSON.parse(connection.get(\"users/#{user_id}\").body))\n end", "def user(username_or_id)\n puts \"Getting Info about User %s\" % username_or_id.to_s\n begin\n u = @MT.user(username_or_id)\n string_data = {\n :name => u.name,\n :screen_name => u.screen_name,\n :location => u.location,\n :description => u.description,\n :url => u.url \n }\n user_data = {\n :id => u.id,\n :followers_count => u.followers_count,\n :friends_count => u.friends_count,\n :protected => u.protected,\n :listed_count => u.listed_count,\n :created_at => u.created_at,\n :favourites_count => u.favourites_count,\n :utc_offset => u.utc_offset,\n :time_zone => u.time_zone,\n :geo_enabled => u.geo_enabled,\n :verified => u.verified,\n :statuses_count => u.statuses_count,\n :lang => u.lang,\n :is_translator => u.is_translator\n }\n string_data.each { |k,v| v.nil? ? (user_data[k] = nil) : (user_data[k] = v) }\n user_data\n rescue Twitter::Error::Unauthorized, Twitter::Error::Forbidden, Twitter::Error::NotFound\n puts \"Suspended?\"\n nil\n end\n end", "def user(id:)\n User.find(id)\n end", "def user_get(name)\n execute(\"id -P #{name}\") do |result|\n fail_test \"failed to get user #{name}\" unless /^#{name}:/.match?(result.stdout)\n\n yield result if block_given?\n result\n end\n end", "def get_user_data(id)\n load_user_data(id)\n @user_data[@user_id]\n end", "def user(id = 'self')\n get(\"users/#{id}\").user\n end", "def get_user_info(user)\n if user.respond_to? :id\n username = Digest::MD5.hexdigest(user.id.to_s)\n else\n username = user\n end\n\n begin\n url = \"#{DOMAIN}/#{ORG}/#{APP}/users/#{username}\"\n response = RestClient.get(url, \"Authorization\" => \"Bearer #{access_token}\", content_type: :json, accept: :json)\n res = JSON.parse(response.body)\n p res[\"entities\"]\n rescue => e\n puts e.response\n end\n end", "def get_userid(user_page)\n\t\tpp user_page.body\n\t\tuserid_xpath = '(//input[@name=\"profile_user\"]/@value)[1]'\n\t\tid = user_page.parser.xpath(userid_xpath)\n\n\t\tid.text\n\tend", "def get_external_id_by_user_id(id)\n get_user_by_id(id)[\"external_user_id\"]\n end", "def get_user_data\n @user = User.find(params[:id])\n end", "def get_user_from_id(user_id)\n \t\tuser = nil\n \t\tunless user_id.blank?\n\t \t\tcol = :email\n\t \t\tif CONFIG[:enable_username?]\n\t \t\t\tunless is_email(user_id)\n\t \t\t\t\tcol = :username\n\t \t\t\tend\n\t \t\tend\n#\t \t\tp \"Finding user by col: #{col}, user_id = #{user_id}\"\n\t \t\tuser = User.find_by(col => user_id.downcase)\n\t \tend\n\t \tuser\n \tend", "def get_user_info\n response = send_method(:get_user_info)\n user_from(response)\n end", "def get_user(username)\n Chef::Log.info username\n user = @node[:users][username]\n Chef::Log.info user.inspect\n user\nend", "def user\n Webmetrics.users.find_one('_id' => id)\n end", "def get_user_info user\n unless user.known_user.nil?\n known_user = user.known_user\n is_me = known_user.is_current_user || false\n return is_me ? \"people/me\" : known_user.person_name\n end\n get_one_of user\nend", "def extract_user_id(params)\n User.find_by_id(params[:user_id]) || User.find_by_email(params[:email]) || nil\n end", "def get_id(user_name)\n return get_value_of(user_name, :id)\n end", "def get_user_profile(uid,fields)\n begin\n @user_details = graph.get_object(\"#{uid}\",\"fields\" => \"#{fields}\")\n rescue Exception => e\n error(\"get_user_profile :: #{e.message}\")\n end\n end", "def user\n UserRepository.find(user_id)\n end", "def user_id\n username\n end", "def get_user(request, params)\n # --- Get the USER ---\n user = UserOCCI.new(\n User.build_xml(params[:id]),\n @client)\n\n # --- Prepare XML Response ---\n rc = user.info\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return to_occi_xml(user, :code=>200)\n end", "def nameFromID(user_id, cache)\n\n return cache[user_id] if cache[user_id]\n\n require 'net/http'\n require 'uri'\n\n api_key=ENV[\"FLICKR_API_KEY\"] if ENV[\"FLICKR_API_KEY\"]\n\n uri=\"http://api.flickr.com/services/rest/?method=flickr.people.getInfo&api_key=#{api_key}&user_id=#{user_id}\"\n who = Net::HTTP.get(URI.parse(uri))\n STDERR.puts(\"REST API user lookup: #{uri}\")\n who =~ /<username>(.*)<\\/username>/ # dumbass. use an api. any api!\n name = \"\"\n name = $1 if $1\n cache[user_id] = name\n STDERR.puts(\"Cached user lookup: #{user_id} as '#{name}' \")\n return name\nend", "def get(user_id)\n User.find user_id\n end", "def current_user_id\n info['user']['id']\n end", "def id\n @data[:user_id]\n end", "def user_management_get_single_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/users/{id}\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\n \"id\" => id,\n }\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.get query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif response.code == 404\n raise APIException.new \"Not Found\", 404, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end", "def get_user_by_id(user_id)\n\n headers = {\n content_type: 'application/json',\n authorization: @token \n }\n\n response = RestClient.get \"https://milkinium-api.herokuapp.com/v1/users/#{user_id}\", headers=headers\n response_hash = JSON.parse(response.body)\n return response_hash\n end", "def info\n\t@user = User.find(params[:id])\n end", "def select_all_user_info_id(user_id)\n p \"uder id #{user_id}s\"\n p \"look here#{get_db_as_hash().execute(\"SELECT * FROM user WHERE user_id = ?\", user_id).first}\"\n return get_db_as_hash().execute(\"SELECT * FROM user WHERE user_id = ?\", user_id).first\n end", "def user_id\n raise \"Implement in Client or Advocate\"\n end", "def get_userid()\r\n user_info = @context.call_myspace_api(:user_info, :v1_json => true)\r\n user_info['userId'].to_s\r\n end", "def retrieve(user_id:)\n User.new get_request(\"users/#{user_id}\").body.dig(\"user\")\n end", "def user_id\n @raw['user']['id']\n end", "def get_user_info(list)\n\trequire 'net/http'\n\tNet::HTTP.get(ENV[\"VERITAS-USER-SERVER\"] + \"/users?user_ids=#{list}\")\nend", "def getUser( user_id)\n params = Hash.new\n params['user_id'] = user_id\n return doCurl(\"get\",\"/user\",params)\n end", "def account_user(id)\n get(\"accountuser/#{id}\")\n end", "def query_user_id\n @attributes[:query_user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def user_id\n @attributes[:user_id]\n end", "def get_userid()\n user_info = call_myspace_api(:user_info, :v1_json => true)\n user_info['userId'].to_s\n end", "def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\n end", "def get_user_id(full_user_name)\n @url = \"http://#{$canvas_host}/api/v1/courses/#{$canvas_course_id}/users\"\n puts \"@url is #{@url}\"\n \n @payload={'search_term': full_user_name}\n puts(\"@payload is #{@payload}\")\n \n @getResponse = HTTParty.get(@url, :body => @payload.to_json, :headers => $header)\n puts(\" GET to get user has Response.code #{@getResponse.code} and getResponse is #{@getResponse}\")\n \n user_data = @getResponse.parsed_response\n user_id = nil\n\n user_data.each do |user_info|\n if user_info[\"name\"] == full_user_name\n user_id = user_info[\"id\"]\n end\n end\n\n return user_id\nend", "def find_user_by_id(id = 'my', params = {})\n object_from_response(Code42::User, :get, \"user/#{id}\", params)\n end", "def find_user\n User.find(params.fetch(:id))\n end", "def user()\n return @data[\"access\"][\"user\"]\n end", "def user(id)\n self.users[id] ||= User.supervise id, workflow_name: name\n user = self.users[id].actors.first\n user.load_data\n user\n end", "def user(user_name)\n OctocatHerder::User.fetch(user_name, connection)\n end", "def get_user_info_from_id_token id_token\n token_parts = id_token.split(\".\")\n encoded_token = token_parts[1]\n leftovers = token_parts[1].length.modulo(4)\n if leftovers == 2\n encoded_token << \"==\"\n elsif leftovers == 3\n encoded_token << \"=\"\n end\n decoded_token = Base64.urlsafe_decode64(encoded_token)\n jwt = JSON.parse decoded_token\n {email: jwt[\"unique_name\"], name: jwt[\"name\"]}\n end", "def getUser(user, info)\n @@users[user][info]\n end", "def identify_using_user(identifier)\n user_id = identifier.gsub(\"user-\", \"\")\n\n identify_with_cache(:user, user_id) do\n User.find_by(id: user_id)\n end\n end", "def user(user_id, params = {})\n make_get_request(\"/users/#{user_id}\", params)\n end", "def getUserID\n if signed_in? \n if params[:id].empty?\n uid = current_user.id\n else\n uid = params[:id]\n end\n @user = User.find(uid)\n else\n redirect_to pages_home_path\n end\n end", "def show(id)\n response = request(:get, \"/users/#{id}.json\")\n response[\"user\"]\n end", "def user(id)\n target = \"#{self.base_url}/user/#{id.to_s}/\"\n self.class.get(target, {basic_auth: self.auth})\n end", "def show(id)\n response = request(:get, \"/users/#{id}.json\")\n response.first[1]\n end", "def auth_user_id\n auth[:user_id]\n end", "def get_user(id)\n conn = @client.get do |req|\n req.url \"/api/v2/user/#{id}\"\n req.headers[\"Authorization\"] = @token\n end\n conn.body\n end", "def fetch_user_details(iam_id)\n result = {}\n # Each we use ___[0] because get_from_api returns an array\n # We know we only need [0] because we are querying by iamId\n\n # Get ids, names and affiliations\n basic_info = get_from_api(\"api/iam/people/search\", \"iamId\" => iam_id)\n result[\"basic_info\"] = !basic_info || basic_info.empty? ? [] : basic_info\n\n # Get email, postaladdress, phone numbers\n contact_info = get_from_api(\"api/iam/people/contactinfo/search\", \"iamId\" => iam_id)\n result[\"contact_info\"] = !contact_info || contact_info.empty? ? [] : contact_info\n\n # Get kerberos loginid\n kerberos_info = get_from_api(\"api/iam/people/prikerbacct/search\", \"iamId\" => iam_id)\n result[\"kerberos_info\"] = !kerberos_info || kerberos_info.empty? ? [] : kerberos_info\n\n # Get PPS department, title, and position type\n pps_info = get_from_api(\"api/iam/associations/pps/search\", \"iamId\" => iam_id)\n result[\"pps_info\"] = !pps_info || pps_info.empty? ? [] : pps_info\n\n # Get ODR department and title\n odr_info = get_from_api(\"api/iam/associations/odr/#{iam_id}\")\n result[\"odr_info\"] = !odr_info || odr_info.empty? ? [] : odr_info\n\n # Get student information\n student_info = get_from_api(\"api/iam/associations/sis/search\", \"iamId\" => iam_id)\n result[\"student_info\"] = !student_info || student_info.empty? ? [] : student_info\n\n return result\n end", "def get_user_info(credentials)\n client = Google::APIClient.new\n client.authorization = credentials\n oauth2 = client.discovered_api('oauth2', 'v2')\n result = client.execute!(:api_method => oauth2.userinfo.get) \n user_info = nil\n\n if result.success?\n user_info = result.data\n else\n puts \"An error occured: #{result.data['error']['message']}\"\n end\n\n if user_info != nil && user_info.id != nil\n return user_info\n end\n\n raise NoUserIdError, \"Unable to retrieve the user's Google ID.\"\nend", "def get_user(id, &block)\n get(\"#{@base_url}/user/#{id}/json\", user_mapping, block)\n end", "def user_information\n { \"username\": @user.username, \"email\": @user.email, \"id\": @user.id }\n end", "def fetch_user(id)\n fetch( :user, id ).last_result_item\n end", "def get_data_from_github(id)\n page = Nokogiri::HTML(open(\"https://github.com/#{id}\"))\n # fullname = page.css('body.logged_out.env-production.linux.page-profile\n # div.wrapper div.header.header-logged-out div.container.clearfix\n # div.command-bar.js-command-bar ul.top-nav li.explore a')\n fullname = page.css('span.vcard-fullname').text\n { user: fullname }\nend", "def get_user(users, id)\n user = users.select { |f| f[:id] == id }\n user.first\n end", "def get\n\t\t\t\tparams.required(:id)\t\n\n\t\t\t\t# Grab the service that is trying to authenticate\n unathenticated_error unless @api_consumer.is_a? Service\n service = @api_consumer\n\n\t\t\t\t@user = service.users.find params[:id]\n\t\t\tend", "def get_user_data(user_id, auth_token)\n request = Typhoeus::Request.new(\n \"https://oauth2-api.mapmyapi.com/v7.0/user/self/\",\n method: :get,\n body: {\n 'Content-Type' => \"application/json\",\n 'Api-Key' => ID,\n 'Authorization' => \"Bearer #{auth_token}\"\n },\n headers: {\n 'Api-Key' => ID,\n 'Authorization' => auth_token\n }\n )\n request.run\n response = request.response\n fail\n\n end", "def user_info(access_token:, user_id:)\n query = {\n user: user_id\n }.compact\n response = HTTParty.get(\"https://slack.com/api/users.info\",\n query: query,\n headers: { 'Authorization': \"Bearer #{access_token}\" })\n JSON.parse(response.body, symbolize_names: true)\n end", "def show_user(id)\n BrickFTP::API::User.find(id)\n end", "def show_user(id)\n BrickFTP::API::User.find(id)\n end", "def user(body)\n User.find(body[:id])\n end", "def get_user_id_harvest\n harvest_uri = URI(\"https://api.harvestapp.com/v2/users/me\")\n\n Net::HTTP.start(harvest_uri.host, harvest_uri.port, use_ssl: true) do |http|\n harvest_request = Net::HTTP::Get.new harvest_uri\n\n harvest_request[\"Authorization\"] = \"Bearer #{harvest_access_token}\"\n harvest_request[\"Harvest-Account-ID\"] = harvest_account_id\n harvest_request[\"User-Agent\"] = harvest_user_agent\n \n harvest_response = http.request harvest_request\n json_response = JSON.parse(harvest_response.body)\n return json_response[\"id\"]\n end\n end", "def get_user_data(uid)\n @conn.get(\"/api/v1/users/#{uid}\")\n end", "def user_id\n instance_variable_get(:@prepared_arguments).dig(:user_id)\n end", "def user_id\n @logged_in_user = User.find_by(id: params[:id])\n @user_id = @logged_in_user.id\n end", "def find_by_id\n User.find_by_id(@username_or_id)\n end", "def show\n @user = UserService.getUserById(params[:id])\n end", "def user\n\t\tdatastore['IRCNICK']\n\tend", "def view\n\t\trequest_user(params[:id])\n\tend" ]
[ "0.71896064", "0.69202936", "0.691275", "0.6888319", "0.68710905", "0.6865562", "0.6799513", "0.6727998", "0.6717491", "0.67016494", "0.66736007", "0.6673272", "0.66628355", "0.6644424", "0.66267776", "0.66216415", "0.6586932", "0.65833235", "0.6575809", "0.65728354", "0.65704805", "0.65670913", "0.6564119", "0.6553631", "0.6533313", "0.6528127", "0.65137124", "0.6510185", "0.65065706", "0.6504686", "0.65036875", "0.6498694", "0.64904195", "0.6427999", "0.642605", "0.64129007", "0.6394137", "0.63928235", "0.6392422", "0.6390853", "0.63907135", "0.6388185", "0.6386431", "0.63812745", "0.6374136", "0.6371212", "0.63692087", "0.6369165", "0.63646525", "0.636434", "0.6362511", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.6349229", "0.63476217", "0.63458407", "0.6345616", "0.63402975", "0.63313115", "0.63232255", "0.6322968", "0.63185555", "0.6315522", "0.6310436", "0.6297567", "0.62944144", "0.6280034", "0.62767076", "0.62742555", "0.6268137", "0.62660027", "0.626594", "0.62597126", "0.6255765", "0.6255001", "0.6242268", "0.6236881", "0.62308", "0.6225912", "0.6225638", "0.6218601", "0.62169516", "0.621431", "0.621431", "0.6213972", "0.621292", "0.6212232", "0.6209969", "0.6208888", "0.6203444", "0.619908", "0.6198576", "0.6197285" ]
0.7585293
0
lookup a user by computing id and create their account if we locate them
def lookup_and_create_account( id ) # lookup locally with the default email user = User.find_by_email( User.email_from_cid( id ) ) return user if user.present? # if we cannot find them, lookup in LDAP user_info = user_info_by_cid( id ) return nil if user_info.nil? # now look them up with the located email user = User.find_by_email( user_info.email ) return user if user.present? # create their account return User.new_user( user_info, user_info.email ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_user_account\n Account.create(user_id: self.id) \t\n end", "def associate_with_user\n if user_id.nil? || user.email == Address::PLACEHOLDER_EMAIL\n self.user_id = User.find_or_create_by_details(\n email: email_address, name: billing_full_name\n ).id\n end\n end", "def create_or_find_user\n User.find_or_create_by(provider: auth_hash['provider'], uid: auth_hash['uid']) do |user|\n user.email = auth_hash['info']['email']\n user.name = auth_hash['info']['name']\n user.username = auth_hash['extra']['raw_info']['login']\n user.public_repos = auth_hash['extra']['raw_info']['public_repos']\n end\n end", "def find_or_create_user\n\n # create the user \n email = self.accesscode.to_s+\"@shuttlechallenge.ca\"\n user = User.where(email: email).first\n\n if user.nil? # no duplicate users please\n password = self.accesscode\n name = \"#{self.firstname} #{self.lastname}\"\n user = User.new(name: name, email: email, password: password)\n\n \n #create the access object for this user\n user.access = Access.new(code: password)\n\n\n\n #device\n user.device= Device.new(device: self.logger_id)\n user.save!\n\n end\n user\n end", "def _user_add f = {}\n\t\tf[:salt] \t\t= _random_string 5\n\t\tf[:created] \t= Time.now\n\n\t\trequire \"digest/sha1\"\n\t\tf[:pawd] \t\t= Digest::SHA1.hexdigest(f[:pawd] + f[:salt])\n\n\t\t_throw L[:'the user is existing'] if _user? f[:name]\n\n\t\tDB[:_user].insert(f)\n\t\tuid = DB[:_user].filter(:name => f[:name]).get(:uid)\n\t\tuid ? uid : 0\n\tend", "def create_user_account\n Account.cache_or_create_by! @current_user\n rescue => e\n log_error(e, account: 'cannot_create_unique_account_record')\n end", "def find_or_create_user\n name = get_user_name\n while name == nil\n puts ''\n puts \"*** Please enter a valid name. ***\".colorize(:color => :red)\n puts ''\n name = get_user_name\n end\n @user = User.find_or_create_by(name: name)\n @id = @user.id\n end", "def ensure_user(data)\n if @users.include?(data['id'].to_i)\n @users[data['id'].to_i]\n else\n @users[data['id'].to_i] = User.new(data, self)\n end\n end", "def fetch_or_create_user(name)\n if User.exists?(:name => name)\n user = User.find_by_name(name)\n else\n user = User.new(:name => name, :status => \"active\")\n end\n user\nend", "def find_or_create(uid)\n is_new = false\n @user = User.where(\"uid =?\",uid).first\n is_new = true if @user.nil?\n @user = User.new() if @user.nil?\n @user.uid = uid\n @user.is_new = is_new\n @user\n end", "def execute\n auth_user = create_or_find_auth_user(auth0_id_string, access_level)\n create_or_find_person(auth_user, email)\n end", "def find_or_create_user\n name = @prompt.ask(\"What's your name?: \")\n @user = Fan.find_or_create_by(name: name)\n end", "def find_or_create_user(extractor)\n Email.find_by_email(extractor.email).try(:user) ||\n IclaSignature.find_by_email(extractor.email).try(:user) ||\n User.create! do |user|\n user.first_name = extractor.first_name\n user.last_name = extractor.last_name\n end\n end", "def find_user(id)\n contact = find(id)\n\n create_user(contact.attributes)\n end", "def find_or_create_identity!(auth)\n ident = Identity.from_oauth auth\n\n # Identity already exist. Make sure it's valid...\n if ident.persisted? && ident.user != self\n raise \"Identity is associated with another user (#{ident.user}).\"\n end\n\n ident.user = self\n ident.save!\n ident\n end", "def create_account_for_user\n # # if age.exists?\n # balance = age >= 18 ? 350 : 250\n # create_account(balance: balance)\n # # end\n create_account(balance: 250)\n end", "def find_or_create(name)\n @users[name]\n end", "def new_user\n account_make = self\n # assign storing of information to a variable\n account_store = YAML::Store.new 'users.store'\n # store the object into a file\n account_store.transaction do\n account_store[username.to_s] = account_make\n end\n end", "def create_new_user_and_identity(auth, params)\n user = User.create!(\n first_name: auth.info[:first_name],\n last_name: auth.info[:last_name],\n email: auth.info[:email],\n oauth_signup: true,\n # referred_by_user_id => params.andand[\"rid\"]\n )\n user.confirm!\n create_new_identity(user, auth)\n end", "def identity_create\n # Potential threat of overlap\n identity = Identity.create(uid:rand(100000000..9999999999), provider: 'registration')\n identity.user_id = resource.id\n identity.name = params['user']['name'] #Looks very ugly\n identity.email = resource.email\n identity.save\n end", "def add_initial_user\n initial_user = Member.where(:email => \"[email protected]\").first\n \n unless initial_user\n # Create an initial position.\n position = Position.new\n position.name = \"Administrator\"\n position.pos_type = \"Administrator\"\n position.save\n \n # Create an initial division.\n division = Division.new\n division.name = \"Administrator\"\n division.save\n \n # Find initial position and division created.\n # Id´s will be used to crete initial user.\n position = Position.where(:name => \"Administrator\").first\n division = Division.where(:name => \"Administrator\").first\n \n # Create an initial user with position and divison created above.\n member = Member.new\n member.name = \"Administrator\"\n member.email = \"[email protected]\"\n member.password = \"administrator\"\n member.major = \"NONE\"\n member.grad_year = 9999\n member.member_since = 9999\n member.hometown = \"NONE\"\n member.position_id = position.id\n member.division_id = division.id\n member.save\n end\n end", "def resolve(username: nil, password: nil, idclient: nil) \n User.create(userName: username, password: password, idClients: idclient)\n end", "def set_user\n if User.exists?(params[:id].to_i)\n @user = User.find(params[:id])\n end\n end", "def find_existing_account(hash)\n # Need a lookup key, or we have nothing\n return nil unless (hash.keys & [:jhed_lid, :hopkins_id, :horizon_borrower_id]).length > 0\n\n queries = []\n [:hopkins_id, :jhed_lid, :horizon_borrower_id].each do |key|\n queries << \"#{key} = :#{key}\" if hash[key]\n end\n\n # There shouldn't be multiples, but just in case we do an ORDER BY,\n # so we'll always get the same one if there are multiples (the earliest created one)\n return User.where( queries.join(\" OR \"), hash).order(:created_at, :id).first\n end", "def create_user(user_id, user_email)\n \n puts user_id\n puts user_email\n new_user = User.first_or_create( {:googleuniqueid => user_id},{\n :googleuniqueid => user_id,\n :googleemail => user_email,\n :useralias => user_email,\n });\n new_user.save\n return new_user\nend", "def user(id_or_username = \"my\", params = {})\n if id_or_username.is_a?(Fixnum) || id_or_username == 'my'\n find_user_by_id id_or_username, params\n else\n find_user_by_username id_or_username, params\n end\n end", "def set_user\n @user = User.find_by_external_id(params[:id])\n @user = User.create!(name: params[:name], email: params[:email], external_id: params[:external_id]) unless @user\n end", "def add_user(name, is_admin, building_id, notify_new_request= false, notify_new_listing=false)\n user_id = User.create(\n first_name: name,\n last_name: 'LNU',\n email: 'jack+' + name + '@jackmgill.com',\n password: 'foo',\n is_admin: is_admin,\n building_id: building_id,\n notify_new_request: notify_new_request,\n notify_new_listing: notify_new_listing\n ).id\n return user_id\nend", "def find_by_id!\n User.find(@username_or_id)\n end", "def find_or_create_user(user_descr, keys = nil)\n debug \"central find_or_create_user: '#{user_descr.inspect}'\"\n raise 'Method not implemented because the Central Manager just need to pass the same requisition to the other' \\\n ' brokers and create the concatenated results'\n end", "def find_or_create_user\n @user = User.find_by(email: auth_email)\n @user ||= create_new_user\n save_omniauth_details\n\n @user\n end", "def find_or_create_user(username, company, phone)\n\n #find the user (if not, create)\n @user = nil\n if username.empty?\n false #if there's no username, don't create.\n else\n #add on dummy email @\n username << '@appfolio.com'\n\n #find the user\n @user = User.where(email: username).take\n if @user.nil?\n @user = User.new(:email => username,\n :password => 'appfolio_dummy',\n :password_confirmation => 'appfolio_dummy',\n :company_name => company,\n :phone_number => phone\n )\n @user.save\n\n end\n\n @user\n\n end\n\n end", "def edit_or_create_user(field_hash)\n if field_hash.has_key? :id\n id = field_hash[:id]\n if id !~ /^user\\//\n id = \"user/#{id}\"\n field_hash[:id] = id\n end\n else\n raise \"RT_Client.edit_or_create_user require a user id in the 'id' key.\"\n end\n resp1 = \"not called\"\n resp2 = \"not called\"\n resp1 = edit(field_hash)\n resp2 = create_user(field_hash) if resp1 =~ /does not exist\\.$/\n resp = \"Edit: #{resp1}\\nCreate:#{resp2}\"\n resp\n end", "def user(id)\n @users[id.resolve_id]\n end", "def find_by_id\n User.find_by_id(@username_or_id)\n end", "def get_or_create(data)\n usrgrpid = get_id(data)\n if usrgrpid.nil?\n usrgrpid = create(data)\n end\n usrgrpid\n end", "def find_or_create_via_omniauth(attributes, existing_user=nil)\n identity = lookup(attributes[:uid], attributes[:provider])\n if(identity)\n Fission::Data.logger.info \"Found existing identity: #{identity.inspect}\"\n else\n Fission::Data.logger.info \"No existing identity found! Creating new user: #{attributes[:uid]}\"\n source = Source.find_or_create(:name => attributes[:provider])\n username = attributes[:info].try(:[], :nickname) ||\n attributes[:info].try(:[], :login) ||\n attributes[:info].try(:[], :email) ||\n unique_id\n user = User.find_by_username(username)\n unless(user)\n user = User.new(:username => username)\n user.run_state.identity_provider = attributes[:provider]\n user.source = source if source\n user.save\n end\n identity = Identity.new\n identity.user = user\n end\n identity.provider = attributes[:provider]\n identity.uid = attributes[:uid]\n identity.extras = attributes[:extras]\n identity.credentials = attributes[:credentials]\n identity.infos = attributes[:info]\n identity.source = source if source\n # Set login time\n identity.user.session[:login_time] = Time.now.to_f\n identity.user.save_session\n unless(identity.save)\n Fission::Data.logger.error identity.errors.inspect\n raise identity.errors unless identity.save\n end\n identity\n end", "def create_user(email, name, pw)\n user = User.find_or_create_by(username: name) do |u|\n u.email = email\n u.username = name\n u.password = pw\n u.password_confirmation = pw\n end\n user\nend", "def create_user(details)\n puts \"Checking for #{details[:user_name]} user...\"\n\n db_user = User.where(:user_name => details[:user_name]).first\n\n if db_user.blank?\n db_user = User.create(details)\n db_user.creator_id = db_user.id\n db_user.updater_id = db_user.id\n\n db_user.skip_user_name_exclusion_list = true\n\n db_user.save!\n\n db_user.skip_user_name_exclusion_list = false\n\n puts \"... #{details[:user_name]} user created.\"\n else\n puts \"... #{details[:user_name]} user already exists.\"\n end\nend", "def create!\n self.save\n self.set_lookup(:login) if self.is_a?(User)\n :ok\n end", "def login_new_user\n name = 'test_user_' + rand(1000).to_s\n user = TestHelper.ensure_user_exists(name, name)\n login_user user\n user\nend", "def set_user\n if params[:name]\n @user = User.where(name: params[:name]).first\n else\n count = User.count\n exists = User.exists?(params[:id].to_i)\n if (params[:id].to_i <= count) and exists\n @user = User.find(params[:id])\n end\n end\n end", "def assign_creator(user_id)\n\t\tadd_user(user_id, true, true, true)\n\tend", "def assign_creator(user_id)\n user_id = user_id.id if user_id.is_a?(User)\n add_user(user_id, true, true, true)\n end", "def find_or_create_user_data(user_id)\n # ap(find_or_create_user_data: {user_id: user_id})\n # NOTE: The code below is designed to avoid a race condition.\n q = {\"_id\" => BSON::ObjectId(user_id)}\n user_data = @user_data.find_one(q)\n if user_data\n reject_record_id(user_data)\n else\n begin\n # Regardless whether we or some other process did the actual insert, we return an empty hash, as the record is fresh.\n @user_data.insert(q)\n {}\n rescue Mongo::OperationFailure => e\n raise unless e.error_code == 11000 # duplicate key error index\n # Another process/thread has just inserted the record.\n {} \n end\n end\n end", "def user(id)\n id = id.resolve_id\n return @users[id] if @users[id]\n\n LOGGER.out(\"Resolving user #{id}\")\n begin\n response = API::User.resolve(token, id)\n rescue Discordrb::Errors::UnknownUser\n return nil\n end\n user = User.new(JSON.parse(response), self)\n @users[id] = user\n end", "def create_user(field_hash)\n field_hash[:id] = \"user/new\"\n payload = compose(field_hash)\n resp = @site['user/new/edit'].post payload\n new_id = resp.match(/User\\s*(\\d+)/)\n if new_id.class == MatchData\n new_user = new_id[1]\n else\n new_user = resp\n end\n new_user # return the new user id or the full REST response\n end", "def create_reference_account\n User.create(:email => \"[email protected]\", :password => \"walla2\", :admin => true)\nend", "def create_reference_account\n User.create(:email => \"[email protected]\", :password => \"walla2\", :admin => true)\nend", "def create_employee_user\n email = self.work_email\n user = User.new(email: self.work_email, password: 'appsimpact@#123', role: 'employee')\n user.save\n self.user_id = user.id\n end", "def create_user\n user = User.where(email: user_email)\n if user.blank? # new user\n @user = create_new_user\n church = nil\n if affiliation.blank?\n church = create_affiliation_from_church\n else\n church = Affiliation.find(self.affiliation)\n end\n @user.affiliation = church\n church.users << @user\n @user.save\n\n guest = Role.find_by_name(\"Guest\").id \n @user.role_ids=[guest]\n self.user_id = @user.id\n end\n end", "def associate_user\n \tfbUserIdString = params[:idString]\t\n \tuser = User.new(fbUserId:fbUserIdString)\n \tif user.valid?\t\n\t\t\t user = User.create(fbUserId:fbUserIdString)\n\t\t\t success = true\n\t\t end\n\t\t start_session(fbUserIdString)\n end", "def add_user(new_user_id, users)\r\n print \"Please enter a username: \"\r\n new_username = Readline.readline.strip\r\n\r\n user_index = users.find_index { |user| user.username == new_username }\r\n\r\n if new_username.strip.empty?\r\n puts \"You cannot create a user with an empty username, please try again.\"\r\n puts \"Press any key to continue.\"\r\n STDIN.getch\r\n return nil\r\n elsif !user_index.nil?\r\n puts \"There is already an account with that name, please try again.\"\r\n puts \"Press any key to continue.\"\r\n STDIN.getch\r\n return nil\r\n end\r\n\r\n print \"Do you want to set a password? (y/n) or (m) to return to the main login screen: \"\r\n password_wanted = Readline.readline.strip.downcase\r\n\r\n new_user = nil\r\n\r\n while new_user.nil?\r\n if password_wanted == \"y\"\r\n print \"Enter password: \"\r\n new_password = Readline.readline\r\n new_user = User.new(new_user_id, new_username, new_password)\r\n print \"Please confirm your password: \"\r\n elsif password_wanted == \"n\"\r\n new_user = User.new(new_user_id, new_username)\r\n elsif password_wanted == \"m\"\r\n return nil\r\n end\r\n\r\n end\r\n\r\n return new_user\r\nend", "def google #find or create a user using the attrs sent by google\n @user = User.find_or_create_by(email: auth[\"info\"][\"email\"]) do |user|\n user.username = auth[\"info\"][\"first_name\"]\n user.password = SecureRandom.hex(10) #assigns random password to the user\n end \n if @user.save\n session[:user_id] = @user.id #set the session id which logs them in\n redirect_to user_path(@user.id)\n else \n flash[:message] = 'There was a problem signing you in through Google. Please register or try signing in later.'\n redirect_to '/login' #if user doesn't save redirect to homepage\n end \n end", "def account_user(id)\n get(\"accountuser/#{id}\")\n end", "def create_user(username)\n if Commitchamp::User.find_by(login: username) == nil\n user = @github.get_user(username)\n Commitchamp::User.find_or_create_by(login: user['login'])\n end\n Commitchamp::User.find_by(login: username)\n end", "def test_get_existing_user \n num_users0 = count_users\n proto = User.new('oauth_id' => '566213105', 'name' => 'Avilay Parekh') \n user = get_user('566213105')\n assert(user === @ds.add_or_get_user(proto))\n assert_equal(num_users0, count_users)\n assert_equal(user.id, @ds.user_id)\n end", "def get_or_create_user(username)\n u = User.find_by_login(username.gsub(/\\s+/,''))\n if(!u)\n @agent.get(forum_url + '.showUserPublicProfile?gid='+username.gsub(/\\s+/,''))\n puts 'creating ' + username\n u = User.new\n u.login = username.downcase.gsub(/\\s+/,'')\n u.password = username.reverse\n if @agent.page.at('div[@id=membersince]')\n u.created_at = @agent.page.at('div[@id=membersince]').html.match(/[A-z]+ [0-9]{1,2}, [0-9]{4}/).to_s\n end\n u.save!\n end\n return u\nend", "def existing_user\n puts \"Please Enter Username\"\n username = gets.chomp\n puts \"Please Enter Password\"\n password = gets.chomp\n unless $customer = Customer.find_by(\n username: username,\n password: password\n )\n puts 'Sorry, username and/or password combination not valid. Please try again'\n process_login\n end\n main_menu($customer)\n end", "def check_user_existence\n recipient = User.find_by(email: recipient_email)\n if recipient\n self.recipient_id = recipient.id\n end\n end", "def amniauth_create\n user = User.find_or_create_by(:provider => auth_hash[:provider], :uid => auth_hash[:uid]) do |user|\n user.name = auth_hash[:info][:name]\n end\n\n session[:user_id] = user.id\n redirect_to user_path(user)\n end", "def find_user_by_id(id)\n users.find_by_id(id)\n end", "def create(user)\n # If the caller has already set an id, trust it.\n user.assign_id!(new_uuid) unless user.id\n user.update_timestamps!\n user.last_updated_by!(requester_authz_id)\n\n validate_before_create!(user)\n\n # If you say you know the authz id, then we trust that it already exists\n user.create_authz_object_as(requester_authz_id) unless user.authz_id\n user_side_create(user)\n user.persisted!\n user\n rescue Sequel::DatabaseError => e\n log_exception(\"User creation failed\", e)\n self.class.query_failed!(e.message)\n end", "def ensure_user_byemail(email, name)\n users = db[:users]\n usr = users.first(:email => email)\n\n if usr.nil?\n\n u = retrieve_user_byemail(email, name)\n\n if u.nil? or u['login'].nil?\n warn \"Could not retrieve user #{email} through search API query\"\n login = (0...8).map { 65.+(rand(25)).chr }.join\n users.insert(:email => email,\n :name => name,\n :login => login,\n :fake => true,\n :deleted => false,\n :created_at => Time.now)\n info \"Added user fake #{login} -> #{email}\"\n users.first(:login => login)\n else\n in_db = users.first(:login => u['login'])\n geo = geolocate(location: u['location'])\n if in_db.nil?\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n info \"Added user #{u['login']} (#{email}) through search API query\"\n else\n in_db.update(:name => u['name'],\n :company => u['company'],\n :email => u['email'],\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :fake => false,\n :deleted => false,\n :created_at => date(u['created_at']))\n debug \"User #{u['login']} with email #{email} exists\"\n end\n users.first(:login => u['login'])\n end\n else\n debug \"User with email #{email} exists\"\n usr\n end\n end", "def create_org_member\n @organization = Organization.find(params[:organization_id].to_i)\n @email = params[:email]\n\n @first_name = params[:first_name]\n @last_name = params[:last_name]\n @pw = params[:password]\n @pw_confirmation = params[:password_confirmation]\n\n # TODO check if authtoken is in sess variable\n # If so, only update user password\n \n # Allocate User account, dashboard, and profile \n @user = User.create(\n email: @email,\n password: @pw,\n password_confirmation: @pw_confirmation,\n organization: @organization\n )\n if @user\n Dashboard.create(\n lead_email: @email, \n lead_name: \"#{@first_name} #{@last_name}\",\n user: @user\n )\n\n profile = Profile.find_or_create_by!(email: @email) do |profile|\n profile.first_name = @first_name\n profile.last_name = @last_name\n profile.dashboard_registered = true\n end\n\n profile.update(user: @user)\n\n # Create zoho lead record\n if [email protected]? && @organization.name != 'test'\n ZohoService.save_to_zoho(profile)\n end\n\n #sign in newly created user\n sign_in(@user, scope: :user)\n # Setting up alias to map user id to mixapanel unique id. So we can use userid moving forward\n mixpanel_distinct_id = params[:distinct_id]\n @tracker.alias(@user.id,mixpanel_distinct_id)\n @tracker.people.set(@user.id,{\n '$first_name' => @user.profile.first_name,\n '$last_name' => @user.profile.last_name,\n '$email' => @user.email,\n '$phone' => @user.profile.phone\n },@user.current_sign_in_ip.to_s)\n @tracker.track(@user.id,'User account created for org. member')\n\n # flash[:notice] = 'Welcome to MyDomino!'\n \n render json: {\n message: 'User added',\n status: 200\n }, status: 200\n else\n render json: {\n message: 'Error adding user',\n status: 400\n }, status: 400\n end\n end", "def user_create(name='admin', is_admin=true)\n key = \"#{name}:#{is_admin}\"\n UserCache.instance[key] ||= User.find_or_create_by_name(name) do |u|\n u.email_address = \"#{u.name}@concord.org\"\n u.password = u.password_confirmation = \"#{u.name}pAsS\"\n u.state = 'active'\n u.administrator = is_admin\n end\nend", "def user_lookup(email, id = false)\n if id\n send_req({act: :user_lookup, unique_id: email})\n else\n send_req({act: :user_lookup, cloudflare_email: email})\n end\n end", "def user_by_id(user_id)\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Picking user ID #{user_id.inspect} from pool\"\n users.select { |user| user[:id] == user_id.to_i }.first\n end", "def ensure_user_byuname(user)\n users = db[:users]\n usr = users.first(:login => user)\n\n if usr.nil?\n u = retrieve_user_byusername(user)\n\n if u.nil?\n warn \"User #{user} does not exist\"\n return\n end\n\n email = unless u['email'].nil?\n if u['email'].strip == '' then\n nil\n else\n u['email'].strip\n end\n end\n\n geo = geolocate(location: u['location'])\n\n users.insert(:login => u['login'],\n :name => u['name'],\n :company => u['company'],\n :email => email,\n :fake => false,\n :deleted => false,\n :type => user_type(u['type']),\n :long => geo[:long],\n :lat => geo[:lat],\n :country_code => geo[:country_code],\n :state => geo[:state],\n :city => geo[:city],\n :created_at => date(u['created_at']))\n\n info \"Added user #{user}\"\n\n if user_type(u['type']) == 'ORG'\n info \"User #{user} is an organization. Retrieving members\"\n ensure_org(u['login'], true)\n end\n\n users.first(:login => user)\n else\n debug \"User #{user} exists\"\n usr\n end\n end", "def create\n authenticate_with_open_id(params[:openid_identifier], \n required: [:email, :nickname]) do |result, identity_url, registration|\n if result.successful?\n #FIXME - needs normalizing before checking for the identity_url?\n unless @user = User.find_by_identity_url(identity_url) or\n User.find_by_email(registration['email'])\n # creates new user if there was none registered\n # with the provided url, or fetched email \n @user = User.create(identity_url: identity_url, \n email: registration['email'], \n username: registration['nickname'])\n end\n login @user\n else\n # indicates that login failed\n # something went wrong with the auth \n # process, prompt for a retry\n flash[:alert] = \"Something went wrong. Please try logging in again.\"\n redirect_to(login_url)\n end\n end\n end", "def create_account(user)\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"email\" => user.email, \"name\" => user.username })\nend", "def create\n if openid = request.env[Rack::OpenID::RESPONSE]\n case openid.status\n when :success\n ax = OpenID::AX::FetchResponse.from_success_response(openid)\n user = User.where(:identifier_url => openid.display_identifier).first\n user ||= User.find_by_email(ax.get_single('http://axschema.org/contact/email')) \n \n sign_in user\n if user.first_name.blank?\n redirect_to edit_user_path(user)\n else\n redirect_back_or(user)\n end\n when :failure\n render :action => 'problem'\n end\n else\n redirect_to new_session_path\n end\n end", "def create_user(application_name, application_id)\n res = nil\n user_id = VaultDriver.generate_uid\n uri = URI(@url + \"auth/#{application_name}/map/user-id/#{user_id}\")\n req = Net::HTTP::Post.new(uri)\n req['X-Vault-Token'] = @token\n application_data = { 'value' => application_id }\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|\n req.body = application_data.to_json\n http.request(req)\n end\n [user_id, res.code.to_i]\n end", "def create_account\n system 'clear'\n puts \"--------LOGIN--------\"\n used_flag = false\n while !used_flag\n new_user = @prompt.ask(\"Enter username: \", required: true)\n if !User.all.map(&:name).include?(new_user)\n new_password = @prompt.mask(\"Enter password: \", required: true)\n used_flag = 1\n else\n puts \"Username already taken\"\n end\n end\n @current_user = User.create(name: new_user, password: new_password)\n main_menu\n end", "def find_or_create_client(email, first_name, last_name)\n print \"Looking up client by email: #{email}...\"\n person_id = find_client_by_email(email)\n if person_id\n puts \"FOUND: #{person_id}\"\n else\n puts \"not found\"\n print \"Creating client for #{email}...\"\n person = create_object(\"people\", person: {email: email, first_name: first_name, last_name: last_name})\n puts \"CREATED: #{person['id']} (put this in a safe place)\"\n end\nend", "def get_or_create_user\n name = metadata['user']\n\n db = DB::Users.find(name, pool)\n u = load_user\n\n if db.nil?\n # The user does not exist, create him\n Commands::User::Create.run!(\n pool: pool.name,\n name: u.name,\n ugid: u.ugid,\n uid_map: u.uid_map.export,\n gid_map: u.gid_map.export,\n )\n\n return DB::Users.find(name, pool) || (fail 'expected user')\n end\n\n # Free the newly allocated ugid, use ugid from the existing user\n UGidRegistry.remove(u.ugid) if u.ugid != db.ugid\n\n %i(uid_map gid_map).each do |param|\n mine = db.send(param)\n other = u.send(param)\n next if mine == other\n\n fail \"user #{pool.name}:#{name} already exists: #{param} mismatch: \"+\n \"existing #{mine}, trying to import #{other}\"\n end\n\n db\n end", "def does_user_exist (username)\n user = Account.find_by(:user_name=> username)\n if user\n return true\n else\n return false\n end\nend", "def create\n auth = AuthService.where(:provider => @authhash[:provider], :uid => @authhash[:uid]).first\n\n if auth\n # signin existing user\n session[:user_id], session[:service_id] = auth.user_id, auth.id\n flash[:notice] = 'Signed in successfully via ' + @authhash[:provider].capitalize + '.'\n else\n # find or create user\n user = User.where(:email => @authhash[:email]).first || User.new(:email => @authhash[:email])\n user = user.apply_omniauth(@authhash)\n\n if user.save!\n session[:user_id], session[:service_id] = user.id, user.auth_services.where(:provider => @authhash[:provider]).first.id\n end\n flash[:notice] = 'Your account has been created and you have been signed in!'\n end\n unless session[:user_id]\n reset_session\n flash[:error] = 'There was an error while creating your account from which we were not able to recover.'\n end\n\n redirect_to root_url\n end", "def local_user_create(handle:, name:, pwd:, priv: \"read-only\")\n\n user = _get_local_user(handle, name)\n if !user.nil?\n return local_user_modify(handle: handle, name: name, :priv => priv, :account_status => AaaUserConsts::ACCOUNT_STATUS_ACTIVE)\n end\n\n available_user_id = _get_free_user_id(handle)\n\n new_user = AaaUser.new( parent_mo_or_dn: \"sys/user-ext\", id: available_user_id)\n args = {:name => name,\n :pwd => pwd,\n :priv => priv,\n :account_status => AaaUserConsts::ACCOUNT_STATUS_ACTIVE}\n new_user.set_prop_multiple(**args)\n\n handle.set_mo(mo: new_user)\n #return new_user\n return handle.query_dn(dn: new_user.dn)\nend", "def identify_using_user(identifier)\n user_id = identifier.gsub(\"user-\", \"\")\n\n identify_with_cache(:user, user_id) do\n User.find_by(id: user_id)\n end\n end", "def find_by_username\n User.find_by_username(@username_or_id)\n end", "def create\n checkexists = User.find_by(email: user_params[:email], organization_id: user_params[:organization_id])\n\tif checkexists\n\t\tflash[:danger] = 'A user with this email address already exists within the specified organization'\n\t\tredirect_to '/signup.html'\n\telse\n\t\t@user = User.new(user_params)\n\t\[email protected]_attribute(:is_admin, false)\n\t\tif @user.save\n\t\t\trender 'show'\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend\n end", "def create\n extuser = User.find_by(username: user_params[:username])\n if(extuser.nil?)\n @user = User.new(user_params)\n @user.high_score = 0\n @user.save!\n auth_token = AuthenticateUser.new(user_params[:username], user_params[:password]).call\n response = { message: Message.account_created, auth_token: auth_token, high_score: 0 }\n json_response(response, :created)\n else\n response = { message: Message.dublicate_user }\n json_response(response, :bad_request)\n end \n end", "def user_info_by_cid( id )\n\n print \"Looking up user details for #{id}...\"\n\n # lookup the user by computing id\n user_info = Helpers.lookup_user( id )\n if user_info.nil?\n puts \"not found\"\n return nil\n end\n\n puts \"done\"\n return user_info\n end", "def add user, pin = nil\n command = aqhbci <<-CMD\n adduser \\\n --tokentype=#{user.tokentype} \\\n --context=#{user.context} \\\n --bank=#{user.bank} \\\n --user=#{user.userid} \\\n --server=#{user.server} \\\n --username=#{user.name} \\\n --hbciversion=#{user.hbciversion}\n CMD\n stdin, stdout, stderr, wait_thr = Open3.popen3(command.strip)\n success = wait_thr.value.success?\n\n if pin && success\n with_secure_pin user, pin do |f|\n sysid_command = aqhbci(\"getsysid --user=#{user.userid}\", \"--pinfile=#{f.path.strip}\").strip\n stdin, stdout, stderr, wait_thr = Open3.popen3(sysid_command)\n wait_thr.join\n success = success && wait_thr.value.success?\n end\n end\n return success\n end", "def find_or_create_for_omniauth auth, &block\n email = auth.info.email\n # This is just a placeholder for indexes and validations etc.\n # (twitter doesn't give us an email)\n email ||= \"#{auth.info.nickname || auth.uid}@#{auth.provider}.auth\"\n\n user = find_for_omniauth auth\n user ||= find_or_initialize_by email: email\n\n user.omniauth!(auth, &block) and user\n end", "def create_authy_id\n authy = Authy::API.register_user(\n email: current_user.email,\n cellphone: current_user.phone_number,\n country_code: current_user.country_code\n )\n\n current_user.update(\n authy_id: authy.id\n )\n end", "def get_user(jid, create)\n # Drop the resource.\n parts = jid.to_s.split('/')\n jid = parts[0]\n\n user = @users[jid]\n if not user and create\n user = User.new(@sender, jid, invent_nick(jid))\n @users[jid] = user\n @logger.debug(\"Created user #{user.nick} <#{user.jid}>\")\n end\n user\n end", "def _user_add argv = {}\n\t\tf\t\t\t\t= {}\n\t\tf[:tag]\t\t\t= argv[:tag] if argv.include?(:tag)\n\t\tf[:salt] \t\t= _random 5\n\n\t\t#username\n\t\t_throw Sl[:'the user is existing'] if _user? f[:name]\n\t\tf[:name] \t\t= argv[:name]\n\n\t\t#password\n\t\trequire \"digest/sha1\"\n\t\tf[:pawd] \t\t= Digest::SHA1.hexdigest(argv[:pawd] + f[:salt])\n\n# \t\tSdb[:user].insert(f)\n\t\t_submit :_user, :fkv => f, :uniq => true\n\t\tuid = Sdb[:_user].filter(:name => f[:name]).get(:uid)\n\t\tuid ? uid : 0\n\tend", "def find_by_username!\n User.find_by_username!(@username_or_id)\n end", "def create_user params, send_info_email = false\n if params[:email] && !params[:email].empty?\n email = params[:email].downcase\n else\n email = params[:person_identifier] + '@example.com' if params[:person_identifier]\n end\n\n if email && email =~ /\\A[^@]+@[^@]+\\z/\n u = User.find_by_email(email)\n email_correct = true\n end\n return u if u\n\n # no existing user, create new\n u = User.new\n u.email = email\n\n unless email_correct \n while User.find_by_email(u.email)\n if params[:first_name] && !params[:first_name].empty? && params[:last_name] && !params[:last_name].empty?\n identifier = params[:first_name] + '.' + params[:last_name] + SecureRandom.hex(5)\n else\n identifier = SecureRandom.hex(15)\n end\n u.email = identifier + '@example.com'\n end\n end\n\n if params[:password] && !params[:password].empty?\n pw = params[:password]\n else\n pw = SecureRandom.base64(5)\n end\n u.password = pw\n u.password_confirmation = pw\n\n u.first_name = params[:first_name]\n u.last_name = params[:last_name]\n if params[:display_name]\n u.display_name = params\n elsif u.first_name && u.last_name\n u.display_name = u.first_name + ' ' + u.last_name\n end\n\n u.skip_confirmation! if User.respond_to? 'skip_confirmation!' # skip the confirmation email, that would be automatically sent by devise\n AuditoriumMailer.automatically_generated_user(u.email, password).deliver if send_info_email unless u.email.include? '@example.com'\n\n u.save\n u\n end", "def lookup_user\n reset_session #use this when they ask you to find a user\n if session[:user_id]\n @user = User.find(session[:user_id])\n end\n end", "def store_issuer\n user = User.find_or_create_by(slack_id: @params[:user_id])\n user.update(username: @params[:user_name]) # in case they have changed their username\n end", "def create\n username = user_params[:username]\n if (User.where(username: username).exists?)\n result = get_user(username)\n else\n result = create_user(username)\n end\n\n respond_to do |format|\n if (result[:is_success])\n format.html { redirect_to result[:data], notice: 'Repositories were successfully retrieved.' }\n else\n flash[:error] = \"User wasn't found!\"\n format.html { redirect_to action: \"new\"}\n end\n end\n end", "def create_user_if_none_exist\n return if User.exists?\n puts \"Creating Users...\"\n\n User.create :email => \"[email protected]\", :password => \"welcome1\", :password_confirmation => \"welcome1\"\n end", "def account_create(uid,display_name)\n user_hash = @client.user_create(\"#{uid}\",\"#{display_name}\")\n Rails.logger.debug '> Radosgw: Account create'\n user_json = user_hash.to_json\n storage = Storage.new(STORAGES_BUCKET)\n storage.upload(uid, user_json, 'application/json')\n user_hash\n end", "def does_user_exist(username)\n user = Account.find_by(:user_name => username)\n if user\n return true\n else\n return false\n end\nend", "def create\n return request_sreg unless params[:user][:identity_url].blank? || !params[:commit].eql?('Load from OpenID')\n logout_keeping_session! unless logged_in? && current_user.is_administrator?\n @object = User.new(params[:user])\n # Add attributes not available to mass-assign\n login = params[:user][:login]\n identity_url = params[:user][:identity_url]\n @object.login = (login.blank? ? nil : login)\n @object.identity_url = (identity_url.blank? ? nil : identity_url)\n success = @object && @object.valid?\n @object.save! if success\n # the normal case of user signup\n @object.register! if success && params[:activate].to_i != 1\n # special case for administrators creating accounts\n if success && params[:activate].to_i == 1 && (logged_in? && current_user.is_administrator?)\n @object.activate!\n create_change_log_entry(@object.id, nil, 'activate', 'Automatic user activation on create.')\n end\n respond_to do |format|\n if success && @object.errors.empty?\n if logged_in? && current_user.is_administrator?\n flash[:notice] = 'The account has been created!'\n create_change_log_entry\n format.html { redirect_to(users_path) }\n format.xml { render :xml => @object, :status => :created, :location => @object }\n else\n flash[:notice] = 'Your account has been created! Please check your email, to complete the activation process.'\n create_change_log_entry(@object.id, @object.id)\n format.html { redirect_to(login_path) }\n format.xml { render :xml => @object, :status => :created, :location => @object }\n end\n else\n flash.now[:error] = \"We couldn't set up your account, sorry. Please try again, or contact the site administrator.\"\n format.html { render :action => 'new', :template => 'users/form' }\n format.xml { render :xml => @object.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find_or_create_by(uid: auth['uid']) do |u|\n u.name = auth['info']['name']\n u.email = auth['info']['email']\n end\n\n session[:user_id] = @user.id\n\n render 'welcome/home'\n end", "def admin_create_work_user_ivars(allow_nil_user=true)\n if @curr_user.admin?\n work_user_id = (params[:work_user] || session[:work_user_id] || 0).to_i\n @work_user = if work_user_id > 0\n User.find(work_user_id)\n elsif allow_nil_user\n nil\n else\n User.find(:first, :order => 'name asc')\n end\n session[:work_user_id] = @work_user ? @work_user.id : nil\n else\n @work_user = session[:work_user_id] = nil\n end\n end" ]
[ "0.67742336", "0.6773403", "0.668789", "0.6681846", "0.6617749", "0.6611668", "0.65838003", "0.6583433", "0.6515639", "0.6507259", "0.64511025", "0.6434905", "0.6411974", "0.6391272", "0.63751304", "0.637097", "0.6344418", "0.63415676", "0.6316173", "0.6314543", "0.6310543", "0.62929994", "0.62908036", "0.6249725", "0.6244783", "0.62224835", "0.6222448", "0.62135637", "0.62121105", "0.6209914", "0.6208064", "0.6189688", "0.6184697", "0.6181953", "0.6179372", "0.6178891", "0.61754185", "0.6162381", "0.616113", "0.6141755", "0.61357486", "0.6127311", "0.6082586", "0.6080832", "0.6075726", "0.60736394", "0.60703295", "0.60686135", "0.60686135", "0.60613877", "0.6056053", "0.60528415", "0.60426354", "0.6034592", "0.60316825", "0.60294926", "0.60050774", "0.60030407", "0.60021955", "0.5996497", "0.599464", "0.5992352", "0.5991125", "0.5989598", "0.59848714", "0.59781", "0.5978027", "0.5966499", "0.59646875", "0.5964246", "0.5961105", "0.59506655", "0.594734", "0.5935087", "0.5930377", "0.5927254", "0.5921877", "0.5919608", "0.5918165", "0.59156644", "0.5910608", "0.59041965", "0.59027386", "0.5890733", "0.5888583", "0.5885906", "0.58843535", "0.5878822", "0.58736056", "0.5870261", "0.5867333", "0.5865582", "0.5859936", "0.58564174", "0.58532226", "0.58522594", "0.5849789", "0.5843215", "0.58410096", "0.58321595" ]
0.81069696
0
delete the specified file from the specified work on behalf of the specified user
def delete_fileset( user, fileset ) print "deleting file set #{fileset.id} (#{fileset.label})... " file_actor = ::CurationConcerns::Actors::FileSetActor.new( fileset, user ) file_actor.destroy puts "done" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n work_id = params[:work]\n respond_to do |format|\n errors = WorkFile.destroy( current_user, params[:id] )\n if !errors\n format.html { redirect_to \"/works/#{work_id}\", notice: 'File was successfully removed.' }\n format.json { render json: {}, status: :ok }\n else\n format.html { redirect_to \"/works/#{work_id}\", notice: 'Error removing file.' }\n format.json { render json: { error: errors }, status: :unprocessable_entity }\n end\n end\n end", "def delete\n\t\tbegin\n\t\t\tFile.open(\"models/userDetails/#{@username}.txt\", \"r\") do |f|\n\t\t\t File.delete(f)\n\t\t\tend\n\t\trescue Errno::ENOENT\n\t\tend\n\tend", "def remove_file\n @assignment = Assignment.find(params[:id])\n if ((@assignment.facebook_user.id == @fb_user.id) or (@assignment.is_author? @fb_user))\n @assignment.remove_file(params[:path])\n ZipWorker.asynch_zip_assignment(:id => @assignment.id)\n render :partial => \"file_removed\", :layout => false\n end\n end", "def unshare_file_in_db(file_id, user_id)\n $db.execute(\"DELETE FROM shared_files WHERE file_id = ? AND user_id = ?\", file_id, user_id)\nend", "def delete current_user\n raise RequestError.new(:internal_error, \"Delete: no user specified\") if current_user.nil?\n\n # remove all its files\n self.files.each { |item| item.delete current_user }\n # remove all its children, meaning all its subdirectories. (all sub-sub-directories and sub-files will me removed as well)\n self.childrens.each { |children| children.delete current_user }\n\n if current_user.id != self.user_id then # if random owner \n # remove all links between this folder and the current user only\n FileUserAssociation.all(x_file_id: self.id, user_id: current_user.id).destroy!\n # remove all associations where this folder is a children of a folder belonging to the current user only\n FolderFolderAssociation.all(children_id: self.id).each do |asso|\n asso.destroy! if current_user.x_files.get(asso.parent_id)\n end\n # No sharing for folders: no SharedToMeAssociations\n\n else # if true owner \n # remove all links between this folder and ALL users\n FileUserAssociation.all(x_file_id: self.id).destroy!\n # remove all associations where this folder is a children of a folder belonging ALL users\n FolderFolderAssociation.all(children_id: self.id).destroy!\n # No sharing for folders: no SharedByMeAssociations\n\n # No need to remove the association where this folder is a parent (of a file or folder)\n # because the children have already been removed and all theirs associations\n #\n # FolderFolderAssociation.all(parent_id: self.id).destroy!\n # FileFolderAssociation.all(parent_id: self.id).destroy!\n \n # now remove the entity\n self.destroy!\n end\n end", "def destroy\n user_file = UserFile.find(params[:id])\n @user_file_id = user_file.id.to_s\n @allowed = Job::Max_Attachments - user_file.attachable.user_files.count\n user_file.destroy\n end", "def destroy_usecase_file\n @user=find_user\n if [email protected]?\n @file_use=UseCase.find_by_id(params[:id])\n if !session[:file_id].nil?\n @file=ProjectFile.find(session[:file_id])\n if [email protected]? and @user.privilige!=\"Read\" and !@file_use.nil?\n @file_use.project_files.delete(@file)\n respond_to do |format|\n format.html { redirect_to show_file_uses_url(@file.id) }\n end\n else\n redirect_to project_files_path\n end\n else\n redirect_to project_files_path\n end\n else\n redirect_to sign_in_url\n end\n\n end", "def destroy_requirement_file\n @user=find_user\n if [email protected]?\n @file_req=Requirement.find_by_id(params[:id])\n if !session[:file_id].nil?\n @file=ProjectFile.find(session[:file_id])\n if [email protected]? and @user.privilige!=\"Read\" and !@file_req.nil?\n @file_req.project_files.delete(@file)\n\n respond_to do |format|\n format.html { redirect_to show_file_reqs_url(@file.id) }\n end\n else\n redirect_to project_files_path\n end\n else\n redirect_to project_files_path\n end\n else\n respond_to do |format|\n format.html { redirect_to sign_in_url }\n end\n end\n end", "def delete\n if(current_user)\n\tuser_id = current_user.id\n\n\tid = params['file_id']\n\t\tsubmission = FileSubmission.find_by_id(id)\n\tif(submission)\n\t\tlogger = Logger.new(\"log/uploads.log\")\n\t\tlogger.info \"#{Time.now}:: #{current_user.friendly_full_name} (ID# #{current_user.id}) has attempted to delete #{submission.name}.\"\n\n\t\tif(submission && submission.user_can_delete(user_id))\n\t\t\tfaculty_id = Course.find(Assignment.find(submission.assignment_id).course_id).user_id\n\n\t\t\tFile.delete(submission.full_save_path)\n\t\t\tFileSubmission.destroy(id)\n\t\t\tflash[:notice] = \"File removed successfully.\"\n\t\t\tlogger.info \"Delete permitted.\"\n\t\telse\n\t\t\tflash[:error] = \"You do not have permission to do that.\"\n\t\t\tlogger.info \"Request denied.\"\n\t\tend\n\t\tredirect_to assignment_view_path(submission.assignment_id)\n\telse\n\t\tflash[:error] = \"File does not exist\"\n\t\tredirect_to root_path\n\tend\n\n else\n flash[:error] = 'You do not have permission to delete this item. Please login.'\n redirect_to root_path\n end\n end", "def delete_current_presentation(file_id, user)\n delete_url = \"https://www.googleapis.com/drive/v2/files/#{file_id}\"\n headers = { 'Authorization': \"Bearer #{user.google_access_token}\", 'Content-type': 'application/json' }\n rest_resource = RestClient::Resource.new(delete_url, :headers => headers)\n rest_resource.delete\n end", "def destroy\n \n @user_file = UserFile.find(params[:id])\n authorize! :destroy, @user_file\n name=@user_file.uploaded_file_file_name\n @user_file.destroy\n\n respond_to do |format|\n format.html { redirect_to :back,:notice=>\"Deleted file: \"+name }\n format.json { head :ok }\n end\n end", "def removeWorkingUser user\n @workingUsers.delete user\n end", "def delete\n # no need to delete all the associations because root_folder.delete does it\n self.root_folder.delete self\n # remove all friendships where the user is the source\n Friendship.all(source_id: self.id).destroy!\n # remove all friendships where the user is the target\n Friendship.all(target_id: self.id).destroy!\n\n # remove all associations where this user receives a file >BY< another user\n SharedToMeAssociation.all(user_id: self.id).destroy!\n # remove all associations where this user shared a file >TO< another user\n SharedByMeAssociation.all(user_id: self.id).destroy!\n\n self.destroy!\n end", "def delete_opml_file\n if self.filename.present?\n Feedbunch::Application.config.uploads_manager.delete self.user_id, OpmlExporter::FOLDER, self.filename\n end\n end", "def delete(current_user)\n if can_delete?(current_user)\n force_delete\n else\n errors.add_to_base(\"you are not allowed to remove this FileContent\")\n raise \"you are not allowed to remove this FileContent\"\n end\n end", "def file_delete(node, file)\n _out, _local, _remote, code = node.test_and_store_results_together(\"rm #{file}\", 'root', 500)\n code\nend", "def file_delete(node, file)\n _out, _local, _remote, code = node.test_and_store_results_together(\"rm #{file}\", 'root', 500)\n code\nend", "def destroy\n @work = Work.find(params[:id])\n if not (@current_user.mine?(@work) || @current_user.admin? || @current_user.produce? )\n redirect_to @current_user\n else\n if @work.deleted\n @work.deleted = false\n else\n @work.deleted = true\n end\n @work.save\n\n respond_to do |format|\n format.html { redirect_to(works_url) }\n format.xml { head :ok }\n end\n end\n end", "def destroy\n @repo = Repository.find(params[:id])\n\n\t\t#REMOVE FILE FROM FILE SYSTEM AND DO A GIT commit\n\t\tif(FileUtils.rm(params[:path]))\n\t\t\t@git = GitHelper.init(@repo.path, current_user.email, current_user.name)\n\t\t\tGitHelper.commitAll(@git, \"Removed file :: #{params[:path]}\")\n\t\tend\n end", "def delete_file(uid, info = {})\n if info[\"multipart_id\"]\n multipart_upload = object(uid).multipart_upload(info[\"multipart_id\"])\n abort_multipart_upload(multipart_upload)\n\n delete [object(\"#{uid}.info\")]\n else\n delete [object(uid), object(\"#{uid}.info\")]\n end\n end", "def destroy\n @userfile = Userfile.find(params[:id])\n @userfile.destroy\n\n respond_to do |format|\n format.html { redirect_to uploads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_file.destroy\n respond_to do |format|\n format.html { redirect_to user_files_url, notice: \"User file was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete\n Modeles::File.delete @fileInTable.id\n @errors = nil\n @fileInTable = nil\n @path = nil\n @user = nil\n @group = nil\n @userRights = nil\n @groupRights = nil\n @othersRights = nil\n end", "def delete_file(uid, info = {})\n grid_info = files_collection.find(filename: uid).first\n bucket.delete(grid_info[:_id]) if grid_info\n end", "def destroy\n @userfile.destroy\n\n fileName = Rails.root.join('public','uploads', @userfile.file_name_slug)\n File.delete(fileName) if File.exist?(fileName)\n\n respond_to do |format|\n format.html { redirect_to user_mycontact_meeting_userfiles_path }\n format.json { head :no_content }\n end\n end", "def delete(user)\n Rails.logger.debug \"Call to photo.delete\"\n if !self.file.blank?\n Util.delete_image(self.file) #Delete the image file from the image server\n end\n reqUrl = \"/api/photo/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_delete_request(reqUrl,user['email'],user['password'])#Make the DELETE request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n return true, rest_response #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n end", "def destroy\n @userfile.destroy\n respond_to do |format|\n format.html { redirect_to userfiles_url, notice: 'Userfile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n @user = User.get(params[:id])\n \n\n user_dir = \"#{RAILS_ROOT}\" + \"/public/user_files/#{current_user.userid}/\"\n FileUtils.rm_rf user_dir\n \n # @mycarts = Mycart.all(:user_id => @user.id) \n # @mycarts.destroy\n\n @mytemplates = Mytemplate.all(:user_id => @user.id)\n @mytemplates.destroy\n \n @freeboards = Freeboard.all(:user_id => @user.id) \n @freeboards.destroy\n\n @myimages = Myimage.all(:user_id => @user.id) \n @myimages.destroy\n\n if @user.destroy\n redirect_to(admin_users_url) \n else\n puts \"에러 발생 ==========================================\"\n puts @user.errors\n redirect_to(admin_users_url) \n end\n \n\n end", "def delete_file(filename,repo)\n curl_delete(\"#{self.host}/api2/repos/#{repo}/file/?p=#{filename}\").body_str\n end", "def destroy\n file_store = FileStore.find_by_sha1_hash!(params[:id])\n if user['id'] == file_store.user_id || user['role'] == 'admin' ||\n (user['uname'] == 'file_store' && user['role'] == 'system')\n file_store.destroy\n head :no_content\n else\n render_error 403\n end\n end", "def delete(filename); end", "def deleteFile(filePath, dryRun)\n #N Without this, the required ssh command to delete a file won't be (optionally) executed.\n ssh(\"rm #{filePath}\", dryRun)\n end", "def userfiles_delete_files_delete_with_http_info(multi_userfile_mod_req, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserfilesApi.userfiles_delete_files_delete ...'\n end\n # verify the required parameter 'multi_userfile_mod_req' is set\n if @api_client.config.client_side_validation && multi_userfile_mod_req.nil?\n fail ArgumentError, \"Missing the required parameter 'multi_userfile_mod_req' when calling UserfilesApi.userfiles_delete_files_delete\"\n end\n # resource path\n local_var_path = '/userfiles/delete_files'\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', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(multi_userfile_mod_req)\n auth_names = ['BrainPortalSession']\n data, status_code, headers = @api_client.call_api(:DELETE, 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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UserfilesApi#userfiles_delete_files_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def deleteFile(filePath, dryRun)\n #N Without this, the deletion command won't be run at all\n sshAndScp.deleteFile(filePath, dryRun)\n end", "def destroy\n\n # Deleting a file that is on the filsystem\n # if @user.filename\n # filename = Rails.root.join('public', 'uploads', @user.filename)\n # File.delete(filename) if File.exist?(filename)\n # end\n \n # Deleting image using Paperclip\n @user.avatar = nil\n \n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_file\n File.unlink file\n end", "def delete_file\n File.unlink file\n end", "def unshare\n login = params[:login]\n raise RequestError.new(:bad_param, \"Wrong login\") if login.nil? || login.length == 0\n user = User.all(login: login).first\n raise RequestError.new(:bad_param, \"User not found\") if user.nil?\n file = user.x_files_shared_to_me.get(params[:id])\n raise RequestError.new(:file_not_found, \"File not found\") unless file\n\n file = WFile.unshare_to_user(session[:user], user, WFile.get(params[:id]))\n file.update_and_save\n @result = { success: true }\n session[:user].save\n end", "def remove_local_file(file, user)\n logger.debug(\"removing local file #{file.uid} by user #{user.dxuser}\")\n UserFile.transaction do\n # Use find_by(file.id) since file.reload may raise ActiveRecord::RecordNotFound\n file = UserFile.find_by(id: file.id)\n return unless file\n\n Event::FileDeleted.create_for(file, user)\n file.destroy!\n end\n end", "def delete(name)\n handle = system.run!(:search, \"user\", name, nil, @keyring)\n system.run!(:unlink, handle, @keyring)\n end", "def delete_file(path)\n \n puts \"Sending path via MCollective Files client\"\n @mc.delete(:path => path)\n printrpcstats\n \n end", "def destroy\n #FIXME: Double check auth is working for deletion. Also, maybe should only delete if not associated with any experiments.\n @data_file.destroy\n \n respond_to do |format|\n format.html { redirect_to(data_files_path) }\n format.xml { head :ok }\n end\n end", "def delete_user\n end", "def destroy\n RawFile.transaction do\n @raw_file = RawFile.find_by_user(params[:id],current_user.id)\n @raw_file.destroy\n\n respond_to do |format|\n format.html { redirect_to raw_files_url }\n format.json { head :no_content }\n end\n end\n rescue\n redirect_to raw_files_url, flash: {:error => $!.to_s}\n end", "def delete_user\n client.delete(user)\n end", "def delete_file(file)\n delete_attachment(file)\n end", "def destroy\n @upload = @user.uploads.find(params[:id])\n authorize @upload\n\n @upload.destroy\n redirect_to user_uploads_path(@user)\n end", "def destroy\n\n unless @workitem.user_id == current_user.id\n render json: \"unauthorized\", status: :unauthorized\n return\n end\n\n @workitem.destroy\n respond_to do |format|\n format.html { redirect_to workitems_url }\n format.json { head :no_content }\n end\n end", "def delete_github_repo_file\n # commit\n commit_to_github(@repo, post_params)\n end", "def delete(owner_id, name)\n @user.delete([@base_uri, owner_id, name].join(\"/\"))\n end", "def remove_fileset\n\n fileset = get_the_fileset\n if fileset.nil? == false\n works = fileset.in_works\n work_id = works.empty? ? 'unknown' : works[0].id\n\n # audit the information\n WorkAudit.audit( work_id, User.cid_from_email( @api_user.email), \"File #{fileset.label}/#{fileset.title[0]} deleted\" )\n\n file_actor = ::CurationConcerns::Actors::FileSetActor.new( fileset, @api_user )\n file_actor.destroy\n render_standard_response( :ok )\n else\n render_standard_response( :not_found, 'Fileset not available' )\n end\n\n end", "def destroy\n @file = current_user.past_exams.find(params[:id])\n\t\[email protected]\n respond_to do |format|\n format.html { redirect_to file_infos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @[email protected]_uploads.find(params[:id])\n @file_upload.destroy\n respond_to do |format|\n format.html { redirect_to user_file_uploads_path, notice: 'File was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cell_automaton.destroy\n file_path = Rails.root.join(\"public\", \"cell_automatons\", \"#{current_user.id}\")\n file_name = file_path.to_s + \"/\" + @cell_automaton.id.to_s\n File.delete(\"#{file_name}.rb\")\n \n redirect_to cell_automatons_url, notice: 'Cell automaton was successfully destroyed.'\n end", "def userfiles_delete_files_delete(multi_userfile_mod_req, opts = {})\n userfiles_delete_files_delete_with_http_info(multi_userfile_mod_req, opts)\n nil\n end", "def destroy_manuscript\n requires_user_can :edit, task\n paper.file.destroy!\n\n head :no_content\n end", "def remove_failed_files(job)\n context = build_context(job)\n api = context.api\n scope = job[\"args\"].first\n project = UserFile.publication_project!(context.user, scope)\n\n files = UserFile.where(scope: scope, project: project, state: UserFile::STATE_COPYING)\n\n begin\n api.project_remove_objects(project, files.map(&:dxid))\n rescue DXClient::Errors::NotFoundError\n # do nothing\n end\n\n files.destroy_all\n end", "def delete\n unless FileDescriptor.exists?(filename: params[:fname])\n fpath = filePath params[:fname]\n begin\n File.delete fpath\n result = {status: 'ok'}\n status = 200\n rescue Exception => e\n result = {status: 'error', message: e.message}\n status = 500\n end\n else\n result = {status: 'error', message: 'File is open'}\n status = 403 # Forbidden\n end\n render json: result.to_json, status: status\n end", "def delete_user_route(user)\n self.client.delete(\"gh.storage.user.#{user}\")\n end", "def destroy\n @file = UserUpload.find(params[:id])\n if @file\n \[email protected]\n end\n # Render nothing to denote success\n render :text => \"\" and return\n end", "def delete_from_directory_for_user(directory, username)\n file_to_delete = File.join(directory, BitlbeeConfig::User.username_to_filename(username))\n File.delete(file_to_delete) if File.exist?(file_to_delete)\n end", "def remove_collaborator\n @project = current_user.projects.find(params[:id])\n @collaborator = User.find(params[:collaborator_id])\n @project.users.delete(@collaborator)\n\n redirect_to project_path(@project), :alert => \"Supervisor is deleted successfully\"\n end", "def delete_submission_files\n begin\n # instantiate user client for updating workspace attributes\n user_client = user_fire_cloud_client(current_user, @user_workspace.namespace)\n # first, add submission to list of 'deleted_submissions' in workspace attributes (will hide submission in list)\n workspace = user_client.get_workspace(@user_workspace.namespace, @user_workspace.name)\n ws_attributes = workspace['workspace']['attributes']\n if ws_attributes['deleted_submissions'].blank?\n ws_attributes['deleted_submissions'] = [params[:submission_id]]\n else\n ws_attributes['deleted_submissions']['items'] << params[:submission_id]\n end\n logger.info \"Adding #{params[:submission_id]} to workspace delete_submissions attribute in #{@user_workspace.name}\"\n user_client.set_workspace_attributes(@user_workspace.namespace, @user_workspace.name, ws_attributes)\n logger.info \"Starting submission #{params[:submission_id]} deletion in #{@user_workspace.name}\"\n # use GCS Admin client to get/delete files\n submission_files = ApplicationController.gcs_client.execute_gcloud_method(:get_workspace_files, 0, @user_workspace.namespace,\n @user_workspace.name, prefix: params[:submission_id])\n submission_files.each do |file|\n ApplicationController.gcs_client.execute_gcloud_method(:delete_workspace_file, 0, @user_workspace.namespace,\n @user_workspace.name, file.name)\n end\n render '/user_workspaces/submissions/delete_submission_files'\n rescue => e\n logger.error \"Unable to remove submission #{params[:submission_id]} files from #{@user_workspace.name} due to #{e.class.name}:#{e.message}\"\n @alert = \"Unable to delete the outputs for #{params[:submission_id]} due to the following error: #{e.message}\"\n render '/user_workspaces/submissions/display_modal'\n end\n end", "def delete(remote_filepath)\n @request = Net::HTTP::Delete.new(::File.join(@uri.path, remote_filepath))\n @request.basic_auth @username, @password\n\n @response = @http.request(@request)\n @response.body.presence || @response.code.to_i\n end", "def destroy\n begin\n File.delete( @doc_file.docOwner)\n rescue\n end\n @doc_file.destroy\n \n respond_to do |format|\n format.html { redirect_to doc_files_url }\n format.json { head :no_content }\n end\n end", "def delete_workspace_permission(user, workspace)\n # queries on permissions are a bit limited - to only one filter parameter\n query_result = @rally.find(:workspace_permission, :fetch => true, :pagesize => 100) {\n equal :\"user.login_name\", user.login_name\n }\n \n # So now we need to find the exact workspace for all the users workspace_permissions\n workspace_permission = nil\n workspace_permission = query_result.find { |wp| wp.workspace == workspace }\n # delete it if it exists\n if workspace_permission != nil\n workspace_permission.delete\n end\n end", "def delete_user(user)\n delete user_path(user)\n end", "def destroy\n @user_work = UserWork.find(params[:id])\n @user_work.destroy\n tflash('delete', :success, {:model=>@@model, :count=>1})\n respond_to do |format|\n format.html { redirect_to(redis_databases_url) }\n format.xml { head :ok }\n end\n end", "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end", "def destroy\n @time_work = TimeWork.find(params[:id])\n\n respond_to do |format|\n redirect_with_format(format, @time_work.user_id)\n\n @time_work.soft_delete\n\n @@msg_success = 'Hora removida com sucesso'\n format.html { redirect_to time_works_url }\n format.json { head :no_content }\n end\n end", "def local_remove(body)\n key_hash = _user_keyhash(body)\n raise \"Invalid username\" unless key_hash\n raise \"That user is signed in!\" if @var[:presence][key_hash]\n @connection.comm.rsa_keys.delete(body)\n @connection.comm.names.delete(key_hash)\n @var[:user_keys].delete body\n _save_env\n _notice \"User '#{body}' has been removed from your key repository\"\nend", "def delete_user(username, removehome=false)\n\t\t\tend", "def destroy\n file&.delete\n end", "def revoke(userid=nil, email=nil) #(userid OR email) required\n end", "def test_delete_file\n remote_file_name = 'TestDeleteFile.docx'\n\n upload_file File.join(local_test_folder, local_file), remote_data_folder + '/' + remote_file_name\n\n request = DeleteFileRequest.new(path: remote_data_folder + '/' + remote_file_name)\n\n @words_api.delete_file(request)\n end", "def destroy\n @workfile.destroy\n respond_to do |format|\n format.html { redirect_to workfiles_url, notice: 'Workfile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @run = current_user.runs.find(params[:id])\n @run.destroy\n end", "def revoke(userid=nil, email=nil) #(userid OR email) required\n end", "def delete_from_flickr user_id=nil\n return unless user_id.present?\n begin\n # DE - 2016-08-05 change delete_from_flickr behavior to clear flickr data;\n # previously, publication_data was deleted; changed to keep pub..n_data,\n # but clear flickr_id and metadata. #on_flickr? changed to report presence\n # of publication_data.flickr_id (handled by delegate; above)\n return unless on_flickr?\n\n client = Flickr::Client.connect!\n client.delete flickr_id\n # remove all the flickr data\n self.publication_data.clear_flickr_data\n self.publication_data.save_by! User.find user_id\n ensure\n unmark_in_process\n end\n end", "def delete_spectator(user)\n @user = user\n @study = user.study\n email_with_name = \"#{@user.name} <#{user.email}>\"\n mail(:to => email_with_name, :subject => I18n.t('users.delete_spectator.mail.subject'))\n end", "def remove_file\n\n @source_files_id = params[:source] + '_files'\n @source = TaliaCore::Source.find(N::URI.from_encoded(params[:source]))\n\n TaliaFile.find(params[:talia_file_uri]).destroy\n end", "def delete!(creds = {}, section = \"file\", reason = \"because\")\n BlipTV::ApiSpec.check_attributes('videos.delete', creds)\n\n reason = reason.gsub(\" \", \"%20\") # TODO write a method to handle this and other illegalities of URL\n\n if creds[:username] && !creds[:userlogin]\n creds[:userlogin] = creds[:username]\n end\n\n url, path = \"www.blip.tv\", \"/?userlogin=#{creds[:userlogin]}&password=#{creds[:password]}&cmd=delete&s=file&id=#{@id}&reason=#{reason}&skin=api\"\n request = Net::HTTP.get(url, path)\n hash = Hash.from_xml(request)\n make_sure_video_was_deleted(hash)\n end", "def destroy\n @admin_people_file.destroy\n respond_to do |format|\n format.html { redirect_to admin_people_files_url, notice: 'People file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def file_delete(path)\n params = {\n \"root\" => @root,\n \"path\" => format_path(path, false),\n }\n response = @session.do_post build_url(\"/fileops/delete\", params)\n parse_response(response)\n end", "def delete_by_id(user_id)\n Iterable.request(conf, \"/users/byUserId/#{user_id}\").delete\n end", "def delete_file_from_database(file_id)\n $db.execute(\"DELETE FROM files WHERE id = ?\", file_id)\n $db.execute(\"DELETE FROM file_share_table WHERE file_id = ?\", file_id)\nend", "def delete(*args)\n arguments(args, required: [:user, :repo])\n\n delete_request(\"/repos/#{arguments.user}/#{arguments.repo}\", arguments.params)\n end", "def delete(*args)\n arguments(args, required: [:user, :repo])\n\n delete_request(\"/repos/#{arguments.user}/#{arguments.repo}\", arguments.params)\n end", "def delete(permanent = false)\n if permanent\n @session.execute!(\n :api_method => @session.drive.files.delete,\n :parameters => {\"fileId\" => self.id})\n else\n @session.execute!(\n :api_method => @session.drive.files.trash,\n :parameters => {\"fileId\" => self.id})\n end\n return nil\n end", "def delete (fei)\n\n fei_path = compute_file_path(fei)\n\n #ldebug { \"delete() for #{fei.to_debug_s} at #{fei_path}\" }\n\n File.delete(fei_path)\n end", "def remove_requester(user)\n attempted_interpreter_requests.find_by(user_id: user.id).destroy\n end", "def delete_user(username)\n file_buffer = ''\n File.open(FTPUSERS_PATH, 'r') do |password_file|\n file_buffer = password_file.read\n end\n\n file_buffer.gsub!(/^#{username}.*$\\n/, '')\n\n File.open(FTPUSERS_PATH, 'w') do |password_file|\n password_file.write(file_buffer)\n end\n end", "def del\n File.delete(@file)\n end", "def destroy_file\n File.delete full_file_path\n rescue\n end", "def delete\n params = self.class.prepare_params_for(:delete, \"userName\" => user_name)\n response = self.class.perform(params)\n self.class.check_response(response)\n end", "def destroy_dirty_file!(file)\n system(\"trashtrash #{file}\")\n end", "def deleteTorrent(target)\n if isIllegalName(target)\n error 'You have specified an invalid release name.'\n end\n filename = Torrent.getTorrentName(target)\n torrent = Nil.joinPaths(@torrentPath, filename)\n begin\n stat = File.stat(torrent)\n user = Etc.getpwuid(stat.uid).name\n if user != @user.name\n error \"#{filename} is owned by another user - ask the administrator for help.\"\n end\n FileUtils.rm(torrent)\n @database.transaction do\n #notify the user about the removal of the torrent\n @notification.downloadDeletedNotification(@user.id, target, \"Release #{target} was removed at your request\")\n #remove the corresponding entry from the queue\n @queue.removeQueueEntry(target)\n end\n rescue Errno::EACCES\n error \"You do not have the permission to remove #{filename}.\"\n rescue Errno::ENOENT\n error \"Unable to find #{filename}.\"\n end\n end", "def destroy_a_work(work:)\n work.destroy\n end", "def destroy_a_work(work:)\n work.destroy\n end", "def user_delete(user_id)\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/users/#{user_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = user_id\n\t\tend\n\t\n\tend" ]
[ "0.66906035", "0.66807526", "0.6663661", "0.66518617", "0.6639899", "0.6581516", "0.65436244", "0.63847363", "0.63835806", "0.6378853", "0.6345853", "0.62254953", "0.6213368", "0.6204843", "0.62027824", "0.6155135", "0.6155135", "0.6149683", "0.6148678", "0.61435777", "0.61366665", "0.6119583", "0.61172336", "0.6116902", "0.6114144", "0.6091195", "0.606611", "0.6034328", "0.60129523", "0.60079676", "0.6004038", "0.59783447", "0.5973255", "0.59685344", "0.5960001", "0.5956495", "0.5956495", "0.59362984", "0.5914716", "0.5912543", "0.59011906", "0.5893881", "0.5881812", "0.58774805", "0.5860975", "0.58524954", "0.5839814", "0.58253056", "0.5820859", "0.58178276", "0.5816337", "0.5805", "0.5786448", "0.5785914", "0.5778862", "0.57741344", "0.5772259", "0.5760901", "0.5758466", "0.57571685", "0.57532746", "0.57357955", "0.57315797", "0.57303953", "0.5729489", "0.5728551", "0.5725264", "0.572388", "0.572212", "0.5718481", "0.5707868", "0.5706704", "0.5703549", "0.57005334", "0.56946623", "0.56942767", "0.568757", "0.56844383", "0.568131", "0.567911", "0.5678897", "0.56737095", "0.56725556", "0.5671989", "0.56610817", "0.5657215", "0.56543016", "0.56543016", "0.56541187", "0.5654048", "0.56539744", "0.56458455", "0.5644058", "0.5634982", "0.5627501", "0.5626473", "0.5615444", "0.5615134", "0.5615134", "0.56035936" ]
0.62440485
11
batch process a group of SOLR works
def batched_process_solr_works( solr_works, &f ) solr_works.each do |gw_solr| begin gw = LibraWork.find( gw_solr['id'] ) f.call( gw ) rescue => e puts e end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_bulk; end", "def send_batch(batch)\n return if batch.empty?\n json_package = JSON.generate(batch.map { |c| c.output_hash })\n begin\n resp = @http_client.post @solr_update_url, json_package, \"Content-type\" => \"application/json\"\n rescue StandardError => exception\n end\n\n if exception || resp.status != 200\n error_message = exception ? \n Traject::Util.exception_to_log_message(exception) : \n \"Solr response: #{resp.status}: #{resp.body}\"\n\n logger.error \"Error in Solr batch add. Will retry documents individually at performance penalty: #{error_message}\"\n \n batch.each do |c|\n send_single(c)\n end\n end\n end", "def send_batch(batch)\n return if batch.empty?\n\n logger.debug(\"#{self.class.name}: sending batch of #{batch.size} to Solr\")\n\n json_package = JSON.generate(batch.map { |c| c.output_hash })\n\n begin\n resp = @http_client.post solr_update_url_with_query(@solr_update_args), json_package, \"Content-type\" => \"application/json\"\n rescue StandardError => exception\n end\n\n if exception || resp.status != 200\n error_message = exception ?\n Traject::Util.exception_to_log_message(exception) :\n \"Solr response: #{resp.status}: #{resp.body}\"\n\n logger.error \"Error in Solr batch add. Will retry documents individually at performance penalty: #{error_message}\"\n\n batch.each do |c|\n send_single(c)\n end\n end\n end", "def indexAllItems\n begin\n Thread.current[:name] = \"index thread\" # label all stdout from this thread\n batch = emptyBatch({})\n\n # The resolver and catalog stuff below is to prevent BioMed files from loading external DTDs\n # (which is not only slow but also unreliable)\n classPath = \"/apps/eschol/erep/xtf/WEB-INF/lib/saxonb-8.9.jar:\" +\n \"/apps/eschol/erep/xtf/control/xsl/jing.jar:\" +\n \"/apps/eschol/erep/xtf/normalization/resolver.jar\"\n Nailgun.run(classPath, 0, \"-Dxml.catalog.files=/apps/eschol/erep/xtf/normalization/catalog.xml\") { |nailgun|\n loop do\n # Grab an item from the input queue\n Thread.current[:name] = \"index thread\" # label all stdout from this thread\n itemID = $indexQueue.pop\n itemID or break\n\n # Extract data and index it (in batches)\n begin\n Thread.current[:name] = \"index thread: #{itemID}\" # label all stdout from this thread\n indexItem(itemID, batch, nailgun)\n rescue Exception => e\n puts \"Error indexing item #{itemID}\"\n raise\n end\n\n # To avoid Saxon's Java process from growing gigantic, restart it once in a while.\n nailgun.callCount == 1000 and nailgun.restart\n end\n }\n\n # Finish off the last batch.\n batch[:items].empty? or $batchQueue << batch\n rescue Exception => e\n if $preindexMode\n raise e\n else\n puts \"Exception in indexAllItems: #{e} #{e.backtrace}\"\n end\n ensure\n $batchQueue << nil # marker for end-of-queue\n end\nend", "def transform_and_load_compounds!\n compound_records.each_slice(batch_size) do |compound_records_batch|\n transformer_worker_klass.perform_async(\n compound_records_batch,\n solr_config,\n cdm_endpoint,\n oai_endpoint,\n field_mappings,\n batch_size\n )\n end\n end", "def process(requests)\n by_broker = requests.group_by {|request| broker_for(request)}\n\n if by_broker.count > 1 && @cluster.config.parallel_batches\n # Run in separate threads for parallelism\n by_broker.map do |broker, requests|\n Thread.new do\n process_broker(broker, requests)\n end\n end.each(&:join)\n else\n # Run in current thread\n by_broker.each do |broker, requests|\n process_broker(broker, requests)\n end\n end\n end", "def perform_processing_run(faids)\n perform_analysis(faids)\n perform_processing!\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 run_all\n perform\n end", "def run_all\n perform\n end", "def scrape_job_listings\n queries = [\"Rails+Developer\", \"front+end+Developer\", \"ruby+developer\", \"junior+web+Developer\", \"javascript+Developer\"]\n locations = [\"San+Francisco\"]\n\n locations.each do |location|\n queries.each do |query|\n scrape_indeed(query, location)\n scrape_github(query, location)\n # scrape_glassdoor(query, location)\n ; scrape_careerbuilder(query, location)\n end\n end\nend", "def process_foreach(options, filter, vars)\n agent = rpcclient('rpcutil')\n set_filter(agent, filter, vars)\n nodes = agent.discover\n nodes.each do |node|\n options['tasks'].each do |task|\n vars.merge!('node' => node)\n process_task(task, {:discovery => [node]}, vars)\n end\n end\nend", "def processing_batches(w)\n dir = join(@basedir, DIR_PROCESSING)\n w.sftp.dir[dir, '*'].map do |entry|\n Model::Batch.new(:path => join(dir, entry.name), :state => :processing)\n end\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 bulk_update_document index, data\n Parallel.each( data.each_slice(4), in_threads: ENV['NUMBER_OF_THREADS'].to_i ) do |slice|\n # Hardcoded for slice of 4 elements, of which we need to combine 2\n enriched_slice = slice.map do |document|\n { doc: document, serialization: document.to_json }\n end\n\n nested_slice = []\n\n if enriched_slice.any? { |s| s[:serialization].length > 50_000_000 }\n log.debug(\"Splitting bulk update document into separate requests because one document more than 50Mb\")\n enriched_slice.each_slice(2) do |tuple|\n nested_slice << tuple\n end\n else\n nested_slice = [enriched_slice]\n end\n\n nested_slice.each do |enriched_postable_slice|\n begin\n uri = URI(\"http://#{@host}:#{@port_s}/#{index}/_doc/_bulk\")\n req = Net::HTTP::Post.new(uri)\n body = \"\"\n enriched_postable_slice.each do |enriched_document|\n body += enriched_document[:serialization] + \"\\n\"\n end\n req.body = body\n\n req[\"Content-Type\"] = \"application/x-ndjson\"\n\n run(uri, req)\n rescue SocketError => e\n log.warn(e)\n tries = 1\n while ! up\n log.info \"Waiting for elastic search\"\n sleep tries\n tries +=1\n end\n log.debug \"Retrying request\"\n run(uri, req)\n rescue StandardError => e\n log.warn( \"Failed to upload #{enriched_postable_slice.length} documents\" )\n\n ids = enriched_postable_slice.map do |enriched_document|\n enriched_document && enriched_document[:doc][:index] && enriched_document[:doc][:index][:_id]\n end\n\n log.warn( e )\n log.warn( \"Failed to upload documents #{ids.join(\", \")} with total length #{body.length}\" )\n log.warn( \"Failed documents #{ids.join(\", \")} are not ginormous\" ) if body.length < 100_000_000\n end\n end\n end\n end", "def gather_target_sites(all_blast_results,gbff_dir,seq_dir,flanking_res)\n #step1 process blast_results into a hash function which includes the seq_id and an array of blast_items\n #blast_result_hash = blast_results_to_hash(all_blast_results)\n #step2 gather endo from gbff file\n process_all_db(all_blast_results,gbff_dir,seq_dir,flanking_res)\nend", "def all_works\n #start = numeric( params[:start], DEFAULT_START )\n #limit = numeric( params[:limit], DEFAULT_LIMIT )\n\n works = batched_get( {} )\n respond_to do |format|\n format.json do\n if works.empty?\n render_json_works_response(:not_found )\n else\n # dont provide fileset information here, it takes too long and we just want work information\n render_json_works_response(:ok, work_transform( works, EXCLUDE_FILESETS ) )\n end\n end\n format.csv do\n # provide fileset information here because this is used for work export\n render_csv_works_response( work_transform( works, INCLUDE_FILESETS ) )\n end\n end\n\n end", "def main()\n res = @s.execute_get(@s.url_for(\"var/search/needsprocessing.json\"))\n unless res.code == '200'\n raise \"Failed to retrieve list to process [#{res.code}]\"\n end\n\n process_results = JSON.parse(res.body)['results']\n log \"processing #{process_results.size} entries\"\n unless process_results.size > 0\n return\n end\n\n # Create some temporary directories.\n Dir.mkdir DOCS_DIR unless File.directory? DOCS_DIR\n Dir.mkdir PREV_DIR unless File.directory? PREV_DIR\n Dir.mkdir PDFS_DIR unless File.directory? PDFS_DIR\n\n # Create a temporary file in the DOCS_DIR for all the pending files and outputs all the filenames in the terminal.\n Dir.chdir DOCS_DIR\n queued_files = process_results.collect do |result|\n FileUtils.touch result['_path']\n end\n\n log \" \"\n log \"Starts a new batch of queued files: #{queued_files.join(', ')}\"\n\n Dir['*'].each do |id|\n FileUtils.rm_f id\n log \"processing #{id}\"\n\n begin\n meta_file = @s.execute_get @s.url_for(\"p/#{id}.json\")\n unless meta_file.code == '200'\n raise \"Failed to process: #{id}\"\n end\n\n meta = JSON.parse meta_file.body\n mime_type = meta['_mimeType']\n given_extension = meta[\"sakai:fileextension\"]\n extension = determine_file_extension_with_mime_type(mime_type, given_extension)\n filename = id + extension\n log \"with filename: #{filename}\"\n\n if ignore_processing?(mime_type) || extension.eql?('')\n if extension.eql?('')\n log \"ignoring processing of #{filename}, no preview can be generated for files without a known mime type\"\n log \"The file's original extension was #{given_extension}, and it's mime type is #{mime_type}\"\n else\n log \"ignoring processing of #{filename}, no preview can be generated for #{mime_type} files\"\n end\n else\n # Making a local copy of the file.\n content_file = @s.execute_get @s.url_for(\"p/#{id}\")\n unless ['200', '204'].include? content_file.code\n raise \"Failed to process file: #{id}, status: #{content_file.code}\"\n end\n File.open(filename, 'wb') { |f| f.write content_file.body }\n\n if process_as_image? extension\n extension = output_extension extension\n page_count = 1\n filename_thumb = 'thumb' + extension\n\n content = resize_and_write_file filename, filename_thumb, 900\n post_file_to_server id, content, :normal, page_count, extension\n\n content = resize_and_write_file filename, filename_thumb, 180, 225\n post_file_to_server id, content, :small, page_count, extension\n\n FileUtils.rm_f DOCS_DIR + \"/#{filename_thumb}\"\n else\n begin\n # Check if user wants autotagging\n user_id = meta[\"sakai:pool-content-created-for\"]\n user_file = @s.execute_get @s.url_for(\"/system/me?uid=#{user_id}\")\n unless user_file.code == '200'\n raise \"Failed to get user: #{uid}\"\n end\n user = JSON.parse(user_file.body)\n if user[\"user\"][\"properties\"][\"isAutoTagging\"] != \"false\"\n # Get text from the document\n Docsplit.extract_text filename, :ocr => false\n text_content = IO.read(id + \".txt\")\n terms = extract_terms(text_content)\n tags = \"\"\n terms.each_with_index do |t, i|\n tags += \"- #{t}\\n\"\n terms[i] = \"/tags/#{t}\"\n end\n # Generate tags for document\n @s.execute_post @s.url_for(\"p/#{id}\"), {':operation' => 'tag', 'key' => terms}\n log \"Generate tags for #{id}, #{terms}\"\n admin_id = \"admin\"\n origin_file_name = meta[\"sakai:pooled-content-file-name\"]\n if not terms.nil? and terms.length > 0 and user[\"user\"][\"properties\"][\"sendTagMsg\"] and user[\"user\"][\"properties\"][\"sendTagMsg\"] != \"false\"\n msg_body = \"We have automatically added the following tags for #{origin_file_name}:\\n\\n #{tags}\\n\\nThese tags were created to aid in the discoverability of your content.\\n\\nRegards, \\nThe Sakai Team\"\n @s.execute_post(@s.url_for(\"~#{admin_id}/message.create.html\"), {\n \"sakai:type\" => \"internal\",\n \"sakai:sendstate\" => \"pending\",\n \"sakai:messagebox\" => \"outbox\",\n \"sakai:to\" => \"internal:#{user_id}\",\n \"sakai:from\" => \"#{admin_id}\",\n \"sakai:subject\" => \"We've added some tags to #{origin_file_name}\",\n \"sakai:body\" => msg_body,\n \"_charset_\" => \"utf-8\",\n \"sakai:category\" => \"message\"\n })\n log \"sending message from #{admin_id} user to #{user_id}\"\n end\n end\n rescue Exception => msg\n log \"failed to generate document tags: #{msg}\", :warn\n end\n\n # Generating image previews of the document.\n if only_first_page? extension\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg, :pages => 1\n else\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg\n end\n\n # Skip documents with a page count of 0, just to be sure.\n next if Dir[id + '_*'].size == 0\n\n Dir.mkdir PREV_DIR + \"/#{id}\" unless File.directory? PREV_DIR + \"/#{id}\"\n\n # Moving these previews to another directory: \"PREVS_DIR/filename/index.jpg\".\n Dir[id + '_*'].each_with_index do |preview, index|\n FileUtils.mv \"#{id}_#{index + 1}.jpg\", \"#{PREV_DIR}/#{id}/#{index}.jpg\"\n end\n\n Dir.chdir PREV_DIR + \"/#{id}\"\n page_count = Dir[\"*\"].size\n\n # Upload each preview and create+upload a thumbnail.\n for index in (0..page_count - 1)\n filename_p = \"#{index}.jpg\"\n # Upload the generated preview of this page.\n nbytes, content = File.size(filename_p), nil\n File.open(filename_p, \"rb\") { |f| content = f.read nbytes }\n post_file_to_server id, content, :large, index + 1\n\n # Generate 2 thumbnails and upload them to the server.\n filename_thumb = File.basename(filename_p, '.*') + '.normal.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 700\n post_file_to_server id, content, :normal, index + 1\n\n filename_thumb = File.basename(filename_p, '.*') + '.small.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 180, 225\n post_file_to_server id, content, :small, index + 1\n end\n\n FileUtils.remove_dir PREV_DIR + \"/#{id}\"\n end\n # Pass on the page_count\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:pagecount\" => page_count, \"sakai:hasPreview\" => \"true\"}\n\n # Change to the documents directory otherwise we won't find the next file.\n Dir.chdir DOCS_DIR\n end\n\n #SAKAI TO PDF\n # We check if mimetype is sakaidoc\n if(mime_type == \"x-sakai/document\")\n if (File.exist?(\"../wkhtmltopdf\"))\n # Go to PDF Dir\n Dir.chdir PDFS_DIR\n\n #delay in secs\n $delay = \"20\"\n\n #filename with extension\n filename_p = id + \".pdf\"\n\n # We parse the structure data to var structure (we do not need the rest)\n structure = JSON.parse meta['structure0']\n\n # Create var and add beginning of code line to run\n line = \"../wkhtmltopdf \"\n\n # Go through structure and add the pagelink for each page id\n structure.each do |page|\n link = \"content#l=\" + page[0] + \"&p=\" + id\n link = @s.url_for(link)\n link = \"'\" + link + \"' \"\n line += link\n end\n\n # Fetch cookie value to get access to all content\n # USERNAME PASSWORD SERVER\n $username = \"admin\"\n auth = \"../auth.sh \" + $username + \" \" + $pw + \" \" + $preview_referer\n cookietoken = `#{auth}`\n\n # Append end of line containing arguments for print css, delay and authentication\n line += filename_p + \" --print-media-type --redirect-delay \" + $delay + \"000 --cookie 'sakai-trusted-authn' \" + cookietoken\n\n # Run the command line (run wkhtmltopdf)\n `#{line}`\n\n # We read the content from the pdf in the PDF directory\n content = open(filename_p, 'rb') { |f| f.read }\n\n # We post it to server through this function\n post_pdf_to_server id, content\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"false\"}\n #Change dir\n Dir.chdir DOCS_DIR\n else\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n log \"PDF Converter (wkhtmltopdf) not present in directory\"\n log \"Cannot convert Sakai document to PDF\"\n log \"Continuing without conversion\"\n end\n end\n rescue Exception => msg\n # Output a timestamp + the error message whenever an exception is raised\n # and flag this file as failed for processing.\n log \"error generating preview/thumbnail (ID: #{id}): #{msg.inspect}\\n#{msg.backtrace.join(\"\\n\")}\", :warn\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n ensure\n # No matter what we flag the file as processed and delete the temp copied file.\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:needsprocessing\" => \"false\"}\n FileUtils.rm_f DOCS_DIR + \"/#{filename}\"\n end\n end\n\n FileUtils.remove_dir PDFS_DIR\n FileUtils.remove_dir PREV_DIR\n FileUtils.remove_dir DOCS_DIR\nend", "def execute_bulk_requests\n begin\n @responses = Hash.new\n @headers = Hash.new\n @all_urls = Hash.new\n data = ActiveSupport::JSON.decode(params[:data])\n @detailed_results = data[\"detailed_results\"]\n num_threads = data[\"threads\"].to_i\n data[\"lines_to_send\"].threadify(num_threads) { |line|\n path = data[\"path\"].gsub(/XXXCHANGEMEXXX/, line)\n headers = data[\"headers\"].gsub(/XXXCHANGEMEXXX/, line)\n body = data[\"body\"].gsub(/XXXCHANGEMEXXX/, line)\n data.each do |key, value|\n if key.start_with?(\"replace_\") && !key.end_with?(\"_by\")\n path.gsub!(\"XXX#{value}XXX\",data[key + \"_by\"]) if data[key + \"_by\"] != \"\"\n headers.gsub!(\"XXX#{value}XXX\",data[key + \"_by\"]) if data[key + \"_by\"] != \"\"\n body.gsub!(\"XXX#{value}XXX\",data[key + \"_by\"]) if data[key + \"_by\"] != \"\"\n end\n end\n if @cloud\n if @cloud.api == \"Atmos\"\n @responses[line], @headers[line], @all_urls[line] = atmos_request(data[\"http_method\"], path, headers, body)\n elsif @cloud.api == \"Amazon\"\n @responses[line], @headers[line], @all_urls[line] = amazon_request(data[\"http_method\"], path, headers, body)\n elsif @cloud.api == \"Swift\"\n @responses[line], @headers[line], @all_urls[line] = swift_request(data[\"http_method\"], path, headers, body)\n end\n else\n url = path\n uri = URI.parse(url)\n headers_to_send = Hash.new\n headers.split(\"\\n\").each do |row|\n hash = eval(row)\n headers_to_send[hash.keys.first.downcase] = hash.values.first.to_s\n end\n @responses[line] = http_request(url, uri.port, data[\"http_method\"], headers_to_send, body)\n @headers[line] = headers_to_send\n end\n }\n rescue Exception => e\n @exception = e\n end\n respond_to do |format|\n format.js { render 'shared/execute_bulk_requests' }\n end\n end", "def perform\n\t\tbegin\n\t\t\tnext_run_at = Time.now + 30.minutes\n\t\t\tDataImporterWorker.perform_at(next_run_at)\n\t\t\tqds = QueryDataSource.find_all_by_enabled(true)\n\t\t\tqds.each do |q|\n\t\t\t\tQueryDataSourceWorker.perform_async(q.id)\n\t\t\tend\n\n\t\t\t#spree data source importer\n\t\t \tspree_data_sources = SpreeDataSource.find_all_by_enabled(true)\n\t\t \tspree_data_sources.each do |sds|\n\t\t\t\tSpreeDataSourceWorker.perform_async(sds.id)\n\t\t\tend\n\t\trescue Exception => e\n\t\t \tRails.logger.error e.to_s\n\t\t\tputs e.to_s\n\t\tend\n\tend", "def process(cursor, batch) end", "def each(&block)\n process_results unless @processed\n @results.each(&block)\n end", "def batch\n yield if block_given?\n end", "def run\n super\n\n # Attach to the corpwatch service & search\n x = Ear::Client::Corpwatch::CorpwatchService.new\n corps = x.search @object.name\n\n corps.each do |corp|\n # Create a new organization object & attach a record\n o = create_object Organization, { \n :name => corp.name, \n }\n o.physical_locations << create_object(PhysicalLocation, {\n :address => corps.first.address, \n :state => corps.first.state,\n :country => corps.first.country }\n )\n end\n \n #@task_run.save_raw_result corps.to_s\n\n # Queue a detailed search\n TaskManager.instance.queue_task_run(\"hoovers_company_detail\",o, {})\nend", "def cloud_search_batch_documents(&block)\n begin\n self.in_cloud_search_batch_documents = true\n yield\n # final flush for any left over documents\n self.cloud_search_document_batcher.flush\n ensure\n self.in_cloud_search_batch_documents = false\n end\n end", "def index_item_set(all_items, o={})\n puts \"Indexing #{all_items.size} items...\" ; cur_docs = 0\n #Searcher.load_features() if !$clf\n all_items.in_groups_of(FileCollector::FILES_IN_BATCH) do |batch|\n items = batch.find_all{|d|d}\n\n #read contents\n if o[:download]\n $idx.read_files(items.find_all{|d|d.itype =~ /file/ && !d.content})\n items.each{|d| $idx.read_webpage(d) if d.itype =~ /webpage|concept/ && d.uri =~ /^http/}\n end\n #run indexing\n items.each{|d|$idx.index_item(d)}\n cur_docs += batch.size\n puts \"#{cur_docs} / #{all_items.size} finished\"\n end\n end", "def add_batch\n result = RLetters::Solr::Connection.search(next_query)\n return false if result.num_hits == 0\n\n # Call the progress function\n @total ||= result.num_hits\n @progress.call((@start.to_f / @total.to_f * 100).to_i) if @progress\n\n # Import the dataset entries (quickly)\n ::Datasets::Entry.import([:uid, :dataset_id],\n result.documents.map do |d|\n [d.uid, @dataset_id]\n end,\n validate: false)\n\n # Check to see if there's any externally fetched documents here\n unless @dataset.fetch\n if result.documents.any? { |d| d.fulltext_url }\n @dataset.fetch = true\n @dataset.save\n end\n end\n\n # Tell the caller whether or not we should continue\n @start <= @total\n end", "def processed_batches(w)\n dir = join(@basedir, DIR_PROCESSED)\n w.sftp.dir[dir, '*'].map do |entry|\n Model::Batch.new(:path => join(dir, entry.name), :state => :processed)\n end\n end", "def process(obj_list, filename)\n @utility.set_workdir(filename)\n obj_list.map! { |x| process_one_work(x) }\n obj_list.flatten!\n end", "def perform\n\n begin\n\n # acquire lock and fetch the locked hooks\n fetch_hooks_to_be_processed\n\n # Process these Hooks\n process_hooks\n\n # Mark Hooks as processed\n update_status_to_processed\n\n rescue StandardError => se\n\n @hooks_to_be_processed.each do |hook|\n hook_id = hook.id\n # Skip if we already know that his hook was processed or failed\n next if @success_responses[hook_id].present? ||\n @failed_hook_to_be_ignored[hook_id].present? ||\n @failed_hook_to_be_retried[hook_id].present?\n @failed_hook_to_be_retried[hook_id] = {\n exception: {message: se.message, trace: se.backtrace}\n }\n end\n\n ensure\n\n # For hooks which failed, mark them as failed\n release_lock_and_update_status_for_non_processed_hooks\n\n # Notify Devs in case on Errors\n notify_devs\n\n success_with_data(processor_response)\n\n end\n\n end", "def run_batch\n make_run_batch_call\n end", "def processes\n GoodData::Process.all\n end", "def bulk_refresh(list,num=@max_parallel)\n\t\tputs \"Refresh entries in the site store from list:\\n #{list}\" if @verbose\n\t\tresults=Hash.new\n\t\tif list.size > 0\n\t\t\tputs \"Start parallel refreshing on the sites:\\n #{list}\"\n\t\t\tParallel.map(list, :in_processes => num) { |target|\n\t\t\t\trefresh(target)\n\t\t\t}.each do |process|\n\t\t\t\tif process.nil?\n\t\t\t\t\tnext\n\t\t\t\telsif process.empty?\n\t\t\t\t\t#do nothing\n\t\t\t\telse\n\t\t\t\t\tresults[process['url']]=Hash.new\n\t\t\t\t\tresults[process['url']]=process\n\t\t\t\tend\n\t\t\tend\n\t\t\t# Clean up old entries, by Y.L. 03/30/2015\n\t\t\tlist.map {|x| @known_sites.delete(x)}\n\t\t\t# Add back fresh entries\n\t\t\t@known_sites.merge!(results)\n\t\t\tputs \"Done refresh sites.\"\n\t\telse\n\t\t\tputs \"Error: no entry is loaded. Please check your list and try again.\"\n\t\tend\n\t\treturn results\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\tend", "def convertAllItems(arks)\n # Let the user know what we're doing\n puts \"Converting #{arks==\"ALL\" ? \"all\" : \"selected\"} items.\"\n\n cacheAllUnits()\n\n # Fire up threads for doing the work in parallel\n Thread.abort_on_exception = true\n indexThread = Thread.new { indexAllItems }\n batchThread = Thread.new { processAllBatches }\n\n arks.each { |ark|\n ark =~ /^qt\\w{8}$/ or raise(\"Invalid ark #{ark.inspect}\")\n $indexQueue << ark\n }\n $indexQueue << nil # end-of-queue\n\n # Wait for everything to work its way through the queues.\n indexThread.join\n batchThread.join\n\n $nTotal > 0 and scrubSectionsAndIssues() # one final scrub\nend", "def solr_execute(request, shard_url = nil)\n if solr_using_shards?\n # Handle batch update\n if request.is_a?(Solr::Request::AddDocument) and request.docs.size > 1 and !shard_url\n # Split the request into several ones if it must be sent to different shards\n sub_requests = {}\n request.docs.each do |doc|\n url = shard_url_for(doc['pk_s'])\n if sub_requests.has_key?(url)\n sub_requests[url].add_doc(doc)\n else\n sub_requests[url] = Solr::Request::AddDocument.new(doc)\n end\n end\n # Recursive execution of the sub queries\n logger.debug \"Splitted batch update to send it to the following shards: #{sub_requests.keys.inspect}\" if sub_requests.size > 1\n sub_requests.each{|url, sub_request| solr_execute(sub_request, url)} and return\n\n # Handle delete by query by sending the request to all the shards\n elsif request.is_a?(Solr::Request::Delete) and request.query and !shard_url\n solr_shards_urls.each do |url|\n solr_execute(request, url)\n end\n return\n\n # Handle commit by sending the request to all the shards\n elsif request.is_a?(Solr::Request::Commit) and !shard_url\n solr_shards_urls.each do |url|\n solr_execute(request, url)\n end\n return\n\n # Handle optimize by sending the request to all the shards\n elsif request.is_a?(Solr::Request::Optimize) and !shard_url\n solr_shards_urls.each do |url|\n solr_execute(request, url)\n end\n return\n end\n\n url = shard_url ? shard_url : random_shard_url\n request.shards = solr_shards if request.is_a?(Solr::Request::Select)\n\n logger.debug \"#{request.class} using shard #{url}\"\n\n else\n url = solr_url\n end\n\n connection = Solr::Connection.new(url)\n result = nil\n\n message = request.respond_to?(:to_hash) ? \"/#{request.handler} #{request.to_hash.inspect}\" : request.to_s\n\n solr_log message do\n result = connection.send(request)\n end\n result\n end", "def jobs\r\n end", "def finish\n if batch.present?\n solr_service_connection.add(batch, softCommit: true, commit: false)\n batch.clear\n end\n end", "def run\n threads = []\n\n filters = @f.all\n filters.each do |filter|\n threads << Thread.new(filters) do |fi|\n @i.move(\n filter[:filter],\n { \n :from => filter[:search_folder], \n :to => filter[:destination_folder]\n }\n )\n puts \"Applied filter #{filter[:name]}\"\n end\n end\n threads.each { |t| t.join }\n end", "def run_all()\n end", "def process\n process_setting_specs\n process_shard_specs\n process_connection_specs\n end", "def process_batch(batch)\n call([], :process_batch, batch.__calls)\n end", "def work_received(results)\n\n # write results to disk\n results.each do |name,fasta,qual,comments|\n @@results.write_seq(name,fasta,qual,comments)\n end\n \n end", "def perform(uris)\n counter = 0\n logger = Rails.logger\n\n logger.info \"Reindexing #{uris.count} URIs\"\n uris.each do |uri|\n work = ActiveFedora::Base.find(ActiveFedora::Base.uri_to_id(uri))\n logger.info \"\\t reindexing #{work.id}\"\n work.update_index\n counter += 1\n # rubocop:disable Style/RescueStandardError\n rescue => e\n logger.info \"Failed to reindex #{work.id}: #{e.message}\" unless work.nil?\n logger.info \"Failed to reindex a work: #{e.message}\" if work.nil?\n next\n end\n # rubocop:enable Style/RescueStandardError\n logger.info \"Total indexed: #{counter}/#{uris.count}\"\n end", "def run_tasks()\n self.task_queue.each do |task|\n\n self.task_list << task\n trigger_event(:start,:task)\n\n result = self.send(task[:name],*(task[:args]))\n if result[:status] == :failed\n break\n end\n\n\n self.task_list.last[:result]=result\n trigger_event(:end,:task)\n end\n end", "def do_local_indexing(solr_doc); end", "def run_all\n end", "def run_all\n end", "def update_all\n delete if blacklight_items.count > 0\n self.exports.collect { |pid| add_to_solr(pid) }\n commit\n end", "def process\n by_time_batch\n by_waiting_batch\n rescue\n @logger.fatal \"Failed to process: #{$!}\"\n @logger.fatal $!.backtrace.join(\"\\n\")\n end", "def create_retrievals\n work_ids = Work.pluck(:id)\n existing_ids = RetrievalStatus.where(:source_id => id).pluck(:work_id)\n\n (0...work_ids.length).step(1000) do |offset|\n ids = work_ids[offset...offset + 1000] & existing_ids\n InsertRetrievalJob.perform_later(self, ids)\n end\n end", "def threaded_search_by_chunks(filters)\n\t\trequire 'thread'\n\t\tthreads = NSConnector::Config[:no_threads].to_i\n\t\tif threads < 1 then\n\t\t\traise NSConnector::Config::ArgumentError, \n\t\t\t\t\"Need more than #{threads} threads\"\n\t\tend\n\n\t\t# We bother pre-populating the queue here because locking is\n\t\t# super expensive, on my build of ruby at least.\n\t\tqueue = Queue.new\n\t\t(threads - 1).times do |i|\n\t\t\tqueue << i\n\t\tend\n\n\t\tmutex = Mutex.new\n\n\t\tworkers = []\n\t\tresults = []\n\t\tcurrent_chunk = threads - 1\n\t\tdone = false\n\n\t\t# Workers\n\t\tthreads.times do\n\t\t\tworkers << Thread.new do\n\t\t\t\tuntil done\n\t\t\t\t\tbegin\n\t\t\t\t\t\t# Avoid a deadlock by popping\n\t\t\t\t\t\t# off -1 to exit\n\t\t\t\t\t\tchunk = queue.pop \n\t\t\t\t\t\tbreak if chunk == -1\n\n\t\t\t\t\t\tresult = grab_chunk(\n\t\t\t\t\t\t\tfilters, chunk\n\t\t\t\t\t\t)\n\t\t\t\t\trescue NSConnector::Errors::EndChunking\n\t\t\t\t\t\tdone = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\trescue Timeout::Error, Errno::ECONNRESET\n\t\t\t\t\t\tretry\n\t\t\t\t\tend\n\n\t\t\t\t\tmutex.synchronize do\n\t\t\t\t\t\tresults += result\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# Master\n\t\tuntil done\n\t\t\tif queue.empty? then\n\t\t\t\tqueue << current_chunk\n\t\t\t\tcurrent_chunk += 1\n\t\t\tend\n\t\tend\n\n\t\tthreads.times do \n\t\t\tqueue << -1\n\t\tend\n\n\t\tworkers.each do |worker|\n\t\t\tworker.join\n\t\tend\n\n\t\treturn results\n\tend", "def process\n proccess_contacts_imports\n proccess_attendance_imports\n process_fnz_imports\n proccess_crm_imports\n process_planning_imports\n process_mailing_imports\n end", "def typhoeus_batch(urls)\n hydra = Typhoeus::Hydra.new(max_concurrency: 100)\n responses = []\n urls.each do |url|\n request = get_typhoeus_request(url)\n request.on_complete do |response|\n responses << response if response.success?\n end\n hydra.queue(request)\n request\n end\n hydra.run\n responses\n end", "def run_all_indexers\n run_all_indexers_orig\n $pui.run_index_round\n end", "def updatePrices\n\n puts \"Updating Search Result Prices\"\n\n SITE_CONFIG.each do |site, opts|\n\n SearchResult.order_by([[:updated_at, :desc]]).where(site_name: site).limit(GOOGLE_SERP_LIMIT * 10).each do |searchResult|\n\n puts \"Grabbing Prices for #{site.humanize.capitalize}:#{searchResult.sku}\"\n\n getPrices(searchResult)\n\n end\n\n end\n\nend", "def perform\n # Fetch the user based on ID\n user = User.find(user_id)\n raise ArgumentError, 'User ID is not valid' unless user\n \n # Create a dataset and save it, to fix its ID\n dataset = user.datasets.build(:name => name)\n raise StandardError, 'Cannot create dataset for user' unless dataset\n raise StandardError, 'Cannot save dataset' unless dataset.save\n \n # Build a Solr query to fetch the results, 1000 at a time\n solr_query = {}\n solr_query[:start] = 0\n solr_query[:rows] = 1000\n solr_query[:q] = q\n solr_query[:fq] = fq\n solr_query[:qt] = qt\n\n # Only get shasum, no facets\n solr_query[:fl] = 'shasum'\n solr_query[:facet] = false\n \n # We trap all of this so that if we get exceptions we can clean them\n # up and delete any and all fledgling dataset parts\n begin\n # Get the first Solr response\n solr_response = Solr::Connection.find solr_query\n\n raise StandardError, 'Unknown error in Solr response' unless solr_response.ok?\n raise StandardError, 'Attempted to save empty query' unless solr_response[\"response\"][\"numFound\"] > 0\n \n # Get our parameters\n docs_to_fetch = solr_response[\"response\"][\"numFound\"]\n dataset_id = dataset.to_param\n \n while docs_to_fetch > 0\n # What did we get this time?\n docs_fetched = solr_response[\"response\"][\"docs\"].count\n\n # Send them all in with activerecord-import\n DatasetEntry.import([ :shasum, :dataset_id ],\n solr_response[\"response\"][\"docs\"].map { |d|\n [ d[\"shasum\"], dataset_id ]\n },\n :validate => false)\n \n # Update counters and execute another query if required\n docs_to_fetch = docs_to_fetch - docs_fetched\n if docs_to_fetch > 0\n solr_query[:start] = solr_query[:start] + docs_fetched\n solr_response = Solr::Connection.find solr_query\n\n raise StandardError, 'Unknown error in Solr response' unless solr_response.ok?\n raise StandardError, 'Attempted to save empty query' unless solr_response[\"response\"][\"numFound\"] > 0\n end\n end\n rescue StandardError => e\n # Destroy the dataset to clean up\n dataset.destroy\n raise\n end\n end", "def start_work\n \n #first lets make sure the workitem is valid for this function\n unless WorkItemHelper.validate_workitem(workitem)\n raise ArgumentError, \"Invalid workitem. Check parameters.\"\n end\n\n # now we start processing.\n\n DaemonKit.logger.info \"Starting work...\"\n @swr.send(\"busy\", workitem.params['exec_timeout'], workitem.params['executable'])\n\n \n Dir.chdir(WORK_DIR) do \n # clean directory\n system \"rm -rf *\"\n\n #\n # here we're going to look at a few different ways to get files.\n # - first we look for an array called input_files, and get them individually\n # - then we'll look at input_bucket and then filter on input_filter to get other files\n # - lastly, we'll look for previous output bucket, and get those files using filter\n #\n\n #First, lets get input files. they should be in the form: 'mybucket:testdir/sub/file.txt'\n\n # infile list is an account of files that were downloaded\n infile_list = Hash.new\n infile_basenames = Array.new\n auxfile_basenames = Array.new\n params_basenames = Array.new\n\n DaemonKit.logger.info \"Downloading input files...\"\n infile_basenames = Item.download(workitem.params['input_files'].split(',')) unless workitem.params['input_files'].nil? || workitem.params['input_files'].empty?\n # infile_basenames = @s3h.download_all(workitem.params['input_files'].split(',')) unless workitem.params['input_files'].nil? || workitem.params['input_files'].empty?\n \n DaemonKit.logger.info \"Downloading params file...\"\n params_basenames = @s3h.download_all(workitem.params['params_file'].split(',')) unless (workitem.params['params_file'].nil? || workitem.params['params_file'].empty?)\n \n DaemonKit.logger.info \"Downloading auxiliary files...\"\n auxfile_basenames = Item.download(workitem.params['aux_files'].split(',')) unless workitem.params['aux_files'].nil? || workitem.params['aux_files'].empty?\n # auxfile_basenames = @s3h.download_all(workitem.params['aux_files'].split(',')) unless workitem.params['aux_files'].nil? || workitem.params['aux_files'].empty?\n \n # infile_list = @s3h.get_md5_sums(infile_basenames + auxfile_basenames + params_basenames) # deprecated for now\n \n DaemonKit.logger.info \"Downloaded #{infile_list.keys.size} files.\"\n\n #now we run the command based on the params, and store it's output in a file\n args = workitem.params['args'] ||= ''\n \n infiles_arg = ''\n \n infiles_arg = \"--input_files='#{infile_basenames.join(',')}'\" if workitem.params['pass_filenames'].eql?(\"true\")\n \n DaemonKit.logger.info \"Running Command #{workitem.params['executable']} #{args} #{infiles_arg}...\"\n \n #now we examine out and see if we can parse it \n output_hash = Hash.new\n \n #find the executable!\n which_exec = `which #{workitem.params['executable']}` unless workitem.params['executable'].nil?\n which_exec.strip!\n\n if (! workitem.params['executable'].nil?) && (File.exist?(which_exec))\n \n resp = Net::HTTP.get_response(URI.parse(META_URL))\n instance_id = resp.body\n instance_id = 'UNKNOWN' if instance_id.size > 50\n \n \n out = `#{workitem.params['executable']} #{args} #{infiles_arg}`\n \n DaemonKit.logger.info \"Found output:\"\n puts out\n \n begin\n \n output_hash = JSON.parse(out)\n raise \"not a hash\" unless output_hash.class.to_s.eql?(\"Hash\")\n \n rescue\n \n DaemonKit.logger.info \"Could not parse executable's output as JSON. Using raw output...\"\n output_hash = Hash.new\n output_hash[\"result\"] = out\n \n end\n \n # set executable result\n workitem['result'] = \"\\nInstance ID: #{instance_id}\\nRunning: #{workitem.params['executable']} #{args} #{infiles_arg}\\nWorkflow id: #{workitem.fei['wfid']}\\n\\n\" \n workitem[\"result\"] += output_hash[\"result\"]\n \n else\n \n # set error is file not found\n output_hash['error'] = \"Could not find executable: #{workitem.params['executable']}\"\n\n end\n \n #crash if has error \n raise \"#{output_hash['error']}\" if output_hash.has_key?(\"error\") \n \n #now lets upload and set output files based on hash\n \n #get the apropriate output project\n \n output_project_id = workitem['previous_output_project_id'] ||= workitem.params['output_project_id']\n \n raise \"No output project found in Workitem\" if output_project_id.nil?\n \n user_id = workitem.params['user_id'] \n \n raise \"No user if found in workitem\" if user_id.nil?\n \n workitem['previous_output_project_id'] = output_project_id # set previous output project for future reference\n \n DaemonKit.logger.info \"Uploading Output Files...\"\n \n output_project = Project.find(output_project_id) \n \n #first dup upload / output files if necessary\n output_hash[\"upload_files\"] = output_hash[\"output_files\"] if output_hash.has_key?(\"output_files\") && ! output_hash.has_key?(\"upload_files\")\n output_hash[\"output_files\"] = output_hash[\"upload_files\"] if output_hash.has_key?(\"upload_files\") && ! output_hash.has_key?(\"output_files\")\n \n #now lets set output & upload\n \n if output_hash.has_key?(\"output_files\") && output_hash.has_key?(\"upload_files\")\n\n # first lets upload everything, it should return an array of project_attachement id's!\n \n items = Item.upload(output_hash[\"upload_files\"], user_id, output_project_id)\n \n #need to pass the output folder along with output_files\n workitem[\"output_files\"] = Array.new \n workitem[\"output_files\"] = items.collect{|r| r['id']}\n \n end\n \n @swr.send_idle\n\n end\n\n \n \n end", "def convertAllItems(arks)\n # Let the user know what we're doing\n puts \"Converting #{arks==\"ALL\" ? \"all\" : \"selected\"} items.\"\n\n # Build a list of all valid units\n $allUnits = Unit.map { |unit| [unit.id, unit] }.to_h\n $allUnits['lbnl'].type = 'campus'\n\n # Build a cache of unit ancestors\n $unitAncestors = Hash.new { |h,k| h[k] = [] }\n UnitHier.each { |hier| $unitAncestors[hier.unit_id] << hier.ancestor_unit }\n\n # Fire up threads for doing the work in parallel\n Thread.abort_on_exception = true\n prefilterThread = Thread.new { prefilterAllItems }\n indexThread = Thread.new { indexAllItems }\n batchThread = Thread.new { processAllBatches }\n\n # Count how many total there are, for status updates\n $nTotal = QUEUE_DB.fetch(\"SELECT count(*) as total FROM indexStates WHERE indexName='erep'\").first[:total]\n\n # Convert all the items that are indexable\n query = QUEUE_DB[:indexStates].where(indexName: 'erep').select(:itemId, :time).order(:itemId)\n $nTotal = query.count\n if $skipTo\n puts \"Skipping all up to #{$skipTo}...\"\n query = query.where{ itemId >= \"ark:13030/#{$skipTo}\" }\n $nSkipped = $nTotal - query.count\n end\n query.all.each do |row| # all so we don't keep db locked\n shortArk = row[:itemId].sub(%r{^ark:/?13030/}, '')\n next if arks != 'ALL' && !arks.include?(shortArk)\n erepTime = Time.at(row[:time].to_i).to_time\n item = Item[shortArk]\n if !item || item.last_indexed.nil? || item.last_indexed < erepTime || $rescanMode\n $prefilterQueue << [shortArk, erepTime]\n else\n #puts \"#{shortArk} is up to date, skipping.\"\n $nSkipped += 1\n end\n end\n\n $prefilterQueue << nil # end-of-queue\n prefilterThread.join\n indexThread.join\n batchThread.join\nend", "def postprocess(groups)\n end", "def bulk_add(list,num=@max_parallel)\n\t\tputs \"Add entries to the local site store from list:\\n #{list}\"\n\t\tresults=Hash.new\n\t\tlist = list - [nil,\"\"]\n\t\tif list.size > 0\n\t\t\tputs \"Start parallel adding on the sites:\\n #{list}\"\n\t\t\tParallel.map(list, :in_processes => num) { |target|\n\t\t\t\tadd(target)\n\t\t\t}.each do |process|\n\t\t\t\tif process.nil?\n\t\t\t\t\tnext\n\t\t\t\telsif process.empty?\n\t\t\t\t\tnext #do nothing\n\t\t\t\telse\n\t\t\t\t\tresults[process['url']]=Hash.new\n\t\t\t\t\tresults[process['url']]=process\n\t\t\t\tend\n\t\t\tend\n\t\t\t@known_sites.merge!(results)\n\t\telse\n\t\t\tputs \"Error: no entry is added. Please check your list and try again.\"\n\t\tend\n\t\tputs \"Done adding site entries.\"\n\t\tif results.size>0\n\t\t\tputs \"New entries added: #{results}\"\n\t\telse\n\t\t\tputs \"No new entry added. \"\n\t\tend\n\t\treturn results\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\tend", "def run(sets)\n sets = Util.to_hash(sets)\n to_run = config['search'].select {|eng,valhash| valhash['run'] }\n to_run.each do |engine,valhash|\n search_engine = Katamari::SearchEngine.const_get(engine.capitalize).new(@config)\n list_of_runs = sets.map {|key,val| val }.flatten\n search_engine.run(list_of_runs)\n end\n end", "def perform(&block)\n raise Exception.new(\"You must have at least 2 requests\") unless @requests.length > 1\n @responses.clear\n requests.each_slice(Limit).to_a.each do |batch|\n body = {\n :batch => Yajl::Encoder.encode(batch),\n :access_token => Baloo.client_credentials\n }\n Client.post(\"/\", :body => body).each do |response|\n # response['headers'] = Yajl::Parser.parse(response['headers'])\n response['body'] = Yajl::Parser.parse(response['body'])\n yield response\n end\n end\n end", "def call\n results = []\n\n threads = @operations.each_with_index.map do |operation, index|\n Thread.new do\n results[index] = call_on_service_or_client operation\n end\n end\n\n threads.each(&:join)\n\n results\n end", "def test_search_with_many_results\n internal = @service.indexes.fetch(\"_internal\")\n internal.refresh()\n if internal.fetch(\"totalEventCount\").to_i < 150\n fail(\"Need at 150 events in index _internal for this test.\")\n end\n\n job = @service.jobs.create(\"search index=_internal | head 150\")\n while !job.is_done?()\n sleep(0.1)\n end\n\n stream = job.results(:count => 0)\n results = Splunk::ResultsReader.new(stream)\n count = 0\n results.each do |event|\n count += 1\n end\n assert_equal(150, count)\n\n stream = job.preview(:count => 0)\n results = Splunk::ResultsReader.new(stream)\n count = 0\n results.each do |event|\n count += 1\n end\n assert_equal(150, count)\n end", "def indexAllItems\n Thread.current[:name] = \"index thread\" # label all stdout from this thread\n batch = emptyBatch({})\n loop do\n # Grab an item from the input queue\n Thread.current[:name] = \"index thread\" # label all stdout from this thread\n itemID, timestamp, prefilteredData = $indexQueue.pop\n itemID or break\n\n # Extract data and index it (in batches)\n begin\n Thread.current[:name] = \"index thread: #{itemID}\" # label all stdout from this thread\n indexItem(itemID, timestamp, prefilteredData, batch)\n rescue Exception => e\n puts \"Error indexing item #{itemID}\"\n raise\n end\n end\n\n # Finish off the last batch.\n batch[:items].empty? or $batchQueue << batch\n $batchQueue << nil # marker for end-of-queue\nend", "def search_product_marts( documents )\n \n # HTGT_TARG Biomart\n targ_mart = Biomart.new(\n :url => \"http://htgt.internal.sanger.ac.uk:9002/dev/martsearch/htgtdev/biomart/martservice\",\n :http => @@http_agent,\n :dataset => \"htgt_targ\",\n :attributes => [\n \"marker_symbol\",\n \"design_plate\",\n \"design_well\",\n \"intvec_plate\",\n \"intvec_well\",\n \"targvec_plate\",\n \"targvec_well\",\n \"allele_name\",\n \"escell_clone_name\"\n ]\n )\n \n # HTGT_TRAP Biomart\n trap_mart = Biomart.new(\n :url => \"http://htgt.internal.sanger.ac.uk:9002/dev/martsearch/htgtdev/biomart/martservice\",\n :http => @@http_agent,\n :dataset => \"htgt_trap\",\n :attributes => [\n \"marker_symbol\",\n \"escell_clone_name\"\n ]\n )\n \n # Chunk the gene symbols into groups of 100 so that we don't \n # swamp the martservices\n doc_chunks = documents.keys.chunk( documents.keys.size % 100 )\n \n # Process the chunks one at a time...\n doc_chunks.each { |chunk|\n \n # HTGT_TARG search\n targ_data = targ_mart.search( [\"marker_symbol\"], chunk.join(',') )\n targ_data.each { |data|\n document = documents[ data['marker_symbol'] ]\n\n if document == nil\n document = Document.new( data['marker_symbol'] )\n end\n\n if ! ( data['design_plate'].to_s.empty? && data['design_well'].to_s.empty? )\n document.targeting_designs.push( data['design_plate'] + '_' + data['design_well'] )\n end\n\n if ! ( data['intvec_plate'].to_s.empty? && data['intvec_well'].to_s.empty? )\n document.intermediate_vectors.push( data['intvec_plate'] + '_' + data['intvec_well'] )\n end\n\n if ! ( data['targvec_plate'].to_s.empty? && data['targvec_well'].to_s.empty? )\n document.targeting_vectors.push( data['targvec_plate'] + '_' + data['targvec_well'] )\n end\n\n if ! data['allele_name'].to_s.empty?\n document.alleles.push( data['allele_name'] )\n end\n\n if ! data['escell_clone_name'].to_s.empty?\n document.escells.push( data['escell_clone_name'] )\n end\n\n documents[ data['marker_symbol'] ] = document\n }\n \n # HTGT_TRAP search\n trap_data = trap_mart.search( [\"marker_symbol\"], chunk.join(',') )\n trap_data.each { |data|\n document = documents[ data['marker_symbol'] ]\n\n if document == nil\n document = Document.new( data['marker_symbol'] )\n end\n\n document.escells.push( data['escell_clone_name'] )\n\n documents[ data['marker_symbol'] ] = document\n }\n \n }\n \n return documents\n \nend", "def process\n # start with the original as if it was the last destination\n tasks.each do |t|\n process_task(t)\n end\n close_files\n\n result_details\n end", "def perform\n track do\n reset!\n\n Restforce::DB::Registry.each do |mapping|\n run(\"CLEANING RECORDS\", Cleaner, mapping)\n run(\"ATTACHING RECORDS\", Attacher, mapping)\n run(\"PROPAGATING RECORDS\", Initializer, mapping)\n run(\"COLLECTING CHANGES\", Collector, mapping)\n end\n\n # NOTE: We can only perform the synchronization after all record\n # changes have been aggregated, so this second loop is necessary.\n Restforce::DB::Registry.each do |mapping|\n run(\"UPDATING ASSOCIATIONS\", Associator, mapping)\n run(\"APPLYING CHANGES\", Synchronizer, mapping)\n end\n end\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 perform(*args)\n isize = 1\n batchsize = 10000\n stime = Time.now\n vst = stime.strftime(\"%H:%M:%S\");\n tstat = Transstatus.find_by name: 'ParseResultsWorker', created_at: Time.now.utc.to_date\n\n if tstat.nil?\n tstat = Transstatus.create(:name => \"ParseResultsWorker\" )\n end\n\n Rails.logger.debug ' ParseResultsWorker start job ' + vst\n SearchParams.find_each(start:isize, batch_size: batchsize) do |params|\n pdate = params['searchdate']\n if pdate == nil or (pdate.year <= Time.now.year and pdate.mon != Time.now.month)\n\n\n tstat.update(currentparam: params.searchparam)\n @pnewscrawl = PropertyNewsCrawler.new('http://www.propertynews.com', params.searchparam)\n @pnewscrawl.findresult\n end\n end\n etime = Time.now\n vet = etime.strftime(\"%H:%M:%S\");\n PropertySite.lastscanned\n\n Rails.logger.debug ' ParseResultsWorker end job ' + vet\n rescue StandardError => e\n Rails.logger.debug 'Error running ParseResultsWorker.perform ' + e.message\n return false;\n end", "def perform\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_STARTED\")\n Agents::Branch.find_in_batches do |group|\n group.each do |each_branch|\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_STARTED_#{each_branch.id}\")\n each_branch.branch_specific_stats\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_FINISHED_#{each_branch.id}\")\n end\n end\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_FINISHED\")\n end", "def pump_results!\n loop do\n distribute_results!\n end\n end", "def process_batch\n \t metadata = CSV.read(@batch_file)\n collection_title = metadata.shift.first.titleize\n\t @collection = find_collection(collection_title)\n\n # Skip to the file manifest\n metadata.shift(4)\n\t process_files(metadata)\n end", "def multi; end", "def process_solutions\n raise NotImplementedError, 'You must implement this'\n end", "def process_multiple_resque_jobs(number, expected_class, queue=nil, &block)\n number.times do\n process_resque_job(expected_class, queue, &block)\n end\n end", "def test_multi_solr_search_multiple_models\n # TODO: Generalize me\n ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => 'type_s:Author AND NOT id:\"Author:1\" AND NOT id:\"Author:2\"'))\n ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => 'type_s:Book AND NOT id:\"Book:1\" AND NOT id:\"Book:2\"'))\n ActsAsSolr::Post.execute(Solr::Request::Commit.new)\n\n records = Book.multi_solr_search \"Napoleon OR Tom OR Thriller\", :models => [Movie, Category], :results_format => :ids\n assert_equal 3, records.total\n assert records.docs.include?({\"id\" => \"Category:1\"})\n assert records.docs.include?({\"id\" =>\"Book:1\"})\n assert records.docs.include?({\"id\" => \"Movie:1\"})\n end", "def each_service(wspace=workspace, &block)\n\t\tservices(wspace).each do |service|\n\t\t\tblock.call(service)\n\t\tend\n\tend", "def multiple_batch!(operations, opts = {})\n response = multiple_batch(operations, opts)\n\n response.wait(opts)\n end", "def process_all\n @events = []\n\n # Download and parse each of the files for all the seasons\n # and week ranges we need to process\n Config.read(\"seasons\").each do |season|\n Config.read(\"week_ranges\").each do |weeks|\n data = download(academic_year, season, weeks)\n parse(data)\n end\n end\n\n # Do nothing if saving to cache was not possible\n Cache.save(@course_id, @events) rescue nil\n\n init_calendar\n add_to_calendar(@events)\n end", "def get_results(in_progress)\nhostname2pid = {}\nin_progress.each { |pid, hostname|\n hostname2pid[hostname] = pid\n}\nissue_command_on_hosts(hostname2pid, 30){ |vp, pid| vp.get_results(pid) }\nend", "def process tweet, *_\n @aggregator << tweet.to_hash\n if @aggregator.size == options.buffered_docs\n response = @indexer.index_array(@aggregator)\n raise \"Your motherfucking bulk request failed.\" if response.has_failures?\n warn(\"Success\")\n @aggregator = []\n end\n end", "def functional_group_loop\n segments = []\n batchids.each do |batch_id|\n Output835.log.info \"batch_id : #{batch_id}\"\n segments << functional_group_header\n segments << transactions\n segments << functional_group_trailer(batch_id)\n end\n segments = segments.compact\n segments\n end", "def puppetRunBatch(cluster, layer, interval)\n\n epoch = Time.now.to_i\n\n mc = rpcclient \"puppet\"\n mc.compound_filter \"deploop_collection=#{cluster} and deploop_category=/.*#{layer}/\"\n mc.progress = false\n\n nodes = mc.discover\n nodes = mc.discover.sort\n\n puts \"Deploying Puppet Run for nodes:\"\n puts nodes\n\n result = mc.runonce(:forcerun => true, :batch_size => interval)\n waitPuppetRun = Thread.new{checkForPuppetRun nodes, epoch}\n puts 'waiting for puppet run all catalog finished'\n\n waitPuppetRun.join\n puts 'DONE!'\n end", "def build_document_xmls()\n unless @test_environment\n puts \"Creating Solr XML files (#{@batch_size} docs per file)...\"\n end\n \n doc_chunks = @document_cache_keys.keys.chunk( @batch_size )\n doc_chunks.each_index do |chunk_number|\n unless @test_environment\n puts \"[ #{chunk_number + 1} / #{doc_chunks.size} ]\"\n end\n \n doc_names = doc_chunks[chunk_number]\n docs = []\n doc_names.each do |name|\n docs.push( get_document( name ) )\n end\n \n file = File.open( \"solr-xml-#{chunk_number+1}.xml\", \"w\" )\n file.print solr_document_xml(docs)\n file.close\n end\n end", "def get_all_items(solr_params)\n solr_params['rows'] = 1000000\n end", "def process_results(agent)\n links = ScraperWiki.select(\"link FROM links\")\n links.collect{ |x| x['link'] }.each do | link |\n load_details(agent, link)\n delete_link(link)\n sleep 10\n end\n ScraperWiki.save_var(INDEX, 0)\nend", "def process_results(agent)\n links = ScraperWiki.select(\"link FROM links\")\n links.collect{ |x| x['link'] }.each do | link |\n load_details(agent, link)\n delete_link(link)\n sleep 10\n end\n ScraperWiki.save_var(INDEX, 0)\nend", "def run_jobs(result_io=nil)\n result_io = ResultIO.new if result_io.nil?\n self.reload\n begin\n while self.pending_op_groups.count > 0\n op_group = self.pending_op_groups.first\n self.user_agent = op_group.user_agent\n if op_group.pending_ops.count == 0\n case op_group.op_type\n when :change_members\n added = Array(op_group.args['added']).select{ |id| (role = role_for(id)) and Ability.has_permission?(id, :ssh_to_gears, Application, role, self) } \n removed = Array(op_group.args['removed']).dup\n Array(op_group.args['changed']).each do |(id, from, to)|\n was = Ability.has_permission?(id, :ssh_to_gears, Application, from || default_role, self) \n is = Ability.has_permission?(id, :ssh_to_gears, Application, to || default_role, self) \n next if is == was\n (is ? added : removed) << id\n end\n ops = calculate_update_existing_configuration_ops({\n # FIXME this is an unbounded operation, all keys for all users added and removed to each gear. need to optimize\n 'add_keys_attrs' => CloudUser.members_of(added).map{ |u| get_updated_ssh_keys(u._id, u.ssh_keys) }.flatten(1),\n 'remove_keys_attrs' => CloudUser.members_of(removed).map{ |u| get_updated_ssh_keys(u._id, u.ssh_keys) }.flatten(1),\n })\n op_group.pending_ops.push(*ops)\n when :update_configuration\n ops = calculate_update_existing_configuration_ops(op_group.args)\n op_group.pending_ops.push(*ops)\n when :add_features\n #need rollback\n features = self.requires + op_group.args[\"features\"]\n group_overrides = (self.group_overrides || []) + (op_group.args[\"group_overrides\"] || [])\n ops, add_gear_count, rm_gear_count = update_requirements(features, group_overrides, op_group.args[\"init_git_url\"], op_group.args[\"user_env_vars\"])\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :remove_features\n #need rollback\n features = []\n features = self.requires - op_group.args[\"features\"] unless op_group.args[\"remove_all_features\"]\n group_overrides = (self.group_overrides || []) + (op_group.args[\"group_overrides\"] || [])\n ops, add_gear_count, rm_gear_count = update_requirements(features, group_overrides)\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :update_component_limits\n updated_overrides = (self.group_overrides || []).deep_dup\n found = updated_overrides.find {|go| go[\"components\"].include? op_group.args[\"comp_spec\"] }\n group_override = found || {\"components\" => [op_group.args[\"comp_spec\"]]}\n group_override[\"min_gears\"] = op_group.args[\"min\"] unless op_group.args[\"min\"].nil?\n group_override[\"max_gears\"] = op_group.args[\"max\"] unless op_group.args[\"max\"].nil?\n group_override[\"additional_filesystem_gb\"] = op_group.args[\"additional_filesystem_gb\"] unless op_group.args[\"additional_filesystem_gb\"].nil?\n updated_overrides.push(group_override) unless found\n features = self.requires\n ops, add_gear_count, rm_gear_count = update_requirements(features, updated_overrides)\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :delete_app\n self.pending_op_groups.clear\n self.delete\n when :remove_gear\n ops = calculate_remove_gear_ops(op_group.args)\n try_reserve_gears(0, 1, op_group, ops)\n when :scale_by\n #need rollback\n ops, add_gear_count, rm_gear_count = calculate_scale_by(op_group.args[\"group_instance_id\"], op_group.args[\"scale_by\"])\n try_reserve_gears(add_gear_count, rm_gear_count, op_group, ops)\n when :replace_all_ssh_keys\n ops = calculate_replace_all_ssh_keys_ops(op_group.args)\n op_group.pending_ops.push(*ops)\n when :add_alias\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :add_alias, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s, \"fqdn\" => op_group.args[\"fqdn\"]} )\n break\n end\n end\n when :remove_alias\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :remove_alias, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s, \"fqdn\" => op_group.args[\"fqdn\"]} )\n break\n end\n end\n when :add_ssl_cert\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :add_ssl_cert, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s,\n \"fqdn\" => op_group.args[\"fqdn\"], \"ssl_certificate\" => op_group.args[\"ssl_certificate\"], \"private_key\" => op_group.args[\"private_key\"], \"pass_phrase\" => op_group.args[\"pass_phrase\"] } )\n break\n end\n end\n when :remove_ssl_cert\n self.group_instances.each do |group_instance|\n if group_instance.gears.where(app_dns: true).count > 0\n gear = group_instance.gears.find_by(app_dns: true)\n op_group.pending_ops.push PendingAppOp.new(op_type: :remove_ssl_cert, args: {\"group_instance_id\" => group_instance.id.to_s, \"gear_id\" => gear.id.to_s, \"fqdn\" => op_group.args[\"fqdn\"]} )\n break\n end\n end\n when :patch_user_env_vars\n op_group.pending_ops.push(PendingAppOp.new(op_type: op_group.op_type, args: op_group.args.dup))\n when :add_broker_auth_key, :remove_broker_auth_key\n ops = []\n args = op_group.args.dup\n self.group_instances.each do |group_instance|\n args[\"group_instance_id\"] = group_instance._id.to_s\n group_instance.gears.each do |gear|\n args[\"gear_id\"] = gear._id.to_s\n ops.push(PendingAppOp.new(op_type: op_group.op_type, args: args.dup))\n end\n end\n op_group.pending_ops.push(*ops)\n when :start_app, :stop_app, :restart_app, :reload_app_config, :tidy_app\n ops = calculate_ctl_app_component_ops(op_group.op_type)\n op_group.pending_ops.push(*ops)\n when :start_feature, :stop_feature, :restart_feature, :reload_feature_config\n ops = calculate_ctl_feature_component_ops(op_group.op_type, op_group.args['feature'])\n op_group.pending_ops.push(*ops)\n when :start_component, :stop_component, :restart_component, :reload_component_config\n ops = calculate_ctl_component_ops(op_group.op_type, op_group.args['comp_spec'])\n op_group.pending_ops.push(*ops)\n when :execute_connections\n op_group.pending_ops.push PendingAppOp.new(op_type: :execute_connections)\n end\n end\n\n if op_group.op_type != :delete_app\n op_group.execute(result_io)\n unreserve_gears(op_group.num_gears_removed)\n op_group.delete\n self.reload\n end\n\n end\n true\n rescue Exception => e_orig\n Rails.logger.error e_orig.message\n Rails.logger.debug e_orig.backtrace.inspect\n\n #rollback\n begin\n op_group.execute_rollback(result_io)\n op_group.delete\n num_gears_recovered = op_group.num_gears_added - op_group.num_gears_created + op_group.num_gears_rolled_back + op_group.num_gears_destroyed\n unreserve_gears(num_gears_recovered)\n rescue Exception => e_rollback\n Rails.logger.error \"Error during rollback\"\n Rails.logger.error e_rollback.message\n Rails.logger.error e_rollback.backtrace.inspect\n end\n raise e_orig\n end\n end", "def run_bulk(t, first, last, incr = 1)\n retry_until { DRMAA.run_bulk_jobs(t.ptr, first, last, incr) }\n end", "def solrize_objects(opts={})\n # retrieve a list of all the pids in the fedora repository\n num_docs = 1000000 # modify this number to guarantee that all the objects are retrieved from the repository\n puts \"WARNING: You have turned off indexing of Full Text content. Be sure to re-run indexer with @@index_full_text set to true in main.rb\" if index_full_text == false\n\n if @@index_list == false\n solrize_from_fedora_search(opts) \n else\n solrize_from_csv\n end\n end", "def process(io_stream)\n settings.fill_in_defaults!\n\n count = 0\n start_time = batch_start_time = Time.now\n logger.debug \"beginning Indexer#process with settings: #{settings.inspect}\"\n\n reader = self.reader!(io_stream)\n writer = self.writer!\n\n\n processing_threads = settings[\"processing_thread_pool\"].to_i\n thread_pool = Traject::ThreadPool.new(processing_threads)\n\n logger.info \" Indexer with #{processing_threads} processing threads, reader: #{reader.class.name} and writer: #{writer.class.name}\"\n\n log_batch_size = settings[\"log.batch_size\"] && settings[\"log.batch_size\"].to_i\n\n reader.each do |record; position|\n count += 1\n\n # have to use a block local var, so the changing `count` one\n # doesn't get caught in the closure. Weird, yeah.\n position = count\n\n thread_pool.raise_collected_exception!\n\n if settings[\"debug_ascii_progress\"].to_s == \"true\"\n $stderr.write \".\" if count % settings[\"solr_writer.batch_size\"].to_i == 0\n end\n\n context = Context.new(\n :source_record => record,\n :settings => settings,\n :position => position,\n :logger => logger\n )\n\n if log_batch_size && (count % log_batch_size == 0)\n batch_rps = log_batch_size / (Time.now - batch_start_time)\n overall_rps = count / (Time.now - start_time)\n logger.send(settings[\"log.batch_size.severity\"].downcase.to_sym, \"Traject::Indexer#process, read #{count} records at id:#{context.source_record_id}; #{'%.0f' % batch_rps}/s this batch, #{'%.0f' % overall_rps}/s overall\")\n batch_start_time = Time.now\n end\n\n # We pass context in a block arg to properly 'capture' it, so\n # we don't accidentally share the local var under closure between\n # threads.\n thread_pool.maybe_in_thread_pool(context) do |context|\n map_to_context!(context)\n if context.skip?\n log_skip(context)\n else\n writer.put context\n end\n\n end\n\n end\n $stderr.write \"\\n\" if settings[\"debug_ascii_progress\"].to_s == \"true\"\n\n logger.debug \"Shutting down #processing mapper threadpool...\"\n thread_pool.shutdown_and_wait\n logger.debug \"#processing mapper threadpool shutdown complete.\"\n\n thread_pool.raise_collected_exception!\n\n\n writer.close if writer.respond_to?(:close)\n\n @after_processing_steps.each do |step|\n begin\n step.execute\n rescue Exception => e\n logger.fatal(\"Unexpected exception #{e} when executing #{step}\")\n raise e\n end\n end\n\n elapsed = Time.now - start_time\n avg_rps = (count / elapsed)\n logger.info \"finished Indexer#process: #{count} records in #{'%.3f' % elapsed} seconds; #{'%.1f' % avg_rps} records/second overall.\"\n\n if writer.respond_to?(:skipped_record_count) && writer.skipped_record_count > 0\n logger.error \"Indexer#process returning 'false' due to #{writer.skipped_record_count} skipped records.\"\n return false\n end\n\n return true\n end", "def perform_indexes(first_modified)\n client = PurlFetcher::Client::Reader.new('', 'purl_fetcher.first_modified' => first_modified)\n client.each_slice(1000) do |batch|\n batch.each do |record, _change|\n IndexFullTextContentJob.perform_later(record.druid)\n end\n\n ts = batch.map { |_, change| Time.zone.parse(change['updated_at']) if change['updated_at'] }.max\n yield ts if ts\n end\n\n yield client.range['last_modified']\n end", "def processAllBatches\n Thread.current[:name] = \"batch thread\" # label all stdout from this thread\n loop do\n # Grab a batch from the input queue\n batch = $batchQueue.pop\n batch or break\n\n # And process it\n processBatch(batch)\n end\nend", "def processAllBatches\n Thread.current[:name] = \"batch thread\" # label all stdout from this thread\n loop do\n # Grab a batch from the input queue\n batch = $batchQueue.pop\n batch or break\n\n # And process it\n processBatch(batch)\n end\nend", "def multi(&block); end", "def collect2 pages\n id = 'joshuabaer'\n results = []\n tasks = []\n 1.upto pages do |page|\n puts \"queueing page #{page}\"\n task = BackgroundTask.new do \n http_get id, page\n end\n tasks << task\n task.run\n end\n tasks.each do |task|\n puts \"task retrieved\"\n results += task.result\n end\n results\nend", "def process_sales(sales_by_masterchannel)\n sales_by_masterchannel.each do |mc, sale_array|\n mc.process_sale(sale_array, self) unless mc.nil?\n end\n end", "def bulk(records)\n records_array = Array(records)\n\n bulk_delay(records_array)\n\n yield\n\n bulk_queue(records_array)\n end", "def get_results\n \n stories = []\n blog_posts = [] \n tweets = []\n base_errors = []\n last_date = nil\n @voter_ids = []\n \n # searchterms = search_terms.gsub(\" and \", \" \").gsub(\"\\r\", \"\").split(\"\\n\").collect{|s| \"(\"+s+\")\"}.join( \" OR \" )\n terms_set = search_terms.split(\"\\n\")\n \n start_time = Time.zone.now\n @total_results = 0\n @new_results = 0\n update_attributes!( :last_started => Time.zone.now, :status=>\"executing\", :seconds_to_execute=>nil, :total_results=>nil, :new_results=>nil )\n \n terms_set.each do |terms|\n next if terms.strip.blank?\n procs = []\n @second_phase_topic_post_queue = Queue.new # Use Queue to ensure thread safety.\n\n if( true )\n twitter_proc = Proc.new do\n begin\n logger.info( \"Searching Twitter with #{terms} : #{DateTime.now.ltf}\" ) \n searcher = TS.new( terms, nil, last_date, nil, 0, $APP_CONFIG[:search][:ts_debug_level] )\n _tweets = []\n while( !TEST_MODE && tweet = searcher.next_result )\n _tweets << tweet\n # puts \"tweet: #{tweet.inspect}\"\n # debug_msg( tweet.to_s, 2 )\n process_result tweet\n end\n logger.info( \"Twitter (#{terms}) results: #{_tweets.length} : #{DateTime.now.ltf}\" )\n end\n end\n procs << twitter_proc\n end\n\n begin\n threading = $APP_CONFIG[:search][:use_threading]\n if( threading )\n # puts(\"Executing search in multi-threaded mode.\")\n threads = []\n procs.each do |proc|\n thread = Thread.new(proc, Thread.current) do |search_proc, caller_thread|\n begin\n Poll.connection.reconnect!\n search_proc.call\n rescue Exception\n Thread.current[:exception] = $!\n end\n end\n threads << thread\n end\n # debug_msg \"Waiting on Threads \" + threads.join(\" \")\n threads.each do |thread| \n thread.join\n if thread[:exception]\n raise thread[:exception]\n end\n end\n # debug_msg \"Passed wait on Threads\"\n else\n # puts(\"Executing search in single-threaded mode.\")\n procs.each do |proc|\n proc.call\n end\n end\n\n rescue Exception => exception\n # logger.error $!.inspect\n # logger.error $!.backtrace.join(\"\\n\")\n raise $!\n end\n end\n perform_reach_lookups\n update_attributes!( :last_updated => Time.zone.now, :status=>\"completed\", :seconds_to_execute=>Time.zone.now-start_time, :total_results=>@total_results, :new_results=>@new_results )\n end" ]
[ "0.61693203", "0.60873973", "0.6084905", "0.59042245", "0.5902048", "0.58922154", "0.5884926", "0.58821285", "0.5831383", "0.5831383", "0.581307", "0.57927036", "0.5787895", "0.57803464", "0.5716339", "0.57033634", "0.57032394", "0.5653601", "0.5645989", "0.56376886", "0.5618731", "0.5604135", "0.5594127", "0.55883485", "0.5582061", "0.55778706", "0.5569489", "0.556795", "0.55536133", "0.5548151", "0.5540336", "0.55325425", "0.5529725", "0.55214894", "0.5513787", "0.5504064", "0.54996496", "0.5489339", "0.5475886", "0.54571754", "0.54559857", "0.54542994", "0.5450015", "0.54495937", "0.5444857", "0.5438851", "0.5438851", "0.5427795", "0.5426024", "0.54197377", "0.5405049", "0.5399995", "0.53812", "0.53761125", "0.5368613", "0.5368597", "0.536637", "0.5362279", "0.53582853", "0.5354105", "0.5352513", "0.53382266", "0.5336479", "0.532601", "0.5325934", "0.53257513", "0.53247726", "0.5320941", "0.5320436", "0.5319577", "0.5298762", "0.52941066", "0.52940863", "0.5293028", "0.52884775", "0.5285846", "0.5276731", "0.5269728", "0.52687615", "0.5267392", "0.52565163", "0.5237667", "0.52318865", "0.5231083", "0.52247494", "0.52233213", "0.521907", "0.521907", "0.52146083", "0.5209973", "0.52088195", "0.52064294", "0.5202488", "0.5198013", "0.5198013", "0.51922286", "0.5186658", "0.5182875", "0.51818603", "0.51812977" ]
0.7796205
0
show full details of a libra work
def show_libra_work( work ) return if work.nil? j = JSON.parse( work.to_json ) j.keys.sort.each do |k| val = j[ k ] if k.end_with?( '_id' ) == false && k.end_with?( '_ids' ) == false show_field( k, val, ' ' ) end end show_field( 'visibility', work.visibility, ' ' ) Author.sort( work.authors ).each_with_index do |p, ix| show_person( " author #{ix + 1}:", p ) end Contributor.sort( work.contributors ).each_with_index do |p, ix| show_person( " contributor #{ix + 1}:", p ) end if work.file_sets file_number = 1 fs = work.file_sets.sort { |x, y| x.date_uploaded <=> y.date_uploaded } fs.each do |file_set| puts " file #{file_number} => #{file_set.label}/#{file_set.title[0]} (/downloads/#{file_set.id})" file_number += 1 end end puts '*' * 40 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workspace_info\n link_to_workspace_info(\"http://library.nyu.edu/info/myworkspace.html\", \"left\")\n end", "def show_details(workspace)\n begin\n puts workspace.show_details\n rescue => exception\n puts \"Error: #{exception.message}\"\n end\nend", "def show\n render_default_format(@work, true, 200)\n rescue Exception => e\n puts e.inspect\n end", "def show_info\n run('show info')\n end", "def details; end", "def get_info\n puts \"#{@title} by #{@author} is #{@status}.\"\n if @description\n puts \"#{@title} description: #{@description}.\"\n end\n end", "def printHelp\n print \"getrbart v#{/(\\d+\\.\\d+)/.match( '$Revision: 1.9 $' )[ 1 ]}\nCopyright (C) 2008,2009 by Dave Pearson <[email protected]>\nhttp://www.davep.org/\n\nSupported command line options:\n\n -h --host <host> Specify the host to be contacted\n (default is \\\"www.redbubble.com\\\").\n -p --port <port> Specify the port to be connected\n (default is 80).\n --product <product> Specify the type of product list to\n download. Either 'art' or 'clothing'.\n -t --tagged <tag> Only get works with a specific tag.\n -u --user <user> Specify the RedBubble user.\n -v --verbose Work in verbose mode.\n --help Display this help.\n -L --licence Display the licence for this program.\n\nThe results (which are printed to STDOUT) contain one work per line in the\nformat:\n\n<work id>\\\\t<work title>\\\\t<thumbnail URL>\n\"\nend", "def details\n data()\n end", "def display_help\n puts \"Dev Sync : report or sync your development files\"\n puts \" report nas_directory(optional)\"\n puts \" sync reported_file_name\"\nend", "def show\n render_default_format(@our_works, true, 200)\n rescue Exception => e\n puts e.inspect\n end", "def info; end", "def info; end", "def details\n p '===== details ====='\n p \"Main TABLE: #{@main_t}\"\n p \"MAX_FREQUENCY_METRIX\"\n p @cache_mfx_table\n '===== details ====='\n end", "def show_info()\n\t\tputs \"ID: #{@@id}\"\n\t\tputs \"Name: #{@car_name}\"\n\t\tputs \"Make: #{@@make}\"\n\t\tputs \"Cost: #{calc_total_cost} INR\"\n\t\tputs\n\t\tputs \"Review: #{@review}\"\n\t\tputs \"Rating: #{@rating} stars\"\n\tend", "def list_details\n puts \"Name: \" + @name\n puts \"Description: \" + @details\n puts \"Exercise Time: \" + @duration\n end", "def show\n @work = Work.find(params[:id])\n render :json => {:name => @work.name, :desc => @work.description}\n end", "def details\n\n end", "def about_worker\n print \"Name-#{name}, Specialty-#{@specialty}, Experience-#{@experience}\"\n end", "def overview\n\n end", "def details\n end", "def info()\n #This is a stub, used for indexing\n end", "def helper\n \"Display the list of results generated by analysis modules.\"\n end", "def show\n\t\t@works = @anthology.works.decorate\n\tend", "def show(number, full=false)\n request = get_request_by_number(number)\n # determine whether to show full diff or just stats\n option = full ? '' : '--stat '\n diff = \"diff --color=always #{option}HEAD...#{request.head.sha}\"\n print_request_details(request)\n puts git_call(diff)\n print_request_discussions(request)\n end", "def get_info\n p \"The #{@model} bike has #{@wheels} wheels and a #{@frame_size} frame.\"\n end", "def display_usage\n end", "def show\n set_project_stat\n end", "def show\n set_project_stat\n end", "def details(*args); end", "def show() end", "def show() end", "def show() end", "def help\n puts \"plan #{Plan::VERSION} - john crepezzi - http://github.com/seejohnrun/plan\"\n COMMAND_GLOSSARY.each do |cmd, description|\n puts \"\\e[0;33m#{cmd}\\e[0m - #{description}\"\n end\n end", "def get_info\n puts @name + ' [ID: ' + @id.to_s + ' @ '+ @@company + ']'\n end", "def about\n puts \"The CLI Tracker was developed by Dakota States as part of a Flatiron School CLI Project. The data source: https://covid.ourworldindata.org/data/owid-covid-data.json\"\n end", "def listinfo\n puts \"排名:#{@no}\"\n puts \"月份:#{@month}\" if @month\n puts \"标签: #{@subtag}\" if @subtag\n puts \"标题:#{@title}\"\n puts \"集数:#{@episode}\" if @episode\n puts \"链接:#{@link}\"\n puts \"<bilibili独家哟!>\" if @bilibilionly_flag\n puts \"--------------------\"\n end", "def show\n file_name = project_log_path\n if File.exist?(file_name)\n @logOffset = File.size(file_name)\n else\n @logOffset = 0\n end\n\n # get load_test data\n @load_tests = @project.load_tests.reverse_chronological_list #LoadTest.where(project_id: @project.id).reverse_chronological_list\n end", "def describe\n\t\t\"Shows the folder and files of the present working directory.\"\n\tend", "def description\n\t\"This task scrapes Hoovers for company info.\"\nend", "def show\n puts \"******* show *******\"\n end", "def show_job_details(job)\n @scraper.scrape_details(job)\n job.print_info\n job\n end", "def info\n\tend", "def results\r\n print_books\r\n print_toys\r\n print_classes\r\n end", "def show\n @work = Work.find( params[:id] )\n @audits = Audit.work( params[:id] )\n @file_upload_url = RestEndpoint.file_upload_url(current_user)\n end", "def icl_show( args )\n if args == \"all\"\n puts @log.show_all\n else\n puts @log.show( args )\n end\n\n end", "def get_help_info\n 'See the documentation here - https://github.com/blockfrost/blockfrost-ruby'\n end", "def print_usage; end", "def show\n\t\t end", "def details\r\n\t\treturn @feature + \". \" + @real_need.details\r\n\tend", "def displayLibraryDetails()\n getAllUsers()\n getAllBooks()\n puts \"SUMMARY\"\n puts \"---------------------------------\"\n puts \"Total Number of Books: \" + @books.length.to_s\n puts \"Total Number of Users: \" + @users.length.to_s\n puts \"---------------------------------\"\n end", "def print_info\n\n puts \"\\e[H\\e[2J\" # clear terminal screen\n\n # print the listing title\n print \"#{@@white}Job Title: #{@@green}#{self.title}\\n\"\n\n\n # print the time left to bid\n print \"\\t#{@@white}Time Left: #{@@green}#{self.time_left}\\n\"\n\n # print the budget for the job if valid\n if self.budget\n print \"\\t#{@@white}Budget: #{@@green}#{self.budget}\\n\"\n end\n\n # print the tags associated with the listing\n print \"\\t#{@@white}Tags: #{@@green}#{self.tags.join(',')}\\n\"\n\n # print the number of bids if valid\n if self.bids\n print \"\\n\\t#{@@white}Bids: #{@@green}#{self.bids}\\n\"\n end\n\n # print the average bid if valid\n if self.avg_bid\n print \"\\t#{@@white}Average Bid: #{@@green}#{self.avg_bid}\\n\"\n end\n\n # display the summary of bids at the momment\n print \"\\t#{@@white}Bid Summary: #{@@green}#{self.bid_summary}\\n\" if self.bid_summary\n\n # if we don't have the main description then print the short_description otherwise print the main description\n print \"\\t#{@@white}Description: \\n#{@@green}\"\n if self.description == nil\n # print \"#{self.short_description}\\n\\n\".green # put a .each_line block here and add \\t\\t to space it out properly\n desc = self.short_description\n else\n # print \"#{self.description}\\n\\n\".green\n desc = self.description\n end\n\n # fix the formating issues by indenting each line with tabs twice\n desc.each_line {|line| print \"\\t\\t#{@@green}#{line}\\n\"}\n\n print \"#{@@reset}\"\n end", "def describe\n\t\t\"Show the present working directory.\"\n\tend", "def show\n @work_log = WorkLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_log }\n end\n end", "def show\n add_breadcrumb \"Project: #{@project.name}\", project_path(@project)\n add_breadcrumb \"Phase #{@phase.sequence + 1}: #{@phase.name}\", project_phase_path(@project, @phase)\n add_breadcrumb \"Experiment: #{@experiment.name}\"\n end", "def show_info(config, layout)\n Squib::logger.info \"Squib v#{Squib::VERSION}\"\n Squib::logger.info \" building #{@cards.size} #{@width}x#{@height} cards\"\n Squib::logger.info \" using #{@backend}\"\n end", "def help\n\tusage\n\tputs \"This tool is oriented to separate web pages into segments called blocks, based on the structural and visual properties\"\nend", "def show\n @serial_works = @series.serial_works.find(:all, :include => :work, :conditions => ['works.posted = ?', true], :order => :position).select{|sw| sw.work.visible(User.current_user)}\n # sets the page title with the data for the series\n @page_title = \"\"\n if logged_in? && !current_user.preference.work_title_format.blank?\n @page_title = current_user.preference.work_title_format\n @page_title.gsub!(/FANDOM/, @series.allfandoms.collect(&:name).join(', '))\n @page_title.gsub!(/AUTHOR/, @series.allpseuds.collect(&:byline).join(', '))\n @page_title.gsub!(/TITLE/, @series.title)\n else\n @page_title = @series.title + \" - \" + @series.allpseuds.collect(&:byline).join(', ') + \" - \" + @series.allfandoms.collect(&:name).join(', ')\n end\n @page_title += \" [#{ArchiveConfig.APP_NAME}]\"\n end", "def output_details(files) \n @stdout.puts\n @stdout.puts \"Details\".bold\n files.each do |t|\n fname = t.path\n @stdout.puts \"File: %s\" % [((t.status == FileData::STATUS_OK) ? fname : fname.red)]\n @stdout.puts \"Includes: %s\" % [format_fds(t.includes)] unless t.includes.empty?\n @stdout.puts \"Included by: %s\" % [format_fds(t.included_by)] unless t.included_by.empty?\n @stdout.puts \"References: %s\" % [format_fds(t.references)] unless t.references.empty?\n @stdout.puts \"Referenced by: %s\" % [format_fds(t.referenced_by)] unless t.referenced_by.empty?\n unless t.status == FileData::STATUS_NOT_FOUND\n # show that part only if file exists\n @stdout.puts \"Size: %s (%d)\" % [format_size(t.size),t.size]\n if (t.docbook)\n @stdout.puts \"Type: DocBook, Version #{t.version}, Tag: #{t.tag}\"\n else\n @stdout.puts \"MIME: #{val_s(t.mime)}\"\n end\n @stdout.puts \"Timestamp: %s\" % [t.ts]\n @stdout.puts \"SHA1: %s\" % [t.checksum]\n end\n @stdout.puts \"Error: %s\" % [t.error_string.to_s.red] unless (t.error_string.nil?) \n @stdout.puts\n end\n end", "def details\n return @description + \": \" + \"#{@extra_cost}\" + \". \" + @basic_inst.details\n end", "def showInformation()\n print(\"Starting up the scraper for the RAND Terrorism Incident Database. The flashing numbers that will appear represent written incidents. It will take a few moments for the initial program to load... \\n\");\nend", "def show\n @title = @repository.url\n\n @leaks = @repository.leaks\n\n @unchecked_leaks = @leaks.select(&:unchecked?)\n @safe_leaks = @leaks.select(&:safe?)\n @unsafe_leaks = @leaks.select(&:unsafe?)\n\n @unchecked_leak_exists = @unchecked_leaks.count > 0\n end", "def display_work_unit\n \"unit ##{@options['work_unit_id']} (#{@action_name})\"\n end", "def display_results\r\n raise \"Not implemented\"\r\n end", "def title\n puts \"\\nTalia Digital Library system. Version: #{TaliaCore::Version::STRING}\" \n puts \"http://www.muruca.org/\\n\\n\"\n end", "def libra_only\n @works = Work.libra_only\n render :index\n end", "def info\n puts 'Info'\n end", "def print_debug_info\n puts \"Project #{name}:\"\n puts \"\\tState: #{state}\"\n puts \"\\tMan-days total: #{man_days}\"\n puts \"\\tMan-days done: #{man_days_done}\"\n puts \"\\tPrice: #{price}\"\n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def show\n \n end", "def help\n lines = []\n end", "def show_info\n\t\tputs \"Your start station: #{starting_point}\"\n\t\tputs \"Your destination: #{ending_point}\"\n\t\tputs \"Travel time: ___\"\n\t\tputs \"Price: ____\"\n\tend", "def introduction\n puts 'hello welcome to the github scrapper'.light_blue\n puts 'this tool is desgined for fetching data from github quickly and saving it to a csv file'.light_blue\nend", "def display_text_result_help result\n help_link(\"Help?\", result.help_id) \n end", "def show\n @other_tools = @tool.others_from_this_owner\n @collaborators = @tool.collaborators\n end", "def print_debug_info\n puts \"Programmer #{name}:\"\n puts \"\\tSpeed: #{speed}\"\n puts \"\\tDaily wage: #{daily_wage}\"\n puts \"\\tProject: #{project_name}\"\n end", "def import_show \n end", "def index(libent)\n\t\tprintAndCall(\"ar s #{libent}\")\n\tend", "def find_work\n\n end", "def help; end", "def help; end", "def help; end", "def show\n @test_results = @test_run.test_results\n end", "def show_help\n puts HELP_INSTALL\n end", "def show_stat\n \t\tputs \"=============Statistics============\"\n \t\tputs \"Score: #{get_score}\"\n \t\tputs \"Total time: \" + \"%0.2f\" %(@end_time - @start_time + @save_time) + \" seconds\"\n \t\tputs \"Number of sets found: #{@number_of_correct}\"\n \t\tputs \"#{@number_of_hint}/#{@total_hint} hints used\"\n \tend", "def help\r\n end", "def help\r\n end", "def show\n # binding.pry\n \n end", "def help\n \n end", "def run\n\t\t\tsummary\n\t\tend", "def get_basic_info(opts = Opts.new)\n sp_hash = {\n cols: [:id, :display_name, :version, :remote_repos],\n filter: [:eq, :id, id()]\n }\n\n rows = get_objs(sp_hash)\n GetBasicInfo.find_match(rows, opts) || fail(Error.new('Unexpected that there is no info associated with module'))\n end", "def show\n @diagnostic = @ticket.diagnostics.new\n @diagnostics = @ticket.diagnostics\n #@issues = @ticket.issues\n @client = @ticket.client.id\n @computers = @ticket.computers\n #@computer - @ticket.computers\n \n end", "def display_library(selected)\n\tl = Library.find(selected)\n\tputs \"\\n#{l.branch_name} is located at #{l.address} Phone number #{l.phone}\\n\"\nend", "def help\n end" ]
[ "0.6527745", "0.6361649", "0.6350302", "0.62399715", "0.6149119", "0.6148327", "0.6130828", "0.6034295", "0.6028256", "0.6017531", "0.5982396", "0.5982396", "0.592682", "0.591022", "0.5899939", "0.58746207", "0.5872047", "0.58624816", "0.58400434", "0.58334535", "0.58300734", "0.5826749", "0.5819282", "0.57845753", "0.57576686", "0.575659", "0.5744802", "0.5744802", "0.5735567", "0.5731593", "0.5731593", "0.5731593", "0.5729427", "0.5728896", "0.5720384", "0.57130456", "0.5705419", "0.569719", "0.56892276", "0.56836516", "0.56812555", "0.5665648", "0.56589514", "0.56582814", "0.5655098", "0.5652925", "0.56461644", "0.56317574", "0.56274784", "0.5621493", "0.56193984", "0.5619166", "0.5614268", "0.56135297", "0.56092113", "0.5598197", "0.559745", "0.5595765", "0.55935127", "0.55895203", "0.5588201", "0.558714", "0.55757785", "0.55650747", "0.5560236", "0.5554609", "0.5554158", "0.5553577", "0.5553577", "0.5553577", "0.5553577", "0.5553577", "0.5553577", "0.5553577", "0.5553577", "0.5553577", "0.5553037", "0.55511457", "0.554633", "0.5521155", "0.55128336", "0.5512794", "0.5510096", "0.55079573", "0.5506786", "0.5502598", "0.5502598", "0.5502598", "0.54997337", "0.54982364", "0.54952425", "0.54930234", "0.54930234", "0.5492196", "0.5490165", "0.54884833", "0.5488465", "0.54857874", "0.5485592", "0.54842925" ]
0.72610444
0
show the contents of a person subfield
def show_person( title, person ) #puts "#{title} #{person}" puts "#{title}" show_field( 'ix', person.index, ' ' ) show_field( 'cid', person.computing_id, ' ' ) show_field( 'first_name', person.first_name, ' ' ) show_field( 'last_name', person.last_name, ' ' ) show_field( 'department', person.department, ' ' ) show_field( 'institution', person.institution, ' ' ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_content\n f = ''\n subfields.each do |sf|\n f += \"|#{sf.code}#{sf.value}\"\n end\n f\n end", "def add_show_field(*) super end", "def render_person_info(person)\n partial :sidebar_person_info, :locals => {:person => person}\n end", "def subfield(tag)\n subfields.find { |sf| sf.tag == tag.to_s }\n end", "def display_fields\n @form.fields.each {|f| puts f.name}\n end", "def showlist\n\t\t@people_list.each do |x|\n\t\t\tputs \"* #{capitalize(x.type)}, #{capitalize(x.name)}, #{capitalize(x.party)}\"\n\t\tend\n\tend", "def show\n @person = Person.find(params[:id])\n @address = @person.addresses.take\n @identifiers = @person.identifiers\n @parent = @person.company\n end", "def localized_info_field(f, name, lang = current_person.locale) # :nodoc:\n render({:partial => '/partials/localized_info_form_content',\n :locals => {:f => f, :name => name, :lang => lang}})\n end", "def show\n @names = @fascicle.names\n @groups = @fascicle.groups\n @magazines = @fascicle.magazines\n @unions = @fascicle.unions\n end", "def get_field_display_rtpl\n '{%=' + @model_name + '[:' + @name + ']%}'\n end", "def sub_field(named, human_name = nil, &block)\n human_name ||= named\n @sub_fields << QueryBuilder::Field.new(named, human_name, self.depth+1, &block)\n end", "def display_for(object, field_name)\n fdef = field_called(field_name)\n fdef.display_proc.call(fdef.reader_proc.call(object))\n end", "def child_info(f)\n panel(f, \"Section 2 Child Information\") do\n render partial: \"child_info\", locals: { f: f }\n end\n end", "def show\n @page_title = 'Profile for ' + @person.full_name\n end", "def show\n @title = @user.complete_name\n @description = \"Informations relatives à #{@user.complete_name}\"\n @jsonld = @user.to_jsonld\n end", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def display\n\t\tname\n\tend", "def render_document_show_field_value *args\n render_field_value(*args)\n end", "def custom_field(label, contents)\r\n render_field(label, {}, contents)\r\n end", "def record_edit_display\n \"1. Name: #{name}\\n\"\\\n \"2. Email: #{email}\\n\"\\\n \"3. Library: #{libraries_edit_display}\"\n end", "def show_field(id)\n get(\"fields/#{id}\")\n end", "def display_fields\n [\"user_name\", \"assignment_name\"]\n end", "def display_field(field, depth = 0, parents = [])\n my_parents = parents.dup\n field_str = ''\n name = field[:name]\n if field[:class] == BinData::Array\n field_str = \"\\n\" + (\"\\t\" * depth) + name.to_s.upcase\n parent = self\n my_parents.each do |pfield|\n parent = parent.send(pfield)\n end\n array_field = parent.send(name)\n field_str << process_array_field(array_field, (depth + 1))\n else\n if my_parents.empty?\n label = \"\\n\" + (\"\\t\" * depth) + name.to_s.upcase\n if field[:class].ancestors.include? BinData::Record\n field_str = label\n else\n value = send(name)\n field_str = format '%-30s %s', label, value\n end\n else\n parent = self\n my_parents.each do |pfield|\n parent = parent.send(pfield)\n end\n value = parent.send(name)\n label = field[:label] || name.to_s.capitalize\n label = \"\\n\" + (\"\\t\" * depth) + label\n field_str = format '%-30s %s', label, value\n end\n end\n my_parents << name\n field[:fields].each do |sub_field|\n field_str << display_field(sub_field, (depth + 1), my_parents)\n end\n field_str\n end", "def edit(opts={})\n on SubAccountPage do |page|\n edit_fields opts, page, :description, :name, :active_indicator, :sub_account_type_code,\n :cost_sharing_chart_of_accounts_code, :cost_sharing_account_number,\n :icr_identifier, :icr_type_code\n\n end\n end", "def show\n @partner_person = PartnerPerson.find(params[:id])\n @title = \"association partners <--> peoples\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partner_person }\n end\n end", "def display\n puts \"Personal Details\"\n puts \" Name : #{self.name}\"\n puts \" Date of Birth : #{self.dob}\"\n puts \" Marital Status : #{self.marital_status}\"\n puts \" Mobile Number : #{self.mobile_number}\"\n puts \" Email : #{self.email}\"\n end", "def list \n @people.each_with_index do |a,i|\n puts \"Entry \" + (i+1).to_s + \": \" + a.fullname\n end\n end", "def show_full_name\n name\n end", "def render_manual(p)\n r = \"\"\n if p.authors.size > 0 then\n r += p.authors.map {|a| a.abbreviated_name}.joined_by_comma_and_and + \". \"\n end\n\n r += p.title.detex.titlecase + \". \"\n r += text_for_field(\"Organization\", p, :postfix => \", \").detex\n r += text_for_field(\"Address\", p, :postfix => \", \").detex\n\n if field(p,\"Edition\") then\n r += text_for_field(\"Edition\", p).titlecase.detex + \" edition, \"\n end\n\n r += month_for_field(\"Month\", p, :postfix => \" \").detex\n r += text_for_field(\"Year\", p, :postfix => \". \").detex\n r += text_for_field(\"Note\", p, :postfix => \". \").detex\n return r\nend", "def show\n @title = \"Perfil del Candidato: #{@profile.forenames} #{@profile.surnames}\"\n end", "def show\n @title = \"#{@profile.forenames} #{@profile.surnames}\"\n end", "def show_subfeature\n ::Actions::Features::YourFeature1::YourSubfeature1.new(bot: bot, user: user, some_attr: 'attr').show\n end", "def display_title\n\n if (subtype &&\n subtype[0] &&\n subtype[0] == \"#{SUBTYPE_BASE_URI}/party/person\")\n # People have names\n str = nil\n\n g = name_given\n if g && ! g.empty?\n str = g[0]\n end\n\n f = name_family\n if f && ! f.empty?\n if str\n str += \" #{f[0]}\"\n else\n str = f[0]\n end\n end\n\n if str\n return str\n end\n\n else\n # All others have titles\n\n t = title\n if t\n t = title[0]\n if t\n if t && ! t.blank?\n return t\n end\n end\n end\n end\n\n return '(untitled)'\n end", "def show\n\t @person = Entry.last\n end", "def show_name\n @name\n end", "def full_text\n \"#{role} by #{person.full_name}\"\n end", "def sub_object\n splits= @field.split('.')\n object_name = splits.first\n field_names = splits[1..-1] # all but the first\n return unless object_name && obj.respond_to?(object_name)\n object = obj.send(object_name)\n # Its a collection => invoice.items and access is done by ary index:\n # first item => [items.1.name]\n if object.nil?\n # empty relation\n @result.gsub!(@placeholder, '')\n elsif object.is_a?(Array) && ary_index = field_names.first[/\\A\\d*\\z/]\n field_names.delete_at(0) # remove entry from field_names ary\n # replace with empty string if the index does not exist or obj is empty\n @result.gsub!(@placeholder, '') unless object = object[ary_index.to_i-1]\n end\n\n # Recurse and let the referenced object do the expanding\n if object.respond_to?(:expand_placeholders)\n value = object.expand_placeholders(\"[#{field_names.join('.')}]\")\n @result.gsub!(@placeholder, value)\n end\n end", "def show_fields(**params)\n get('fields', params)\n end", "def sub_name\n primary_property ? \"#{primary_property.description}\" : ''\n end", "def contact_field(contact, field_name, label=field_name)\n html=[]\n style=\"edit\"\n html << \"<label>#{label}</label>\"\n val = html_escape(contact.send(field_name))\n if val.blank?\n val = 'Click to edit' \n style << \" subtle-text\"\n end\n html << \"<span id=\\\"#{field_name}\\-#{contact.id}\\\" class=\\\"#{style}\\\">#{val}</span><br>\"\n html.join(\"\").html_safe\n end", "def document_show_field_label(document, field)\n lookup_display_name(document, field) || super\n end", "def subfield(tag, code)\n field(tag).map{|f| f.subfields.select{|s| s.code == code } }.flatten\n end", "def show ( contact )\n puts \"#{contact[:name]}\"\n puts \"phone: #{contact[:phone]}\"\n puts \"email: #{contact[:email]}\"\n puts\nend", "def print_person\n puts \"Name: #{name}\"\n puts \"Age: #{age} years old\"\n puts \"ID: VCN#{id}\"\n end", "def show\n results = Dbpedia.sparql.query(\"SELECT ?person ?abstract ?name WHERE {\n ?person rdf:type <http://dbpedia.org/ontology/Person>.\n ?person foaf:name ?name.\n ?person dbpedia-owl:abstract ?abstract .\n FILTER (LANG(?abstract)='pl' && ?name=\\\"\"[email protected]_name+\"\\\"@en)\n }\")\n if results.first != nil\n @bio=results.first[:abstract] \n end\n end", "def show\n @ProfileSubValue = ProfileSubValue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @ProfileSubValue }\n end\n end", "def display_phone_number(emp)\n\t\tprint \"Name \t\t: #{emp.name}\t\\n\"\t\t\n\t\tprint \"Phone Number : #{emp.phone}\t\\n\"\n\tend", "def subtitle_fields\n []\n end", "def post_detail( post, field )\n d = \"data-field='details[#{field}]'\"\n k = \"<p>#{field.to_s.humanize}:</p>\"\n\n if post.new_record?\n value = \"Edit this\"\n else\n value = post.details.send :[], field\n end\n v = \"<p #{d} class='post-field input'>#{value}</p>\"\n\n \"<div class='detail'>#{k} #{v}</div>\".html_safe\n end", "def field_content\n value\n end", "def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end", "def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end", "def display_name\n titre\n end", "def sub_name\n primary_property ? \"#{primary_property.description}\" : ''\n end", "def show\n @person = Person.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @person }\n format.json { render :json => @person.to_json(:include => [:fieldvalues, :address, :city, :province]) }\n end\n end", "def print_person\n print \"The peoples registered are: #{@person}\"\n end", "def person_field(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"personFields/#{id}\", params)\n end", "def person_name_fields\n \"\".tap do |result|\n fields_for(:person_name) do |f|\n result << f.text_field(:name_prefix)\n result << f.text_field(:first_name)\n result << f.text_field(:middle_name)\n result << f.text_field(:last_name)\n result << f.text_field(:name_suffix)\n end\n end\n end", "def eob_subscriber_sidebar(claim)\n insured = claim.subscriber\n str = \"<b>Subscriber:</b><br /><b>#{insured.subscriber_name}</b><table>\"\n str += \"<tr><td><b>Relationship:</b></td><td> #{insured.type_patient}</td></tr>\" \n str += \"<tr><td><b>Group:</b></td><td> #{insured.ins_group}</td></tr><tr><td><b>Policy:</b></td><td> #{insured.ins_policy}</td></tr>\" \n str += \"<tr><td><b>Priority:</b></td><td> #{insured.ins_priority}</td></tr>\"\n str += \"<tr><td><b>DOB:</b></td><td> #{insured.subscriber_dob.strftime(\"%m/%d/%Y\") if !insured.subscriber_dob.blank?}</td></tr><tr><td><b>Gender:</b></td><td> #{insured.subscriber_gender}</td></tr></table>\"\n return str.html_safe\n end", "def display_resource(expert)\n \"#{expert.first_name} #{expert.last_name}\"\n end", "def to_html\n return nil if fields.empty?\n output = \"\"\n fields.each do |field|\n output << \"<dt#{label_class} title='#{field.label}'>#{field.label}:</dt>\"\n output << \"<dd#{value_class}>\"\n subs = []\n field.values.each do |subjects|\n buffer = []\n sub_parts = []\n subjects.each do |val|\n if val.is_a?(ModsDisplay::Name::Person)\n buffer << val.name\n else\n buffer << val\n end\n if @config.link and @config.hierarchical_link\n if val.is_a?(ModsDisplay::Name::Person)\n txt = link_to_value(val.name, buffer.join(' '))\n txt << \" (#{val.role})\" if val.role\n sub_parts << txt\n else\n sub_parts << link_to_value(val, buffer.join(' '))\n end\n elsif @config.link\n if val.is_a?(ModsDisplay::Name::Person)\n txt = link_to_value(val.name)\n txt << \" (#{val.role})\" if val.role\n sub_parts << txt\n else\n sub_parts << link_to_value(val.to_s)\n end\n else\n sub_parts << val.to_s\n end\n end\n subs << sub_parts.join(@config.delimiter)\n end\n output << subs.join(\"<br/>\")\n output << \"</dd>\"\n end\n output\n end", "def display_resource(person)\n if person.first_name.blank? || person.last_name.blank?\n \"#{person.email}\"\n else\n \"#{person.first_name} #{person.last_name}\".strip\n end\n end", "def display_patron(selected)\n\tp = Patron.find(selected)\n\tputs \"\\n#{p.name} #{p.email_address}\"\nend", "def show\n find_and_show Person\n end", "def member_name\n # does nothing - just here to satisfy text_field_with_auto_complete (which requires a model property)\n end", "def member_name\n # does nothing - just here to satisfy text_field_with_auto_complete (which requires a model property)\n end", "def subfield_value(field, subfield)\n sub = field.subfields.find {|s| s.code == subfield}\n if sub.nil?\n return nil\n end\n sub.value\nend", "def show\n @member = Member.find(params[:id])\n @title = \"#{@member.last_name} #{@member.given_names}\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "def show_a_profile_with_name_and_more(my_name, my_age, my_gender)\n # TODO: This profile should provide more information based on the\n # person's name, age, and gender\n puts \"<h1>#{my_name}</h1>\"\n puts \"<p>I am a #{my_age}-year-old #{my_gender}.<p>\"\nend", "def whole_name\r\n return \"#{self.firstname} #{self.surname}\"\r\n end", "def show_fields\n self.class.fields.values.select { |field| field.show }\n end", "def show_as(*args, &proc) # :yields: field_def or nil\n @view_control.show_as(*args, &proc)\n end", "def get_field_display_rtpl\n # TODO: revisit when implementing save/display of multiselct values\n # if(isset($this->multiple) && $this->multiple != '')\n # $multiple = $this->multiple;\n # else $multiple = '';\n\n field_string = '{%=' + @model_name + '[:' + @name + '_display]%}'\n field_string\n end", "def fields\n collection(\"profiles/fields\")\n end", "def print_searchable_fields\n puts\n puts 'Searchable fields'\n puts '-----------------'\n @searchable_fields[@object].each { |field| puts field }\n puts '-----------------'\n end", "def show\n \n # grab all the parameters/attributes for this person\n @name = Name.find(params[:id])\n \n # get the geographical_region code for this person, if he/she has no code do nothing: \n if not @name.geographical_region.empty?\n temp = Regioncode.find_by_code @name.geographical_region\n @name.geographical_region = temp.description\n end\n \n # get the department code for this person: \n if not @name.department.empty?\n temp = Regioncode.find_by_code @name.department\n @name.department = temp.description\n end\n \n # get the municipality code for this person: \n if not @name.municipality.empty?\n temp = Regioncode.find_by_code @name.municipality\n @name.municipality = temp.description\n end\n\n # get the administrative_district code for this person: \n if not @name.admin_district.empty?\n temp = Regioncode.find_by_code @name.admin_district\n @name.admin_district = temp.description\n end\n \n # get the communes code for this person: \n if not @name.commune.empty?\n temp = Regioncode.find_by_code @name.commune\n @name.commune = temp.description\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @name }\n end\n \n end", "def show\n set_persona_biometria\n end", "def show\n\t\tputs \"I am #{self}\"\n\t\tputs \"My value is #{@value}(#{@count})\"\n\t\tputs \"My parent is #{@parent.value}\" if @parent != nil\n\t\tputs \"My small child is #{@small_child.value}\" if @small_child != nil\n\t\tputs \"my big child is #{@big_child.value}\" if @big_child != nil\n\t\tputs \"\"\n\t\t@small_child.show if @small_child != nil\n\t\t@big_child.show if @big_child != nil\n\tend", "def show\n @custom_field = CustomField.find(params[:id])\n authorize! :read, @custom_field\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @custom_field }\n end\n end", "def full_name\n self.name + ' ' + self.section\n end", "def detail_member(field, message)\n return message if field == :base\n resource_key = resource_key_for(field)\n [translation_for(resource_key), message].join(' ')\n end", "def display_contacts\n Contact.each do |contacts|\n print \"First name: #{contacts.first_name}, Last name: #{contacts.last_name}, Email address: #{contacts.email}, Notes: #{contacts.note}\"\n end\n\n # HINT: Make use of this method in the display_all_contacts and search_by_attribute methods to keep your code DRY\n end", "def full_title(field = nil)\n field && find_record_value(field) || super()\n end", "def rdfs_sub_property_of\n end", "def set_subfields\n subfield = Struct.new(:code, :text)\n subfield_list = []\n @subfield_info.keys.sort.each { |k|\n code = @subfield_info[k][:code]\n value = @subfield_info[k][:value]\n subfield_list << subfield.new(code,value)\n }\n subfield_list\n end", "def related_identifier_nested\n self[Solrizer.solr_name('related_identifier_nested', :displayable)]\n end", "def participants_list_name\n @browser.text_field(:id=>\"addarea_participants_name\")\n end", "def display_details()\n\t\tputs \"------------------------------\"\n\t\tputs \"User Details\"\n\t\tputs \"#{@first_name} #{@surname} aged '#{@age}'\"\n\t\tputs \"------------------------------\"\n\tend", "def read_only_field(form_name, field_name, html_options)\n \"<span #{attributes(html_options)}>#{instance_variable_get('@' + form_name)[field_name]}</span>\"\n end", "def show\n @child = Child.get(params[:id])\n\n @form_sections = get_form_sections_for_child @child\n\n @page_name = @child[\"name\"]\n\n @aside = 'picture'\n @body_class = 'profile-page'\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @child }\n format.custom(\"image/jpeg\") { send_data(@child.photo, :type => \"image/jpeg\")}\n format.json { render :json => @child.to_json }\n format.pdf do\n pdf_data = PdfGenerator.new.child_photo(@child)\n send_pdf( pdf_data, \"photo.pdf\" )\n end\n end\n end", "def get_field_list_rtpl\n '{%=' + @model_name + '[:' + @name + ']%}'\n end", "def precinctsShowLink\n \"#{firstname} #{lastname}, #{office.name}\"\n end", "def person_full_name\n person_full_name = ''\n person_full_name += self.person_prefix + ' ' if self.person_prefix\n person_full_name += self.person_forenames_inline if self.person_forenames_inline\n person_full_name += ' ' + self.person_surname_inline if self.person_surname_inline\n person_full_name += ', ' + self.person_suffix + ' ' if self.person_suffix\n person_full_name\n end", "def display_name\n entry = JSON.parse(self.entry)\n user = User.find(user_id)\n \"#{user.display_name} #{entry['text']}\"\n end", "def show\n @participants = @activity.participants\n .joins(:person)\n .order(attending: :desc)\n .order('people.first_name ASC')\n @organizers = @activity.organizers\n .map(&:display_name)\n .sort\n .join(', ')\n @ownparticipant = @activity.participants.includes(:person)\n .find_by('people.id': current_person.id)\n @counts = @activity.state_counts\n @num_participants = @counts.values.sum\n @assignable_subgroups = @activity.subgroups\n .where(is_assignable: true)\n .order(name: :asc)\n .pluck(:name)\n @subgroup_ids = @activity.subgroups\n .order(name: :asc)\n .pluck(:name, :id)\n @subgroup_ids.prepend([I18n.t('activities.subgroups.filter_nofilter'), 'all'])\n @subgroup_ids.append([I18n.t('activities.subgroups.filter_nogroup'), 'withoutgroup'])\n end", "def display_character_blah\n \n puts \"Name: #{name}\"\n puts \"Bio: #{description}\"\n end", "def show\n @person = User.friendly.find(params[:id])\n add_breadcrumb @person.nickname, cooperative.person_path(@person)\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render :json => @person }\n end\n end", "def show\n @subcriterion = Subcriterion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subcriterion }\n end\n end" ]
[ "0.6345041", "0.5971252", "0.5925871", "0.57882094", "0.57867664", "0.56752175", "0.56466365", "0.564341", "0.56142503", "0.5609505", "0.55953133", "0.55819607", "0.5578387", "0.55635995", "0.5549511", "0.54991406", "0.54991406", "0.54991406", "0.54991406", "0.5495332", "0.5494961", "0.5494917", "0.54751813", "0.5457137", "0.5454295", "0.5418545", "0.54157573", "0.5390109", "0.5380915", "0.5380531", "0.53777534", "0.5367752", "0.5367113", "0.53656167", "0.5361626", "0.5352803", "0.53514016", "0.5345918", "0.5340243", "0.53223556", "0.5315701", "0.53114533", "0.53044176", "0.5302006", "0.5300422", "0.529237", "0.52886814", "0.5284922", "0.5281673", "0.5274402", "0.5263702", "0.526206", "0.5260698", "0.5260698", "0.52519125", "0.5249784", "0.52489936", "0.524746", "0.523352", "0.5224515", "0.52234405", "0.52136844", "0.521184", "0.52063113", "0.51884764", "0.5186757", "0.5183211", "0.5183211", "0.51787513", "0.516627", "0.5162182", "0.5161884", "0.5161504", "0.51535183", "0.5144952", "0.5139584", "0.5136718", "0.5131628", "0.5130103", "0.51260394", "0.5123945", "0.51183724", "0.5111056", "0.5106797", "0.5106159", "0.5098889", "0.5092283", "0.50886005", "0.5086864", "0.50861496", "0.50615776", "0.5058233", "0.5051732", "0.5048665", "0.5048642", "0.50467974", "0.5038845", "0.5037597", "0.50369304", "0.50366175" ]
0.7020725
0
show a field if it is not empty
def show_field( name, val, indent ) return if val.nil? return if val.respond_to?( :empty? ) && val.empty? puts "#{indent}#{name} => #{val}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty?()\n fields.empty?\n end", "def empty?\n @fields.empty?\n end", "def empty?\n\t\treturn self.fields.empty?\n\tend", "def empty?\n @fields.values.empty?\n end", "def field?\n false \n end", "def blank?\n true\n end", "def text_field?(field_name); end", "def blank?\n true\n end", "def field?\n true \n end", "def blank?\n true\n end", "def blank?\n true\n end", "def blank?\n true\n end", "def draw?\n @fields.index(' ') == nil\n end", "def blank?\n empty?\n end", "def blank?\n false\n end", "def blank?\n empty?\n end", "def blank?\n false\n end", "def blank?\n false\n end", "def blank?\n false\n end", "def blank?\n false\n end", "def blank?\n false\n end", "def blank?\n self.value.blank? || self.deleted?\n end", "def display_field\n current_field_values_with_field_type_id(field_types.first.id).first.try(:value) || 'no display field available'\n end", "def field_required(member, template)\n member ? \"\\n\" + '%span.error This field is required' : ''\n end", "def empty?\n\t\treturn @form.empty?\n\tend", "def is_none_fields\n\t\tunless self.designation!=\"none\" && self.department!=\"none\"\n\t\t\tself.errors[:none] << \"=> You can't create none role\"\n\t\tend\n\tend", "def render_value(value, field:, **opt)\n if present? && object.field_names.include?(field)\n object[field] || EMPTY_VALUE\n end || super\n end", "def field_supplied( field )\n return false if field.blank?\n return false if BLANK_PLACEHOLDERS.include?( field )\n return true\n end", "def display(attr)\n attr unless attr.nil?\n end", "def immediate?; @unbound_fields.empty?; end", "def blank?\n self.strip.empty?\n end", "def empty?\n name.blank?\n end", "def show_field?(name)\n show_fields.key?(name)\n end", "def fields?; @fields; end", "def should_render_show_field? document, field_config\n should_render_field?(field_config, document) && document_has_value?(document, field_config)\n end", "def partial?; @unbound_fields.any?; end", "def is_blank_space?\n get_type == :empty\n end", "def blank?\n value.blank?\n end", "def hidden_field?(field_name); end", "def ft_field_display\n blacklight_config.search_fields[blacklight_config.full_text_index].include_in_simple_select = true\n blacklight_config.search_fields[blacklight_config.full_text_index].if = true\n end", "def show_field(model, field, label = nil)\n label ||= field.to_s.titlecase\n show_value(model.send(field), label)\n end", "def blank?\n self.nil? || self.empty?\n end", "def display_name\n first_name.blank? || last_name.blank? ? email : first_name + \" \" + last_name\n end", "def can_show? str\n \treturn not(str.nil? || str === \"\")\n end", "def blank?\n length == 0\n end", "def blank?\n self.strip.length === 0\n end", "def empty_row?\n @row.fields.compact.empty?\n end", "def is_empty()\n \n end", "def field_has_data(title, field, pregnant)\n\t\tif field_data_is_true(field) && title_should_be_shown(title, pregnant)\n\t\t\t\n\t\t\tif title == \"pregnant\" && !pregnant || title == \"pregnant_due_date\" && !pregnant\n\t\t\t\treturn false\n\t\t\tend\n\n\t\t\ttrue\t\t\t\n\t\tend\n\tend", "def empty?\n city.blank? && user.blank? && name.blank? && from_date.blank? && to_date.blank?\n end", "def given?(field)\n !field.empty?\nend", "def full_title(field = nil)\n field && find_record_value(field) || super()\n end", "def displayed_name\n first_name.present? || last_name.present? ? \"#{last_name}#{first_name.blank? ? '' : ', ' + first_name}\" : 'NAME NOT PROVIDED'\n end", "def skip_blanks?() @skip_blanks end", "def field_empty_afterward?(*args)\n Log.debug(\"[GRIDIUM::Element] Checking the field after sending #{args}, to see if it's empty\")\n check_again = has_characters?(*args) && no_symbols?(*args)\n field_is_empty_but_should_not_be = check_again && field_empty?\n if field_is_empty_but_should_not_be\n raise \"Browser Error: tried to input #{args} but found an empty string afterward: #{value}\"\n end\n end", "def show_user_field?(field)\n return true unless @setup or current_user.blank?\n return true if @setup and current_user.required_profile_elements.include?(field)\n return false\n end", "def dl_value(value)\n value.blank? || value.size == 0 ? '&nbsp;'.html_safe : value\n end", "def effectively_empty( value )\n value.nil? || value.to_s.empty?\n end", "def attribute_empty?(apicall, field)\n if (apicall[field.to_sym].nil? || apicall[field.to_sym].length < 1)\n return true\n else\n return false\n end\n end", "def blur\n # Only place a check mark if a if :confirm_empty_fields option is present and false and\n # if the length of the field data is non-zero. The use of try here is to prevent spurious\n # errors from cropping up on the client side.\n if @options[:confirm_empty_fields] != false\n model_inst.mark_field!(@field_name) unless attrs.value.nil? || attrs.value.try(:strip).try(:length) == 0\n end\n end", "def field_error(obj, field)\n if obj.errors[field].any?\n content_tag :div,\n obj.errors.messages[field].first,\n class: 'form-error-message'\n end\n end", "def empty?(row)\n row.fields.reject(&:nil?).empty?\n end", "def required_field\n\t\tcontent_tag :span, \"**\", class: \"required_field\"\n\tend", "def required_field\n\t\tcontent_tag :span, \"**\", class: \"required_field\"\n\tend", "def get_text(value, id, field, *args)\n opt = args.extract_options!\n value = value.to_s\n if value.eql?(\"\")\n msg = \"#{field} doit ne doit pas etre nul\"\n if (opt[:if_null].eql?(:error)) # generate an error if value == ''\n add_invalid(msg, id)\n nil\n elsif (opt[:if_null].eql?(:warning)) # generate an invalid if value == ''\n add_warning(msg, id)\n nil\n end\n end\n value\n end", "def empty?\n @text.empty?\n end", "def show_val(value,\n str_if_empty='____',\n value_style='form_data',\n prefix='',\n suffix='',\n prefix_style='field_label')\n value_style = 'form_data' if value_style.blank?\n isblank = value.blank?\n if isblank && str_if_empty=='suppress'\n return ''\n end\n value = str_if_empty if isblank\n s = ''\n s << \"<span class='#{prefix_style}'>\" + prefix + \"</span>\" unless prefix.blank?\n s << \"<span class='#{value_style}'>#{value}</span>\"\n if (!isblank) && (!suffix.blank?) && (suffix != value.to_s[-1,1])\n s << suffix\t#\tAppend suffix if it not already the last character in the string (e.g., avoids double periods)\n end\n return s.html_safe\n end", "def _blank?(value)\n value.nil? || value == ''\n end", "def blank?\n @value == nil\n end", "def blank?\n self.strip.size == 0\n end", "def required_field_helper( model, element, html )\n if model && ! model.errors.empty? && element.is_required\n return content_tag( :div, html, :class => 'fieldWithErrors' )\n else\n return html\n end\n end", "def is_blank? item\n\titem.nil? || item.gsub(/\\s+/, \"\").empty?\nend", "def has_field?(field_name); end", "def blank?\n nil? || (respond_to?(:empty?) && empty?)\n end", "def blank?\n nil? || (respond_to?(:empty?) && empty?)\n end", "def blank?\n nil? || (respond_to?(:empty?) && empty?)\n end", "def blank?\r\n nil? || (respond_to?(:empty?) && empty?)\r\n end", "def blank?\n to_s.blank?\n end", "def blank?(value)\n value.nil? || value.to_s.empty?\n end", "def format_text(text, empty=\"Unknown\")\n text.blank? ? empty : text\n end", "def field?(name)\n ! self[name].nil?\n end", "def display_name?\n !display_name.to_s.empty?\n end", "def blank?\n @address_line1.blank? && @town.blank? && @postcode.blank?\n end", "def is_empty?\n end", "def field? name\n !!self.fields[name]\n end", "def check_solr_field(field=nil)\n if field.nil? \n return \"\"\n elsif field.is_a?(Array)\n return field.join(\" | \")\n elsif field.is_a?(String)\n return field.strip\n else\n return \"\" \n end\n end", "def display_name\n if !self.first_name.blank?\n self.first_name\n elsif !self.name.blank?\n self.name\n elsif !self.provider_username.blank?\n self.provider_username\n else\n self.email\n end\n end", "def any_present?\n if name.blank? and phone.blank? and license_plate.blank?\n errors.add :base, \"You must fill in at least one field\"\n end\n end", "def crushyfield_required; \"<span class='crushyfield-required'> *</span>\"; end", "def blank?\n strip.empty?\n end", "def blank?\n respond_to?(:empty?) ? empty? : !self\n end", "def check_blank_patient_name(value)\n value.upcase.eql?('NONE') ? '' : value\n end", "def simple_fields\n fields.select(&:filterable?)\n end", "def null?(field_info, field)\n field_info[\"notnull\"] == 1 && self.send(field).blank?\n end", "def blank?(object)\n object.to_s.sub(/\\s+/, '') == ''\n end", "def display_name\n self.name.blank? ? self.email : self.name\n end", "def add_show_field(*) super end", "def empty?\n @name.empty?\n end", "def blank?\n respond_to?(:empty?) ? !!empty? : !self\n end", "def js_value_settle\n %Q{\n if ($('#{dom_id(:operator)}').value=='blank') {\n $('#{dom_id(:value_div)}').hide();\n }\n else {\n $('#{dom_id(:value_div)}').show();\n }\n }\n end" ]
[ "0.6946621", "0.69020337", "0.6788965", "0.65098995", "0.6470843", "0.6434844", "0.6415562", "0.6391451", "0.6364682", "0.631447", "0.631447", "0.631447", "0.6312858", "0.6284911", "0.6277242", "0.6248132", "0.62451744", "0.62451744", "0.62451744", "0.6243429", "0.6243429", "0.61820287", "0.61625755", "0.6150826", "0.6145908", "0.61094266", "0.61049724", "0.61017144", "0.60929304", "0.60898924", "0.60790175", "0.60466754", "0.60400903", "0.6026801", "0.6024314", "0.6018378", "0.60114324", "0.5999776", "0.5980262", "0.5965913", "0.5964182", "0.5950054", "0.59470266", "0.593998", "0.5929196", "0.5927256", "0.59138906", "0.59119546", "0.5906642", "0.5905708", "0.58982766", "0.58867705", "0.5873879", "0.5869465", "0.5862421", "0.5858071", "0.5855826", "0.5846113", "0.5841758", "0.5837847", "0.5834482", "0.5819986", "0.5805985", "0.5805985", "0.58052766", "0.5803583", "0.57894963", "0.57788956", "0.5774938", "0.5767279", "0.5767246", "0.5767025", "0.57476366", "0.5723681", "0.5723681", "0.57230014", "0.5721749", "0.57165235", "0.5707508", "0.5705466", "0.5699657", "0.5694786", "0.5693085", "0.56791794", "0.5673792", "0.56674975", "0.5665285", "0.5661943", "0.56607634", "0.56583834", "0.5652235", "0.5651704", "0.5648898", "0.56483006", "0.563252", "0.56222445", "0.56203175", "0.5612914", "0.5605979", "0.55987996" ]
0.7372356
0
upload the specified file to the specified work on behalf of the specified user
def upload_file( user, work, filename, title, visibility ) print "uploading #{filename}... " fileset = ::FileSet.new fileset.title << title unless title.nil? file_actor = ::CurationConcerns::Actors::FileSetActor.new( fileset, user ) file_actor.create_metadata( work ) file_actor.create_content( File.open( filename ) ) fileset.visibility = visibility fileset.save! puts "done" return fileset end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upload(file, someone)\n end", "def file_upload(params_userfile)\n content_upload(params_userfile.read)\n end", "def creator_upload(username, file_name, file)\r\n dir = \"creators/#{username}\"\r\n file.original_filename = file_name + (File.extname file.original_filename)\r\n return write(dir, file)\r\n end", "def upload(obj, file_path)\n begin\n res = scribd_user.upload(:file => escape(file_path), :access => access_level)\n obj.update_attributes({:ipaper_id => res.doc_id, :ipaper_access_key => res.access_key})\n rescue\n raise ScribdFuUploadError, \"Sorry, but #{obj.class} ##{obj.id} could not be uploaded to Scribd. \"\n end\n end", "def upload_file\n #TODO\n end", "def upload\r\n \r\n end", "def upload(upload_to = nil)\n upload_task(upload_to).invoke\n end", "def upload(remote_path, contents)\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 upload_file(upload, user, client_name)\n if upload != nil\n if user.link_picture != nil\n File.delete('public/images/' << user.link_picture)\n end\n name = upload['img'].original_filename\n directory = 'public/images/' + client_name + '/users/' + user.username\n path = File.join(directory, name)\n File.open(path, 'wb') { |f| f.write(upload['img'].read) }\n path_img = client_name + '/users/' + user.username + '/' + name\n User.where(:id => user.id).update_all(link_picture: path_img)\n end\n end", "def upload_file(file_upload, owner)\n image = MiniMagick::Image.open(file_upload.tempfile.path)\n image.resize \"500x500>\"\n image.format \"jpeg\"\n\n tempfile = Tempfile.new \"item_picture\"\n image.write(tempfile)\n\n owner = \"#{current_user.id}/#{owner}\"\n\n upload = Upload.find_by(owner: owner) || Upload.new(owner: owner)\n\n upload.mime_type = \"image/jpeg\"\n upload.extension = \".jpeg\"\n upload.body = tempfile.read\n\n if upload.save\n StoreUploadToCloudJob.perform_later upload\n\n upload\n end\n end", "def upload(command)\n fname = command[1]\n\n #If the user didn't specify the file name, just use the name of the file on disk\n if command[2]\n new_name = command[2]\n else\n new_name = File.basename(fname)\n end\n\n if fname && !fname.empty? && File.exists?(fname) && (File.ftype(fname) == 'file') && File.stat(fname).readable?\n pp @client.files.upload(new_name, WriteConflictPolicy.overwrite, open(fname))\n else\n puts \"couldn't find the file #{ fname }\"\n end\n end", "def upload\n end", "def upload\n end", "def upload_zip_file\n @assignment = Assignment.find(params[:id])\n if ((@assignment.facebook_user.id == @fb_user.id) or (@assignment.is_author? @fb_user))\n @upload_url = ActionController::Base.asset_host + \"/assignments/upload/\"\n else\n flash[:alert] = \"You do not have permissions to upload a zip file to that assignment.\"\n redirect_to @assignment\n end\n end", "def upload\n uploaded_io = params[:user][:photo_data]\n filename = uploaded_io.original_filename\n\n filepath = Rails.root.join( 'public', \n 'uploads', \n filename )\n\n # Note that this will create a new file \"filename\" but it\n # can NOT create a new folder, so you must already\n # have a folder of that name \"public/uploads\" available.\n\n File.open(filepath, 'wb') do |file|\n # Note that we're using the `read` method\n file.write(uploaded_io.read)\n end\n end", "def execute(msg, url, filename)\n return if Variables::Constants::IGNORED_USERS.include?(msg.user.nick)\n authedusers = Variables::NonConstants.get_authenticated_users\n if authedusers.include?(msg.user.authname)\n butt = LittleHelper.init_wiki\n upload = butt.upload(url, filename)\n if upload\n msg.reply('Uploaded the file to the wiki!'.freeze)\n else\n msg.reply(\"Possibly failed! Error warning: #{upload}\")\n end\n else\n msg.reply(Variables::Constants::LOGGED_IN)\n end\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 upload_simple\r\n \r\n end", "def upload\n self._create params[:upfile], params[:pictitle]\n end", "def upload(bucket, file); end", "def upload\n\n current_user_id = params[:current_user_id]\n print current_user_id\n filename = params[:Filename]\n print filename\n filedata = params[:Filedata]\n print filedata\n galleryname = params[:gallery_name]\n print galleryname\n\n # Construct the gallery if necessary\n gallery = Gallery.find_by_title(galleryname)\n if gallery.nil?\n gallery = Gallery.new\n gallery.title = galleryname\n gallery.person_id = current_user_id\n gallery.save\n end\n \n picture = Picture.new\n picture.picture_file_name = filename\n picture.picture_file_data = filedata\n picture.title = \"\"\n picture.person_id = current_user_id\n picture.gallery_id = gallery.id\n picture.save\n \n end", "def create_uploaded_file\n Hyrax::UploadedFile.create(user: @user, file: local_file)\n end", "def perform\n upload_file\n end", "def create(work)\n super\n file_upload_initial\n update_work(aasm.current_state)\n @uploaded_file = service.upload_file_content\n @handled_uploaded_files = handle_uploaded_file(@uploaded_file)\n @handled_uploaded_files ? file_upload_succeeded : file_upload_failed\n rescue StandardError => e\n file_upload_failed\n log(\"failed during file upload: #{e.message} : #{e.backtrace}\")\n end", "def file_upload(*paths); net_scp_transfer!(:upload, false, *paths); end", "def attach_file_to_work(work, file_set_params = {})\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n ## move next four statements to update_work_with_file_set\n #copy_visibility(work, file_set) unless assign_visibility?(file_set_params)\n #work.ordered_members << file_set\n #set_representative(work, file_set)\n #set_thumbnail(work, file_set)\n update_work_with_file_set( work, file_set, file_set_params )\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n end\n end", "def attach_to_work( work, file_set_params = {}, uploaded_file_id: nil )\n Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n Deepblue::LoggingHelper.called_from,\n \"work.id=#{work.id}\",\n \"file_set_params=#{file_set_params}\" ]\n acquire_lock_for( work.id ) do\n # Ensure we have an up-to-date copy of the members association, so that we append to the end of the list.\n work.reload unless work.new_record?\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.ordered_members << file_set\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n # Save the work so the association between the work and the file_set is persisted (head_id)\n # NOTE: the work may not be valid, in which case this save doesn't do anything.\n work.save\n Deepblue::UploadHelper.log( class_name: self.class.name,\n event: \"attach_to_work\",\n id: file_set.id,\n uploaded_file_id: uploaded_file_id,\n work_id: work.id,\n work_file_set_count: work.file_set_ids.count )\n Hyrax.config.callback.run(:after_create_fileset, file_set, user)\n end\n rescue Exception => e # rubocop:disable Lint/RescueException\n Rails.logger.error \"#{e.class} work.id=#{work.id} -- #{e.message} at #{e.backtrace[0]}\"\n Deepblue::LoggingHelper.bold_debug [ Deepblue::LoggingHelper.here,\n Deepblue::LoggingHelper.called_from,\n \"ERROR\",\n \"e=#{e.class.name}\",\n \"e.message=#{e.message}\",\n \"e.backtrace:\" ] +\n e.backtrace\n Deepblue::UploadHelper.log( class_name: self.class.name,\n event: \"attach_to_work\",\n event_note: \"failed\",\n id: work.id,\n uploaded_file_id: uploaded_file_id,\n work_id: work.id,\n exception: e.to_s,\n backtrace0: e.backtrace[0] )\n end", "def do_upload(f_path, r_path)\n with_exp_backoff(LokaliseRails.max_retries_export) do\n api_client.upload_file project_id_with_branch, opts(f_path, r_path)\n end\n end", "def upload(from, to)\n end", "def upload_media_file( wikipath, filename, raw )\n p filename\n headers = {\n 'Content-Type' => 'application/octet-stream',\n 'X-File-Name' => filename\n }\n url = upload_url( wikipath, filename )\n p url\n wait_second\n pp @agent.post( url, raw, headers )\n save_uploaded( filename )\n end", "def remote_file(task)\n target_roles = task.delete(:roles)\n override = task.delete(:override)\n\n UploadTask.define_task(task) do |t|\n prerequisite_file = t.prerequisites.first\n file = shared_path.join(t.name).to_s.shellescape\n\n on roles(target_roles) do\n if override || !test(\"[ -f #{file} ]\")\n info \"Uploading #{prerequisite_file} to #{file}\"\n upload! File.open(prerequisite_file), file\n end\n end\n\n end\n end", "def get\n # first find the upload within own uploads\n upload = current_user.uploads.find_by_id(params[:id])\n \n #if not found in own uploads, check if the current_user has share access to the parent folder of the file\n upload ||= Upload.find(params[:id]) if current_user.has_share_access?(Upload.find_by_id(params[:id]).folder)\n \n if upload\n send_file upload.uploaded_file.path, :type => upload.uploaded_file_content_type\n else\n flash[:error] = \"You have no permissions to access this area!!\"\n redirect_to uploads_path\n end\n \n end", "def upload(path, options)\n args = sign(auth(options))\n args['photo'] = File.new(path)\n Photo.new(element(@agent.post(UPLOAD, args).body, 'photoid'))\n end", "def upload(video, user)\r\n self.connect(user) unless user.token?\r\n uri = URI(HOST + 'feeds/api/users/default/uploads')\r\n post = Net::HTTP::Post.new uri.path\r\n post.body_stream, post.content_type = Multipart::Post.prepare_query(\"atom\" => video.atom, \"Video\" => video.file)\r\n post.add_field('Slug', video.name)\r\n post.content_type = \"multipart/related;\"\r\n post.\r\n post.body video.atom\r\n post.\r\n _http_post(uri, post, user)\r\n end", "def upload\n secure_silence_logs do\n return bad_request unless params[:file] && params[:title] && current_account\n is_file = params[:file].respond_to?(:path)\n if !is_file && !(URI.parse(params[:file]) rescue nil)\n return bad_request(:error => \"The 'file' parameter must be the contents of a file or a URL.\")\n end\n \n if params[:file_hash] && Document.accessible(current_account, current_organization).exists?(:file_hash=>params[:file_hash])\n return conflict(:error => \"This file is a duplicate of an existing one you have access to.\")\n end\n params[:url] = params[:file] unless is_file\n @response = Document.upload(params, current_account, current_organization).canonical\n render_cross_origin_json\n end\n end", "def upload file, data={}\n @flickr.upload_photo file, data\n end", "def upload_file(job, pathname)\n if job.respond_to?(:upload)\n # With Rocket Job Pro the file can be uploaded directly into the Job itself\n job.upload(pathname.to_s)\n archive_directory ? archive_file(job, pathname) : pathname.unlink\n else\n upload_default(job, pathname)\n end\n end", "def set_upload\n @upload = current_user.uploads.find(params[:id])\n end", "def upload_file local_source, remote_dest, options = {}\n add [local_source, remote_dest], check_file(remote_dest)\n chmod options[:perms], remote_dest if options[:perms]\n chown options[:owner], remote_dest if options[:owner]\n end", "def upload_local(path, **opt)\n File.open(path) do |io|\n file_attacher.attach(io, **opt)\n end\n rescue => error\n __output \"!!! #{__method__}: #{error.class}: #{error.message}\"\n raise error\n end", "def run_task(_task, _args)\n invoke(\"#{name}:upload\")\n end", "def attach_to_work(work, file_set_params = {})\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"work.id=#{work.id}\",\n \"file_set_params=#{file_set_params}\",\n \"\" ] if file_set_ordered_ordered_members_actor_debug_verbose\n file_set.visibility = work.visibility unless assign_visibility?(file_set_params)\n work.representative = file_set if work.representative_id.blank?\n work.thumbnail = file_set if work.thumbnail_id.blank?\n end", "def upload\n uploaded_io = params[:address][:file]\n File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|\n file.write(uploaded_io.read)\n end\nend", "def attach_file_to_work(work, file_set, file_set_params)\n acquire_lock_for(work.id) do\n # Ensure we have an up-to-date copy of the members association, so\n # that we append to the end of the list.\n work.reload unless work.new_record?\n unless assign_visibility?(file_set_params)\n copy_visibility(work, file_set)\n end\n work.ordered_members << file_set\n set_representative(work, file_set)\n set_thumbnail(work, file_set)\n\n # Save the work so the association between the work and the file_set is persisted (head_id)\n work.save\n end\n end", "def upload(params)\n self.class.post('/files.upload', body: params.merge({token: @token})).tap do |response|\n raise \"error uploading file: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end\n end", "def userfile_params\n params.require(:userfile).permit(:filename, :user_id, :mycontact_id, :meeting_id, :references)\n end", "def upload_shipped\n end", "def upload_user_bikes\n end", "def upload(local, remote, mode = 0o644)\n file.open(remote, 'w', mode) { |io| io.upload(local) }\n end", "def upload(id, path)\n path = Pathname.new(path) unless path.kind_of? Pathname\n\n mime = MIME::Types.type_for(path.to_s)[0] || MIME::Types[\"application/octet-stream\"][0]\n uri = endPoint(\"/#{id}\")\n request = Net::HTTP::Post.new(uri)\n ret = nil\n\n path.open do |io|\n request.body_stream = io\n set_def_headers(request)\n request.content_length = path.size\n request.content_type = mime.simplified\n ret = workit(request)\n end\n ret\n end", "def upload_file(server_or_workers, local_file, remote_file)\n case server_or_workers\n when :server\n raise 'Server node is nil' unless @os_aws.server\n\n return @os_aws.server.upload_file(local_file, remote_file)\n when :worker\n raise 'Worker list is empty' if @os_aws.workers.empty?\n\n return @os_aws.workers.each { |w| w.upload_file(local_file, remote_file) }\n end\n end", "def files_upload(params = {})\n response = @session.do_post \"#{SCOPE}.upload\", params\n Slack.parse_response(response)\n end", "def upload\n @project = current_user.projects.find(params[:id])\n\n uploaded_io = params[:file]\n if uploaded_io == nil \n render 'show', :alert => \"File fails to upload\"\n end \n\n file_name = Time.now.to_i.to_s + \"_\" + uploaded_io.original_filename # Attach the timestamp to avoid overwriting old files\n file_path = Rails.public_path + \"/uploads/\" + file_name\n File.open(file_path, 'wb') do |file|\n file.write(uploaded_io.read)\n end \n\n @project_file = ProjectFile.new( :file_name => file_name, \n :file_path => file_path, \n :user_id => params[:user_id], \n :project_id => params[:project_id],\n :original_file_name => uploaded_io.original_filename)\n\n if @project_file.save\n record_activity(\"uploaded \" + file_name)\n redirect_to :back, :notice => \"File uploaded successfully\"\n else\n record_activity(\"upload failed \" + file_name)\n render 'show', :alert => \"File info is failed to save\"\n end \n end", "def upload from_path, to_path, options={}, &block\n to_path = \"#{@host}:#{to_path}\"\n Sunshine.logger.info @host, \"Uploading #{from_path} -> #{to_path}\" do\n execute rsync_cmd(from_path, to_path, options), &block\n end\n end", "def upload\n endpoint = \"#{task.endpoint}\"\n\n response = task.oauth_consumer.request(:post, endpoint, vimeo.get_access_token, {}, {}) do |req|\n req.set_content_type(\"multipart/form-data\", { \"boundary\" => MULTIPART_BOUNDARY })\n\n io = StringIO.new(data)\n io.instance_variable_set :\"@original_filename\", task.filename\n def io.original_filename; @original_filename; end\n def io.content_type; \"application/octet-stream\"; end\n\n parts = []\n parts << Parts::ParamPart.new(MULTIPART_BOUNDARY, \"ticket_id\", task.id)\n parts << Parts::ParamPart.new(MULTIPART_BOUNDARY, \"chunk_id\", index)\n parts << Parts::FilePart.new(MULTIPART_BOUNDARY, \"file_data\", io)\n parts << Parts::EpiloguePart.new(MULTIPART_BOUNDARY)\n\n ios = parts.map{|p| p.to_io }\n req.content_length = parts.inject(0) {|sum,i| sum + i.length }\n req.body_stream = CompositeReadIO.new(*ios)\n\n :continue\n end\n\n # free memory (for big file uploads)\n @data = nil\n\n @id = response.body\n end", "def upload(path, options={})\n if options[:description]\n options['text'] = options[:description]\n options.delete(:description)\n end\n\n if options[:target]\n options['filename'] = options[:target]\n options.delete(:target)\n end\n\n if options[:summary]\n options['text'] ||= options[:summary]\n options['comment'] = options[:summary]\n options.delete(:summary)\n end\n\n options['comment'] ||= \"Uploaded by MediaWiki::Gateway\"\n options['file'] = File.new(path) if path\n full_name = path || options['url']\n options['filename'] ||= File.basename(full_name) if full_name\n\n raise ArgumentError.new(\n \"One of the 'file', 'url' or 'sessionkey' options must be specified!\"\n ) unless options['file'] || options['url'] || options['sessionkey']\n\n form_data = options.merge(\n 'action' => 'upload',\n 'token' => get_token('edit', options['filename'])\n )\n\n make_api_request(form_data)\n end", "def file_upload\n redirect_to wip_path()\n # TODO file_upload_wip\n end", "def upload_request_file(pos, user)\n\t\tfile_contents = generate_pull_file_contents(pos, user)\n\t\tfile_path = gen_file\n\t\tlogger.info \"Pull request file: #{file_path}\"\n\t\tPullRequest.transaction do\n\t\t\tlogger.info \"File should contain #{file_contents.size} POs\"\n\t\t\tif file_contents.size > 0\n\t\t\t\tFile.write(file_path, file_contents.join(\"\\n\"))\n\t\t\t\tlogger.info \"#{file_path} created\"\n\t\t\tend\n\t\t\t@pr = PullRequest.new(filename: file_path, file_contents: (file_contents.size > 0 ? file_contents.join(\"\\n\") : ''), requester: User.current_user_object)\n\t\t\tpos.each do |p|\n\t\t\t\[email protected]_object_pull_requests << PhysicalObjectPullRequest.new(physical_object_id: p.id, pull_request_id: @pr.id)\n\t\t\tend\n\t\t\tif file_contents.size > 0\n\t\t\t\tsuccess = scp(file_path)\n\t\t\tend\n\t\t\[email protected]!\n\t\t\t@pr\n\t\tend\n\tend", "def upload\n uploaded_io = params[:file]\n File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|\n file.write(uploaded_io.original_filename) \n end\n end", "def upload_picture\n \n # Pass through the specified user, making sure that it exists\n @user = User.find_by_login(params[:user_login])\n \n # Check that the current user is the specified user, or an\n # administrator\n unless @user == current_user or admin_logged_in?\n flash[:error] = 'You cannot upload a profile picture for another user.'\n redirect_to :controller => 'sessions', :action => 'new'\n else\n render :layout => 'dialog'\n end\n end", "def upload!(_local, _remote, _options = {}) raise MethodUnavailableError end", "def upload(params)\n self.class.post('/files.upload', body: params.merge({token: @token})).tap do |response|\n raise \"error uploading file: #{response.fetch('error', 'unknown error')}\" unless response['ok']\n end\n end", "def set_user_file\n @user_file = @folder.files.find(params[:id])\n end", "def upload(*files)\n ogfiles = files\n files = files.flatten\n raise OwO::Err::NoContent, 'There is a empty string in your arguments!' if files.include? ''\n raise OwO::Err::NoContent, 'Theres no files provided!' if files.empty?\n files = files.map do |x|\n return x if x.respond_to? :read\n begin\n File.new(File.absolute_path(x), 'rb')\n rescue Errno::ENOENT, Errno::EACCES, Errno::ENAMETOOLONG => e\n errstring = 'Unknown'\n case e.class.name\n when 'Errno::ENOENT'\n errstring = 'File Not Found'\n when 'Errno::EACCES'\n errstring = 'Permission Denied'\n when 'Errno::ENAMETOOLONG'\n errstring = 'Name Too Long'\n end\n raise OwO::Err::FileError, \"Error initializing file '${x}' | #{errstring} | #{e.class.name}\"\n end\n end\n result = OwO::API.upload(opts, files)['files'].map { |x| \"https://#{@url}/#{x['url']}\" }\n result[0] if ogfiles.length == 1 || !ogfiles.first.is_a?(Array)\n end", "def upload(path, write_conflict_policy, in2, opts = {})\n input_json = {\n path: path,\n write_conflict_policy: write_conflict_policy,\n }\n response = @session.do_content_endpoint(\"/#{ @namespace }/upload\", input_json, in2)\n file, metadata = Dropbox::API::HTTP.parse_content_response(response)\n return Dropbox::API::File.from_json(metadata)\n end", "def upload(ticket, file_path, response_url='www.divshare.com/upload_result') \n location = nil\n File.open(file_path, 'r') { |file|\n uri = URI.parse(UPLOAD_URL)\n http = Net::HTTP.new(uri.host, uri.port)\n # API methods can be SLOW. Timeout interval should be long.\n http.read_timeout = 15*60\n request = Net::HTTP::Post.new(UPLOAD_PATH)\n fields = Hash.new\n fields['upload_ticket'] = ticket\n # API doesn't allow blank response_url. This is just filler.\n fields['response_url'] = response_url\n\n fields['file1'] = file\n request.multipart_params = fields\n # Until DivShare supports direct upload API, we deal with its response location field\n location = http.request(request)['location']\n }\n \n # if error, throw, otherwise return file ID for caller to do whatever they like\n resp = {}\n location.split('?')[1].split('&').each { |param| \n k, v = param.split('=', 2) # some params could contain two '=' for some reason\n resp[k]=CGI.unescape(v)\n }\n if resp['error']\n raise Divshare::APIError, resp['description']\n else\n resp['file1'] # return the file ID\n end\n end", "def upload_file(filename, path, uploaded_io)\n\tstatus = \"File not uploaded properly\"\t\n\tif !File.exists?(path + \"//\" + filename) && File.directory?(path)\n File.open(path + \"//\" + filename, 'w') do |file|\n input = uploaded_io.read\n input.force_encoding('UTF-8')\n file.write(input)\n end\n Upload.create(:file_name => uploaded_io.original_filename, :status => 'Not Processed', :upload_date => Time.now)\n upload_record = Upload.find_by_file_name(uploaded_io.original_filename)\n upload_record.uploaded_by = current_user.email\n upload_record.save\n\t status = \"File has been uploaded successfully, check the uploaded files to see its processing status.\"\n\telsif File.exists?(path + \"//\" + filename)\n\tstatus = \"Duplicate file found in uploads, file not uploaded\" \n\tend\n\tstatus\n end", "def upload_file(command, remote_path, contents, ssh_username=nil)\n upload_as_user = ssh_username || default_ssh_username\n run_remote_command(\"mkdir -p #{File.dirname(remote_path)}\", upload_as_user)\n Tempfile.open(\"remote_script\") do |file|\n file << contents\n file.flush\n logfile.puts \"uploading #{remote_path} to Inception VM\"\n Net::SCP.upload!(host, upload_as_user, file.path, remote_path, ssh: { keys: private_keys })\n end\n true\n rescue StandardError => e\n logfile.puts \"ERROR running upload_file(#{command.class}, '#{remote_path}', ...)\"\n logfile.puts e.message\n logfile.puts e.backtrace\n false\n end", "def execute(file)\n check_args!(file)\n\n resolve_uploader.upload(file)\n end", "def upload(file, folder = 0)\n # Requires authorization\n raise PutioError::AuthorizationRequired if authentication_required!\n\n # Make the upload.\n response = make_upload_call('/files/upload?parent_id=%i' % [folder], file)\n\n # Return whatever.\n response.transfer || response.file\n end", "def upload(http_post_url, remote_folder, local_file)\n $log.info \"curl -F file=@#{local_file} -F directory=#{remote_folder} #{http_post_url}\"\n return system(\"curl -F file=@#{local_file} -F directory=#{remote_folder} #{http_post_url}\")\nend", "def create\n parameters = params[:file_submission]\n assignment = Assignment.find(parameters['assignment_id'])\n definition = AssignmentDefinition.find_by_assignment_id(assignment.id)\n file = parameters['file']\n \n user_id = current_user.id\n unless (not parameters['user_id']) or parameters['user_id'] == ''\n user_id = parameters['user_id']\n end\n \n file.original_filename.gsub!(/[^a-z0-9A-Z.]/, '')\n\n user = User.find(user_id)\n \n logger = Logger.new(\"log/uploads.log\")\n\n logger.info \"#{assignment.course.id}\"\n logger.info \"USER ID: #{user_id} CURRENT USER #{current_user.id}\"\n\t if assignment.course.is_user_student(user_id)\n\t user_id = current_user.id if assignment.course.is_user_student(current_user.id)\n logger.info \"#{Time.now}:: #{current_user.friendly_full_name} (ID# #{current_user.id}) has submitted something for user with ID# #{user_id}.\"\n\t\t oldSubmission = FileSubmission.where(:assignment_id => assignment.id,\n\t\t\t\t\t :course_id => assignment.course_id, :user_id => user_id)[0]\n\t\t unless oldSubmission.nil?\n\t\t\t File.delete(oldSubmission.full_save_path)\n\t\t\t oldSubmission.destroy\n\t\t\t logger.info \"#{Time.now}::\\t #{current_user.friendly_full_name} has just overwritten the old submission.\"\n\t\t end\n\t end\n\n @submission = FileSubmission.new(:course_id => assignment.course_id, :assignment_id => assignment.id, :assignment_definition_id => definition.id, :user_id => user_id, :file => file, :name => file.original_filename, :uploaded_by => current_user.id)\n @submission.save\n\n logger.info \"#{Time.now}:: #{current_user.friendly_full_name} stored submission successfully at #{@submission.full_save_path}.\"\n\n course = Course.find(assignment.course_id)\n\n @assignmentFile = user_id == course.user_id\n @studentFile = !StudentInCourse.find_all_by_user_id_and_course_id(user_id, course.id).empty?\n \n\t\t@assignment = assignment\n\t\t\n render '/assignment/create.js' \n end", "def upload_file( wikipath, filename )\n p filename\n raw = File.read( filename )\n return if uploaded?( filename, raw )\n\n case filename\n when /[.]#{EXTENSION}$/\n upload_wiki_file( wikipath, filename )\n else\n upload_media_file( wikipath, filename, raw )\n end\n end", "def multipart_upload\n end", "def upload!(local, remote, options={}, &block)\n upload(local, remote, options, &block).wait\n end", "def upload(opts, files)\n request(\n :post,\n \"#{opts['a']}#{UPLOAD_URL}?key=#{opts['t']}\",\n 'files'.to_sym => files\n )\n end", "def migrate_user url, user\n \n # make sure the url contains file stack\n return unless url.start_with? 'https://cdn.filepicker.io'\n\n open('migrated.jpg', 'wb') do |file|\n \n file << open(url).read\n \n #upload the file to the user\n attachment = ActionDispatch::Http::UploadedFile.new(tempfile: file, filename: \"migrated\", type: \"image/jpg\")\n user.avatar_src = attachment\n user.save!\t\n end\nend", "def upload!(local, remote, options = {}) # rubocop:disable Lint/UnusedMethodArgument\n end", "def post_job_content_sample(client)\n job_multipart = {\n :file => File.new($full_path),\n 'num copies' => 10\n }\n\n response = client['jobs'].post job_multipart\n\n p ''\n p 'Submit a new job'\n p response\nend", "def upload(\n file_path,\n opts = {\n force: true\n }\n )\n @call_params[:file_path] = file_path\n @call_params = @call_params.merge(opts)\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def sudo_upload(file_path, to)\n filename = File.basename(to)\n to_directory = File.dirname(to)\n execute \"mkdir -p /tmp/cap_upload\"\n upload! file_path, \"/tmp/cap_upload/#{filename}\"\n execute \"sudo mv /tmp/cap_upload/#{filename} -f #{to_directory}\"\nend", "def upload\n do_upload(self.class.upload_class)\n end", "def upload_params\n params.require(:upload).permit(:title, :upload, :user_id)\n end", "def upload(file_data)\n\t\t\tkparams = {}\n\t\t\t# The file data\n\t\t\tclient.add_param(kparams, 'fileData', file_data);\n\t\t\tclient.queue_service_action_call('baseentry', 'upload', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def upload_files\n params.each do |k,v|\n logger.debug(\"K: #{k} ,V: #{v}\")\n end\n \n ff = params['ajb'].original_filename\n \n mlh = ''\n ff.each_byte do |b|\n if b < 127\n mlh = mlh + b.chr\n else\n break\n end\n end\n \n qzh = params['qzh']\n dalb = params['dalb']\n \n dh = \"#{qzh}-#{dalb}-#{mlh}-%\"\n \n #delete any document connected to dh\n User.find_by_sql(\"delete from archive where dh like '#{dh}'; \")\n User.find_by_sql(\"delete from document where dh like '#{dh}'; \")\n\n user = User.find_by_sql(\"select * from d_dwdm where id=#{qzh};\")[0]\n dwdm = user.dwdm # find by sql query\n\n v = params['jnb']\n ff = File.new(\"./dady/tmp/#{v.original_filename}\",\"w+\")\n ff.write(v.tempfile.read)\n ff.close\n\n v = params['ajb']\n ff = File.new(\"./dady/tmp/#{v.original_filename}\",\"w+\")\n ff.write(v.tempfile.read)\n ff.close\n \n logger.debug \"ruby ./dady/bin/upload_mulu.rb #{v.original_filename} #{dwdm} #{qzh} #{dalb} &\"\n system (\"ruby ./dady/bin/upload_mulu.rb #{v.original_filename} #{dwdm} #{qzh} #{dalb} &\")\n \n render :text => \"{success:true}\"\n end", "def upload_file(remote, local)\n write_file(remote, ::File.read(local))\n end", "def create_upload_request\n call(:post, upload_path)\n end", "def create\n @user_file = UserFile.new(user_file_params)\n @user_file.user = current_user\n respond_to do |format|\n if @user_file.save\n format.html { redirect_to @user_file, notice: \"User file was successfully created.\" }\n format.json { render :show, status: :created, location: @user_file }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @user_file.errors, status: :unprocessable_entity }\n end\n end\n end", "def upload_file\n file = google_session.upload_from_file(file_params[:file].tempfile,\n file_params[:file].original_filename)\n collection.add(file)\n google_session.root_collection.remove(file)\n render json: 'Upload Successful'\n end", "def upload(project, token)\n\n uri = URI.parse(\"https://pkghub.io/api/v1/upload\")\n n = Net::HTTP.new(uri.host, uri.port)\n n.use_ssl = true\n\n File.open(@path) do |package_file|\n req = Net::HTTP::Post::Multipart.new uri.path,\n \"token\" => token,\n \"project\" => project,\n \"distro\" => @distro,\n \"file\" => UploadIO.new(package_file, \"application/x-deb\", File.basename(@path))\n\n res = n.start do |http|\n http.request(req) \n end\n\n if res.code == \"200\"\n puts \"Success\"\n else\n raise \"Error uploading to pkghub.io API, code: #{res.code} body: #{res.body}\"\n end\n end\n\n end", "def user_params\n params.require(:upload).permit(:file)\n end", "def valkyrie_perform(work)\n work_acl = Hyrax::AccessControlList.new(resource: work)\n\n file_sets_for(work).each do |file_set|\n Hyrax::AccessControlList\n .copy_permissions(source: work_acl, target: file_set)\n end\n end", "def upload(file_data)\n\t\t\tkparams = {}\n\t\t\t# The file data\n\t\t\tclient.add_param(kparams, 'fileData', file_data);\n\t\t\tclient.queue_service_action_call('document', 'upload', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def create\n @user = User.find(params[:user_id])\n @mycontact = Mycontact.find(params[:mycontact_id])\n @meeting = Meeting.find(params[:meeting_id])\n @userfile = @meeting.userfiles.new(userfile_params)\n\n uploadedIo = params[:userfile][:doc]\n @userfile.filename = uploadedIo.original_filename\n meetingId = @meeting.id\n tmpFileName = meetingId.to_s + \"_\" + [uploadedIo.original_filename.split(\".\").first.downcase.parameterize, \".\", uploadedIo.original_filename.split(\".\").last].join()\n @userfile.file_name_slug = tmpFileName\n\n\n fileName = Rails.root.join('public','uploads', tmpFileName)\n File.open(fileName, 'wb') do |file|\n file.write(uploadedIo.read)\n end\n\n respond_to do |format|\n if @userfile.save\n #format.html { redirect_to @userfile, notice: 'Userfile was successfully created.' }\n format.html { redirect_to user_mycontact_meeting_userfiles_path}\n format.json { render action: 'show', status: :created, location: @userfile }\n else\n format.html { render action: 'new' }\n format.json { render json: @userfile.errors, status: :unprocessable_entity }\n end\n end\n end", "def upload(file, schema, mode = 'FULL')\n schema.upload file, self, mode\n end", "def userfile_params\n params.require(:userfile).permit(:filename, :date_created, :owner, :size)\n end", "def test_upload_file\n remote_file_name = 'TestUploadFile.docx'\n\n request_file_content = File.open(File.join(local_test_folder, local_file))\n request = UploadFileRequest.new(file_content: request_file_content, path: remote_data_folder + '/' + remote_file_name)\n\n result = @words_api.upload_file(request)\n assert_equal false, result.nil?\n end", "def create\n @work = Work.new(work_params.merge(depositor: current_user))\n\n respond_to do |format|\n if @work.save\n format.html do\n redirect_to work_version_file_list_path(@work, @work.versions.last),\n notice: 'Work was successfully created.'\n end\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def uploadFolder(folder,foldersync,googlefolder)\n puts \"Feature Pending\"\n #Create the collection\n #uploadFile(file)\nend" ]
[ "0.77202815", "0.6761699", "0.67311305", "0.66025543", "0.6534689", "0.6488298", "0.6375653", "0.63280386", "0.6318654", "0.631007", "0.6294155", "0.6236812", "0.6234402", "0.6234402", "0.6152242", "0.6110015", "0.61081517", "0.61026263", "0.61013734", "0.6051725", "0.60357744", "0.6027245", "0.6006637", "0.59956205", "0.5982238", "0.59702927", "0.59536326", "0.5949824", "0.5948147", "0.5916034", "0.58971274", "0.5879188", "0.58787775", "0.5868848", "0.58590466", "0.5847862", "0.5829539", "0.5821597", "0.58213735", "0.57901883", "0.57719547", "0.57687485", "0.57472444", "0.57337457", "0.5732807", "0.5726015", "0.5718167", "0.5717685", "0.5717113", "0.5711801", "0.5706114", "0.5701302", "0.56970793", "0.5696925", "0.5692314", "0.5692167", "0.56905556", "0.56825745", "0.56704134", "0.5663926", "0.5661677", "0.5658388", "0.56528425", "0.5652702", "0.56379557", "0.56365377", "0.5627848", "0.56271", "0.56112367", "0.561112", "0.56096715", "0.5607033", "0.5606069", "0.5595023", "0.5594635", "0.5594238", "0.5588177", "0.5587158", "0.55789196", "0.55681425", "0.55652696", "0.5560193", "0.55520064", "0.55491996", "0.55491054", "0.5544114", "0.5535428", "0.55328506", "0.55287075", "0.5522069", "0.5516409", "0.5514682", "0.55094755", "0.55086875", "0.55069816", "0.5506641", "0.550597", "0.55001867", "0.5499811", "0.54972106" ]
0.6789401
1
get a list of assets in the specified directory that match the supplied pattern
def get_directory_list( dirname, pattern ) res = [] begin Dir.foreach( dirname ) do |f| if pattern.match( f ) res << f end end rescue => e end return res.sort { |x, y| directory_sort_order( x, y ) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def asset_files\n asset_files = []\n Find.find(assets_path).each do |path|\n next if File.directory?(path)\n next if path.include?(stylesheets_path) || path.include?(images_path)\n asset_files << path.sub(assets_path, 'assets')\n end\n asset_files\n end", "def find_files( directory, pattern='*')\n `find -H '#{directory}' -name \"#{pattern}\"`.split(\"\\n\").reject{|f| f==directory}\n end", "def find_files dir = test_dir\n glob file_pattern(dir)\n end", "def get_local_files regexp\n Dir[File.join(dir, '*')].select do |path|\n name = File.basename path\n File.file?(path) and name =~ regexp\n end\n end", "def asset_paths\n search_path.children.select { |n| Cnfs::Core.asset_names.include?(base_name(n)) }.sort\n end", "def get_file_list(path_pattern)\n return Dir[path_pattern].sort\n end", "def file_list(pattern)\n FileList[pattern].tap do |list|\n list.exclude 'vendor/**/*', # bundler\n 'pkg/**/*', # gem build process\n 'spec/fixtures/**/*' # puppetlabs fixtures\n list.reject! { |f| File.directory? f }\n end\n end", "def files() = files_path.glob('**/*')", "def find(pattern)\n patterns= [pattern].flatten\n contents=[]\n self.each_pair do |path, content|\n patterns.each do |pattern|\n contents << content if Content.path_match? path, pattern\n end\n end\n contents\n end", "def find_files(block)\n files = []\n block.scan(URL_PATTERN).each do |attribute, path|\n if !URI.parse(path).absolute?\n resource = create_resource_file(attribute, path)\n files << resource if resource\n end\n end\n files\n end", "def glob(path, pattern)\n dirlist = []\n @sftp.dir.glob(path, pattern) do |match|\n dirlist << match\n end\n return dirlist\n end", "def retrieve_assets_from(manifest)\n # TODO: Rspec Examples for non-Existed Files\n return [] if @parsed_manifests.include?(manifest) || !FileTest.exist?(manifest)\n @parsed_manifests.push(manifest)\n\n required_assets = []\n directive = Directive.new(asset_type)\n\n Pathname.new(manifest).each_line do |line|\n required_assets.concat(analyze(*directive.parse(line))) if directive.legal_directive?(line)\n end\n\n required_assets.flatten\n end", "def directory_contents(directory)\n return Dir.glob(File.join(directory, '*'))\n end", "def filter_files(pattern)\n regexp=Regexp.new(pattern || '.*')\n @[email protected]([]) do |matches,file| \n file_without_basepath=file[@basepath.length .. -1]\n matches << file if file_without_basepath=~regexp\n matches\n end\n @table.reloadData\n end", "def glob(pattern)\n root = self.root\n Pathname.glob(root.join(pattern)).map do |match|\n match.relative_path_from(root).to_s\n end\n end", "def scan(dir,match=/\\.cha$/)\n files = []\n if not dir.split('/').pop =~ /^\\./ and File.directory?(dir)\n Dir.foreach(dir) do |file|\n path = File.join(dir,file)\n \n if File.directory?(path)\n# puts \"SCANNING #{path}\"\n scan(path,match).each { |pair| files.push pair }\n elsif file =~ match\n files.push path\n end\n end\n end\n\n return files\nend", "def ls(pattern='**/*', _opts={})\n root = pattern[%r{^[^\\*\\?\\{\\}\\[\\]]+/}]\n root.chomp!('/') if root\n Enumerator.new do |y|\n glob(root) do |path|\n y << path if File.fnmatch?(pattern, path, File::FNM_PATHNAME)\n end\n end\n end", "def find_files(dir, pattern, &block)\n require 'find'\n\n Find.find(dir) do |p|\n if p =~ Regexp.compile(pattern)\n yield p\n end\n end\nend", "def ls(pattern='**/*', _opts={})\n Enumerator.new do |y|\n @files.each_key do |key|\n y << key if File.fnmatch?(pattern, key, File::FNM_PATHNAME)\n end\n end\n end", "def ls(pattern = '**/*', **_opts)\n Enumerator.new do |y|\n walk(pattern) do |path, _|\n y << path if File.fnmatch?(pattern, path, File::FNM_PATHNAME)\n end\n end\n end", "def matches(directory, extension)\n matches = []\n Find.find(directory) do |path|\n ext = File.extname(path)\n matches << path if ext && ext.downcase == extension\n end\n matches\n end", "def list\n Dir.glob(\"#{@path}/**/*\").select{|path| File.file?(path) }.map do |path|\n path.sub Regexp.new(\"^#{@path}\\/\"), ''\n end\n end", "def find_files(pattern)\n Dir[File.join(folder, pattern, \"*.#{pattern}\")].sort{|f1, f2|\n File.basename(f1) <=> File.basename(f2)\n }.collect{|f|\n File.join(pattern, File.basename(f))\n }\n end", "def addSrcFilesByRE(re)\n Dir.for_each(@srcDir) { |f|\n next if File.stat(f).dir?\n @files << f if re =~ f\n }\n end", "def files #only wants mp3 files\n Dir.entries(path).select {|entry| entry.include?(\".mp3\")} #select returns an array itself\n end", "def files\n FileUtils.cd(@ruhoh.paths.theme) {\n return Dir[\"**/*\"].select { |filepath|\n next unless self.is_valid_asset?(filepath)\n true\n }\n }\n end", "def files\n Dir.entries(\"#{path}\").select {|song_filename| song_filename.include?(\"mp3\")}\n end", "def find_manifests(directory) # :nodoc: :yield: pathname\n raise ArgumentError.new(\"Illegal path to cartridge repository: '#{directory}'\") unless File.directory?(directory)\n\n # wildcards: cartridges and cartridge versions\n glob = PathUtils.join(directory, '*', '*', 'metadata', 'manifest.yml')\n Dir[glob].each { |e| yield e }\n end", "def get_document_assets( dirname )\n\n files = []\n f = File.join( dirname, TaskHelpers::DOCUMENT_FILES_LIST )\n begin\n File.open( f, 'r').each do |line|\n\n # handle blank and commented lines\n next if line.blank?\n next if line[ 0 ] == '#'\n tokens = line.strip.split( \"|\" )\n files << { :id => tokens[ 0 ], :timestamp => tokens[ 1 ], :title => tokens[ 2 ] }\n end\n rescue Errno::ENOENT\n # do nothing, no files...\n end\n\n return files\n end", "def files\n # list_of_filenames = Dir.entries(path)\n @list_of_filenames = Dir.glob(\"#{@path}/*.mp3\").collect! {|x| x.gsub(\"#{@path}/\", \"\") }\n # binding.pry\n end", "def get_image_paths(directory)\n Dir[\"#{directory}/**/*.jpg\"]\nend", "def path(match, options={})\n return [] if options[:from]\n\n found = []\n $LOAD_PATH.uniq.map do |path|\n list = Dir.glob(File.join(File.expand_path(path), match))\n list = list.map{ |d| d.chomp('/') }\n found.concat(list)\n end\n found.concat(data_path(match, options))\n found\n end", "def files_listing path\n cmd = \"find #{path} -type f \"\n cmd += \"-regextype posix-extended \"\n cmd += \"-regex \\\"#{@file_regexp}\\\" \" if @file_regexp\n out = exec_cmd(cmd)\n end", "def result_paths( pattern = '*' )\n paths = nil\n Dir.chdir(dir) {\n paths = Dir.glob(pattern).map {|x| Pathname.new(x).expand_path }\n }\n # remove directories of Analysis\n anl_dirs = analyses.map {|anl| /^#{anl.dir.to_s}/ }\n paths.reject do |path|\n anl_dirs.find {|anl_dir| anl_dir =~ path.to_s }\n end\n end", "def glob(pattern, &block)\n result = @lock.with_read_lock { @paths.flat_map { |path| path.glob(pattern, &block) }}\n result unless block\n end", "def directory_glob\n glob = File.join(directory_path, \"#{globular_file_parts}.*\")\n Dir.glob(glob)\n end", "def dir(pattern, base=FOUNDATION_BOARD)\n Dir[File.join(base, pattern)].map {|name| File.basename name}\nend", "def all_files() = path.glob('**/*').select(&:file?).map(&:to_s)", "def directory_entries\n entries.select{ |f| File.directory?(File.join(path,f)) }\n #dirs = ::Dir.glob(\"#{path}/\")\n #dirs.collect{ |f| f.chomp('/') }\n end", "def list_assets\n get('/video/v1/assets')\n end", "def file_paths\n Dir.glob(@filepath_pattern).sort\n end", "def scan\n results = []\n dirs.each do |dir|\n files_in_dir = Dir.glob(File.join(dir,'**','*'))\n results.concat(files_in_dir)\n end\n @known_files = results\n end", "def get_assets asset\n return [] if @crawl_results.empty? # No crawling yet? Return empty search\n\n # The asset parameter can only be images, stylesheets or scripts\n unless %w(images stylesheets scripts).include? asset.to_s\n # Display error message in this case.\n SuperCrawler::Render.error \"`asset` parameter can only be `images`, `stylesheets` or `scripts`\"\n return [] # Return empty array\n end\n\n # Good! Return flatten array of unique assets\n return @crawl_results.map{ |cr| cr[:assets][asset.to_sym] }.flatten.uniq\n end", "def search_assets\n prefix = unsafe_params[:prefix]\n\n if !prefix.is_a?(String) || prefix.size < 3\n fail \"Prefix should be a String of at least 3 characters\"\n end\n\n assets = Asset.closed.\n accessible_by(@context).\n order(:name).\n with_search_keyword(prefix).\n select(:uid).\n distinct.\n limit(ASSETS_SEARCH_LIMIT)\n\n render json: { uids: assets.map(&:uid) }\n end", "def add_matching(pattern)\n Dir[ pattern ].each do |fn|\n self << fn unless exclude?(fn)\n end\n end", "def list_files_from path,opts = {}\n unless Dir.exists? path\n Logger.<<(__FILE__,\"ERROR\",\"Local fetcher: path does not exists for listing... #{path} \")\n raise \"Error LocalFileFetcher !\"\n end\n if opts[:directories]\n cmd = \"ls -td #{path}/*/\"\n else\n cmd = \"ls #{path}\"\n cmd += \"/#{opts[:regexp]}\" if opts[:regexp]\n end\n out = `#{cmd}`\n return out.split(\"\\n\")\n end", "def add_matching(pattern)\n Dir[pattern].each do |fn|\n\tself << fn unless exclude?(fn)\n end\n end", "def manifest_files\n files = []\n exclude = Regexp.new(PROJ.exclude.join('|'))\n Find.find '.' do |path|\n path.sub! %r/^(\\.\\/|\\/)/o, ''\n next unless test ?f, path\n next if path =~ exclude\n files << path\n end\n files.sort!\nend", "def [](path, pattern)\n glob(path, pattern, 0)\n end", "def glob(path, pattern, flags=0)\n flags |= ::File::FNM_PATHNAME\n path = path.chop if path[-1,1] == \"/\"\n\n results = [] unless block_given?\n queue = entries(path).reject { |e| e.name == \".\" || e.name == \"..\" }\n while queue.any?\n entry = queue.shift\n\n if entry.directory? && !%w(. ..).include?(::File.basename(entry.name))\n queue += entries(\"#{path}/#{entry.name}\").map do |e|\n e.name.replace(\"#{entry.name}/#{e.name}\")\n e\n end\n end\n\n if ::File.fnmatch(pattern, entry.name, flags)\n if block_given?\n yield entry\n else\n results << entry\n end\n end\n end\n\n return results unless block_given?\n end", "def glob_match(filenames, pattern)\n\t\n\tnewPattern = pattern.gsub( '*', '.*').gsub( '?', '.')\n\n\treturn filenames.select{|i| i.match(/#{newPattern}/)}\n\t\nend", "def list_files(path)\n return Sass::Script::List.new(\n Dir.glob(path.value).map! { |x| Sass::Script::String.new(x) },\n :comma\n )\n end", "def list_files(path)\n return Sass::Script::List.new(\n Dir.glob(path.value).map! { |x| Sass::Script::String.new(x) },\n :comma\n )\n end", "def files_in_directory name, glob = '**' / '*'\n Dir[path / name / glob]\n end", "def list_all\n \tlist = Dir.glob(\"#{__dir__}/../images/*.jpg\")\n \tlist.each do |character|\n \t\tputs character[/.*images\\/(.*).jpg/,1]\n \tend\n end", "def find_file_matching_pattern(search_dirs, pattern)\n search_dirs = [search_dirs] unless search_dirs.is_a?(Array)\n\n search_dirs.each do |d|\n matches = Dir.glob(File.join(d, pattern))\n return matches.first if matches.size > 0\n end\n return nil\n end", "def files_in_path\n Dir.glob(\"#{@path}/**/*/**\") | Dir.glob(\"#{@path}/**\")\n end", "def glob(pattern)\n Dir.chdir(@output_dir) do\n Dir[pattern]\n end\n end", "def assets\n \n if !params[:path].blank? or !params[:format].blank?\n if get_from_asset_folder\n return\n else\n render_404 and return\n end\n end\n end", "def find_files( dirs, lang, name, exts )\n results = []\n glob_files( dirs, lang, name, exts ) { |file,base,ext| results << file }\n results\n end", "def known_assets\n assets = Rails.application.config.assets.digests.to_a.flatten.map do |asset|\n [asset, \"#{asset}.gz\"]\n end.flatten\n assets + %w(manifest.yml sources_manifest.yml)\n end", "def file_list(full_directory_path)\r\n path = File.join(full_directory_path, '*')\r\n Dir[path].reject { |fn| File.directory?(fn) || File.basename(fn) == @folder_config }\r\n end", "def files\n filename = Dir.entries(@path).find_all {|file| file.include?(\".mp3\")}\n # binding.pry\n # [[\"Thundercat - For Love I Come - dance.mp3\",\n # \"Real Estate - It's Real - hip-hop.mp3\",\n # \"Action Bronson - Larry Csonka - indie.mp3\",\n # \"Real Estate - Green Aisles - country.mp3\"]]\n\n #binding.pry\n end", "def find_files(search_pattern, opts = {})\n Dir.chdir(@top_dir)\n Dir.glob(\"**/*#{search_pattern}*\").map do |path|\n next if File.directory?(path)\n next unless File.readable?(path)\n begin\n mt = mime_type_for_file(path)\n {\n name: path,\n url: get_url_for_path(path),\n mime_type: mt,\n size: File.size(path)\n }\n rescue\n debug \"Can't seem to look at '#{path}'\"\n nil\n end\n end.compact\n end", "def searchFor\n %w{*.lua */*.lua}\n end", "def glob(*pat, &blk)\n regexes = pat.flatten.map {|pat| Bun.convert_glob(pat) }\n enum = self.class.new(@collection) do |yielder|\n self.each do |fname|\n # TODO Refactor with any?\n matched = false\n regexes.each do |regex|\n if fname =~ regex\n matched = true\n break\n end\n end\n yielder << fname if matched\n end\n end\n if block_given?\n enum.each(&blk)\n else\n enum\n end\n end", "def paths\n f = File.open(@path)\n f.grep(FILE_NAME_PATTERN) { $1 }\n end", "def assets\n content_mappings.collect{|mapping| mapping.asset }\n end", "def glob_data_paths(pattern,&block)\n return enum_for(:glob_data_paths,pattern).to_a unless block_given?\n\n DataPaths.paths.each do |path|\n Dir.glob(File.join(path,pattern),&block)\n end\n end", "def list_files\n Find.find(path) do |element| yield element end\n end", "def get_files(site, folder)\n files = []\n Dir.chdir(File.join(site.source, folder)) { files = filter_entries(Dir.glob('**/*.*')) }\n files\n end", "def get_source_movs(path)\n files = []\n Find.find(path) do |filename|\n if !FileTest.directory?(filename)\n if filename =~ MOV_PATTERN\n files << Pathname.new(filename)\n end\n end\n end\n\n files.sort\nend", "def glob_match (filenames, pattern)\n\t# Escape the '*', '?', and '.' characters\n\tpattern.gsub!(/[\\*\\?\\.]/, '*' => '.*', '?' => '.', '.' => '\\.') \t\n\tregex = Regexp.new(pattern)\n\t#select returns a new array\n\tfilenames.select do |filename|\n\t\tfilename =~ regex\n\tend\nend", "def get_files_in_path(path)\n puts \"Scanning for files in directory: #{path}\"\n Dir.entries(path).reject { |f| File.directory? f }\nend", "def ovl_glob(rel_pattern)\n gem_files = Dir.glob(File.join(GEM_ROOT, rel_pattern)).map do |path|\n path.sub(GEM_ROOT+\"/\", \"\")\n end\n\n (gem_files + Dir.glob(rel_pattern)).uniq\n end", "def ovl_glob(rel_pattern)\n gem_files = Dir.glob(File.join(GEM_ROOT, rel_pattern)).map do |path|\n path.sub(GEM_ROOT+\"/\", \"\")\n end\n\n (gem_files + Dir.glob(rel_pattern)).uniq\n end", "def readDirectoryFiles(directory,formats)\n files=[]\n Dir.chdir(directory){\n for i in 0...formats.length\n Dir.glob(formats[i]){|f| files.push(f) }\n end\n }\n return files\nend", "def ls(pattern = '**/*', **_opts)\n Enumerator.new do |acc|\n walk(pattern) {|path| acc << path }\n end\n end", "def find(dirs); end", "def glob(pattern, *args)\n Dir.glob(pattern, *args).sort\n end", "def source_search(url, html)\n\n hits = []\n\n html.css('script,embed,object').each do |source|\n\n # attributes\n data = source.attr('data')\n src = source.attr('src')\n\n if src.nil?\n # load script and parse?\n else\n # check src lib name\n hits << url if src =~ /swfobject.js|player.swf/i\n hits << url if data =~ /player.swf/i\n end\n end\n\n hits.uniq!\n\n end", "def glob pattern\n Dir[File.join(@originals,pattern)].collect do |f|\n File.basename(f)\n end\n end", "def get_assets(type, options = {})\n type = type.to_sym\n\n filtered_assets = []\n\n parents.each do |parent|\n filtered_assets.concat(parent.assets[type]) if parent.assets.include? type\n end if parents\n\n filtered_assets.concat(@assets[type]) if @assets.include?(type)\n\n return [] if filtered_assets.nil? or filtered_assets.empty?\n\n if package_name = options[:package]\n filtered_assets = filter_by_package_name(package_name.to_sym,\n filtered_assets)\n end\n\n if set = options[:set]\n filtered_assets = filter_by_set(set.to_sym, filtered_assets)\n end\n\n # Get asset paths and remove duplicates\n filtered_assets = filtered_assets.map do |asset|\n asset.paths(type)\n end.flatten.uniq\n\n # Remove already rendered assets (paths)\n (filtered_assets - @rendered_assets).tap do |assets|\n @rendered_assets.concat(assets)\n end\n end", "def add_matching(pattern)\n self.class.glob(pattern).each do |fn|\n self << fn unless excluded_from_list?(fn)\n end\n end", "def all_files_in_dir(p_dir)\n [File.join(p_dir, \"**\", \"*\"), File.join(p_dir, \"**\", \".*\")]\n end", "def slice_files_from_search_path\n search_paths = Array(Merb::Plugins.config[:merb_slices][:search_path] || [Merb.root / \"slices\"])\n search_paths.inject([]) do |files, path|\n # handle both Pathname and String\n path = path.to_s\n if File.file?(path) && File.extname(path) == \".rb\"\n files << path\n elsif path.include?(\"*\")\n files += glob_search_path(path)\n elsif File.directory?(path)\n files += glob_search_path(path / \"**/lib/*.rb\")\n end\n files\n end\n end", "def local_compiled_assets \n @manifest.files.keys.map {|f| File.join(@prefix, f)} \n end", "def css\n css_files = []\n @assets.each do |type, path|\n case type\n when :folder\n # Don't import any css/scss files that start with an underscore, so scss partials\n # aren't imported by default:\n # http://sass-lang.com/guide\n css_files += Dir[\"#{path}/**/[^_]*.{css,scss}\"].sort.map do |folder|\n '/assets' + folder[path.size..-1].gsub(/[.]scss$/, '')\n end\n when :css_file\n css_files << path\n end\n end\n\n css_files.uniq\n end", "def manifests\n # TODO: handle s3 case, and use URI for source_location (need to change across batch ingest gem as well)\n Dir[File.join(base_directory, \"**/*.{#{MANIFEST_EXTENSIONS.join(',')}}\")]\n end", "def glob(pattern = '**/*', **_opts)\n Enumerator.new do |acc|\n walk(pattern, with_stat: true) {|info| acc << info }\n end\n end", "def discover_items_via_crawl(root)\n Dir.glob(\"#{root}/**/*\").select { |fname| File.file?(fname) }\n end", "def get_path_assets(path)\n redis.smembers path_assets_key(path)\n end", "def list\n factory.system.list(@path).collect do |item|\n candidate = dir(item)\n if (not candidate.exists?)\n candidate = file(item)\n end\n candidate\n end\n end", "def list_files(path)\n base_directory_content = Dir.glob(File.join(path, \"*\"))\n nested_directory_content = Dir.glob(File.join(path, \"*/**/*\"))\n [base_directory_content, nested_directory_content].flatten\n end", "def plugin_files_by_dir\n Array(Ohai.config[:plugin_path]).inject([]) do |plugin_files, plugin_path|\n plugin_files + PluginFile.find_all_in(plugin_path)\n end\n end", "def search(pattern)\n entries.inject(Rush::SearchResults.new(pattern)) do |results, entry|\n if !entry.dir? and matches = entry.search(pattern)\n results.add(entry, matches)\n end\n results\n end\n end", "def ls(pattern = '**/*', **opts)\n Enumerator.new do |acc|\n walk(pattern, **opts) do |path, _|\n acc << path\n end\n end\n end", "def files &filter_block\n Dir[File.join(path, '**/*')].\n reject{|f| File.directory?(f) }.\n select{|f| f =~ filter_re }.\n sort.reverse[0..MAX_FILES].\n select(&filter_block)\n end", "def find_files(path)\r\n Dir.entries(path).reject {|f| f =~ /^\\./} || Array.new\r\nend", "def getFilesInDirCompiler(path)\n files = []\n #search for all of the files in the directory\n Dir.foreach(path) do |filename|\n #dont include parent files\n next if filename == '.' || filename == '..'\n\n #dont include files that are not jack files\n next unless filename.to_s.include?(\"jack\")\n\n #push the file to the list\n files.push(path+\"/\"+filename)\n end\n\n return files\nend", "def get_jsons(dir)\n files = Dir[ File.join(dir, '**', '*') ].reject { |p| File.directory? p }\n files.select{|x| x.end_with?(\".json\")}\nend" ]
[ "0.68234223", "0.6680393", "0.6609134", "0.6456328", "0.6447481", "0.64322364", "0.6403267", "0.6348924", "0.63369113", "0.6301843", "0.6247889", "0.6241501", "0.6174241", "0.6120743", "0.6104419", "0.60969365", "0.60952514", "0.60825455", "0.60699666", "0.60671216", "0.6060134", "0.60531825", "0.60450286", "0.6031605", "0.59698784", "0.5966402", "0.59569114", "0.5947877", "0.5943613", "0.5943531", "0.59384906", "0.5937948", "0.5935259", "0.5930799", "0.59079725", "0.58997166", "0.5897928", "0.58861345", "0.5884608", "0.5871776", "0.586163", "0.58585817", "0.58490723", "0.58439386", "0.58359355", "0.58351946", "0.58351916", "0.5834517", "0.58317333", "0.5830752", "0.58253384", "0.5824592", "0.5824592", "0.5824558", "0.5820386", "0.5818162", "0.58178806", "0.5810231", "0.5805948", "0.5800529", "0.5778287", "0.5774753", "0.57743514", "0.5769124", "0.5763673", "0.57619447", "0.5750125", "0.57444537", "0.5742078", "0.5739664", "0.57373905", "0.57373613", "0.5736863", "0.57302505", "0.57264006", "0.57264006", "0.5723658", "0.57189745", "0.5717545", "0.5715599", "0.5715483", "0.57150495", "0.5714134", "0.57101136", "0.5709284", "0.57043344", "0.57027346", "0.5697664", "0.5695058", "0.5694986", "0.5693166", "0.56922257", "0.56908476", "0.56905526", "0.56858945", "0.5684969", "0.5684253", "0.56826526", "0.56821793", "0.56796324", "0.56753826" ]
0.0
-1
so we can process the directories in numerical order
def directory_sort_order( f1, f2 ) n1 = File.extname( f1 ).gsub( '.', '' ).to_i n2 = File.extname( f2 ).gsub( '.', '' ).to_i return -1 if n1 < n2 return 1 if n1 > n2 return 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sortFilesFromDirs array, dir #array is elements in current directory: dir\n\n #temp arrays to hold files vs dirs\n dirs = Array.new\n files = Array.new\n\n array.each do |elem|\n\n #path to current entity interested in\n currentPath = dir + \"/\" + elem\n #puts \"currentPath: \" + currentPath\n\n #is dir or no?\n if Dir.exist? currentPath\n dirs << elem\n else\n files << elem\n end\n\n end\n\n #puts \"dirs: \" + dirs.to_s\n #puts \"files: \" + files.to_s\n \n #return concatenated array\n return dirs + files\n\n end", "def sort_items_according_to_current_direction\n case @direction\n when nil\n @items = items.shift(2) + items.partition(&:directory?).flat_map(&:sort)\n when 'r'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort.reverse}\n when 'S', 's'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort_by {|i| -i.size}}\n when 'Sr', 'sr'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:size)}\n when 't'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort {|x, y| y.mtime <=> x.mtime}}\n when 'tr'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:mtime)}\n when 'c'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort {|x, y| y.ctime <=> x.ctime}}\n when 'cr'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:ctime)}\n when 'u'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort {|x, y| y.atime <=> x.atime}}\n when 'ur'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:atime)}\n when 'e'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort {|x, y| y.extname <=> x.extname}}\n when 'er'\n @items = items.shift(2) + items.partition(&:directory?).flat_map {|arr| arr.sort_by(&:extname)}\n end\n items.each.with_index {|item, index| item.index = index}\n end", "def process_directory(path)\n directories = []\n files = []\n sizes = {}\n Dir.entries(path).sort.each do |filename|\n full_path = \"#{path}/#{filename}\"\n case filename\n when '.' || '..'\n\n when 'index.html'\n\n else\n\n case\n when filename =~ /^\\./\n # ignore hidden files\n when File.directory?(full_path)\n directories << filename\n when File.file?(full_path)\n files << filename\n sizes[full_path] = File.size(full_path)\n end\n\n end # case filename\n end\n\n directories.sort.each do |directory|\n process_directory(\"#{path}/#{directory}\")\n end\n\n # output this directory's info:\n write_index_file(\"#{path}/index.html\", directories, files, sizes)\n puts \"#{path}/index.html\"\nend", "def sort!\n #N Without this, the immediate sub-directories won't get sorted\n dirs.sort_by! {|dir| dir.name}\n #N Without this, files contained immediately in this directory won't get sorted\n files.sort_by! {|file| file.name}\n #N Without this, files and directories contained within sub-directories of this directory won't get sorted\n for dir in dirs\n #N Without this, this sub-directory won't have its contents sorted\n dir.sort!\n end\n end", "def GetLevelDirs()\n directories = Dir.entries($level_folder)\n\n for i in 0...directories.length do\n\n if not directories[i].include? \".\" then\n $current_folder = $level_folder + directories[i] + \"/\"\n GetLevels($current_folder)\n end\n\n end\n\nend", "def process_directory(path)\n directories = []\n files = []\n sizes = {}\n mtimes = {}\n Dir.entries(path).sort.each do |filename|\n full_path = \"#{path}/#{filename}\"\n case filename\n when '.' || '..'\n\n when 'index.html'\n\n else\n\n case\n when filename =~ /^\\./\n # ignore hidden files\n when File.directory?(full_path)\n directories << filename\n when File.file?(full_path)\n files << filename\n sizes[full_path] = File.size(full_path)\n mtimes[full_path] = File.mtime(full_path)\n end\n\n end # case filename\n end\n\n directories.sort.each do |directory|\n process_directory(\"#{path}/#{directory}\")\n end\n\n # output this directory's info:\n write_index_file(\"#{path}/index.html\", directories, files, sizes, mtimes)\n puts \"#{path}/index.html\"\nend", "def get_legacy_ingest_list(dirname )\n il = TaskHelpers.get_directory_list( dirname, /^extract./ )\n\n # sort by directory order\n return il.sort { |x, y| TaskHelpers.directory_sort_order( x, y ) }\n end", "def buildArray(localObjCache, increase)\n localDirContents=[] #Array of all items in the cwd\n localDirContents=Dir[Dir.pwd+\"/*\"] #Builds the array of items in cwd\n\n localDirContents.each do |item|\n if File.file?(item)\n fileObj = FileName.new(item)\n localObjCache.push(fileObj)\n n = increase.call #printing every 100 files scanned\n if n % 100 == 0\n puts n\n end\n elsif File.directory?(item)\n Dir.chdir(item)\n buildArray(localObjCache, increase) \n end\n end\n\n return localObjCache\n end", "def sort_files!; end", "def get_folder_list\n\n ################################\n # \n # prep: list\n #\n ################################\n #ref __FILE__ http://stackoverflow.com/questions/37101151/what-does-file-program-name-mean-in-ruby\n path = Pathname.new(__FILE__)\n# path = Pathname.new('.')\n \n #ref https://ruby-doc.org/stdlib-2.1.0/libdoc/pathname/rdoc/Pathname.html\n p \"path.dirname => #{path.dirname}\"\n \n dpath = path.dirname\n# dpath = \"c:/works_2\"\n \n #ref http://stackoverflow.com/questions/1899072/getting-a-list-of-folders-in-a-directory\n Dir.chdir(dpath)\n# Dir.chdir(\"c:/works_2\")\n# Dir.chdir(path.dirname)\n# Dir.chdir('/destination_directory')\n# list = Dir.glob('*').select\n# list = Dir.glob('*').select {|f| File.directory? f}\n files = Dir.glob('*').select {|f| File.file? f}\n dirs = Dir.glob('*').select {|f| File.directory? f}\n \n puts\n puts \"[#{__LINE__}] directory => #{dpath}\" \n \n puts\n puts \"[#{__LINE__}] folders ....\"\n p dirs\n \n puts\n puts \"[#{__LINE__}] files ....\"\n p files.sort\n# p files\n \n# p files.methods.sort\n \n# p __FILE__\n \n# target_directory = \n# \n# Dir.chdir('/destination_directory')\n## Dir.chdir('/destination_directory')\n# \n# list = Dir.glob('*').select {|f| File.directory? f}\n# \n# p list\n \n ################################\n # \n # file: write data\n #\n ################################\n time_label = get_time_label(\"serial\")\n \n fname = \"directory_list.#{time_label}.txt\"\n \n f = File.new(fname, \"w\")\n \n # header\n f.write(\"program file path = #{FILE_PATH}\")\n f.write(\"\\n\")\n f.write(\"version = #{VERSION}\")\n f.write(\"\\n\")\n \n f.write(\"list file created at = #{time_label}\")\n f.write(\"\\n\")\n \n f.write(\"dir path = #{dpath}\")\n f.write(\"\\n\")\n f.write(\"dirs = #{dirs.size}\")\n f.write(\"\\n\")\n f.write(\"files = #{files.size}\")\n f.write(\"\\n\")\n f.write(\"\\n\")\n \n # data: dirs\n f.write \"<directories> #{dirs.size}\"\n f.write \"\\n\"\n \n dirs.each do |elem|\n \n f.write(elem)\n f.write(\"\\n\")\n \n end\n \n f.write(\"\\n\")\n f.write(\"\\n\")\n \n # data: files\n f.write \"<files> #{files.size}\"\n f.write \"\\n\"\n\n files.each do |elem|\n \n f.write(elem)\n f.write(\"\\n\")\n \n end\n \n f.close\n \n puts \"[#{__LINE__}] file written => #{fname}\"\n \nend", "def parent_dirs(file); end", "def directories; end", "def directories; end", "def file_sort_hierarchy(path)\n Dir.glob(path).sort_by { |f| f.split('/').size }\n end", "def hashDirectory(directory)\n count = 0\n hash = {}\n Dir.foreach(directory) do |item|\n next if item == '.' || item == '..'\n hash[count] = item\n count = count + 1\n end\n hash\nend", "def count_files_for_each_dir(path, dirs)\n dirs.each do |dir|\n \n num = 0\n # count flag\n\n Dir.entries(File.join(path, dir)).each do |file|\n num = (num + 1) if file.to_s!=\".\" and file.to_s!=\"..\" and file.to_s!=\".DS_Store\"\n end\n \n # print result\n puts \"#{dir} : #{num}\"\n end\nend", "def index(base_path, glob = nil)\n\t\tglob = '*' if glob == '' or glob.nil?\n\t\tdirs = []\n\t\tfiles = []\n\t\t::Dir.chdir(base_path) do\n\t\t\t::Dir.glob(glob).each do |fname|\n\t\t\t\tif ::File.directory?(fname)\n\t\t\t\t\tdirs << fname + '/'\n\t\t\t\telse\n\t\t\t\t\tfiles << fname\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tdirs.sort + files.sort\n\trescue Errno::ENOENT\n\t\traise Rush::DoesNotExist, base_path\n\tend", "def json_dir_names\n DIR.entries\n .map(&:basename)\n .map(&:to_s)\n .select { |dirname| dirname =~ /^[0-9]+\\.[0-9]/ }.sort\n end", "def sorted_folders\n return @folders if !@retain_order\n @folders.sort_by{|folder| [folder.sort_order]}\n end", "def list_all_in_current_directory\n Dir.glob('**/*').sort\nend", "def order\n \"#{sort} #{dir}\"\n end", "def sort_dir_list(dir_list, path)\n order_by ||= session[:order_by]\n order_by ||= 'filename'\n order_desc = session[:order_desc]\n \n if dir_list.first[order_by.to_sym].class == Fixnum\n dir_list.sort! { |a,b| a[order_by.to_sym] <=> b[order_by.to_sym] }\n else\n dir_list.sort! { |a,b| a[order_by.to_sym].to_s.downcase <=> b[order_by.to_sym].to_s.downcase }\n end\n\n dir_list.reverse! if order_desc\n \n # move folders to top\n new_list = []\n new_dir_list = []\n dir_list.each do |element|\n new_list << element if File.directory?(path + '/' + element[:original_name])\n new_dir_list << element if File.file?(path + '/' + element[:original_name])\n end\n new_list.sort! { |a,b| a[:filename].to_s.downcase <=> b[:filename].to_s.downcase }\n new_list.concat new_dir_list\n end", "def sub_tree\n files = ProjectFile.where(directory_id: id)\n files = files.nil? ? [] : files \n\n files.sort{|x,y| \n if x.is_directory and not y.is_directory\n -1\n elsif not x.is_directory and y.is_directory\n 1\n else\n x.name <=> y.name\n end\n }\n end", "def get_ingest_list( dirname )\n il = TaskHelpers.get_directory_list( dirname, /^.*\\.workset$/ )\n\n # sort alphanumerically\n return il.sort\n end", "def sort_files\n # Iterate thru files in @download_path\n cd(@download_path) do\n Find.find(pwd) do |path_to_file|\n @current_file_path = path_to_file\n next if @current_file_path == pwd # don't include the download folder as one of the files\n update_progress\n @file_directory, @file_name = File.split(@current_file_path)\n next if @file_name[0..0] == \".\" # skip any files/directories beginning with .\n # Stop searching this file/directory if it should be skipped, otherwise process the file\n should_skip_folder? ? Find.prune : process_download_file\n end\n end\n end", "def parse_in_order(*files); end", "def dirs; end", "def dirs; end", "def build_index\n to_index = [@dir]\n index = {}\n while (dir = to_index.shift)\n Dir.new(dir).each { |entry| index_entry to_index, index, dir, entry }\n end\n\n index\n end", "def group_directories_first\n return if @group_directories == :none\n\n files = @files\n dirs = files.select { |f| File.directory?(f) }\n # earlier I had File? which removed links, esp dead ones\n fi = files.reject { |f| File.directory?(f) }\n @files = if @group_directories == :first\n dirs + fi\n else\n fi + dirs\n end\nend", "def splitDirectory(directory, array, hash)\n array.each do |num|\n splitData(directory, hash[num])\n end\nend", "def reverse_dir(d)\r\n return 10 - d\r\n end", "def directory_entries\n entries.select{ |f| File.directory?(File.join(path,f)) }\n #dirs = ::Dir.glob(\"#{path}/\")\n #dirs.collect{ |f| f.chomp('/') }\n end", "def dir_list(path, bases, paging)\n items = paging[:items]\n page = paging[:page]\n offset = paging[:offset]\n raise 'Disabling paging is not supported for a directory listing' if paging[:disable_paging]\n\n max_items = 1000\n\n child_paths, total = FileSystems::Combined.directory_list(path, items, offset, max_items)\n\n children = child_paths.map { |full_path|\n if FileSystems::Combined.directory_exists?(full_path)\n dir_info(full_path, bases)\n else\n raise 'File should exist' unless FileSystems::Combined.file_exists?(full_path)\n\n file_info(full_path)\n end\n }\n\n paging[:total] = total\n paging[:warning] = \"Only first #{max_items} results are available\" if total >= max_items\n\n children\n end", "def find_files(recusive,sort)\n ext_list = $config[\"series\"][\"media_extentions\"].gsub(/,/,\"|\")\n files = [] \n if File.directory? sort\n Find.find(sort) do |path|\n next if File.dirname(path) != sort and not recusive\n next if File.directory? path\n next if File.basename(path) =~ /^\\./\n next if path !~ /#{ext_list}$/\n files << path\n end\n else\n log(\"error: source directory of \\\"#{sort}\\\" does not exist!\")\n exit 2\n end\n files\nend", "def find(dirs); end", "def parse_directories(files, diffs)\n files.sort!\n\n # Initialize those hashes, where each key will map to hash, in wich\n # each key maps to an array:\n # {\n # key1: {\n # },\n # key2: {\n # },\n # }\n #\n without_diffs = Hash.new { |h,k| h[k] = {} }\n with_diffs = Hash.new { |h,k| h[k] = {} }\n\n directories = files.map { |f| f.split('/').first }.uniq\n groups = directories.map { |dir| dir.split('_').first }.uniq\n\n\n # Fill in the files as variants\n directories.each do |directory|\n group = directory.split('_')[0]\n test_name = test_name_from_dir(directory)\n\n # Determines the type of test by the presence of the diff.png\n # file in the folder.\n # Ideally the manifest file format would be different and\n # include the test type with\n if files.select { |file_name| file_name.start_with?(directory) }.any? { |file_name| file_name.include?('diff.png') }\n variants = variants_for_page(directory, diffs)\n else\n variants = variants_for_api_endpoint(directory, diffs, files)\n end\n\n if diffs[directory]\n with_diffs[group][test_name] = variants\n else\n without_diffs[group][test_name] = variants\n end\n end\n\n return groups, without_diffs, with_diffs\n\n # For reference\n # gallery_format = {\n # \"1080\" => {\n # \"name\" => [\n # {\n # image: \"full_img_src\",\n # thumb: \"thumb_src\",\n # domain: \"production\"\n # }, {\n # image: \"foo_src\",\n # thumb: \"thumb_src\",\n # domain: \"test\"\n # }, {\n # image: \"diff_src\",\n # thumb: \"diff_thumb_src\",\n # domain: \"diff\",\n # diff_amt: 0.1\n # }\n # }\n # }\n # }\n end", "def ordered_topologically\n FolderSort.new(self)\n end", "def unique_dir\n taken_ints = taken_paths.map { |path| path.basename.to_s.to_i }\n (taken_ints.count > 0) ? (taken_ints.max + 1).to_s : 1.to_s\n end", "def generate_size_indexed_list(list)\n result = {}\n list.each{|item|\n if File.directory?(item)\n Dir.glob(File.join(item, \"**/*\")){|filename|\n if File.file?(filename) != true\n next\n end\n\n $stdout.puts \"Scanning: #{filename}\"\n\n file_size = File.stat(filename).size\n\n if result.has_key?(file_size) == false\n result[file_size] = []\n end\n result[file_size].push(filename)\n }\n else\n $stderr.puts \"#{item.inspect} is not a directory.\"\n exit 1\n end\n }\n\n return result\nend", "def yaml_parts_in_saving_order\n lang_file_dirs_by_parts = ActiveSupport::OrderedHash.new\n @yaml_parts.each do |lang_file_dir, parts_in_this_dir|\n parts_in_this_dir.each do |part|\n lang_file_dirs_by_parts[part] = (lang_file_dirs_by_parts[part] || []) << lang_file_dir\n end\n end\n \n ordered_yaml_parts = []\n lang_file_dirs_by_parts.keys.sort_by{|key| key.split('.').size}.reverse.each do |part|\n lang_file_dirs_by_parts[part].reverse.each do |lang_file_dir|\n ordered_yaml_parts << File.join(lang_file_dir, part)\n end\n end\n \n ordered_yaml_parts\n end", "def traverse path\n entries = Dir.glob(\"#{View.expand_path(path)}/*\", File::FNM_DOTMATCH).\n select {|i| i !~ /\\/\\.(\\.*|svn|git)$/}. # Exclude some dirs (exclude entensions here too?)\n sort\n\n # Process dirs\n entries.each{ |f|\n next unless File.directory?(f)\n cleaned = clean f\n @res += \"#{cleaned.sub(/(^ *)/, \"\\\\1- \")}/\\n\"\n traverse f\n }\n\n # Process files\n entries.each{ |f|\n next unless File.file?(f)\n cleaned = clean f\n @res += \"#{cleaned.sub(/(^ *)/, \"\\\\1+ \")}\\n\"\n }\n\n end", "def get_directories(src)\n directories = Array.new\n #return directories\n Find.find(src) do |path|\n # not too sure what this was intended to do but its getting in the way\n # and can not be matched correctly.\n #next if File.dirname(path) != src \n next if path == src\n next if not File.directory? path\n directories.push path\n end\n directories.reverse\nend", "def update_folders_order\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n order_arr = params[:folders_order]\n\n SqlHelper.validate_token([params[:id]])\n folders = MailFolder.get_childs(params[:id], false, false)\n # folders must be ordered by xorder ASC.\n\n folders.sort! { |id_a, id_b|\n\n idx_a = order_arr.index(id_a)\n idx_b = order_arr.index(id_b)\n\n if idx_a.nil? or idx_b.nil?\n idx_a = folders.index(id_a)\n idx_b = folders.index(id_b)\n end\n\n idx_a - idx_b\n }\n\n idx = 1\n folders.each do |folder_id|\n begin\n folder = MailFolder.find(folder_id)\n next if folder.user_id != @login_user.id\n\n folder.update_attribute(:xorder, idx)\n\n if folder.xtype == MailFolder::XTYPE_ACCOUNT_ROOT\n mail_account = MailAccount.find_by_id(folder.mail_account_id)\n unless mail_account.nil?\n mail_account.update_attribute(:xorder, idx)\n end\n end\n\n idx += 1\n rescue => evar\n Log.add_error(request, evar)\n end\n end\n\n render(:text => '')\n end", "def data_file_names\n Dir.glob(File.join(@dir, '*.data')).sort! do |a, b|\n a.to_i <=> b.to_i\n end\n end", "def directory_paths\n pages.map { |p| File.dirname(p.path).split(\"/\")[0] }.uniq\n end", "def parse_files\r\n ln_count = 0\r\n\r\n settings.file_order.each do |f|\r\n out = make_file(\"tmp.press\")\r\n\r\n ln_count += parse_lines(f, out)\r\n\r\n out.close\r\n tmp_files << out\r\n end\r\n\r\n ln_count\r\n end", "def push_used_dirs d=Dir.pwd\n # @used_dirs.index(d) || @used_dirs.push(d)\n return if @used_dirs[0] == d\n\n @used_dirs.delete(d) if @used_dirs.index(d)\n @used_dirs.insert(0, d)\nend", "def dir_index\n Directions.index(dir.to_s)\n end", "def count_number_of_lines(change_to_dir)\n Dir.chdir(change_to_dir)\n puts Dir.pwd.blue \n content = Dir.glob(\"*\")\n cur_dirs = []\n content.each do |file|\n file = \"#{Dir.pwd}/#{file}\"\n\n if File.directory?(file)\n cur_dirs << file\n else\n n = File.readlines(file).size\n print \"#{file} \"\n print \" #{n} lines\\n\".green\n end\n end\n cur_dirs.each do |dir| \n count_number_of_lines(dir)\n end\n\nend", "def list_dirs(path)\n dir = pathname(path)\n\n Dir.chdir(dir) do\n Dir['*/'].sort\n end\n\n rescue\n raise FileNotFound, \"no such file in repo - #{path}\"\n end", "def file_list\n list = []\n\n list.concat(Array.new(4, \"class0/file0.html\"))\n list << \"class0/file1.html\"\n list.concat(Array.new(2, \"class0/file2.html\"))\n list.concat(Array.new(3, \"class0/file3.html\"))\n list.concat(Array.new(4, \"class0/file4.html\"))\n\n list.concat(Array.new(7, \"class1/file0.html\"))\n list.concat(Array.new(2, \"class1/file1.html\"))\n list.concat(Array.new(3, \"class1/file2.html\"))\n\n list.concat(Array.new(8, \"class2/file0.html\"))\n list.concat(Array.new(5, \"class2/file1.html\"))\n list.concat(Array.new(5, \"class2/file2.html\"))\n list.concat(Array.new(10, \"class2/file3.html\"))\n\n list.concat(Array.new(15, \"class3/file0.html\"))\n list.concat(Array.new(7, \"class3/file1.html\"))\n\n list.concat(Array.new(12, \"class4/file0.html\"))\n\n list.concat(Array.new(11, \"class5/file0.html\"))\n\n return list.shuffle\nend", "def yaml_parts_in_loading_order\n ordered_yaml_parts = []\n @yaml_parts.each do |lang_file_dir, parts_in_this_dir|\n parts_in_this_dir.sort_by{|part| File.basename(part, '.yml').split('.').size}.each do |part|\n ordered_yaml_parts << File.join(lang_file_dir, part)\n end\n end\n ordered_yaml_parts\n end", "def subdirectories\n path_length - 1\n end", "def pages_to_list\n # sort by fullpath first\n list = self.pages.values.sort { |a, b| a.fullpath <=> b.fullpath }\n # sort finally by depth\n list.sort { |a, b| a.depth <=> b.depth }\n end", "def pages_to_list\n # sort by fullpath first\n list = self.pages.values.sort { |a, b| a.fullpath <=> b.fullpath }\n # sort finally by depth\n list.sort { |a, b| a.depth <=> b.depth }\n end", "def process\n # here is a starting directory\n main_dir = '/home/john/code/ruby/files'\n # let's go to the directory we want\n Dir.chdir(main_dir)\n #print the present working directory (pwd)\n puts Dir.pwd\n # glob is stolen from Perl - list all the \n # matches for the wildcard pattern \"*\"\n listing = Dir.glob(\"*\")\n # put out the list\n puts listing.inspect\n\n\n #let's process the subdirectories and discard other files\n listing.each do |f|\n if File.directory? f\n processDirectory f\n else\n puts \"ignoring file: \" + f\n end\n end\n\n puts @power.inspect\nend", "def directory_index\n end", "def process_result_dirs(parent_dir)\n # get all the result dirs in the parent dir\n results_dirs = Dir.glob(\"#{parent_dir}/*/\").sort\n puts \"processing #{results_dirs.length} results directories...\"\n\n # process each result dir\n results_dirs.each do |dir|\n dirname = File.basename(dir)\n puts \"processing results dir: #{dirname}\"\n\n csv_path = \"#{dir}#{dirname}.csv\"\n puts \"csv_path: #{csv_path}\"\n\n # create a summary csv with the headings and last 2 rows\n heading = \"<h1>#{dirname}</h1>\"\n table = extract_table_from_results_csv(csv_path)\n @tables += heading + table unless table.nil?\n end\nend", "def retrieve_dirs(_base, dir, dot_dirs); end", "def file_list(group)\n return Dir[File.join(@dir, group, FILE_EXT)].sort\nend", "def get_extract_list(dirname )\n el = TaskHelpers.get_directory_list( dirname, /^#{EXPORT_DIR_PREFIX}/ )\n\n # sort by directory order\n return el.sort { |x, y| TaskHelpers.directory_sort_order( x, y ) }\n end", "def GetEnemyDirs()\n\n directories = Dir.entries($enemy_folder)\n\n for i in 0...directories.length do\n\n if not directories[i].include? \".\" then\n $current_folder = $enemy_folder + directories[i]\n GetEnemies($current_folder)\n end\n\n end\n\n ExtractIDs()\nend", "def gfb dir, func\n dir += '/*' if File.directory?(dir)\n dir = dir.gsub('//', '/')\n\n # sort by time and then reverse so latest first.\n sorted_files = Dir[dir].sort_by { |f|\n if File.exist? f\n File.send(func, f)\n else\n sys_stat(func, f)\n end\n }.reverse\n\n # add slash to directories\n sorted_files = add_slash sorted_files\n return sorted_files\nend", "def read_directories(dir = T.unsafe(nil)); end", "def directory_hash(path, name=nil, exclude = [])\n exclude.concat(['..', '.', '.git', '__MACOSX', '.DS_Store'])\n data = {'name' => (name || path), 'type' => 'folder'}\n data[:children] = children = []\n Dir.entries(path).sort.each do |entry|\n # Dir.entries(path).each\n # puts entry\n next if exclude.include?(entry)\n full_path = File.join(path, entry)\n if File.directory?(full_path)\n if entry.include?(\"credit app\")\n kids = Dir.entries(full_path)\n kids.reject! {|x|exclude.include?(x)}\n if kids.length >= 1\n # can add a kids.each loop here if mom ever wants more than one credit app\n child_path = File.join(full_path, kids[0])\n true_path = child_path.partition(\"app/assets/images/\")[2]\n link = ActionController::Base.helpers.image_path(true_path)\n # puts full_path\n # puts link\n entry = entry.split('.')[0]\n if entry.include?('--')\n entry = entry.split('--')[1]\n end\n entry = entry.upcase\n\n children << \"<li class='category'>CREDIT APP<li class='kid'><a href='#{link}'>#{entry}</a></li></li>\"\n else\n # gotta fix these two somehow\n children << \"<li><a href='#'>NO APP</a></li>\"\n end\n elsif entry.include?('flipbook')\n # Dir.entries(full_path).each do |flipbook|\n # next if exclude.include?(flipbook)\n # if File.directory?(full_path)\n name = entry.split(\"-\")[1]\n name = name.upcase\n if @account==\"UNDER ARMOUR\" && full_path.include?('UA GOLF')\n uasub = 'UA GOLF'\n elsif @account==\"UNDER ARMOUR\" && full_path.include?('UA FITNESS')\n uasub = 'UA FITNESS'\n end\n\n linky = view_context.link_to name, controller: 'catalogues', action: 'flipbook', id: @account, subid: entry, :data => { :uaname => uasub }\n children << \"<li class='kid'>#{linky}</li>\"\n # catfolder = full_path.split('/flipbook')[0]\n # end\n\n # end\n elsif entry.include?(\"toplevel\")\n # replace toplevel with a better check, something like if parent = pictures\n entryname=entry.split('-')[0].upcase\n children << \"<li class='kid'><a href='/catalogues/#{@account}/pictures/#{entry}'>#{entryname}</a></li>\"\n\n else\n children << directory_hash(full_path, entry)\n end\n else\n # true_path = full_path.partition(\"app/assets/images/\")[2]\n\n true_path = full_path.partition(\"app/assets/images/\")[2]\n # puts true_path\n link = ActionController::Base.helpers.image_path(true_path)\n\n # puts link\n entry = entry.split('.')[0]\n if entry.include?('--')\n entry = entry.split('--')[1]\n end\n # this is where final kids are created\n entry = entry.upcase\n children << \"<li class='kid'><a href='#{link}'>#{entry}</a></li>\"\n end\n end\n return data\n end", "def files_search_results(search_result, direction)\n files, files_in_folders = search_result.compact.partition { |v| v[:file_path] == \"/\" }\n\n folders_result = files_map(files_in_folders)\n sorted_folders = []\n folders_result.\n group_by { |k| [k[:path]] }.\n sort_by { |k, _| k[0].downcase }.\n each { |_, v| sorted_folders << v }\n sorted_folders.flatten!\n\n files_result = files_map(files)\n sorted_files = files_result.sort_by { |k| k[:title].downcase }\n\n if direction == \"desc\"\n sorted_folders = sorted_folders.reverse\n sorted_files = sorted_files.reverse\n end\n sorted_folders + sorted_files\n end", "def 500_files(input)\n # naive solution is to flatten and sort\n\n \nend", "def make_inventory\n Dir.glob('**/*').sort.each {|f| puts f}\nend", "def horizontal_dirs\n # have to add extra logic?\n \n HORIZONTAL_DIRS\n\n end", "def sequential_files\n get_files_in_dir(@sequential_dir)\n end", "def count\n dir = '/Users/zzygis/lab/tekstai/stenogramos/'\n Dir.foreach(dir) do |f_sn|\n current_dir = dir + f_sn + '/'\n if current_dir =~ /\\d+/ then\n Dir.foreach(dir + f_sn) do |f_sp| \n yield f_sn, current_dir + f_sp if f_sp.include? '.txt'\n end\n end\n end\nend", "def test_run_num_folders\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(6,f.sub_folders.length) #note that there are 6 sub folders\n\tend", "def directory_subdirectories(path)\n\tputs ''\n\tfor i in subdir_paths(path)\n\t\tputs i\n\tend\n\tputs ''\n\treturn nil\nend", "def sorted_files\n sort_file_name_by_semver(all_files.select { |f| semver_file?(f) })\n end", "def get_directory_list( dirname, pattern )\n res = []\n begin\n Dir.foreach( dirname ) do |f|\n if pattern.match( f )\n res << f\n end\n end\n rescue => e\n end\n\n return res.sort { |x, y| directory_sort_order( x, y ) }\n end", "def directory(dir); end", "def enhance_file_list\n return unless $enhanced_mode\n # if only one entry and its a dir\n # get its children and maybe the recent mod files a few\n \n # zsh gives errors which stick on stdscr and don't get off!\n # Rather than using N I'll try to convert to ruby, but then we lose\n # similarity to cetus and its tough to redo all the sorting stuff.\n if $files.size == 1\n # its a dir, let give the next level at least\n if $files.first[-1] == \"/\"\n d = $files.first\n #f = `zsh -c 'print -rl -- #{d}*(omM)'`.split(\"\\n\")\n f = get_file_list d\n if f && f.size > 0\n $files.concat f\n $files.concat get_important_files(d)\n return\n end\n else\n # just a file, not dirs here\n return\n end\n end\n # \n # check if a ruby project dir, although it could be a backup file too,\n # if so , expand lib and maby bin, put a couple recent files\n #\n if $files.index(\"Gemfile\") || $files.grep(/\\.gemspec/).size > 0\n # usually the lib dir has only one file and one dir\n flg = false\n $files.concat get_important_files(Dir.pwd)\n if $files.index(\"lib/\")\n f = `zsh -c 'print -rl -- lib/*(om[1,5]MN)'`.split(\"\\n\")\n if f && f.size() > 0\n insert_into_list(\"lib/\", f)\n flg = true\n end\n dd = File.basename(Dir.pwd)\n if f.index(\"lib/#{dd}/\")\n f = `zsh -c 'print -rl -- lib/#{dd}/*(om[1,5]MN)'`.split(\"\\n\")\n if f && f.size() > 0\n insert_into_list(\"lib/#{dd}/\", f)\n flg = true\n end\n end\n end\n if $files.index(\"bin/\")\n f = `zsh -c 'print -rl -- bin/*(om[1,5]MN)'`.split(\"\\n\")\n insert_into_list(\"bin/\", f) if f && f.size() > 0\n flg = true\n end\n return if flg\n\n # lib has a dir in it with the gem name\n\n end\n return if $files.size > 15\n\n ## first check accessed else modified will change accessed\n moda = `zsh -c 'print -rn -- *(/oa[1]MN)'`\n if moda && moda != \"\"\n modf = `zsh -c 'print -rn -- #{moda}*(oa[1]MN)'`\n if modf && modf != \"\"\n insert_into_list moda, modf\n end\n modm = `zsh -c 'print -rn -- #{moda}*(om[1]MN)'`\n if modm && modm != \"\" && modm != modf\n insert_into_list moda, modm\n end\n end\n ## get last modified dir\n modm = `zsh -c 'print -rn -- *(/om[1]MN)'`\n if modm != moda\n modmf = `zsh -c 'print -rn -- #{modm}*(oa[1]MN)'`\n insert_into_list modm, modmf\n modmf1 = `zsh -c 'print -rn -- #{modm}*(om[1]MN)'`\n insert_into_list(modm, modmf1) if modmf1 != modmf\n else\n # if both are same then our options get reduced so we need to get something more\n # If you access the latest mod dir, then come back you get only one, since mod and accessed\n # are the same dir, so we need to find the second modified dir\n end\nend", "def run_through_directory\n@file_array = []\n Dir.foreach('text_files') do |item|\n next if item == '.' or item == '..'\n @file_array << item\n end\nend", "def traverse_sort_and_add_nav_order_to_nodes(node)\n\t\n\t\t# traverse subfolders, go deep\n\t\tif node_has_children(node)\n\t\t\n\t\t\t node.children.items.each_with_index do |child|\n\t\t\t\t if child.nav_type == \"folder\" || child.nav_type == \"folder+markdown\"\n\t\t\t\t\t items = traverse_sort_and_add_nav_order_to_nodes(child)\n\t\t\t\t\t child.children.items = items if items and items.size > 0\n\t\t\t\t end\n\t\t\t end\n\t\t \n\t\tend\t \n\t\n\t\thas_navig_yml = File.exist?(\"#{node.source_path}/aaaa-navigation.yml\")\n\t\n\t\tif has_navig_yml and node.children and node.children.items?\n\t\n\t\telse\n\t\t\treturn nil\t\t\n\t\tend \n\t\n\t\tsorted_nav_items = nil\n\t\n\t\tif node.children? and node.children.items?\n\t\t\tsorted_nav_items = node.children.items\n\t\tend\n\t\n\t\tif File.exists?(\"#{node.source_path}/aaaa-navigation.yml\")\n\t\t\t# load aaaa-navigation.yml\n\t\t\tnaml = Map.new(YAML.load_file(\"#{node.source_path}/aaaa-navigation.yml\"))\t\t\n\t\n\t\t\t# iterate and re-order navigation.yml\n\t\t\tsorted_nav_items = node.children.items\n\n\t\t\tsorted_nav_items.each_with_index do |sni, i| \n\t\t\t\tsni.nav_order = i + 1000\n\t\t\tend\n\n\t\t\tnaml.nav_items.each_with_index do |naml_item, i|\n\t\t\t\tsorted_nav_items.each do |sni| \n\t\t\t\t\tsni.nav_order = i if sni.source == naml_item.source\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tsorted_nav_items.sort! { |x, y| x.nav_order <=> y.nav_order }\n\n\t\t\tsorted_nav_items.each_with_index do |sni, i| \n\t\t\t\tsni.nav_order = i + 1\n\t\t\tend\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\tend\n\t\n\t\tsorted_nav_items\n\tend", "def move_dirs\n [\n [2, 1],\n [1, 2],\n [-1, 2],\n [-2, 1],\n [-2, -1],\n [-1, -2],\n [1, -2],\n [2, -1]\n ]\n end", "def process_dups dups, output_paths\r\n\tpriorities = {}\r\n\terrors = []\r\n\tputs dups.inspect\r\n\r\n\tdups.each do |hash, files|\r\n\t\t# HACK: eliminate newlines in file names, not sure why they were there in the first place\r\n\t\tfiles.map! { |f| f.gsub(\"\\n\", ' ') }\r\n\r\n\t\t# identify all unique parent directory names for the files\r\n\t\tparent_dirs = files.map { |f| parent_dir(f) }.uniq.sort\r\n\r\n\t\tif parent_dirs.size > 1\r\n\t\t\t# if there are different parent directory names for the same file,\r\n\t\t\t# let the user select which one to use\r\n\t\t\tunless priorities.include? parent_dirs\r\n\t\t\t\tparent_dirs.each_with_index { |d, i| puts \"#{i} = #{d.inspect}\" }\r\n\t\t\t\tprint \"Select Index > \"\r\n\t\t\t\tindex = ($stdin.gets).chomp.to_i\r\n\t\t\t\tpriorities[parent_dirs] = parent_dirs[index]\r\n\t\t\t\tputs # print newline\r\n\t\t\tend\r\n\t\t\tparent_dir = priorities[parent_dirs]\r\n\t\telsif parent_dirs.size == 1\r\n\t\t\tparent_dir = parent_dirs[0]\r\n\t\telse\r\n\t\t\tputs \"Invalid parent directories for #{hash}: #{parent_dirs.inspect}\"\r\n\t\tend\r\n\r\n\t\treadable_files = files.select { |f| File.readable?(f) }\r\n\t\tif readable_files.size == 0\r\n\t\t\terrors << \"Unable to read any of the following files:\\n - #{files.join(\"\\n - \")}\"\r\n\t\telse\r\n\t\t\toutput_paths[parent_dir] << readable_files[0]\r\n\t\tend\r\n\tend\r\n\r\n\terrors\r\nend", "def get_directory_display_order(directory)\n\n display_info_file_path = File.join(directory, \".display_info\")\n\n # Check for a .display_info file\n if File.file?(display_info_file_path)\n\n display_info_hash = YAML.load_file(display_info_file_path)\n\n if display_info_hash.has_key?(\"display_order\")\n return display_info_hash[\"display_order\"]\n end\n end\n\n # No file or key found so return a display order of 0\n return 0\n end", "def test_calculate_tree_size_many_files\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(2705,f.calculate_tree_size(\"./TestFolders/Folder1/\"))\n\tend", "def scandir(dir)\n\tfilecount = 0\n\twordcount = 0\n\thist = {}\n\t$part.each{|p| hist[p] = {}}\n\tDir::glob(\"#{dir}/**/*.{tex,txt,doc,docx,pdf}\").each {|fname|\n\t\t$stderr.print \">>>> #{fname}\\n\"\n\t\tbegin\n \t\t\twordcount += mkhist(fname, hist)\n \t\t\tfilecount += 1\n \t\trescue\n \t\tend\n \t}\n \treturn hist, filecount, wordcount\nend", "def directories\n directory.directoires\n end", "def sort_out_output_directories \n FileUtils.mkdir_p(output_directory)\n FileUtils.mkdir_p(xml_directory)\n FileUtils.mkdir_p(intermediate_directory) unless run_in_memory\n end", "def test_run_num_files\n\t\tf = FolderWalker.new(\"./TestFolders/\")\n\t\tf.run\n\t\tassert_equal(6,f.files.length)\n\tend", "def path_ids\n ancestry_ascendente_directo.split(',').map{|a| a.to_i if a.present?}.compact\n end", "def get_important_files dir\n # checks various lists like visited_files and bookmarks\n # to see if files from this dir or below are in it.\n # More to be used in a dir with few files.\n list = []\n l = dir.size + 1\n\n # 2019-03-23 - i think we are getting the basename of the file\n # if it is present in the given directory XXX\n @visited_files.each do |e|\n list << e[l..-1] if e.index(dir) == 0\n end\n list = get_recent(list)\n\n # bookmarks if it starts with this directory then add it\n # FIXME it puts same directory cetus into the list with full path\n # We need to remove the base until this dir. get relative part\n list1 = @bookmarks.values.select do |e|\n e.index(dir) == 0 && e != dir\n end\n\n list.concat list1\n list\nend", "def read_files\n Dir['*', '*/*'].group_by { |f| f.ext || :_dir }.to_symkey\n end", "def countItems( dir )\n if $options[:verbose]\n STDOUT.puts \"DEBUG: Counting files in [#{dir}]\"\n end\n\n count = 0\n Dir.foreach( dir ) do |item|\n next if item == \".\" or item == \"..\"\n count += 1\n fullPath = File.join( dir, item )\n count += countItems( fullPath ) if File.directory? fullPath\n end\n return count\nend", "def countItems( dir )\n if $options[:verbose]\n STDOUT.puts \"DEBUG: Counting files in [#{dir}]\"\n end\n\n count = 0\n Dir.foreach( dir ) do |item|\n next if item == \".\" or item == \"..\"\n count += 1\n fullPath = File.join( dir, item )\n count += countItems( fullPath ) if File.directory? fullPath\n end\n return count\nend", "def compute_all_dir_sizes(directory:, answer:)\n directory.size = directory.files.sum(&:size) if directory.directories.empty?\n\n directory.directories.each do |child_directory|\n compute_all_dir_sizes(directory: child_directory, answer:)\n end\n\n directory.set_size\n answer.push(directory.size) if directory.size <= 100_000\n answer\nend", "def check_directories\n new_file_names = {}\n DirmonEntry.enabled.each do |entry|\n entry.each do |pathname|\n # BSON Keys cannot contain periods\n key = pathname.to_s.tr('.', '_')\n previous_size = previous_file_names[key]\n size = check_file(entry, pathname, previous_size)\n new_file_names[key] = size if size\n end\n end\n self.previous_file_names = new_file_names\n end", "def dir(*) end", "def walk_path(dirs)\n (1..dirs.to_a.length).map do |k|\n File.join(*dirs.to_a.take(k))\n end\nend", "def scan_dir (dirname)\n log \"*** Inspect: \" + dirname\n Dir.foreach(dirname) do |filename|\n path_cand = File.join(dirname , filename)\n if File.directory?(path_cand)\n #exams directories\n if (filename != \".\" && filename != \"..\")\n unless @filter_dir.index(filename)\n #directory not filtered\n @explore_dir.push(path_cand)\n @dir_list << path_cand\n end\n end\n else\n # file to be listed\n unless file_is_filtered?(path_cand)\n # file is not filtered\n #p path_cand\n if file_has_admitted_extension?(path_cand)\n @result_list.push(path_cand)\n end\n end\n end #file.directory?\n end\n next_dir = @explore_dir.pop\n scan_dir(next_dir) if next_dir \n end", "def scan_dir (dirname)\n log \"*** Inspect: \" + dirname\n Dir.foreach(dirname) do |filename|\n path_cand = File.join(dirname , filename)\n if File.directory?(path_cand)\n #exams directories\n if (filename != \".\" && filename != \"..\")\n unless @filter_dir.index(filename)\n #directory not filtered\n @explore_dir.push(path_cand)\n @dir_list << path_cand\n end\n end\n else\n # file to be listed\n unless file_is_filtered?(path_cand)\n # file is not filtered\n @result_list.push(path_cand)\n end\n end #file.directory?\n end\n next_dir = @explore_dir.pop\n scan_dir(next_dir) if next_dir \n end", "def get_level_children(dirname,level) #:nodoc:\n dir_children = full_entries(dirname)\n @level_children += dir_children\n if level < @max_level\n dir_children.each {|e|\n if File.directory?(e)\n get_level_children(e,level + 1)\n end\n }\n end\n end" ]
[ "0.6484504", "0.641921", "0.6282252", "0.62172365", "0.6177203", "0.6176937", "0.6139749", "0.61335576", "0.61319464", "0.61286837", "0.6115474", "0.6036333", "0.6036333", "0.6033609", "0.6033289", "0.60153216", "0.6005804", "0.59692466", "0.5959485", "0.5923042", "0.5919943", "0.5908537", "0.5891903", "0.5886477", "0.584619", "0.581892", "0.57952255", "0.57952255", "0.5787834", "0.5787483", "0.57817227", "0.57689583", "0.5762114", "0.57539463", "0.5753366", "0.5725954", "0.5720263", "0.5705379", "0.5699769", "0.569781", "0.56793535", "0.56679535", "0.56621325", "0.56544816", "0.56540745", "0.5652554", "0.564226", "0.5629451", "0.56280756", "0.5626951", "0.56221026", "0.56211567", "0.5617771", "0.56175476", "0.56109697", "0.56109697", "0.56094843", "0.5607634", "0.5599353", "0.5598814", "0.5589004", "0.5588873", "0.5586089", "0.55804276", "0.5566869", "0.55668676", "0.55553526", "0.5554659", "0.5553483", "0.5545926", "0.55441856", "0.5540657", "0.55385464", "0.552899", "0.55240154", "0.5523627", "0.5508498", "0.5506264", "0.5506131", "0.5500753", "0.5497394", "0.5487662", "0.5480343", "0.54770863", "0.5466018", "0.5463932", "0.5444806", "0.5442769", "0.5441546", "0.5425123", "0.5421766", "0.54214096", "0.54214096", "0.5414659", "0.5396982", "0.53962076", "0.53961253", "0.5394801", "0.5387448", "0.5385561" ]
0.6317015
2
load a file containing json data and return a hash
def load_json_doc( filename ) begin File.open( filename, 'r') do |file| json_str = file.read( ) doc = JSON.parse json_str return doc end rescue => ex puts "ERROR: loading #{filename} (#{ex})" return nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_hash(file_path) \n file=File.read(file_path)\n JSON.parse(file)\n end", "def load_hash(file_path) \n file=File.read(file_path)\n JSON.parse(file)\n end", "def getHashFromJson(filename)\n File.open( filename, \"r\" ) do |f|\n JSON.load(f)\n end\nend", "def get_data_from_json_file(filename)\n file_to_parse = File.read(filename)\n data_hash = JSON.parse(file_to_parse)\n return data_hash\nend", "def parse_json(filename)\n\tfile = File.read(filename)\n\tbegin\n \t\tdata_hash = JSON.parse(file)\n\trescue JSON::ParserError\n\t\tfile = nil\n\tend\n\tdata_hash\n end", "def read_jason(file_path)\r\n json_file = File.read(file_path)\r\n data_hash = JSON.parse(json_file)\r\n return data_hash\r\nend", "def getFileContent(file_path)\n file = File.read(file_path)\n data_hash = JSON.parse(file)\n return data_hash\nend", "def load_json(filename); end", "def load_dict(filename)\n if File.exist?(filename)\n f = File.read(filename)\n @hash_dict = JSON.parse(f)\n else\n puts('read error')\n end\n end", "def populate\n file = File.read(json_file)\n storage = JSON.parse(file, :symbolize_names => true)\n\n @hashes = storage[:hashes]\n convert if @hashes.is_a? Array\n\n @hashes\n end", "def parse json; return JSON.parse File.read json end", "def parse json; return JSON.parse File.read json end", "def from_json(filename)\n require \"json\" unless defined?(JSON)\n from_hash(JSON.parse(IO.read(filename)))\n end", "def json_load(file_path)\n MultiJson.load(File.read(file_path)).to_smash\n end", "def read\n file = File.read(@filename)\n JSON.parse(file)\n end", "def read_json\n recipes_json = File.read('JSON/recipes.json')\n recipe_hash = JSON.parse(recipes_json)\n return recipe_hash\nend", "def read\n return nil unless File.file?(\"./#{filename}\")\n JSON.parse(IO.read(filename))\n end", "def json_file_fixture(path)\n return JSON.parse(File.read(file_fixture(path)), symbolize_names: true)\n end", "def flat_hash_from_json_file(file_path)\n JSON.parse(File.read(file_path)).path_flatten\n end", "def load(file)\n data = File.read(file)\n JSONL.parse(data)\n end", "def load_from_file(path)\n return unless File.exist?(path)\n json_data = File.read(path)\n load_raw_json(json_data)\n end", "def load\n @cache = JSON.parse(File.read(file))\n rescue\n @cache = {}\n end", "def read_from_json\n JSON.parse File.new(@filepath).read\n end", "def get_hash(name)\n file_name = File.join(@db_dir, name + '.json')\n return ::Hash.new unless File.exist?(file_name)\n\n begin\n json = File.read(file_name)\n rescue => e\n PEROBS.log.fatal \"Cannot read hash file '#{file_name}': #{e.message}\"\n end\n JSON.parse(json, :create_additions => true)\n end", "def read_json_test\n recipes_json = File.read('JSON/recipes.json')\n recipe_hash = JSON.parse(recipes_json)\n return recipe_hash\nend", "def read_json_file(filepath)\n file = File.open(filepath)\n file_data = file.read\n return JSON.parse(file_data)\nend", "def read_and_parse_file(path)\n json = JSON.parse(File.read(path))\n recursive_symbolize_keys!(json)\n end", "def initialize(file_name)\n @file = File.read(file_name)\n @json_hash = JSON.parse(@file)\n end", "def parse\n file = File.read(@file)\n @data = JSON.parse(file)\n end", "def read_json_file(path)\n JSON.parse(File.open(path){ |f| f.read })\nend", "def readJson(dataFilePath)\n dataFile = File.new(dataFilePath, \"r\");\n data = JSON.load(dataFile);\n dataFile.close();\n data;\nend", "def json_file_fixture(path)\n return JSON.parse(File.read(file_fixture(path)), symbolize_names: true)\nend", "def get_json(name)\n r = {}\n open_file(name) do |f|\n r = JSON.parse(f.read)\n yield r if block_given?\n end\n r\n end", "def load_json(json)\n @raw = JSON.load(json)\n\n load_hash(@raw)\n end", "def json_from(json_file)\n JSON.parse(File.read(json_file), symbolize_names: true)\nend", "def read_fixture_as_hash(name)\n JSON.parse(read_fixture(name))\nend", "def json\n @hash ||= ::JSON.parse(data)\n end", "def parse_json_file(json_file)\n json = File.read(json_file)\n obj = JSON.parse(json)\n return obj\n end", "def load_json(dir_path, filename)\n file_path = File.join(dir_path, filename)\n JSON.parse(File.read(file_path))\n end", "def load_json(file, path=nil)\n f = File.new( file )\n json = JSON.parse( f.read )\n if path != nil\n json = Siren.query(query, json)\n end\n counter = 0\n #TODO could support proper results, not just hash?\n if json != nil\n json.each_pair do |key,value|\n if value.class() == Array\n value.each do |v|\n @redis.lpush( key, v )\n end \n elsif value.class == Hash\n value.each_pair do |field, v|\n #TODO better handling of nesting?\n #E.g. convert hash or array back into JSON?\n @redis.hset(key, field, v)\n end\n else\n @redis.set(key, value)\n end\n counter = counter + 1 \n end \n end\n return counter\n end", "def get_data\n json_file = Egd::Builder.new(File.read(@file)).to_json\n data = JSON.parse(json_file)\n end", "def read_locations_from file\n data_hash = []\n File.readlines(file).each do |line|\n data_hash << JSON.parse(line)\n end\n self.location_hash = data_hash\n self\n end", "def load_json(file)\n data = ''\n f = File.open(File.join(Rails.root, 'spec', 'mocks', file)) \n f.each_line do |line|\n data += line\n end\n f.close\n JSON.parse(data)\nend", "def open_data(file)\n @data = JSON.parse(IO.readlines(file).join)\n end", "def load_json(filename)\n begin\n File.open(filename, \"r\" ) do |f|\n JSON.load(f)\n end\n rescue Errno::ENOENT, TypeError => e\n puts \"You must supply a valid filename: #{e.message}\"\n exit\n end\nend", "def file_to_hash( file )\n to_hash( File.read( file ) )\n end", "def read_json(path)\n return JSON.parse(File.read(path).rstrip)\nend", "def read_json(path)\n return JSON.parse(File.read(path).rstrip)\nend", "def read_config_file\n config_hash = {}\n if File.file? @config_file\n begin\n config_hash = JSON.parse(File.read(@config_file))\n rescue StandardError => e\n raise ConfigError.new(\"parsing configuration file: #{e}\")\n end\n end\n config_hash\n end", "def load_from_file!(file_path)\n raise IOError, \"File #{file_path} not exist\" unless File.exist?(file_path)\n raw_data = IO.read(file_path)\n load_from_json!(raw_data)\n end", "def parse_json_file(filename, symbolize_names: false)\n f = File.open(filename, 'r')\n JSON.parse(f.read, symbolize_names: symbolize_names).tap do\n f.close\n end\nend", "def get_data()\n if File.exists?(FILENAME)\n results = JSON.parse(File.read(FILENAME))\n return results\n else\n # JSON only parses strings, so it makes things much faster to simply write the key as in a format that JS can use.\n {\"users\" => []}\n end\nend", "def read_json\n file = File.read('townhall.json')\n jason = JSON.parse(file)\n return jason\nend", "def load_file(file_name)\n File.open(file_name, 'r') do |f|\n f.each_line.collect do |line|\n parse_json(line)\n end\n end\n end", "def read_file(filename)\n JSON.parse(File.read(\"spec/fixtures/files/#{filename}\"))\n end", "def load_file(file_name)\n File.open(file_name, \"r\") do |f|\n f.each_line.collect do |line|\n parse_json(line)\n end\n end\n end", "def load_json(file)\n type = File.basename(file, File.extname(file)).to_sym\n JSON.parse(File.read(file)).each do |allocation, settings|\n next if allocation == \"_\"\n\n settings.reject! { |k, _| k.start_with?(\"_\") }\n host = settings.delete(\"host\")\n host = intern_string(host) if host\n options = if settings.empty?\n EMPTY_HASH\n else\n settings.map { |k, v| [k.to_sym, v.is_a?(String) ? intern_string(v) : v] }.to_h.freeze\n end\n define(type, allocation, host, options)\n end\n end", "def json(*files, **options, &block) = read(*files, parse: :json, ext: '.json', **options, &block)", "def configfile_hash\n\n config = {}\n begin\n json = File.read(configfile)\n config = JSON.parse(json)\n rescue Errno::ENOENT\n # depending on whether the instance has been saved or not, we may not\n # yet have a configfile - allow to proceed\n @logger.debug \"#{configfile} does not exist\"\n @force_save = true\n rescue JSON::ParserError\n # swallow parse errors so that we can destroy and recreate automatically\n @logger.debug \"JSON parse error in #{configfile}\"\n @force_save = true\n end\n config\n end", "def load_data_from_file(default=json_default)\n KiJSONFile.load_json(path, default)\n end", "def read_data_object( filename )\n\n data_dir = self.config['data_dir'] || '_data'\n data_path = File.join(self.config['source'], data_dir)\n if File.symlink?(data_path)\n return \"Data directory '#{data_path}' cannot be a symlink\"\n end\n file = File.join(data_path, filename)\n\n return \"File #{file} could not be found\" if !File.exists?( file )\n \n result = nil\n Dir.chdir(data_path) do\n rows = []\n CSV.foreach(filename, headers: true, col_sep: ',') do |row|\n rows << row.to_hash\n end\n result = rows\n end\n puts \"## Error: No data in #{file}\" if result.nil?\n result = JSON.parse( result.to_json ) if result\n { 'data' => result,\n 'mtime' => File.mtime(file) }\n end", "def json_struct(filename)\n JSON.parse json_string(filename)\n end", "def load\n if File.exist?(@file_path)\n\n @_cache = JSON File.open(@file_path, &:read).strip\n else\n $stderr.puts \"#{@file_path} does not exist\"\n end\n end", "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend", "def load_json( filename, debug = false)\n\traise RuntimeError, \"Missing filename\" if not filename\n\n\tif( File.exists?( filename ) or File.symlink?( filename ) )\t\t\n\t\treturn JSON.load( File.open( filename ) )\n\telse\n\t\traise RuntimeError, \"Could not find \"+filename+\"\\n\"\n\tend\n\nend", "def openJsonFile(filepath)\n $file = File.open filepath\n $jsonObjectMain = JSON.load $file\n return $jsonObjectMain\nend", "def read_json j_file\n data = nil\n open(j_file) do |f|\n data = f.read\n end\n j = JSON.parse(data)\n\n return j\nend", "def parse_json(json_file)\r\n\t\t\tjfile = File.read(json_file)\r\n\t\t\treturn JSON.parse(jfile)\r\n\t\tend", "def load_digest\n begin\n return MultiJson.load(File.read(digest_file))\n rescue => ex\n end\n nil\n end", "def load_data\n data = {}.with_indifferent_access\n\n %w[.json .yaml].each do |ext|\n Dir.glob(\"#{DATA_DIR}/*#{ext}\") do |fname|\n key = File.basename(fname, ext).to_sym\n puts \"Loading data[:#{key}] from #{fname}...\"\n data[key] =\n if ext == '.json'\n JSON.parse(File.read(fname))\n else\n Psych.parse(fname)\n end\n end\n end\n\n data\n end", "def parse_json(file = nil, symbolize = true)\n return unless file && ::File.exist?(file.to_s)\n begin\n ::JSON.parse(::File.read(file.to_s), symbolize_names: symbolize)\n rescue JSON::ParserError\n return\n end\n end", "def read_file_level_data\n cdjf = corresponding_data_json_file\n return {} if cdjf.nil?\n cdjf.read_data\n end", "def hash\n require 'yaml'\n hash = YAML.load(File.read(self.yaml_file)) #gets hash from yaml file\n return hash\n end", "def new_from_json_file(path)\n json = ::File.read(path)\n new_from_json_string(json)\n end", "def json(file_path)\n raise(format(ERROR_EXT_NOT_JSON, file_path)) unless json?(file_path)\n\n content = read_file(file_path)\n JSON.parse(content)\n end", "def read\n raise Errors::FileMissing, @pathname unless @pathname.exist?\n\n JSON.parse(\n @pathname.read,\n symbolize_names: true\n )\n rescue JSON::ParserError => e\n raise Errors::ParserError, e\n end", "def read_file(path, key)\n file = IO.read(path)\n JSON.parse(file)[key]\n end", "def load_from_file(dir, file=\"/specs.def\")\n JSON.parse(IO.read(File.join(dir, file))) rescue raise ArgumentError\n end", "def load_sample(file)\n path = Rails.root.join(\"lib\", \"assets\", \"sample_data\", \"#{file}.json\")\n file_data = File.read(path)\n return JSON.parse(file_data, symbolize_names: true)\n end", "def load_json(filename)\n File.open(File.expand_path(\"../support/#{filename}\", __FILE__), \"r\") do |json_file|\n JSON.load(json_file)\n end\nend", "def load_hash(hash = nil)\n\tdefault = \"yaml_output.yaml\"\n\tprint \"filename: \"\n\n\tfilename = STDIN.gets.chomp\n\tfilename = filename.downcase == \"def\" ? default : filename\n\tfiletype = filename.split(\".\").last\n\t\n\tfile = File.open(filename, \"rb+\") if exists = File.exist?(filename)\n\n\tif !exists\n\t\tputs \"File #{filename} does not exist\"\n\t\texit(0)\n#\telsif (file_string = file.readlines).length == 0\n#\t\tputs \"File #{filename} is empty\"\n#\t\texit(0)\n\tend\n\n\tbenchmark = Benchmark.measure {puts \"LOADING YAML\"; hash = Marshal::load(file) } if filetype == \"yaml\"\n\tbenchmark = Benchmark.measure {puts \"LOADING JSON\"; hash = JSON.parse(file_string) } if filetype == \"json\"\n\tif hash == nil\n\t\tputs \"invalid filename\" \n\t\texit(0)\n\tend\n\t\n\tputs \"LOAD TIME: #{benchmark}\"\n\tputs \"DONE\\n\"\n\tfile.close\n\treturn hash\nend", "def read_data_from_file\n file = File.read(\"condensed_capitals.json\")\n @countries_capitals_as_hash = JSON.parse(file)\n end", "def load\n sleeper = 0.0\n while File.exist? lock_file\n sleeper += 0.1 if sleeper <= 10.0\n sleep(sleeper.to_i)\n end\n # :symbolize_names does not play nicely with :create_additions\n tmp = JSON.parse(File.read(path),\n {:symbolize_names=>false, :create_additions=>true})\n @data = {}\n tmp.each_pair{ |k,v| self[k] = v }\n end", "def load_raw_json(json_data)\n temp = Hashie::Mash.new(MultiJson.load(json_data))\n @structure = temp.structure ? temp.structure : Hashie::Mash.new\n @measure_instances = temp.measure_instances ? temp.measure_instances : Hashie::Mash.new\n # these could be set in the file\n @analysis_id = temp.structure.analysis_id if temp.structure.analysis_id\n @user_defined_id = temp.structure.user_defined_id if temp.structure.user_defined_id\n\n return true\n end", "def fixture_hash(filename, data: {})\n file = File.read fixture_file(filename)\n YAML.load render_erb(file, data)\n end", "def load_data(filename=nil)\n filename=data_file(filename)\n return unless File.exist?(filename)\n case File.extname(filename).downcase\n when \".yaml\",\".yml\"\n YAML.load(File.open(filename))\n when \".json\"\n JSON.parse(File.read(filename))\n else\n File.read(filename)\n end\n end", "def get_json\n recipe_json = File.read('./recipes.json')\n @json_recipes = JSON.parse(recipe_json)\n end", "def reload(file=nil)\n @file = file if file\n @h = JSON.parse(IO.read(@file), :symbolize_names => true)\n self\n end", "def load_databag_json(filename)\n File.open(File.expand_path(\"../../data_bags/rubycas/#{filename}\", __FILE__), \"r\") { |f| MultiJson.load(f) }\nend", "def readfile filename\n if filename.index(\".json\")\n require 'json'\n str = File.read(filename)\n hash = JSON.parse(str)\n elsif filename.index \".yml\"\n require 'yaml'\n hash = YAML::load( File.open( filename ) )\n else\n $stderr.puts color(\"#{$0}: Don't know how to handle #{filename}, pass either .json or .yml\", \"red\")\n exit 1\n end\n puts \"==> readfile: imdbid=\" + hash[\"imdbID\"] if $opt_verbose\n return hash\nend", "def load(filename)\n json_string = String.new\n File.open(filename, \"r\") { |f| \n json_string += f.read \n }\n @score = JSON.parse json_string \n end", "def load_options(path)\n path = File.expand_path path\n if File.exists? path\n JSON.parse(File.read path)\n else\n {}\n end\nend", "def json_to_ruby\n json = File.read('./database/townhalls.json')\n obj = JSON.parse(json)\n return obj\n end", "def json_string(filename)\n File.read json_file(filename)\n end", "def parse_json_file(file_path_as_string)\n\n begin\n\n @parsed_data = JSON.load_file(file_path_as_string, symbolize_names: true)\n\n rescue Errno::ENOENT => e\n puts Rainbow(\"\\n\\nWell now.... file appears to be missing..... I wonder where it went ?\").yellow\n sleep 1\n error_message_and_leave(e)\n\n rescue Errno::EACCES => e\n puts Rainbow(\"\\n\\nSo you haven't got permission for this file.... Dunno why.... Guess you're not at Level 8 Clearance..\").yellow\n sleep 1\n error_message_and_leave(e)\n\n rescue StandardError => e\n puts Rainbow(\"\\n\\nAwkies.... the file is not loading.... probably a user error :) \").yellow\n sleep 1\n error_message_and_leave(e)\n\n end\n\n end", "def parsed_json_fixture(path)\n JSON.parse json_fixture(path)\nend", "def read_JSON_file # called a helper method (is helping you to use less code and dealing with something so that your other methods don't have to)\n @json_data = File.read('./lib/contacts.json')\n @contacts = JSON.parse(@json_data, {:symbolize_names => true})\n end", "def from_json(data)\n hash = Oj.load(data, symbol_keys: true)\n from_h(hash, :from_json)\n end", "def load_penalties\n JSON.parse(File.read(@filename))\n end", "def ensure_load_json(file_path, def_val, json_params = {})\n if File.exists?(file_path)\n file_data = File.read(file_path).force_encoding('utf-8')\n if file_data.size >= 2 # '[]'\n JSON.parse(file_data, json_params)\n else\n def_val\n end\n else\n def_val\n end\n end", "def load!\n JSON.load(File.read(@name))\n rescue JSON::ParserError => e\n raise LogFile::LoadError, e.message\n end" ]
[ "0.8352166", "0.8352166", "0.8264029", "0.81349295", "0.7763567", "0.76565486", "0.7504367", "0.7393502", "0.7145566", "0.71415883", "0.7082485", "0.7082485", "0.70593697", "0.70428085", "0.6992506", "0.69494915", "0.6867012", "0.6795381", "0.67388004", "0.67374027", "0.6724651", "0.67238164", "0.67123586", "0.67062926", "0.6698657", "0.6698596", "0.66966957", "0.6688849", "0.66821766", "0.6649071", "0.661424", "0.6608994", "0.66069365", "0.6586444", "0.6585808", "0.65560925", "0.6532776", "0.65107876", "0.64987266", "0.6482333", "0.6456403", "0.6456234", "0.6430876", "0.6425073", "0.6407289", "0.6398868", "0.63785464", "0.63785464", "0.6359046", "0.6358804", "0.634691", "0.63448215", "0.63272285", "0.63152957", "0.6307093", "0.63057286", "0.6302815", "0.6279141", "0.6272484", "0.6259732", "0.6239805", "0.6238266", "0.62342787", "0.62143445", "0.6200087", "0.6192533", "0.6187358", "0.6171351", "0.6167166", "0.61637616", "0.6154615", "0.61440355", "0.6130364", "0.61292297", "0.6122555", "0.61152697", "0.6113649", "0.61018634", "0.60955626", "0.6079592", "0.6078384", "0.6055089", "0.604838", "0.602535", "0.60246205", "0.6016585", "0.6010914", "0.5987325", "0.5986443", "0.5973878", "0.59468323", "0.5917703", "0.59087276", "0.59054846", "0.58975893", "0.5892232", "0.588975", "0.5874196", "0.58739644", "0.58647805", "0.5825523" ]
0.0
-1
load a file containing xml data and return an oga document
def load_xml_doc( filename ) File.open( filename, 'r') do |file| return Oga.parse_xml( file ) end puts "ERROR: loading #{filename}" return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_xml file\n f = File.open file\n doc = Nokogiri::XML f\n f.close\n doc\n end", "def load_xml_document file_name\n xml_file = File.new file_name, \"r\"\n return Document.new xml_file\n end", "def load_xml(file_path)\n # Read the source XML file.\n puts \"file_path: #{file_path}\"\n raw_xml = File.read(file_path)\n\n # Parse raw_xml using Nokogiri.\n parsed_doc = Nokogiri.XML(raw_xml)\nend", "def load_XML(file)\n begin\n xml_file = File.open(file)\n xml_obj = Document.new(xml_file)\n xml_file.close\n rescue => e\n puts \"ERROR: Unable to create XML object from file: #{file}\"\n puts e.message\n puts e.backtrace\n exit 1\n end\n return xml_obj\nend", "def load_rop(file_path)\n f = File.open(file_path, 'rb')\n xml = REXML::Document.new(f.read(f.stat.size))\n f.close\n return xml\n end", "def nokogiri_xml(file_path)\n Nokogiri::XML(File.open(file_path), nil, 'UTF-8')\n end", "def load_ingest_content( filename )\n xml_doc = TaskHelpers.load_xml_doc( filename )\n return xml_doc\n end", "def xml\n File.read(\"#{@file_path}.xml\")\n end", "def from_file(file_path)\n from_xml(File.read(file_path))\n end", "def read(file)\n\t\tf = File.open file\n\t\t@doc = Nokogiri::XML(f)\n\t\t@current_node = @doc.root;\n\t\tf.close\n\tend", "def DataLoadFromFile(filename)\n file = File.new(filename)\n \n @xml_data = file\n self.ScrapAnalyse()\n end", "def read_xml\n @epub.file.read_xml(abs_filepath)\n end", "def open_file(language)\n begin\n xml_file = File.open(file_path(language))\n doc = Nokogiri::XML(xml_file)\n yield doc\n rescue Errno::ENOENT => e\n abort(e.message)\n end\n end", "def read_xml(xml)\n REXML::Document.new(File.read(xml)).root\nend", "def load_xml(source)\n #begin\n if source.is_a? Nokogiri::XML::Document\n @document = source\n else\n #source =~ /\\<DIF\\>/\n if source.size < 255 and File.exists? source\n source = File.read source\n end\n @document = Nokogiri::XML::Document.parse( source, nil, nil ) #, Nokogiri::XML::ParseOptions::NOBLANKS\n end\n # Sets all properties like Entry_ID for this instance\n load_hash(document_to_hash)\n \n #rescue => e\n #puts e.backtrace\n #raise ArgumentError, \"Cannot load DIF XML: \" + e.message[0..255]\n #end\n end", "def parse\n raise ERROR_FILE_NOT_SET if report.nil? || report.empty?\n raise format(ERROR_FILE_NOT_FOUND, report) unless File.exist?(report)\n\n Oga.parse_xml(File.read(report))\n end", "def from_file(filename, encoding = nil, options = Nokogiri::XML::ParseOptions::DEFAULT_XML)\n file = File.open(filename)\n @mods_ng_xml = Nokogiri::XML(file)\n file.close\n normalize_mods\n end", "def initialize(file_content)\n # Open XML file\n self.fichero = file_content\n # Initialize XML Document\n @doc = Document.new self.fichero\n # Initialize attribute default values\n self.lista_devoluciones = []\n end", "def parse_xml(filename)\n @parser = Parser.new :pregenerated => filename\n @parser.parse\n end", "def parse\n Ox.parse(@xml)\n end", "def moddify_document(path)\n doc = nil\n File.open(path,'r+') do | file|\n xml_string = file.read\n doc = process_xml(xml_string) if valid_xml?(xml_string)\n end\n doc\nend", "def load_xml(xml_url)\n\t\t\tfile = File.new(xml_url)\n\t\t\tload_map(file)\n\t\t\tfile.close\n\t\tend", "def open(arg,force_encoding=nil)\n data=ONIX::Helper.arg_to_data(arg)\n\n xml=nil\n if force_encoding\n xml=Nokogiri::XML.parse(data,nil,force_encoding)\n else\n xml=Nokogiri::XML.parse(data)\n end\n\n xml.remove_namespaces!\n xml\n end", "def read_file(filename)\n File.open(filename, \"r\") {|f| load_xml(f.read)}\n end", "def doc(path, options = {})\n require 'nokogiri'\n\n File.open(path) do |f|\n yield Nokogiri::XML(f)\n end\n end", "def parse_document(file)\n\n hpricot_doc = create_doc(file)\n raise \"Feature not saved!\" if hpricot_doc.nil?\n\n feature = extract_feature(hpricot_doc)\n xml_document = store_xml_document(feature)\n\n feature_object_types = extract_feature_object_types(hpricot_doc, feature)\n feature_relations = extract_feature_relations(hpricot_doc, feature)\n\n #feature_names = extract_feature_names(hpricot_doc, feature)\n extract_feature_names(hpricot_doc, feature)\n\n # When a feature is saved, it caches all of its ancestor ids. \n # You need to make sure this happens for all of the features every time\n # a new batch has been imported. \n features = Feature.all\n features.each do |f|\n f.save\n end\n end", "def initialize(xml)\n @source = isxml?(xml) ? xml : File.read(xml)\n @doc_stream = AltoDocStream.new\n parser = Nokogiri::XML::SAX::Parser.new(doc_stream)\n parser.parse(@source)\n end", "def import_nessus_xml_file(args={})\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\tf = File.open(filename, 'rb')\n\t\tdata = f.read(f.stat.size)\n\n\t\tif data.index(\"NessusClientData_v2\")\n\t\t\timport_nessus_xml_v2(args.merge(:data => data))\n\t\telse\n\t\t\timport_nessus_xml(args.merge(:data => data))\n\t\tend\n\tend", "def xml(path)\n Nokogiri::XML read path\n end", "def doc_xml(file)\n content = nil\n Zip::Archive.open(file) do |archive|\n archive.fopen('word/document.xml') do |f|\n content = f.read\n end\n end\n content\n end", "def readSrepData(config_index)\n file_name = $srep_file_path + config_index.to_s() + \".xml\"\n f = File.open(file_name)\n doc = Nokogiri::XML(f)\n f.close\n return doc\nend", "def load_model file\n self.clear_model\n\n xml_file = File.new file\n doc = Document.new xml_file\n\n doc.elements.each(\"model/entities/entity\") do |element|\n\n id = element.elements[1].text.to_i\n name = element.elements[2].text\n type = element.elements[3].text\n definition = element.elements[4].text\n x = element.elements[5].text.to_i\n y = element.elements[6].text.to_i\n\n if id.to_i > @max_id\n @max_id = id.to_i\n end\n\n ent = self.add_entity name, type, definition, x, y\n ent.id = id\n end\n\n doc.elements.each(\"model/connections/connection\") do |element|\n name = element.elements[1].text\n definition = element.elements[2].text\n source_entity_id = element.elements[3].text.to_i\n target_entity_id = element.elements[4].text.to_i\n source_point_type = element.elements[5].text\n target_point_type = element.elements[6].text\n source_point_x = element.elements[7].text.to_i\n source_point_y = element.elements[8].text.to_i\n target_point_x = element.elements[9].text.to_i\n target_point_y = element.elements[10].text.to_i\n label_x = element.elements[11].text.to_i\n label_y = element.elements[12].text.to_i\n\n source_entity = self.get_entity source_entity_id\n target_entity = self.get_entity target_entity_id\n source_point = Point2D::Double.new source_point_x, source_point_y\n target_point = Point2D::Double.new target_point_x, target_point_y\n\n con = self.add_connection_specific_endpoints source_entity,\n target_entity,\n source_point,\n target_point,\n source_point_type,\n target_point_type,\n name,\n definition\n\n con.label.set_location label_x, label_y\n end\n @panel.repaint\n end", "def load_xml(xml)\n @mmdoc = REXML::Document.new(xml)\n end", "def load_xml(file_name = @file_name)\n\t\tputs \"loading xml...\"+file_name\n\t\ttweet_loader = TweetLoader.new(file_name)\n\t\ttweet_loader.load_tweets\n\t\t@tweets = tweet_loader.get_tweets\n\tend", "def import_nexpose_simplexml_file(args={})\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\tf = File.open(filename, 'rb')\n\t\tdata = f.read(f.stat.size)\n\t\timport_nexpose_simplexml(args.merge(:data => data))\n\tend", "def read(file) \n @file = Nokogiri::XML(file){ |cfg| cfg.noblanks } \n end", "def open_document\n @document = Nokogiri::XML(open(@feed_uri).read)\n end", "def document\n @doc ||= Nokogiri::XML(@xml)\n end", "def document(source)\n ::Nokogiri::XML(source, *@options)\n end", "def load_from_xml(f)\n case f\n when Array\n f.each { |filename| load_from_xml(filename) }\n when String\n load_from_xml(File.open(f))\n when IO\n tf = PROIELXML::Reader.parse_io(f)\n\n tf.proiel.sources.each do |s|\n @sources << Source.new(self, s.id, tf.proiel.export_time, s.language, s.dialect,\n bundle_metadata(s), s.alignment_id) do |source|\n build_divs(s, source)\n end\n\n index_source_objects!(@sources.last)\n end\n\n tf.proiel.dictionaries.each do |s|\n @dictionaries << Dictionary.new(self, tf.proiel.export_time, s.language, s.dialect, s)\n\n index_dictionary_objects!(@dictionaries.last)\n end\n\n annotation_schema = AnnotationSchema.new(tf.proiel.annotation)\n schema_version = tf.proiel.schema_version\n\n @annotation_schema ||= annotation_schema\n @schema_version ||= schema_version\n\n if @annotation_schema == annotation_schema and @schema_version == schema_version\n # FIXME: consolidate export times? This is a design flaw in PROIEL XML\n # 2.0: export time ought to be per source not per PROIEL XML file, so\n # not clear what to do here. Pass it down to the source object?\n # @export_time = tf.proiel.export_time\n else\n raise SchemaMismatch\n end\n else\n raise ArgumentError, 'expected filename, IO or array of these'\n end\n\n self\n end", "def initialize(file)\n\t\t@file = file\n\t\t@doc = Hpricot.XML(file)\n\tend", "def initialize(ead_file)\n @xml = Nokogiri::XML(open(ead_file))\n @doc = {}\n self.getID\n self.getFormatFacet\n self.getTitle\n self.getSubjects\n self.getGeographicSubjects\n self.getPublisherFacet\n self.getGenreFormatFacet\n self.getLanguageFacet\n self.getAbstract\n self.getBiogHist\n #self.getEAD\n end", "def initialize(path)\n @filename = path\n file = nil\n file = open(path)\n @errors = [] \n \n @document = Nokogiri::XML(file)\n @document.remove_namespaces!\n @node = @document.root\n unless self.valid?\n self.errors << {:xml => 'invalid xml passed in'}\n #raise \"Unable to load file. Is it in the correct format?\"\n end\n end", "def read_XML_file(xfile)\n result_array = []\n if File.file?(xfile)\n puts \"\\n\\nOPENING #{xfile}\"\n f = File.open(xfile)\n doc = Nokogiri::XML(f)\n if is_squish?(doc)\n result_array = squish_parser(doc)\n else\n result_array = rspec_parser(doc)\n end\n else\n puts \"\\nNot a file: #{xfile} - verify options (-x for directory, -f for a specific file)\"\n end\n return result_array \n end", "def xml_load(file_path)\n result = MultiXml.parse(File.read(file_path)).to_smash[:configuration]\n xml_format(result)\n end", "def get_xml_document(workflow_file)\n xml_file = File.new(workflow_file)\n document = Document.new(xml_file)\n end", "def create_doc(path)\n doc = File.read(path)\n @current_xml_document = doc\n Hpricot.XML(doc)\n end", "def import_nmap_xml_file(args={})\n filename = args[:filename]\n\n data = \"\"\n ::File.open(filename, 'rb') do |f|\n data = f.read(f.stat.size)\n end\n import_nmap_xml(args.merge(:data => data))\n end", "def xml_parser(directory_name, filename)\n @doc = Document.new File.new(directory_name + filename)\n get_dataset_name(filename)\n set_topics\n set_dataset_rel_and_attr\n get_footnotes\n record_attributes\n @dataset.save\n end", "def read\n Hash.from_xml(File.open(file_name))\n end", "def parse_xml(file)\n @data_pts = Array.new\n doc = REXML::Document.new File.new(file)\n doc.elements.each('data/pt'){|pt|\n value = nil\n error = nil\n vars = Hash.new\n pt.attributes.each{|tag,val|\n\tif(tag == 'value')\n\t value = val.to_f\n\telsif(tag == 'error')\n\t error = val.to_f\n\telse\n\t vars[tag] = val.to_f\n\tend\t\n }\n @data_pts.push(DataPt.new(value,error,vars))\n }\n end", "def import_nmap_xml_file(args={})\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\tf = File.open(filename, 'rb')\n\t\tdata = f.read(f.stat.size)\n\t\timport_nmap_xml(args.merge(:data => data))\n\tend", "def gml_document\n # Rails.logger.debug \"Tag #{id}: gml_document\"\n return nil if self.gml.blank?\n @document ||= Nokogiri::XML(self.gml)\n rescue ArgumentError\n Rails.logger.error \"Error parsing GML document for id=#{self.id}\"\n nil\n end", "def metadata_xml\n Nokogiri::XML(original_file.content)\n end", "def init\n f = File.open(@pref_file)\n @doc = Nokogiri::XML(f)\n f.close\n @doc.remove_namespaces! \n end", "def import_openvas_xml(args={}, &block)\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\traise DBImportError.new(\"No OpenVAS XML support. Please submit a patch to msfdev[at]metasploit.com\")\n\tend", "def parse(io)\n self.doc = Nokogiri::XML(io)\n end", "def import_qualys_xml_file(args={})\n\t\tfilename = args[:filename]\n\t\twspace = args[:wspace] || workspace\n\n\t\tf = File.open(filename, 'rb')\n\t\tdata = f.read(f.stat.size)\n\t\timport_qualys_xml(args.merge(:data => data))\n\tend", "def load_unattend(xml_path)\n print_status(\"Reading #{xml_path}\")\n f = session.fs.file.new(xml_path)\n raw = \"\"\n until f.eof?\n raw << f.read\n end\n\n begin\n xml = REXML::Document.new(raw)\n rescue REXML::ParseException => e\n print_error(\"Invalid XML format\")\n vprint_line(e.message)\n return nil, raw\n end\n\n return xml, raw\n end", "def xml_doc\n @xml_doc ||= unless @xml.blank?\n Nokogiri.parse(@xml)\n else\n Nokogiri::XML::Document.new\n end\n rescue\n raise RuntimeError, 'expected document to parse'\n end", "def parse(file)\n doc = Nokogiri::XML( File.open( file ) )\n @type = doc.xpath(\"/probe/header/@type\").to_s\n @vendor = doc.xpath(\"/probe/header/@vendor\").to_s\n @services = \"<TODO>\"\n @indexes = \"<TODO>\"\n end", "def read_file(file)\n build_xml(Ripper::SexpBuilder.new(IO.read(file)).parse)\n end", "def read_file(file)\n build_xml(Ripper::SexpBuilder.new(IO.read(file)).parse)\n end", "def parse filename\n doc = Document.new(File.new(filename))\n elements = doc.elements\n # Let each entity definition do it's own lower level parsing\n self.entities.each do |e|\n @instances[e.name] = e.parse(self, elements)\n end\n # Let each relationship definition do it's own lower level parsing\n self.relationships.each do |r|\n r.parse(self, @instances)\n end\n end", "def xml\n @xml ||= Nokogiri::XML(path).remove_namespaces!\n end", "def initialize(sopm_file)\n\n @sopm_file = sopm_file\n\n sopm_read_handle = File.open(@sopm_file)\n @sopm = Nokogiri::XML(sopm_read_handle)\n sopm_read_handle.close\n\n parse\n end", "def parse_xml(file)\n\t\tdata = []\n\t\t# Break open XML and go through nodes\n\t\tbegin\n\t\t\tfile = file_sanitizer(file)\n\t\t\tdata = XmlSimple.xml_in(file, {'ForceArray' => false })\n\t\trescue Exception => e\n\t\t\traise e\n\t\tend\n\t\tdata\n\tend", "def import_retina_xml_file(args={})\n filename = args[:filename]\n\n data = \"\"\n ::File.open(filename, 'rb') do |f|\n data = f.read(f.stat.size)\n end\n import_retina_xml(args.merge(:data => data))\n end", "def parse_file_to_ar(f)\n pp_ok \"STARTING PARSE for file #{f}...\"\n\n @doc = Nokogiri::XML(File.open(f), 'UTF-8') do |config|\n config.options = Nokogiri::XML::ParseOptions::STRICT | Nokogiri::XML::ParseOptions::NOBLANKS\n end\n\n # Extend name space to include METS\n # couldn't get the following to work\n # example: node.xpath('.//foo:name', {'foo' => 'http://example.org/'})\n # example: node.xpath('.//xmlns:name', node.root.namespaces)\n # my try: puts @doc.xpath(\"xmlns:METS\", {\"METS\" => \"http://www.loc.gov/METS/\"})\n\n # The following actually modifies the xml, which we don't want. But it works.\n ns = @doc.root.add_namespace_definition(\"xmlns:METS\", \"http://www.loc.gov/METS/\")\n\n\n\n pp_ok \"Current file is: #{f}\"\n # issue information -------------\n # note: issue_id is autoincremented by the db\n # and we will want to select it from the last row created\n\n pp_ok \"ISSUE INFO:\"\n hathitrust = @doc.xpath(\"//MODS:identifier[@type='hathitrust']/text()\").to_s\n pp_ok \"hathitrust value is #{hathitrust}\"\n\n volume = @doc.xpath(\"//MODS:detail[@type='volume']/MODS:number/text()\").to_s\n pp_ok \"volume value is #{volume}\"\n\n issue_no = @doc.xpath(\"//MODS:detail[@type='issue']/MODS:number/text()\").to_s\n pp_ok \"issues value is #{issue_no}\"\n\n edition = @doc.xpath(\"//MODS:detail[@type='edition']/MODS:number/text()\").to_s\n pp_ok \"edition value is #{edition}\"\n\n date_issued = @doc.xpath(\"//MODS:dateIssued/text()\").to_s\n pp_ok \"dateIssued value is #{date_issued}\"\n\n newspaper = @doc.xpath(\"/METS:mets/@LABEL\").to_s\n newspaper = newspaper.split(\",\").first.strip\n pp_ok \"newspaper is #{newspaper}\"\n\n\n issue_id = add_data_issue_ar(hathitrust, volume, issue_no, edition, date_issued, newspaper)\n\n pp_ok \"ISSUE ID IS: #{issue_id}\"\n\n # page information -------------\n # note: page_id is autoincremented by the db\n\n pages_target = \"//METS:structMap/METS:div[@TYPE='np:issue'][@DMDID='issueModsBib']/METS:div[@TYPE='np:page']\"\n\n pages = @doc.xpath(pages_target)\n\n @doc.xpath(pages_target).each do |node|\n\n pp_ok \"PAGE INFO:\"\n\n pp_ok \"issue_id value is #{issue_id}\"\n\n page_no = node.xpath(\"@ORDERLABEL\").to_s\n pp_ok \"page_no value is #{page_no}\"\n\n sequence = node.xpath(\"@ORDER\").to_s.to_i\n pp_ok \"sequence value is #{sequence}\"\n\n text_link = node.xpath(\"METS:mptr[1]/@xlink:href\").to_s\n pp_ok \"text_link value is #{text_link}\"\n\n img_link = node.xpath(\"METS:mptr[2]/@xlink:href\").to_s\n pp_ok \"img_link value is #{img_link}\"\n\n add_data_page_ar(issue_id, page_no, sequence, text_link, img_link)\n\n end # each\n\n pp \"File #{f} processed\"\n\n end", "def raw_file(filename)\n doc = Nokogiri::XML(File.read(filename, encoding: \"UTF-8\")) do |config|\n config.huge\n end\n new(doc, filename, raw: true)\n end", "def download_xml\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/tiendas_v1_es.xml\")\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\tcontent = response.body\n\n\t\txml = REXML::Document.new(content)\n\n\t\treturn xml\n\tend", "def load(fName)\n file = File.new(fName)\n xmlDoc = REXML::Document.new file\n\n xmlDoc.elements[\"GLOBAL_PROFILE\"].elements.each { |profElem|\n #puts profElem\n if profElem.name == \"AUTHOR\"\n @codeAuthor = profElem.attributes[\"name\"]\n @codeCompany = profElem.attributes[\"company\"]\n # puts @codeAuthor\n elsif profElem.name == \"DEFAULT_LICENSE\"\n @codeLicense = profElem.texts.join\n # puts @codeLicense\n end\n }\n end", "def getRoot(filename, debug=false)\r\n\troot = Nokogiri::XML(open(filename))\r\n\troot.encoding = 'UTF-8'\r\n\t#printl \"it's open\",debug\r\n\treturn root\r\nend", "def initialize(xFile)\n @xNodeName = \"00000\"\n\t @bShowText = true\n\t @bShowAttrs = true\n \n @oReXML = REXML::Document::new( File::new( xFile ) )\n @oGraph = \"digraph XML {\\n\"\n _init( @oReXML.root() )\n @oGraph << \"}\\n\"\n end", "def load_xml(path)\n fail MethodDenied, :load_xml if infobase.read_only?\n infobase.designer do\n loadConfigFromFiles path\n end.run.wait.result.verify!\n path\n end", "def get_xml\n header = \"<DESIGN></DESIGN>\"\n path = 'public/users_xml/'+@visitor_id+'.xml'\n f = File.new(path, 'w+') \n f.write header \n f.close\n \n doc = Document.new File.new(path)\n root = doc.root\n \n ###Genes\n gen_bits_string = ''\n gen_bits.each do |g|\n gen_bits_string += g.to_s\n end\n \n genes = Element.new \"genes\"\n genes.attributes[\"string\"] = gen_bits_string\n \n root.add_element genes\n \n ###Colors\n foreground = Element.new \"foreground\"\n @colors.length.times do |n|\n color = Element.new \"fg_color\"\n color.attributes[\"red\"]= @colors[n].red.to_s\n color.attributes[\"green\"]= @colors[n].green.to_s\n color.attributes[\"blue\"]= @colors[n].blue.to_s\n color.attributes[\"n\"]=n.to_s\n \n foreground.add_element color\n end\n root.add_element foreground\n \n background = Element.new \"background\"\n @bg_colors.length.times do |n|\n color = Element.new \"bg_color\"\n color.attributes[\"red\"]= @bg_colors[n].red.to_s\n color.attributes[\"green\"]= @bg_colors[n].green.to_s\n color.attributes[\"blue\"]= @bg_colors[n].blue.to_s\n color.attributes[\"n\"]=n.to_s\n \n background.add_element color\n end\n root.add_element background\n \n ###Fonts\n fonts = Element.new \"fonts\"\n\n p = Element.new \"font\"\n p.attributes[\"type\"] = \"primary\"\n p.attributes[\"font\"] = @primary_font \n fonts.add_element p\n s = Element.new \"font\"\n s.attributes[\"type\"] = \"secondary\"\n s.attributes[\"font\"] = @secondary_font\n fonts.add_element s\n \n root.add_element fonts\n \n File.open(path, 'w') do |f| \n f.puts root \n end\n\n return path\n \n end", "def initialize(xml_file_name)\n @xml_file_name = xml_file_name\n @kinvars = Array.new\n doc = REXML::Document.new(File.new(xml_file_name)) \n kv_elem = doc.elements['kinematic-variables']\n kv_elem.elements.each('kinvar'){|kv| @kinvars.push Kinvar.new(kv)}\n @data_file = kv_elem.elements['dat-file'].attributes['file']\n @file = File.new(@data_file,'rb')\n end", "def load(filename)\n file_content = File.open(filename).read\n TOMLP::Parser.new(file_content).parse\n end", "def parse_xml(pdoc, data)\n # TODO: DTD, etc\n src = ::Nokogiri::XML(data)\n extract_plaintext(src.root, pdoc)\n pdoc.content_type=\"application/xml; charset=#{src.encoding}\"\n end", "def open\n require 'rexml/document'\n xml =\n if cache && File.exist?(cache)\n File.read(cache)\n else\n request :all\n end\n File.open(cache, 'wb') { |io| io.write(xml) } if cache\n REXML::Document.new(xml)\n end", "def init_from_xml(xmlDoc)\r\n @type = xmlDoc.expanded_name\r\n xmlDoc.each_element(\"ID\") { |e| @procID = e.text }\r\n xmlDoc.each_element(\"GROUP\") { |e| @group = e.text }\r\n xmlDoc.each_element(\"PATH\") { |e| @path = e.text }\r\n xmlDoc.each_element(\"ARGSLINE\") { |e| @cmdLineArgs = e.text }\r\n xmlDoc.each_element(\"ENV\") { |e| @env = e.text }\r\n # Dump the XML description of the OML configuration into a file\r\n xmlDoc.each_element(\"OML_CONFIG\") { |config|\r\n configPath = nil\r\n config.each_element(\"omlc\") { |omlc|\r\n configPath = \"/tmp/#{omlc.attributes['exp_id']}-#{@procID}.xml\"\r\n }\r\n f = File.new(configPath, \"w+\")\r\n config.each_element {|el|\r\n f << el.to_s\r\n }\r\n f.close\r\n # Set the OML_CONFIG environment with the path to the XML file\r\n @env << \" OML_CONFIG=#{configPath} \"\r\n }\r\n end", "def initialize(filename)\n @reader = GedReader.new(filename)\n @builder = Builder::XmlMarkup.new(:indent=>2)\n @builder.gencom { parse }\n @xml = @builder.target!\n end", "def read_map(mapfile)\n mapfile = File.join(\"lib\", \"adventure\", \"data\", mapfile)\n xml = Document.new(File.open(mapfile))\n @@name = xml.root.attributes[\"name\"]\n\n xml.elements.each(\"Map/variable\") do |e|\n tmp = e.attributes[\"value\"].split(/\\|/)\n case e.attributes[\"name\"]\n when /MAX_INDEX/ : @@max_index = [tmp[0].to_i, tmp[1].to_i]\n when /START_ROOM/ : @@start_room = e.attributes[\"value\"]\n when /WELCOME_MESSAGE/ : @@welcome_message = e.text\n end\n end # xml.elements.each(\"Map/variable\")\n\n xml.elements.each(\"Map/message\") do |message|\n mymessage = Message.new(\n message.attributes[\"message_id\"] ,\n message.text)\n end # xml.elements.each(\"Map/message\")\n\n xml.elements.each(\"Map/item\") do |item|\n myitem = Thing.new(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n item.elements.each(\"event\") do |event|\n myevent = myitem.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # element.elements.each(\"event\") do |event|\n end # xml.elements.each(\"Map/item\") do |element|\n\n xml.elements.each(\"Map/person\") do |person|\n myperson = Person.new(\n person.attributes[\"person_id\"],\n person.text(\"identifier\"),\n person.text(\"name\"),\n person.text(\"info\"),\n person.text(\"look_text\")\n )\n person.elements.each(\"item\") do |item|\n myperson.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end\n person.elements.each(\"event\") do |event|\n myevent = myperson.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # person.elements.each(\"event\") do |event|\n end #xml.elements.each(\"Map/person\") do |person|\n\n xml.elements.each(\"Map/door\") do |door|\n mydoor = Door.new(\n door.attributes[\"door_id\"],\n door.text(\"identifier\"),\n door.text(\"exit\"),\n door.text(\"open\"),\n door.text(\"key\"),\n door.text(\"name\"),\n door.text(\"info\"),\n door.text(\"look_text\")\n )\n door.elements.each(\"item\") do |item|\n mydoor.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end\n door.elements.each(\"event\") do |event|\n myevent = mydoor.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # person.elements.each(\"event\") do |event|\n end #xml.elements.each(\"Map/door\") do |door|\n\n xml.elements.each(\"Map/room\") do |room|\n myroom = Room.new(\n room.attributes[\"room_id\"],\n room.text(\"identifier\"),\n room.text(\"exits\"),\n room.text(\"name\"),\n room.text(\"info\"),\n room.text(\"look_text\")\n )\n room.elements.each(\"event\") do |event|\n myevent = myroom.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # room.elements.each(\"event\") do |event|\n\n room.elements.each(\"item\") do |item|\n myroom.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end # room.elements.each(\"item\") do |item|\n\n room.elements.each(\"door\") do |door|\n mydoor = myroom.add_door(\n door.attributes[\"door_id\"],\n door.text(\"identifier\"),\n door.text(\"exit\"),\n door.text(\"open\"),\n door.text(\"key\"),\n door.text(\"name\"),\n door.text(\"info\"),\n door.text(\"look_text\")\n )\n door.elements.each(\"item\") do |item|\n mydoor.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end #door.elements.each(\"item\") do |item|\n door.elements.each(\"event\") do |event|\n myevent = mydoor.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # door.elements.each(\"event\") do |event|\n end # room.elements.each(\"door\") do |door|\n\n room.elements.each(\"person\") do |person|\n myperson = myroom.add_person(\n person.attributes[\"person_id\"],\n person.text(\"identifier\"),\n person.text(\"name\"),\n person.text(\"info\"),\n person.text(\"look_text\")\n )\n\n person.elements.each(\"item\") do |item|\n myperson.add_thing(\n item.attributes[\"item_id\"],\n item.text(\"identifier\"),\n item.text(\"use_with\"),\n item.text(\"name\"),\n item.text(\"info\"),\n item.text(\"look_text\")\n )\n end\n\n person.elements.each(\"event\") do |event|\n myevent = myperson.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # person.elements.each(\"event\") do |event|\n end # room.elements.each(\"person\") do |person|\n end # xml.elements.each(\"Map/room\") do |room|\n\n xml.elements.each(\"Map/event\") do |event|\n myevent = Map.add_event(\n event.attributes[\"name\"],\n event.text(\"unique\"),\n event.text(\"condition\"),\n event.text(\"phrase\"),\n event.text(\"message\")\n )\n event.elements.each(\"command\") do |command|\n myevent.add_command(\n command.text(\"action\"),\n command.text(\"object\"),\n command.text(\"helper\")\n )\n end #xml.elements.each(\"command\") do |command|\n end # xml.elements.each(\"Map/event\") do |event|\n\n xml.elements.each(\"Map/start_inventory\") do |item|\n @@inventory.add_byId(item.text)\n end\n @@current_room = Map.room(@@start_room)\n @@current_room.visit\n self\n end", "def get_xml_of_type( asdcp_type, file )\n begin\n xml = Nokogiri::XML( open file )\n rescue Exception => e\n @logger.info \"#{ file }: #{ e.message }\"\n return FALSE\n end\n unless xml.errors.empty?\n xml.errors.each do |error|\n # expected errors from non-xml\n next if error.message =~ /Start tag expected/ or error.message =~ /Document is empty/\n @logger.info \"Syntax error: #{ file }: #{ error }\"\n end\n return FALSE\n end\n\n case xml.root.node_name\n when asdcp_type\n return xml\n else\n return FALSE\n end\nend", "def doc\n @doc ||= xml_doc @xml\n end", "def load(document)\n if document.respond_to?(:keys)\n load_hash(document)\n else\n load_xml(document)\n end\n end", "def load_graph()\n\n\t\t# Get bounds which are needed later\n\t\tdoc = File.open(@filename) { |f| Nokogiri::XML (f) }\n\n\t\t# get bounds\n\t\tbounds = {}\n\n\t\tdoc.xpath(\"//bounds\").each do |boundsValues|\n\t\t\tbounds[:minlon] = boundsValues[:minlon]\n\t\t\tbounds[:minlat] = boundsValues[:minlat]\n\t\t\tbounds[:maxlon] = boundsValues[:maxlon]\n\t\t\tbounds[:maxlat] = boundsValues[:maxlat]\n\t\tend\n\n\t\t# load nodes\n\t\tvertices = {}\n\t\tvisualVertices = {}\n\t\tdoc.xpath(\"//node\").each do |node|\n\t\t\t# this vertex\n\t\t\tnormalVertex = Vertex.new(node[:id])\n\t\t\tvertices[node[:id]] = normalVertex\n\n\t\t\t# kinda confusing to have lat, lon and x, y when they have the same value\n\t\t\tvisualVertex = VisualVertex.new(node[:id], normalVertex, node[:lat], node[:lon], node[:lat], node[:lon])\n\t\t\tvisualVertices[node[:id]] = visualVertex\n\t\tend\n\n\t\t# load edges\n\t\tedgesAr = []\n\t\tvisualEdgesAr = []\n\t\tv1 = nil\n\t\tskip = true\n\t\twayCounter = 0\n\t\twayCounter2 = 0\n\n\n\n\t\tdoc.xpath(\"//way\").each do |way|\n\t\t\tdoc2 = Nokogiri::XML(way.to_s)\n\t\t\t# for each way check tags for highway, speed etc\n\t\t\twayCounter2 = wayCounter2 + 1\n\t\t\tv1 = nil\n\t\t\tskip = true\n\t\t\tmaxSpeed = 50\n\t\t\toneWay = false\n\n\t\t\tdoc2.xpath(\"//tag\").each do |tag|\n\t\t\t\tif tag[:k] == \"highway\" && (@highway_attributes.include? tag[:v])\n\t\t\t\t\tskip = false\n\t\t\t\tend\n\n\t\t\t\tif tag[:k] == \"maxspeed\"\n\t\t\t\t\tmaxSpeed = tag[:v].to_i\n\t\t\t\tend\n\n\t\t\t\tif tag[:k] == \"oneway\" && tag[:v] == \"yes\"\n\t\t\t\t\toneWay = true\n\t\t\t\tend\n\n\t\t\t\t# Set max speed based on the tag\n\t\t\t\tif tag[:k] == \"source:maxspeed\"\n\t\t\t\t\tif tag[:v] == \"CZ:motorway\"\n\t\t\t\t\t\tmaxSpeed = 130\n\t\t\t\t\telsif tag[:v] == \"CZ:trunk\"\n\t\t\t\t\t\tmaxSpeed = 110\n\t\t\t\t\telsif tag[:v] == \"CZ:rural\"\n\t\t\t\t\t\tmaxSpeed = 90\n\t\t\t\t\telsif tag[:v] == \"CZ:urban_motorway\"\n\t\t\t\t\t\tmaxSpeed = 80\n\t\t\t\t\telsif tag[:v] == \"CZ:urban_trunk\"\n\t\t\t\t\t\tmaxSpeed = 80\n\t\t\t\t\telsif tag[:v] == \"CZ:urban\"\n\t\t\t\t\t\tmaxSpeed = 50\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif !skip\n\t\t\t\twayCounter = wayCounter + 1\n\n\t\t\t\tdoc2.xpath(\"//nd\").each do |point|\n\t\t\t\t\tif v1 == nil\n\t\t\t\t\t\tv1 = point[:ref]\n\t\t\t\t\telse\n\t\t\t\t\t\t# create normal edge\n\t\t\t\t\t\tnewEdge = {:vertex1 => v1, :vertex2 => point[:ref], :maxSpeed => maxSpeed, :oneWay => oneWay}\n\t\t\t\t\t\tedgesAr << newEdge\n\n\n\t\t\t\t\t\t# edges << Edge.new(v1, point[:ref], maxSpeed, oneWay)\n\t\t\t\t\t\tv1 = point[:ref]\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# we have all the edges eg lines. there is a lot of duplicates so reduce them!\n\t\tedgesArReduced = edgesAr.uniq\n\n\t\t# used is a unique hash of used vertices - we don't need points that are not being referenced by any path\n\t\tusedVertices = {}\n\t\tusedVisualVertices = {}\n\t\tedges = []\n\t\t# now put them into the array as instances of the required class Edge\n\t\tedgesArReduced.each do |edge|\n\t\t\tnewEdgeReduced = Edge.new(vertices[edge[:vertex1]], vertices[edge[:vertex2]], edge[:maxSpeed], edge[:oneWay])\n\n\t\t\t# used vertices\n\t\t\tusedVertices[edge[:vertex1]] = vertices[edge[:vertex1]]\n\t\t\tusedVertices[edge[:vertex2]] = vertices[edge[:vertex2]]\n\n\t\t\tedges << newEdgeReduced # create visual edge\n\n\n\t\t\tvisualEdge = VisualEdge.new(newEdgeReduced, visualVertices[edge[:vertex1]], visualVertices[edge[:vertex2]])\n\t\t\tusedVisualVertices[edge[:vertex1]] = visualVertices[edge[:vertex1]]\n\t\t\tusedVisualVertices[edge[:vertex2]] = visualVertices[edge[:vertex2]]\n\n\t\t\tvisualEdgesAr << visualEdge\n\t\tend\n\n\t\t# load\n\t\t#\n\t\t# test generating the graph with the graphwiz - all seems good in the exported file\n\t\tgraph = Graph.new(usedVertices, edges)\n\t\tvisualGraph = VisualGraph.new(graph, usedVisualVertices, visualEdgesAr, bounds)\n\n\t\t# we have edges nwo find the largest component\n\t\tcomponents = {}\n\n\n\t\treturn graph, visualGraph\n\n\tend", "def get_content_from_data(raw_xml)\n Nokogiri::XML(raw_xml)\n end", "def get_demographics_from_file(feret_xml_path, subject_id)\n subject_xml_full_path = \"#{feret_xml_path}/#{subject_id}\"\n subject_doc = Nokogiri::XML(File.open(\"#{subject_xml_full_path}/#{subject_id}.xml\"))\n\n FeretSubject.from_xml(subject_doc.at_xpath('//Subjects//Subject'))\nend", "def to_xml(file)\n content = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?>\\n<gedcom>\"\n\n open_tags = [\"gedcom\"]\n\n prev_level = root_level = nil\n\n parser = Gedcom::Parser.new(file)\n content = parser.parse(content, open_tags, prev_level, root_level)\n\n while tag = open_tags.pop\n content << \"\\t\" * (open_tags.length) + \"</#{tag}>\\n\"\n end\n\n content\n end", "def xml_document\n xml = XML::Document.new\n xml.root = self.to_xml\n xml\n end", "def load_from_xml(node)\n # Get all information from the root's children nodes\n node.children.each do |child|\n case child.name.to_s\n when 'id'\n @id = child.content.to_i\n when 'title'\n @title = child.content.to_s\n when 'artists'\n @artists = [] if @artists.nil?\n child.children.each do |artist|\n @artists << Artist.new(:name => artist.content) if artist.name == 'artist'\n @headliner = Artist.new(:name => artist.content) if artist.name == 'headliner'\n end\n @artists << @headliner unless @headliner.nil? || headliner_alrady_listed_in_artist_list?\n when 'image'\n check_image_node(child)\n when 'url'\n @url = child.content\n when 'description'\n @description = child.content\n when 'attendance'\n @attendance = child.content.to_i\n when 'reviews'\n @reviews = child.content.to_i\n when 'tag'\n @tag = child.content\n when 'startDate'\n @start_date = Time.parse(child.content)\n when 'startTime'\n @start_time = child.content\n when 'endDate'\n @end_date = Time.parse(child.content)\n when 'tickets'\n # @todo Handle tickets\n when 'venue'\n @venue = Venue.new_from_xml(child)\n when 'website'\n @website = child.content.to_s\n when 'text'\n # ignore, these are only blanks\n when '#text'\n # libxml-jruby version of blanks\n else\n raise NotImplementedError, \"Field '#{child.name}' not known (#{child.content})\"\n end #^ case\n end #^ do |child|\n @artists.uniq!\n end", "def get_image_data_from_file(xml_file_path)\n document = Nokogiri::XML(File.open(xml_file_path))\n recording = document.at_xpath('//Recordings//Recording')\n img_path = \"dvd#{recording.at_xpath('//URL/@root').to_s[-1]}/#{recording.at_xpath('//URL/@relative')}\"\n\n ImageData.from_xml(recording.at_xpath('//Subject'), img_path)\nend", "def update_xml_from_file(base='public/static/xml_downloads')\n filename = \"#{base}/#{nct_id}.xml\"\n if !File.exists?(filename)\n # update error\n return\n end\n\n content = File.read(filename)\n\n xml = Nokogiri::XML(content)\n if xml.xpath('//clinical_study').length > 0\n self.content = content\n return false unless changed?\n return update content: content\n else\n # add error\n end\n end", "def get_xml(url)\n Nokogiri::XML.parse(get(url), nil, nil, Nokogiri::XML::ParseOptions::STRICT)\n end", "def get_file_doc(prptfile, filename)\n Zip::ZipFile.open(prptfile, Zip::ZipFile::CREATE) do |zipfile|\n return REXML::Document.new zipfile.read(filename)\n end\nend", "def load(file); end", "def open(path)\n document = parse(File.read(path))\n document.path = path\n document\n end", "def from_xml(xml)\n\t\tend", "def load_xml( fileName )\r\n begin\r\n str = IO.read(fileName)\r\n load_xml_rules_as_string(str)\r\n rescue Exception => e\r\n raise RuleLoadingError, \"loading xml file\"\r\n end\r\n end" ]
[ "0.8043625", "0.7516769", "0.73990804", "0.7349184", "0.68753755", "0.6873936", "0.6824196", "0.6785871", "0.6611146", "0.6534131", "0.6530477", "0.64658266", "0.6459023", "0.64540166", "0.6415907", "0.63967764", "0.6384703", "0.63408023", "0.6334972", "0.62992394", "0.6250302", "0.6221948", "0.62054247", "0.6204302", "0.61534196", "0.6150405", "0.6140841", "0.6138162", "0.6131994", "0.6118225", "0.61139846", "0.60994625", "0.609495", "0.6085132", "0.6083539", "0.6069175", "0.6063063", "0.603809", "0.60090595", "0.5974851", "0.5960715", "0.59540725", "0.5932731", "0.5929761", "0.59235317", "0.59054476", "0.590329", "0.589897", "0.5887518", "0.58672476", "0.58449006", "0.5844658", "0.5841521", "0.5837194", "0.5823907", "0.58234304", "0.58230764", "0.5796238", "0.5778391", "0.5772004", "0.57665455", "0.5756191", "0.5756191", "0.5718468", "0.5705977", "0.5703439", "0.56997114", "0.56875443", "0.56808156", "0.5665562", "0.5661307", "0.5657146", "0.5649035", "0.5648628", "0.563393", "0.56269234", "0.56124455", "0.56085086", "0.5599783", "0.5597994", "0.5590673", "0.55846876", "0.5573564", "0.5564511", "0.5560308", "0.5541093", "0.552949", "0.5525824", "0.55111295", "0.55096257", "0.55056524", "0.54859793", "0.5476983", "0.5471967", "0.5470741", "0.5457198", "0.54416615", "0.54299176", "0.5426048", "0.5423066" ]
0.8251758
0
GET /ab_teams GET /ab_teams.json
def index @ab_teams = AbTeam.all @years = AbTeam.pluck(:year).map{|x| x}.uniq.sort end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end", "def organization_teams\n get(\"/organizations/#{@default_org_slug}/teams/\")\n end", "def teams\n render json: @team_query\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def team(id)\n get \"/teams/#{id}\"\n end", "def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def get_teams_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}teams/league/#{league_id}\")[\"teams\"]\nend", "def get_teams\r\n response = HTTParty.get('https://www.balldontlie.io/api/v1/teams')[\"data\"]\r\n response.each do |i|\r\n team = Team.new\r\n \r\n team.full_name = i[\"full_name\"]\r\n team.division = i[\"division\"]\r\n team.conference = i[\"conference\"]\r\n\r\n team.save\r\n\r\n end \r\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = @organization.teams\n end", "def show\n # @teams = ::Services::TeamService.show_teams\n end", "def app_teams(org_name:, platform:, app_id:)\n endpoint = \"/api/organizations/#{org_name}/platforms/#{platform}\"\\\n \"/apps/#{app_id}/teams\"\n res = api.get endpoint\n Response.new(res)\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n game = Game.all\n\n render json: game, include: :teams\n end", "def get_teams\n reply = @client.call(:get_teams)\n data = reply.body.dig(:get_teams_response,\n :get_teams_result,\n :string)\n check_if_data_exists(data)\n rescue Savon::HTTPError => error\n logger.debug error.http.code\n return []\n end", "def teams(org)\n get \"/orgs/#{org}/teams\"\n end", "def team\n fetch('esport.teams')\n end", "def index\n @teams = current_user.teams\n end", "def index\n @teams = current_user.teams\n end", "def index\n @teams = Team.all.order(:name)\n if params[:all]\n json_response(TeamSerializer, @teams)\n else\n @teams_paginated = @teams.page(current_page, per_page).per(per_page)\n json_response(TeamSerializer, @teams_paginated, options(@teams))\n end\n end", "def index\n if current_user_total?\n @teams = Team.order(:description).page(params[:page]).per(5)\n else\n ids = []\n tus = TeamUser.where(user_id: current_user.id)\n tus.each do |tu| # user_id | team_id\n ids << tu.team_id # [1, 6, 7]\n end\n\n return @teams = Team.where(id: ids).order(:description).page(params[:page]).per(5)\n end\n=======\n\n # GET /teams\n # GET /teams.json\n def index\n @teams = Team.order(:description).page(params[:page]).per(5)\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end\n\n # GET /teams/1\n # GET /teams/1.json\n def show\n<<<<<<< HEAD\n=======\n @team = Team.find(params[:id])\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.page(params[:page])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n\t\t@teams = Team.all\n\tend", "def load_teams\n tell \"Loading teams...\" unless options.quiet?\n teams = []\n\n doc = Nokogiri::HTML(open(TEAMS_URL))\n div1a = doc.css('div.mod-container > div.span-2').first\n list = div1a.css('div.mod-teams-list-medium ul li')\n \n list.each do |t|\n a_tag = t.search('h5 > a').first\n id = a_tag['href'].match(/_\\/id\\/([\\d]+)\\/.+\\Z/)[1]\n name = a_tag.content\n teams.push({:id => id, :name => name})\n end\n\n teams.sort_by { |team| team[:name] }\n end", "def all_teams_in_league\n \treturnArray = []\n\t\tbase_uri = 'https://www.thesportsdb.com/api/v1/json/1/search_all_teams.php?l=' + @league_name.to_s\n\t\tresponse = RestClient.get(base_uri)\n\t\tjson_response = JSON.parse(response)\n\t\thashIds = json_response['teams'] \n\t\thashIds.length.times do |i|\n\t\t\treturnArray[i] = \"Team ID: #{hashIds[i]['idTeam']}, Name: #{hashIds[i]['strTeam']}, Short Name: #{hashIds[i]['strTeamShort']}, Formed Year: #{hashIds[i]['intFormedYear']}, Sport: #{hashIds[i]['strSport']}, Alternate Name: #{hashIds[i]['strAlternateName']}\"\n\t\tend\n\t\treturn returnArray\n\tend", "def index\n @games_teams = GamesTeam.all\n end", "def show\n @user_teams = @game.team.user_teams\n end", "def index\n @user_teams = UserTeam.all\n end", "def show\n @team = @club.teams.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def get_teams( org )\n teams = Homework.get(\"/orgs/#{org}/teams\", :headers => @auth)\n teams.each do |team|\n puts team['id']\n end\n end", "def teams\n @teams\n end", "def index\n @teams = @competition.teams.sort_by{|t| t.number}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def org_teams(org)\n Hardmode.get(\"/orgs/#{org}/teams\", :headers => @auth)\n end", "def index\n @users_teams = UsersTeam.all\n end", "def get_team ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}\"\n end", "def team\n @team = Team.where('team_id = ?', params[:id])\n @active_stats = ActiveStat.where('team_id = ?', params[:id])\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def index\n\t\t@teams = Team.all\n\t\trender '/teams/index.json.jbuilder'\n\tend", "def show\n @team = Team.find(params[:id])\n\n render json: @team\n end", "def index\n @teams = Team.order(:id).page(params[:page]).per(10)\n end", "def show\n\t\t@team = Team.find(params[:id])\n\t\trender '/teams/show.json.jbuilder'\n\tend", "def get_project_teams(project_id_or_key)\n get(\"projects/#{project_id_or_key}/teams\")\n end", "def index\n @teams = Team.order(:description).page(params[:page]).per(5)\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end", "def get_event_teams ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}/teams\"\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end", "def index\n @match_teams = MatchTeam.all\n end", "def index\n @mens_teams = MensTeam.all\n end", "def teams\n @teams ||= ApiFactory.new 'Orgs::Teams'\n end", "def list_teams_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TeamApi.list_teams ...\"\n end\n # resource path\n local_var_path = \"/v2/teams\"\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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['GenieKey']\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 => 'ListTeamsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamApi#list_teams\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def team_information_list\n @teams = Team.find_teams_by_user(current_user.id)\n \n end", "def index\n\t\t@teams = Team.order(\"name ASC\").all\n\n\t\t# Pulls upcoming fixtures in Premier League\n\t\t@data = party_time(\"http://api.statsfc.com/premier-league/fixtures.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&timezone=America/New_York&limit=10\")\n\n\t\t# Pulls top scorers in Premier League\n\t\t@data2 = party_time(\"http://api.statsfc.com/top-scorers.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&competition=premier-league&year=2013/2014&limit=10\")\t\n\n\t\t# Pulls news articles about the league through Google RSS\n\t\tdata = party_time(\"https://news.google.com/news/feeds?q=barclays+premier+league&output=rss\")\n\t\t@articles = data[\"rss\"][\"channel\"][\"item\"]\n\tend", "def index\n # @teams = Team.all\n \n redirect_to \"/members\"\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @teams }\n # end\n end", "def teams\n @teams ||= @api.client.orgs.teams.list(org: @org)\n end", "def teams\n parse_domain_top '/Teams/TeamList.aspx', 'lnkTeamInfo'\n end", "def team_information_list\n @teams = Team.find_teams_by_user(session[:user_id])\n \n end", "def index\n @teams = @olympiad.teams.includes(:registrations, :users, :posts).order(:name)\n end", "def index\n @teams = current_user.recent_teams\n end", "def index\n @tournamentteams = Tournamentteam.all\n end", "def show\n team = Team.find_by(:id => params[:id])\n render :json => team\n end", "def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end", "def get_teams_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamsApi.get_teams ...'\n end\n # resource path\n local_var_path = '/teams'\n\n # query parameters\n query_params = {}\n query_params[:'conference'] = opts[:'conference'] if !opts[:'conference'].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 = []\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<Team>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamsApi#get_teams\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @athletes_teams = AthletesTeam.all\n end", "def index\n @club = Club.find_by_slug(params[:club_id])\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end", "def show\n render status: 200, json: Team.find(params[:id])\n end", "def get_teams\n TeamNode.get(node_object_id)\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def index\n @fantasy_league_fantasy_teams = FantasyLeagueFantasyTeam.all\n end", "def index\n @sports_teams = SportsTeam.all\n end", "def index\n @teams_players = TeamsPlayer.all\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end", "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n end" ]
[ "0.8089409", "0.7722675", "0.7667677", "0.75290096", "0.74835384", "0.7479208", "0.7467527", "0.7453771", "0.7303393", "0.7292536", "0.7292536", "0.7270572", "0.7262126", "0.72603416", "0.72526795", "0.72526795", "0.723421", "0.71872026", "0.7187004", "0.71711326", "0.7157632", "0.7157632", "0.71220285", "0.7118574", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.7105731", "0.70801723", "0.7061005", "0.7045599", "0.7034519", "0.70329833", "0.70202994", "0.70011795", "0.6997714", "0.6982142", "0.6968109", "0.696244", "0.69119394", "0.6906619", "0.69060904", "0.690537", "0.6891957", "0.6887705", "0.68869495", "0.68859977", "0.68802786", "0.6868319", "0.6867124", "0.6859942", "0.6855388", "0.68449885", "0.68327206", "0.6807793", "0.67955655", "0.6793883", "0.67933154", "0.6789332", "0.6788822", "0.6762617", "0.67466146", "0.67310935", "0.6715606", "0.66854894", "0.66839707", "0.66691697", "0.666877", "0.6668195", "0.6651444", "0.664466", "0.6625705", "0.6625705", "0.6625705", "0.6625705", "0.66013944", "0.65955204", "0.65909886", "0.65783054", "0.6578242", "0.65773976" ]
0.0
-1
GET /ab_teams/1 GET /ab_teams/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end", "def team(id)\n get \"/teams/#{id}\"\n end", "def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def get_teams_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}teams/league/#{league_id}\")[\"teams\"]\nend", "def show\n @team = @club.teams.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def teams\n render json: @team_query\n end", "def show\n @team = Team.find(params[:id])\n\n render json: @team\n end", "def show\n\t\t@team = Team.find(params[:id])\n\t\trender '/teams/show.json.jbuilder'\n\tend", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "def index\n if current_user_total?\n @teams = Team.order(:description).page(params[:page]).per(5)\n else\n ids = []\n tus = TeamUser.where(user_id: current_user.id)\n tus.each do |tu| # user_id | team_id\n ids << tu.team_id # [1, 6, 7]\n end\n\n return @teams = Team.where(id: ids).order(:description).page(params[:page]).per(5)\n end\n=======\n\n # GET /teams\n # GET /teams.json\n def index\n @teams = Team.order(:description).page(params[:page]).per(5)\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end\n\n # GET /teams/1\n # GET /teams/1.json\n def show\n<<<<<<< HEAD\n=======\n @team = Team.find(params[:id])\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end", "def show\n # @teams = ::Services::TeamService.show_teams\n end", "def organization_teams\n get(\"/organizations/#{@default_org_slug}/teams/\")\n end", "def team\n @team = Team.where('team_id = ?', params[:id])\n @active_stats = ActiveStat.where('team_id = ?', params[:id])\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end", "def get_team ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}\"\n end", "def show\n team = Team.find_by(:id => params[:id])\n render :json => team\n end", "def show\n render status: 200, json: Team.find(params[:id])\n end", "def get_teams\r\n response = HTTParty.get('https://www.balldontlie.io/api/v1/teams')[\"data\"]\r\n response.each do |i|\r\n team = Team.new\r\n \r\n team.full_name = i[\"full_name\"]\r\n team.division = i[\"division\"]\r\n team.conference = i[\"conference\"]\r\n\r\n team.save\r\n\r\n end \r\n end", "def index\n game = Game.all\n\n render json: game, include: :teams\n end", "def index\n @teams = Team.page(params[:page])\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "def index\n @teams = @organization.teams\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def index\n @teams = Team.all\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end", "def show\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end", "def show\n @ultimate_team = UltimateTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ultimate_team }\n end\n end", "def index\n @teams = @competition.teams.sort_by{|t| t.number}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "def team\n fetch('esport.teams')\n end", "def index\n\t\t@teams = Team.all\n\tend", "def index\n @teams = Team.all.order(:name)\n if params[:all]\n json_response(TeamSerializer, @teams)\n else\n @teams_paginated = @teams.page(current_page, per_page).per(per_page)\n json_response(TeamSerializer, @teams_paginated, options(@teams))\n end\n end", "def index\n @teams = current_user.teams\n end", "def index\n @teams = current_user.teams\n end", "def index\n\t\t@teams = Team.all\n\t\trender '/teams/index.json.jbuilder'\n\tend", "def show\n @nba_team = NbaTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nba_team }\n end\n end", "def app_teams(org_name:, platform:, app_id:)\n endpoint = \"/api/organizations/#{org_name}/platforms/#{platform}\"\\\n \"/apps/#{app_id}/teams\"\n res = api.get endpoint\n Response.new(res)\n end", "def index\n @games_teams = GamesTeam.all\n end", "def index\n # @teams = Team.all\n \n redirect_to \"/members\"\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @teams }\n # end\n end", "def index\n\t\t@team = Team.find(params[:team_id])\n\tend", "def index\n @user_teams = UserTeam.all\n end", "def show\n @user_teams = @game.team.user_teams\n end", "def get_teams( org )\n teams = Homework.get(\"/orgs/#{org}/teams\", :headers => @auth)\n teams.each do |team|\n puts team['id']\n end\n end", "def index\n @club = Club.find_by_slug(params[:club_id])\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end", "def index\n @teams = Team.order(:id).page(params[:page]).per(10)\n end", "def index\n @match_teams = MatchTeam.all\n end", "def get_players_by_team(team_id)\n response = parse_api_request(\"#{BASE_URL}players/2018/#{team_id}\")[\"players\"]\nend", "def get_teams\n reply = @client.call(:get_teams)\n data = reply.body.dig(:get_teams_response,\n :get_teams_result,\n :string)\n check_if_data_exists(data)\n rescue Savon::HTTPError => error\n logger.debug error.http.code\n return []\n end", "def teams(org)\n get \"/orgs/#{org}/teams\"\n end", "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n end", "def show\n @swim_team = SwimTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @swim_team }\n end\n end", "def get_project_teams(project_id_or_key)\n get(\"projects/#{project_id_or_key}/teams\")\n end", "def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end", "def index\n @teams = Team.order(:description).page(params[:page]).per(5)\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end", "def show\n @id = @my_team.team_id\n @team_name = Teams.find(@id)\n roster = RestClient.get(\"https://statsapi.web.nhl.com/api/v1/teams/#{@id}/roster\")\n @roster = JSON.parse(roster)[\"roster\"]\n end", "def show\n\n \t\t\trespond_with @team\n\n \t\tend", "def show\n @team = Team.find(params[:id])\n end", "def show\n @team = Team.find(params[:id])\n end", "def index\n @users_teams = UsersTeam.all\n end", "def all_teams_in_league\n \treturnArray = []\n\t\tbase_uri = 'https://www.thesportsdb.com/api/v1/json/1/search_all_teams.php?l=' + @league_name.to_s\n\t\tresponse = RestClient.get(base_uri)\n\t\tjson_response = JSON.parse(response)\n\t\thashIds = json_response['teams'] \n\t\thashIds.length.times do |i|\n\t\t\treturnArray[i] = \"Team ID: #{hashIds[i]['idTeam']}, Name: #{hashIds[i]['strTeam']}, Short Name: #{hashIds[i]['strTeamShort']}, Formed Year: #{hashIds[i]['intFormedYear']}, Sport: #{hashIds[i]['strSport']}, Alternate Name: #{hashIds[i]['strAlternateName']}\"\n\t\tend\n\t\treturn returnArray\n\tend", "def new\n @teammate = Teammate.new\n @teams = Hackathon.find(params[:hackathon_id]).teams\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @teammate }\n end\n end", "def index\n @mens_teams = MensTeam.all\n end", "def show\n @team = Team.find(params[:id])\n @runners = @team.runners\n @count = @runners.length\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end", "def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def get_team_name_by_id(team_id)\n response = parse_api_request(\"#{BASE_URL}teams/team/#{team_id}\")[\"teams\"].values.first[\"name\"]\nend", "def show\n @team_schedule = Schedule.all.where(laxid: params[:laxid]).last[:games]\n ap @team_schedule\n respond_to do |format|\n format.json{render json: @team_schedule}\n end\n end", "def show\n @club = Club.find_by_slug(params[:club_id])\n @team = @club.teams.find_by_name(params[:id].upcase)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team }\n end\n end", "def load_teams\n tell \"Loading teams...\" unless options.quiet?\n teams = []\n\n doc = Nokogiri::HTML(open(TEAMS_URL))\n div1a = doc.css('div.mod-container > div.span-2').first\n list = div1a.css('div.mod-teams-list-medium ul li')\n \n list.each do |t|\n a_tag = t.search('h5 > a').first\n id = a_tag['href'].match(/_\\/id\\/([\\d]+)\\/.+\\Z/)[1]\n name = a_tag.content\n teams.push({:id => id, :name => name})\n end\n\n teams.sort_by { |team| team[:name] }\n end", "def get_team(params = {})\n params = Utils.symbolize_hash_keys(params)\n query_params = { }\n headers = {}\n body = nil\n\n path = \"/team\"\n\n @client.request(\n method: :get,\n path: path,\n query: query_params,\n headers: headers,\n body: body)\n end", "def team\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html #team.html.erb\n end\n end", "def index\n @tournamentteams = Tournamentteam.all\n end", "def team( team_id )\n\n if( team_id.is_a?(String) && team_id.is_a?(Integer) )\n raise ArgumentError.new(format('wrong type. user \\'team_id\\' must be an String (for an Team name) or an Integer (for an Team Id), given \\'%s\\'', team_id.class.to_s))\n end\n raise ArgumentError.new('missing \\'team_id\\'') if( team_id.size.zero? )\n\n v, mv = version.values\n return { 'status' => 404, 'message' => format( 'team has been supported in Grafana since version 5. you use version %s', v) } if(mv < 5)\n\n if(team_id.is_a?(String))\n o_team = search_team(name: team_id)\n status = o_team.dig('status')\n total_count = o_team.dig('totalCount')\n\n return { 'status' => 404, 'message' => format( 'No Team \\'%s\\' found', team_id) } unless(status == 200 && total_count > 0)\n\n teams = o_team.dig('teams')\n team = teams.detect { |x| x['name'] == team_id }\n team_id = team.dig('id')\n end\n\n endpoint = format( '/api/teams/%s', team_id )\n\n @logger.debug(\"Getting team by Id #{team_id} (GET #{endpoint})\") if @debug\n get(endpoint)\n end" ]
[ "0.77725244", "0.76465213", "0.7453878", "0.74052495", "0.73499167", "0.731784", "0.73118573", "0.7290316", "0.7250941", "0.72421795", "0.722624", "0.722624", "0.7187703", "0.7187703", "0.71351486", "0.71341795", "0.7127563", "0.712015", "0.7108229", "0.7082558", "0.7078025", "0.7075122", "0.7068072", "0.70679855", "0.70271146", "0.6985088", "0.6985088", "0.6985088", "0.6985088", "0.6971949", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.6941955", "0.69396245", "0.69394505", "0.6885867", "0.68734527", "0.6868964", "0.68577737", "0.68564796", "0.6836985", "0.6836985", "0.68245107", "0.6818537", "0.6802727", "0.6798962", "0.67792404", "0.6727619", "0.67212176", "0.6714106", "0.67139536", "0.6683629", "0.6677695", "0.66621095", "0.66529965", "0.6645004", "0.6641873", "0.6635518", "0.6619453", "0.66096854", "0.6603946", "0.6603863", "0.6590615", "0.65834314", "0.6581639", "0.6581639", "0.6580482", "0.6568958", "0.65644705", "0.65553546", "0.6553663", "0.65490365", "0.6549006", "0.65444136", "0.6542276", "0.65364194", "0.6531691", "0.65293425", "0.65188885", "0.6512906" ]
0.0
-1
POST /ab_teams POST /ab_teams.json
def create @ab_team = AbTeam.new(ab_team_params) respond_to do |format| if @ab_team.save format.html { redirect_to @ab_team, notice: 'Record was created.' } format.json { render :show, status: :created, location: @ab_team } else format.html { render :new } format.json { render json: @ab_team.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_teams\r\n response = HTTParty.get('https://www.balldontlie.io/api/v1/teams')[\"data\"]\r\n response.each do |i|\r\n team = Team.new\r\n \r\n team.full_name = i[\"full_name\"]\r\n team.division = i[\"division\"]\r\n team.conference = i[\"conference\"]\r\n\r\n team.save\r\n\r\n end \r\n end", "def create\n @response = HTTParty.get('http://laxapi.herokuapp.com/api/teams')\n CreateTeamService.new.create_team_objects(@response)\n render :json => {\n :message => \" #{Team.count} teams have been created\",\n status: 200\n }\n end", "def create_team(name, params = {})\n params[:name] = name\n post('teams', params)\n end", "def create\n @team = Team.new(params[:team])\n\n if @team.save\n render json: @team, status: :created, location: @team\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def create_teams_from_teams_playoffs()\n end", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n format.html { redirect_to '/teams', notice: 'Team was successfully created.' }\n format.json { render :index, status: :created }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = @competition.teams.build(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to competition_team_url(@competition, @team), notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n @leagues = League.all.order(:name)\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.create({:name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end", "def create\n @team = @race.teams.build team_params\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to [@race, @team], notice: I18n.t(:create, scope: 'messages.crud', model: Team.model_name.human) }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.find_by_name(params[:team][:team_name])\n if @team.nil?\n @team = Team.new(captain_id: params[:team][:captain_id],\n\t\t team_name: params[:team][:team_name])\n\n respond_to do |format|\n if @team.save\n format.json { render json: @team, status: :created, location: @team }\n if params[:players]\n \tTeamPlayers.create(params[:players], team_name: @team.name)\n end\n else\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n else \n Team.update(params[:team])\n end\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, :notice => 'Team was successfully created.' }\n format.json { render :json => @team, :status => :created, :location => @team }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(_team)\n # stub\n end", "def add_app_team(org_name:, platform:, app_id:, team_name:)\n endpoint = \"/api/organizations/#{org_name}/platforms/#{platform}\"\\\n \"/apps/#{app_id}/teams\"\n res = api.post endpoint do |request|\n request.headers['Content-Type'] = 'application/x-www-form-urlencoded'\n request.body = URI.encode_www_form(\n team: team_name\n )\n end\n Response.new(res)\n end", "def create_team_member\n clinics = params[:clinics].split(\", \")\n\n team_member = TeamMember.create(\n email: params[:email],\n first_name: params[:first_name],\n last_name: params[:last_name],\n user: params[:user],\n status: \"Active\",\n role: params[:role]\n )\n\n clinics.each do |clinic|\n Clinic.find(clinic).team_members << team_member\n end\n\n render json: team_member, include: ['clinics']\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @games_team = GamesTeam.new(games_team_params)\n\n respond_to do |format|\n if @games_team.save\n format.html { redirect_to @games_team, notice: 'Games team was successfully created.' }\n format.json { render :show, status: :created, location: @games_team }\n else\n format.html { render :new }\n format.json { render json: @games_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = current_user.teams.new(team_params)\n @league = League.find_by(id: params[:league_id])\n @team.league = @league\n if @team.save\n LeagueInvite.where(email: current_user.email, league: @league).destroy_all\n flash[:success] = \"Added team to league\"\n if @league.teams.count == 10 && current_season = Season.current.first\n if LeagueSeason.where(league: @league, season: current_season).count == 0\n LeagueSeason.create(league: @league, season: current_season)\n end\n end\n redirect_to league_players_path(@league)\n else\n render action: :new\n end\n end", "def create\n puts \"IN CREATE ACTION\"\n if(current_user.role == \"guest\")\n redirect_to login_url and return\n end\n @coaches = Coach.all\n @divisions = Division.all\n @organizations = Organization.all\n @students = Student.all\n @team = Team.new(team_params)\n\n unless current_user.coach.nil?\n @team_organization = current_user.coach.organization\n #@team_name = @team.organization.short_name + \" \" + (@team.organization.teams.count+1).to_s\n @team.organization_id = @team_organization.id\n #@team.name = @team_name\n end\n\n puts \"TEAM IS #{@team.valid?} -- #{@team.to_yaml}\"\n \n respond_to do |format|\n if @team.save\n params[:team][:student_teams_attributes].each do |sta|\n st = StudentTeam.new\n puts \"PREVIEW -- #{@team.id} :: #{sta[1][1]}\"\n # @team.student_teams.each do |st|\n st.team_id = 86\n st.student_id = sta[1][1]\n if st.save\n puts \"StudentTeam ID: #{st.id}\"\n else\n puts \"FAIL\"\n end\n end\n format.html { redirect_to edit_team_url(@team), notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team created successfully.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n match_day_team = MatchDayTeam.new(match_day_team_params)\n if match_day_team.save\n render json: match_day_team, status: 201, location: [:api, match_day_team]\n else\n failed_to_create(match_day_team, \"match_day_team\")\n end\n end", "def create\n\t\t@team = Team.new(team_params)\n\n\t\tif @team.save\n\t\t\trender json: @team\n\t\telse\n\t\t\trender json: {\n\t\t\t\terror: {\n\t\t\t\t\tmessage: @team.errors.full_messages.to_sentence\n\t\t\t\t}\n\t\t\t}\n\t\tend\n\tend", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_team( params )\n\n raise ArgumentError.new(format('wrong type. \\'params\\' must be an Hash, given \\'%s\\'', params.class.to_s)) unless( params.is_a?(Hash) )\n raise ArgumentError.new('missing \\'params\\'') if( params.size.zero? )\n\n v, mv = version.values\n return { 'status' => 404, 'message' => format( 'team has been supported in Grafana since version 5. you use version %s', v) } if(mv < 5)\n\n name = validate( params, required: true, var: 'name' , type: String )\n email = validate( params, required: false, var: 'email', type: String )\n\n o_team = search_team(name: name)\n\n status = o_team.dig('status')\n total_count = o_team.dig('totalCount')\n# teams = o_team.dig('teams')\n# team = teams.detect { |x| x['name'] == name }\n\n return { 'status' => 404, 'message' => format('team \\'%s\\' alread exists', name) } if(status == 200 && total_count > 0)\n\n endpoint = '/api/teams'\n\n payload = {\n name: name,\n email: email\n }\n payload.reject!{ |_, y| y.nil? }\n\n @logger.debug(\"Creating team: #{name} (POST #{endpoint})\") if @debug\n\n post( endpoint, payload.to_json )\n end", "def create\n\n \t\t\t@team = Team.new team_params\n\n \t\t\tif @team.save\n\n \t\t\t\trender json: @team,status: :created\n\n \t\t\telse\n\n \t\t\t\trender json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n \t\t\tend\n\n \t\tend", "def create\n @team = fetch_team\n authorize @team\n @team.owners << current_user\n\n if @team.save\n @team.create_activity(:create,\n owner: current_user,\n parameters: { team: @team.name })\n respond_with(@team)\n else\n respond_with @team.errors, status: :unprocessable_entity\n end\n end", "def create\n @athletes_team = AthletesTeam.new(athletes_team_params)\n\n respond_to do |format|\n if @athletes_team.save\n format.html { redirect_to @athletes_team, notice: 'Athletes team was successfully created.' }\n format.json { render :show, status: :created, location: @athletes_team }\n else\n format.html { render :new }\n format.json { render json: @athletes_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def teams\n render json: @team_query\n end", "def create_teams\n number_of_teams.to_i.times do |i|\n self.teams << Team.create!(:name => TEAM_NAMES[i])\n end\n end", "def create_team(opts)\n HelloSign::Resource::Team.new post('/team/create', :body => opts)\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to root_path, notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n # current_game.users.push(@team)\n format.html { redirect_to teams_path, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_team = UserTeam.new(user_team_params)\n\n respond_to do |format|\n if @user_team.save\n format.html { redirect_to @user_team, notice: 'User team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_team }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n @team.users << current_user\n\n respond_to do |format|\n if @team.save\n setup_team(@team)\n format.html { redirect_to user_root_url, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team created successfully.' }\n format.json { render :my_team, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tTeam.create(params[:team])\n\n\t\tredirect_to teams_path\n\tend", "def create\n respond_to do |format|\n if team.save\n format.html { redirect_to team, notice: 'Team was successfully created.' }\n format.json { render json: team, status: ':created', location: team }\n else\n format.html { render action: 'new' }\n format.json { render json: team.errors, status: ':unprocessable_entity' }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html do\n flash[:notice] = 'Team was successfully created.'\n current_user.is_admin? ? (redirect_to teams_path) : (redirect_to user_teams_path(current_user))\n end\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_team(opts)\n HelloSign::Resource::Team.new post('/team/create', body: opts)\n end", "def create\n @team = Team.new(params.required(:team).permit!)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ultimate_team = UltimateTeam.new(params[:ultimate_team])\n\n respond_to do |format|\n if @ultimate_team.save\n format.html { redirect_to @ultimate_team, notice: 'Ultimate team was successfully created.' }\n format.json { render json: @ultimate_team, status: :created, location: @ultimate_team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ultimate_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @nba_team = NbaTeam.new(params[:nba_team])\n\n respond_to do |format|\n if @nba_team.save\n format.html { redirect_to '/nba_teams', notice: 'NBA team was successfully created.' }\n format.json { render json: @nba_team, status: :created, location: @nba_team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nba_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n team_name = params[:name]\n description = params[:description]\n\n @okr_team = OkrTeam.new(name: team_name, description: description)\n\n respond_to do |format|\n if @okr_team.save\n format.json { render json: 'Team is created successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end", "def create_teams\n parent = Object.const_get(session[:team_type]).find(params[:id])\n Team.randomize_all_by_parent(parent, session[:team_type], params[:team_size].to_i)\n undo_link(\"Random teams have been successfully created.\")\n ExpertizaLogger.info LoggerMessage.new(controller_name, '', 'Random teams have been successfully created', request)\n redirect_to action: 'list', id: parent.id\n end", "def create\n @team = Team.new(team_params)\n @team.slug = @team.name.downcase.gsub(\" \", \"-\")\n\n @team.community_rating = 0\n\n # Set default picture url\n if [email protected]_url\n @team.picture_url = 'https://d13yacurqjgara.cloudfront.net/users/205424/screenshots/1953810/pandamoniumshot.png'\n end\n\n @user = User.find(session[:session_key])\n\n respond_to do |format|\n if @team.save\n @team.users.push(@user)\n @team.users\n @team.save\n user_teams = @team.user_teams.find_by(user_id: @user.id)\n user_teams.role = params[:role]\n user_teams.status = 1\n user_teams.save!\n\n # TODO: Add game to user profile if it's not already there\n\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# league admin can add\n\t\t# anyone can add (own team) as pending iff league is addable\n\t\tds = DivisionSeason.find params[:division_season_id]\n\t\tteam = Team.find team[:team_id]\n\n\t\tif can? :manage_teams, ds\n\t\t\tTeamDSService.add_team(ds, team)\n\t\telse\n\t\t\tauthorize! :add_team, ds\n\t\t\tTeamDSService.add_pending_team(ds, team)\n\t\tend\n\n\t\trespond_with tdsr\n\tend", "def create\n @admin_team = Team.new(admin_team_params)\n\n respond_to do |format|\n if @admin_team.save\n format.html { redirect_to admin_teams_url, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @admin_team }\n else\n format.html { render :new }\n format.json { render json: @admin_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_user_team(name, path)\n post(\"/user_teams\", :body => {:name => name, :path => path})\n end", "def team_params\n params.require(:team).permit(:name, :description, :company_id, :opportunity_ids => [], :team_ids => [])\n end", "def create\n @organization = Organization.find(params[:organization_id])\n @team = @organization.teams.create(team_params)\n\n respond_to do |format|\n if @team.save\n\n Teaminvite.create!(admin_id: current_user.id,name: current_user.name,user_id: current_user.id, accepted: 'true', team_id: @team.id, email: current_user.email, admin: 'true',organization_id: @team.organization_id)\n format.html { redirect_to organization_teams_path(@team.organization_id), notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def team_params\n params.require(:team).permit(:name, :user_id, :club_id, :active)\n end", "def create\n @mission_team = @game.mission_teams.new(mission_team_params)\n\n respond_to do |format|\n if @mission_team.save\n format.html { redirect_to [@game, @mission_team], notice: 'Mission team was successfully created.' }\n format.json { render :show, status: :created, location: @mission_team }\n else\n format.html { render :new }\n format.json { render json: @mission_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @my_team = MyTeam.new(my_team_params)\n\n respond_to do |format|\n if @my_team.save\n format.html { redirect_to @my_team, notice: 'My team was successfully created.' }\n format.json { render :show, status: :created, location: @my_team }\n else\n format.html { render :new }\n format.json { render json: @my_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n begin\n @team.save!\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n rescue => e\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @teams = Team.all\n render json: @teams\n end", "def create\n @team = Team.new(team_params)\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: \"Team was successfully created.\" }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n newTeam = TeamMemberRelation.new()\n newTeam.team_id = @team.id\n newTeam.user_id = session[:user]\n newTeam.team_role_id = 1\n newTeam.save\n end", "def new\n @team = @competition.teams.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @team }\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n define_team_user\n end", "def create_team\n new_team_code = genTeamCode(current_user.id)\n team_params = {\n :team_name => params[:teamname],\n :team_code => new_team_code,\n :advisor_users_id => current_user.id,\n }\n team = Team.new(team_params)\n team.save\n\n current_user.update_attribute( :team_name, params[:teamname] )\n current_user.update_attribute( :team_code, new_team_code)\n\n flash.now[:flash] = 'Team Created'\n render '/advisor/index'\n end", "def create\n @team = @project.ae_teams.new(team_params)\n if @team.save\n redirect_to editor_project_ae_team_path(@project, @team), notice: \"Team was successfully created.\"\n else\n render :new\n end\n end", "def create\n @users_team = UsersTeam.new(users_team_params)\n\n respond_to do |format|\n if @users_team.save\n format.html { redirect_to @users_team, notice: 'Membro adicionado com sucesso.' }\n format.json { render :show, status: :created, location: @users_team }\n else\n format.html { render :new }\n format.json { render json: @users_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n\n @membership = Membership.new(team_id: @team.id, player_id: @team.player_id)\n @membership.save\n end", "def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end", "def create\n unless current_user.instructor\n render :nothing => true, :status => :unauthorized\n end\n \n # create team\n team = Team.create(name: params[:team_name], course: $selected_course)\n\n # add students to teams\n student_ids = params[:student_ids]\n student_ids.each do |student_id|\n StudentTeam.create(student_id: student_id, team: team)\n end\n\n render json: { success: true }\n end", "def create\n\t\t@team = Team.new(team_params)\n\n\t\trespond_to do |format|\n\t\t\tif @team.save\n\t\t\t\tformat.html { redirect_to @team, notice: 'Team was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @team }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @team.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @team = Team.new(params[:team])\n @team.user = current_user\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render json: @team, status: :created, location: @team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @swim_team = SwimTeam.new(params[:swim_team])\n\n respond_to do |format|\n if @swim_team.save\n format.html { redirect_to swim_teams_path(), notice: 'Swim team was successfully created.' }\n format.json { render json: @swim_team, status: :created, location: @swim_team }\n else\n format.html { render action: \"new\" }\n format.json { render json: @swim_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def app_teams(org_name:, platform:, app_id:)\n endpoint = \"/api/organizations/#{org_name}/platforms/#{platform}\"\\\n \"/apps/#{app_id}/teams\"\n res = api.get endpoint\n Response.new(res)\n end", "def team_params\n params.require(:team).permit(:name, :code, :description, :project_id, :members_count, :managers_count, :is_deleted, :pending_tasks, :status, :team_lead_ids => [], :user_ids => [])\n end", "def create\n @event_team = EventTeam.new(event_team_params)\n\n respond_to do |format|\n if @event_team.save\n format.html { redirect_to @event_team, notice: 'Event team was successfully created.' }\n format.json { render :show, status: :created, location: @event_team }\n else\n format.html { render :new }\n format.json { render json: @event_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new\n @team.name = team_params[:name]\n @team.captain = current_user\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_team(org, team_name, options={})\n options.merge!(:name => team_name)\n post \"/orgs/#{org}/teams\", :body => options\n end", "def create_teams\n parent = Object.const_get(session[:team_type]).find(params[:id])\n Team.randomize_all_by_parent(parent, session[:team_type], params[:team_size].to_i)\n undo_link(\"Random teams have been created successfully. \")\n redirect_to :action => 'list', :id => parent.id\n end", "def create\n\t\t@team = Team.new(team_params)\n\n\t\trespond_to do |format|\n\t\t\tif @team.save\n\t\t\t\tformat.html do\n\t\t\t\t\t# Add current user to team.\n\t\t\t\t\tmembership = Membership.new\n\t\t\t\t\tmembership.user_id = current_user.id\n\t\t\t\t\tmembership.team_id = @team.id\n\t\t\t\t\tmembership.started_at = DateTime.now\n\n\t\t\t\t\tredirect_to @team, notice: \"Team was successfully created.\", alert: (membership.save ? nil : \"Could not join created team.\")\n\t\t\t\tend\n\t\t\t\tformat.json { render action: \"show\", status: :created, location: @team }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @team.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @team = @organization.teams.build(team_params)\n\n respond_to do |format|\n if @team.save\n current_user.add_role :admin, @team\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:persona_team].merge!({\"account_id\" => session[:account_id]})\n @persona_team = PersonaTeam.new(params[:persona_team])\n\n respond_to do |format|\n if @persona_team.save\n flash[:notice] = 'Persona team was successfully created.'\n format.html { redirect_to(@persona_team_roster) }\n format.xml { render :xml => @persona_team, :status => :created, :location => @persona_team }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @persona_team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @teams = Team.all\n render :json => @teams\n end", "def team_params\n params.require(:team).permit(:league_id, :name)\n end", "def create\n @club = Club.find_by_slug(params[:club_id])\n @team = @club.teams.new(params[:team])\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to(@club, :notice => 'Team was successfully created.') }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def ab_team_params\n params.require(:ab_team).permit(:skater_id, :team_id, :year)\n end", "def create\n @users = User.active\n @team = Team.new(team_params)\n @projects = Project.active\n respond_to do |format|\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(team_params)\n authorize @team\n current_user.update team: @team\n\n respond_to do |format|\n if @team.persisted?\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @manage_team = ManageTeam.new(manage_team_params)\n\n respond_to do |format|\n if @manage_team.save\n format.html { redirect_to @manage_team, notice: 'Manage team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @manage_team }\n else\n format.html { render action: 'new' }\n format.json { render json: @manage_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mens_team = MensTeam.new(mens_team_params)\n\n respond_to do |format|\n if @mens_team.save\n format.html { redirect_to @mens_team, notice: 'Mens team was successfully created.' }\n format.json { render :show, status: :created, location: @mens_team }\n else\n format.html { render :new }\n format.json { render json: @mens_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def team_params\n params.require(:team).permit(:name, :game_id)\n end", "def create\n @match_team = MatchTeam.new(match_team_params)\n\n respond_to do |format|\n if @match_team.save\n format.html { redirect_to @match_team, notice: 'Match team was successfully created.' }\n format.json { render :show, status: :created, location: @match_team }\n else\n format.html { render :new }\n format.json { render json: @match_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_team_with_http_info(body, opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamsAPI.create_team ...'\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 TeamsAPI.create_team\"\n end\n # resource path\n local_var_path = '/api/v2/team'\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(body)\n\n # return_type\n return_type = opts[:debug_return_type] || 'TeamResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :create_team,\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 :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TeamsAPI#create_team\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.72925115", "0.72475654", "0.70817024", "0.68737936", "0.67273307", "0.6681657", "0.66148525", "0.6566181", "0.65511274", "0.6533834", "0.65294397", "0.65180445", "0.6505581", "0.64950085", "0.6470361", "0.6469675", "0.6469675", "0.6469675", "0.6463963", "0.6438598", "0.6426342", "0.64177233", "0.6406692", "0.6404047", "0.6399834", "0.6396202", "0.6396202", "0.6396202", "0.6396202", "0.6396202", "0.6396202", "0.6396202", "0.6396202", "0.6395801", "0.6377961", "0.6364769", "0.6359908", "0.6359419", "0.6353415", "0.63523394", "0.6348986", "0.63486063", "0.63454646", "0.6344499", "0.6340938", "0.63405824", "0.6336835", "0.63322335", "0.6326317", "0.63226575", "0.63137585", "0.63136524", "0.63112265", "0.630629", "0.6304441", "0.62975305", "0.62968564", "0.629684", "0.6296378", "0.62906474", "0.6284832", "0.6262248", "0.6256093", "0.62469393", "0.62388104", "0.6238619", "0.62363166", "0.6232129", "0.6226069", "0.6221416", "0.622002", "0.6216162", "0.6215447", "0.62016195", "0.6198128", "0.6197344", "0.61904734", "0.61853045", "0.6182455", "0.6167535", "0.6161537", "0.61563814", "0.61448354", "0.6144394", "0.6139587", "0.61349744", "0.6134142", "0.6116611", "0.61149985", "0.61138695", "0.61052513", "0.61045283", "0.6102774", "0.6095981", "0.6093263", "0.60880435", "0.60860425", "0.60720074", "0.6050313", "0.604674" ]
0.7013171
3
PATCH/PUT /ab_teams/1 PATCH/PUT /ab_teams/1.json
def update respond_to do |format| if @ab_team.update(ab_team_params) format.html { redirect_to @ab_team, notice: 'Record was updated' } else format.html { render :edit } format.json { render json: @ab_team.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def update\n team_name = params[:name]\n team_description = params[:description]\n team_id = params[:id]\n\n respond_to do |format|\n if OkrTeam.where(id: team_id).update_all(name: team_name, description: team_description)\n format.json { render json: 'Team is updated successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end", "def update\n if :opr == 'edit'\n update\n else\n @team = Team.find_by_id(params[:id])\n @team.update_attributes({:id => params[:id], :name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params.required(:team).permit!)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\tteam_id = params[:id]\n\t\t@team = Team.find(team_id)\n\t\tif @team.update(team_params)\n\t\t\trender json: @team\n\t\telse\n\t\t\trender json: {\n\t\t\t\terror: {\n\t\t\t\t\tmessage: @team.errors.full_messages.to_sentence\n\t\t\t\t}\n\t\t\t}\n\t\tend\n\tend", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render json: @team }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_team\n \n end", "def update\n @team = @club.teams.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to club_path(@club), notice: 'Mannschaft wurde aktualisiert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n ap @team.name\n ap @categorys = Category.where(:team => @team.name)\n ap @admin_tasks = AdminTask.where(:team => @team.name)\n ap @eadmin_tasks = EadminTask.where(:team => @team.name)\n ap @users = User.where(:user_info => @team.name)\n\n if @team.update(team_params)\n ap @team.name\n @admin_tasks.update_all(:team => @team.name )\n @eadmin_tasks.update_all(:team => @team.name )\n @categorys.update_all(:team => @team.name )\n @users.update_all(:user_info => @team.name )\n\n\n format.html { redirect_to team_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, :notice => 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to competition_team_url(@competition, @team), notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def edit_team(id, team_name, options={})\n options.merge!(:name => team_name)\n patch \"/teams/#{id}\", :body => options\n end", "def update\n @team = Team.find(params[:team][:team_id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n if params[:players]\n TeamPlayers.update(params[:players], team_name: @team.name)\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if @team.update(team_params)\n\n render json: @team,status: :ok\n\n else\n\n render json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to organization_teams_path(@team.organization_id), notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @team.name = team_params[:name]\n if @team.save\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @league = League.find(params[:league_id])\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_team\n @team.update(team_params)\n end", "def update\n respond_to do |format|\n if team.update(team_params)\n format.html { redirect_to team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: team.errors, status: ':unprocessable_entity' }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to teams_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @club = Club.find_by_slug(params[:club_id])\n @team = @club.teams.find_by_name(params[:id].upcase)\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to([@club, @team], :notice => 'Team was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to league_team_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to [@race, @team], notice: I18n.t(:update, scope: 'messages.crud', model: Team.model_name.human) }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to user_path(current_user), notice: 'Team information was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: \"Team was successfully updated.\" }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to user_root_url, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ultimate_team = UltimateTeam.find(params[:id])\n\n respond_to do |format|\n if @ultimate_team.update_attributes(params[:ultimate_team])\n format.html { redirect_to @ultimate_team, notice: 'Ultimate team was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ultimate_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @users = User.active\n @projects = Project.active\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_team(opts)\n HelloSign::Resource::Team.new post('/team', :body => opts)\n end", "def update\n respond_to do |format|\n if @admin_team.update(admin_team_params)\n format.html { redirect_to admin_teams_path, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_team }\n else\n format.html { render :edit }\n format.json { render json: @admin_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_team.update(user_team_params)\n format.html { redirect_to @user_team, notice: 'User team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @persona_team = PersonaTeam.find(params[:id])\n\n respond_to do |format|\n if @persona_team.update_attributes(params[:persona_team])\n flash[:notice] = 'Persona team was successfully updated.'\n format.html { redirect_to(@persona_team) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @persona_team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n define_team_user\n end", "def update\n @nba_team = NbaTeam.find(params[:id])\n\n respond_to do |format|\n if @nba_team.update_attributes(params[:nba_team])\n format.html { redirect_to @nba_team, notice: 'Nba team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nba_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_team(opts)\n HelloSign::Resource::Team.new post('/team', body: opts)\n end", "def update\n @swim_team = SwimTeam.find(params[:id])\n\n respond_to do |format|\n if @swim_team.update_attributes(params[:swim_team])\n format.html { redirect_to swim_teams_path(), notice: 'Swim team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @swim_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @games_team.update(games_team_params)\n format.html { redirect_to @games_team, notice: 'Games team was successfully updated.' }\n format.json { render :show, status: :ok, location: @games_team }\n else\n format.html { render :edit }\n format.json { render json: @games_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n @player = Player.find(params[:player_id])\n if @player.access_key == params[:access_key] && (@team.leader_id == @player.id || @team.game.owner_id == @player.id) then\n @team.name = params[:name]\n @team.leader_id = params[:leader_id]\n\n respond_to do |format|\n if @team.save\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n else\n head :unauthorized\n end\n end", "def update\n respond_to do |format|\n if @athletes_team.update(athletes_team_params)\n format.html { redirect_to @athletes_team, notice: 'Athletes team was successfully updated.' }\n format.json { render :show, status: :ok, location: @athletes_team }\n else\n format.html { render :edit }\n format.json { render json: @athletes_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @my_team.update(my_team_params)\n format.html { redirect_to @my_team, notice: 'My team was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_team }\n else\n format.html { render :edit }\n format.json { render json: @my_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n flash[:success] = 'Team was successfully updated.'\n format.html { redirect_to @team}\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @team, :update?\n\n @team_form = Team::Form.new(team: @team, attributes: team_params)\n\n respond_to do |format|\n if @team_form.save\n format.html { redirect_to team_url(subdomain: @team.subdomain, auth_token: GenerateLoginToken.call(user: current_user)), notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to(@team, :notice => 'Team was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team_test = TeamTest.find(params[:id])\n\n respond_to do |format|\n if @team_test.update_attributes(params[:team_test])\n format.html { redirect_to @team_test, notice: 'Team test was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_test.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n t = params[:project][:team]\n team_id = t[:team_id]\n @team = Team.find(team_id)\n @project = Project.find(params[:id])\n params[:project].delete :team\n\n respond_to do |format|\n if @project.update_attributes(params[:project]) and \n @team.update_attribute(:project_id,@project.id)\n format.html { redirect_to admin_projects_url, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @nfl_team = NflTeam.find(params[:id])\n\n respond_to do |format|\n if @nfl_team.update_attributes(params[:nfl_team])\n @nfl_team.create_activity :update, owner: current_user\n format.html { redirect_to @nfl_team, notice: 'Nfl team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nfl_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @leagues = League.all.order(:name)\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update_attributes(params[:team])\n flash[:notice] = 'Team was successfully updated.'\n @changed << @team.id\n\n format.html { redirect_to teams_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { head :no_content }\n else\n @edited << @team.id\n\n format.html { render action: 'edit', template: 'shared/edit' }\n format.js { render 'team' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_team = Team.where(\"league_id = ?\", @league.id)[0]\n respond_to do |format|\n if @league.update(league_params)\n format.html { redirect_to team_path(@user_team.id), notice: 'League was successfully updated.' }\n format.json { render :show, status: :ok, location: @league }\n else\n format.html { render :edit }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n render_success format, 'updated', :ok\n else\n render_errors format, @team.errors, :edit\n end\n end\n end", "def update\n respond_to do |format|\n if (current_user.team_id != @team.id) \n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n else\n if @team.update(team_params)\n #format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n #format.html { render :edit, notice: 'Team was successfully updated.' }\n format.html { redirect_to tracks_url, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @tournamentteam.update(tournamentteam_params)\n format.html { redirect_to @tournamentteam, notice: 'Tournamentteam was successfully updated.' }\n format.json { render :show, status: :ok, location: @tournamentteam }\n else\n format.html { render :edit }\n format.json { render json: @tournamentteam.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n respond_to do |format|\n if @team.update_attributes(params[:team])\n flash[:notice] = 'Tím bol úspšne zmenený.'\n format.html { redirect_to(@team) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @manage_team.update(manage_team_params)\n format.html { redirect_to @manage_team, notice: 'Manage team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @manage_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user_team = UserTeam.find(params[:id])\n\n respond_to do |format|\n if @user_team.update_attributes(params[:user_team])\n format.html { redirect_to(@user_team, :notice => 'User team was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\t\tteam = Team.find(params[:id])\n\t\tteam.update_attributes(params[:team])\n\n\t\tredirect_to teams_path\n\tend", "def update\n respond_to do |format|\n if @team.update_attributes(team_params)\n format.html { redirect_to(@team, :notice => 'Team was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @team_admin = TeamAdmin.find(params[:id])\n\n respond_to do |format|\n if @team_admin.update_attributes(params[:team_admin])\n format.html { redirect_to @team_admin, notice: 'Team admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_admin.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_team\n @team = Team.where(\"id=?\",params[:id]).first\n\n unless @team.present? \n render json:{ status: :error, data: \"team is not find\" }\n\n end\n end", "def update\n @team = Team.find(params[:id])\n if @team.update_attributes(team_params)\n flash[:notice] = \"Team successfully updated\"\n redirect_to teams_url\n else\n render 'edit'\n end\n end", "def update\n match_day_team = MatchDayTeam.find(params[:id])\n if match_day_team.update(match_day_team_params)\n render json: match_day_team, status: 200, location: [:api, match_day_team]\n else\n failed_to_update(match_day_team, \"match_day_team\")\n end\n end", "def set_ab_team\n @ab_team = AbTeam.find(params[:id])\n end", "def update\n user_team_request = UserTeamRequest.find_by_id(params[:id])\n\n user_team_request.delete\n\n user_team_request.create_user_team\n flash[:success] = \"Team Request Accepted!\"\n\n redirect_to user_path(current_user)\n end" ]
[ "0.71269506", "0.6930876", "0.6919916", "0.6902893", "0.6799178", "0.67901677", "0.6749086", "0.67454", "0.6745371", "0.67306083", "0.6722188", "0.6722188", "0.67100656", "0.67100656", "0.67100656", "0.67100656", "0.67100656", "0.67100656", "0.67082393", "0.66853124", "0.66694486", "0.6650304", "0.6645076", "0.66431624", "0.66233104", "0.66056585", "0.6560774", "0.65404457", "0.65255487", "0.65255487", "0.64895797", "0.6459212", "0.6434935", "0.64284796", "0.6427929", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64277345", "0.64175975", "0.6405456", "0.6398587", "0.63971233", "0.63897806", "0.6365578", "0.63512456", "0.6346594", "0.63458025", "0.6334055", "0.6315639", "0.63141775", "0.6297457", "0.6295719", "0.62915444", "0.6283651", "0.62800175", "0.62796944", "0.6266843", "0.6244992", "0.6244147", "0.6232889", "0.623012", "0.62101334", "0.61972696", "0.6193603", "0.6191606", "0.61893725", "0.6178198", "0.6155495", "0.6152057", "0.6150259", "0.6136915", "0.6133191", "0.61192465", "0.61167836", "0.61103034", "0.6108122", "0.61057425", "0.6091552", "0.60876656" ]
0.67578584
6
DELETE /ab_teams/1 DELETE /ab_teams/1.json
def destroy @ab_team.destroy respond_to do |format| format.html { redirect_to ab_teams_url, notice: 'Record was destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @team = @club.teams.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to club_teams_url(@club.id) }\n format.json { head :no_content }\n end\n end", "def destroy\n team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def delete(_team)\n # stub\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def delete_team(id)\n boolean_request :delete, \"/teams/#{id}\"\n end", "def destroy\n @ultimate_team = UltimateTeam.find(params[:id])\n @ultimate_team.destroy\n\n respond_to do |format|\n format.html { redirect_to ultimate_teams_url }\n format.json { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to competition_teams_url(@competition) }\n format.json { head :no_content }\n end\n end", "def destroy\n @nba_team = NbaTeam.find(params[:id])\n @nba_team.destroy\n\n respond_to do |format|\n format.html { redirect_to nba_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n head :no_content\n end", "def destroy\n match_day_team = MatchDayTeam.find(params[:id])\n match_day_team.destroy\n head 204\n end", "def destroy\n @user_team.destroy\n respond_to do |format|\n format.html { redirect_to user_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @manage_team.destroy\n respond_to do |format|\n format.html { redirect_to manage_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy_team\n post('/team/destroy')\n end", "def destroy_team\n post('/team/destroy')\n end", "def destroy\n (kick and return) if not is_god?\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n if @team.destroy\n\n render json: {team: {id: params[:id].to_i}},status: :ok\n\n else\n\n render json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to leagues_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n allTeamRelation = TeamMemberRelation.where(team_id: @team.id)\n allTeamRelation.each do |r|\n r.destroy\n end\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: \"Team was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @athletes_team.destroy\n respond_to do |format|\n format.html { redirect_to athletes_teams_url, notice: 'Athletes team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @swim_team = SwimTeam.find(params[:id])\n @swim_team.destroy\n\n respond_to do |format|\n format.html { redirect_to swim_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to league_teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n team_id = params[:id]\n status = OkrTeam.remove_team_from_system(team_id)\n\n respond_to do |format|\n if status == 200\n format.json { render json: 'Team is removed successfully from the system!', status: :ok }\n else\n format.json { render json: 'Unable to remove team from system!', status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to view_teams_path, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_team_with(id)\n visit teams_path\n click_button 'Delete'\n click_button 'OK'\n end", "def destroy\n @team_has_d.destroy\n respond_to do |format|\n format.html { redirect_to team_has_ds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @games_team.destroy\n respond_to do |format|\n format.html { redirect_to games_teams_url, notice: 'Games team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to organization_teams_url(@organization), notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_team.destroy\n respond_to do |format|\n format.html { redirect_to admin_teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @nhl_team.destroy\n respond_to do |format|\n format.html { redirect_to pool_nhl_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_test = TeamTest.find(params[:id])\n @team_test.destroy\n\n respond_to do |format|\n format.html { redirect_to team_tests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to user_root_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_team.destroy\n respond_to do |format|\n format.html { redirect_to my_teams_url, notice: 'My team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\n ap @category = Category.where(:team => @team.name)\n ap @admin_tasks = AdminTask.where(:team => @team.name)\n @team.destroy\n @admin_tasks.destroy_all\n @category.destroy_all\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @league.fantasy_teams.delete_all\n @league.draft_picks.delete_all\n @league.destroy\n respond_to do |format|\n format.html { redirect_to leagues_url, notice: 'League was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to team_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to(teams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to(teams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to(teams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to(teams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to(teams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @nfl_team = NflTeam.find(params[:id])\n @nfl_team.destroy\n\n respond_to do |format|\n format.html { redirect_to nfl_teams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.gamers.each do |g|\n g.team= nil\n g.save!\n end\n @team.destroy\n ###\n ###\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n # @team.destroy\n # respond_to do |format|\n # format.html { redirect_to teams_url, notice: 'Team was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end", "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to teams_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "def destroy\n @test_team_stat.destroy\n respond_to do |format|\n format.html { redirect_to test_team_stats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to race_teams_url(@race), notice: I18n.t(:destroy, scope: 'messages.crud', model: Team.model_name.human) }\n format.json { head :no_content }\n end\n end", "def destroy\n @teamstat.destroy\n respond_to do |format|\n format.html { redirect_to teamstats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id]);\n @team.destroy();\n redirect_to(user_path(current_user) + '/teams');\n end", "def destroy\n authorize @team, :destroy?\n\n @team.destroy\n respond_to do |format|\n format.html { redirect_to root_url(subdomain: ENV[\"DEFAULT_SUBDOMAIN\"]), notice: 'Team was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_team = UserTeam.find(params[:id])\n @user_team.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_teams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @teammate = Teammate.find(params[:id])\n @teammate.destroy\n\n respond_to do |format|\n format.html { redirect_to teammates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tournamentteam.destroy\n respond_to do |format|\n format.html { redirect_to tournamentteams_url, notice: 'Tournamentteam was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n<<<<<<< HEAD\n\n if @team.destroy\n redirect_to teams_path, notice: I18n.t('messages.destroyed')\n else\n redirect_to teams_path, notice: \"Erro ao excluir...\"\n=======\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_path, notice: I18n.t('messages.destroyed') }\n format.json { head :no_content }\n>>>>>>> d0c6183c3349cba16c54d8ce4c0fb5ee26c49700\n end\n end\n\n private\n # Use callbacks to share common setup or constraints between actions.\n def set_team\n @team = Team.find(params[:id])\n end\n\n # Never trust parameters from the scary internet, only allow the white list through.\n def team_params\n params.require(:team).permit(:id, :description)\n end\nend", "def destroy\n @team.destroy\n respond_to do |format|\n format.html { redirect_to teams_url, notice: 'Group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to team_activities_path(@team) }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n @teams = @player.teams\n if @teams.exists?\n @teams.each do |t|\n t.destroy\n end\n end\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:id])\n @team.destroy\n respond_to do |format|\n format.html { redirect_to course_teams_path, notice: 'Team was successfully removed.' }\n end\n end", "def removeFromTournament\n @tournament = Tournament.find(params[:tournament_id])\n \t@team = Team.find(params[:id])\n \[email protected](@team)\n\t\n respond_to do |format|\n format.html { redirect_to(tournament_path(@tournament)) }\n format.xml { head :ok }\n end\n end", "def delete()\n\n Team.destroy(self.id)\n end", "def destroy\n @tea_club.destroy\n respond_to do |format|\n format.html { redirect_to tea_clubs_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7415762", "0.7352768", "0.725395", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.72512186", "0.7239285", "0.7222529", "0.7222529", "0.7222529", "0.7222529", "0.71912825", "0.7184787", "0.71436065", "0.7128236", "0.70785034", "0.7054784", "0.7031522", "0.702941", "0.70083016", "0.70083016", "0.70067984", "0.69858456", "0.69841427", "0.6979352", "0.69772494", "0.6975356", "0.6974378", "0.6974117", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6962341", "0.6960407", "0.6956255", "0.69489235", "0.6943992", "0.6914206", "0.69127035", "0.69101185", "0.69100106", "0.69097185", "0.69045866", "0.6897186", "0.68941045", "0.6891697", "0.6880323", "0.68785024", "0.68785024", "0.68785024", "0.68785024", "0.68785024", "0.68778956", "0.686879", "0.6864358", "0.6853912", "0.6849082", "0.6840885", "0.6824866", "0.68238884", "0.6809571", "0.68003786", "0.67989177", "0.6797831", "0.679646", "0.67932147", "0.6792227", "0.678059", "0.6775803", "0.6768394", "0.6759455", "0.6758907", "0.6748547" ]
0.7438262
0
Use callbacks to share common setup or constraints between actions.
def set_ab_team @ab_team = AbTeam.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\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 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 workflow\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 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 before_action \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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; 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 setup(&blk)\n @setup_block = blk\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 callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); 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", "def duas1(action)\n action.call\n action.call\nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def call\n setup_context\n super\n end" ]
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", "0.5312988", "0.529798", "0.52968603", "0.52962637", "0.52577317", "0.5244704", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5233461", "0.52322435", "0.5227552", "0.52224743", "0.5217851", "0.521241", "0.52069896", "0.5206555", "0.5176617", "0.51738507", "0.51725876", "0.51660734", "0.51605034", "0.51571786", "0.5152762", "0.5152164", "0.5151477", "0.5145819", "0.51408994", "0.5134412", "0.5114031", "0.5113695", "0.5113695", "0.5108603", "0.5107358", "0.5090405", "0.50889385", "0.50817686", "0.5081617", "0.50658226", "0.50551206", "0.5051746", "0.5049091", "0.5049091", "0.5034681", "0.5024972", "0.5021291", "0.5016024", "0.50134826", "0.50008893", "0.50000244", "0.4999155", "0.49907947", "0.49907947", "0.49853387", "0.49796683", "0.4979596", "0.49778128", "0.49673793", "0.49662578", "0.49587822", "0.4956063", "0.49550167", "0.49523485", "0.4951614", "0.49452996", "0.49442068", "0.49336892", "0.49306205", "0.49264124", "0.49259305", "0.4925823", "0.49229056", "0.4918999", "0.49171805", "0.49167436", "0.4916559", "0.49153692", "0.49148256" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def ab_team_params params.require(:ab_team).permit(:skater_id, :team_id, :year) 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 valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \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 safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\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 filtering_params\n params.permit(:email)\n end", "def active_code_params\n params[:active_code].permit\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 reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\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 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 filter_parameters; end", "def filter_parameters; end", "def list_params\n params.permit(:name)\n 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 valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\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 maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\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 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 droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\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.6981606", "0.6784227", "0.6746523", "0.67439264", "0.67361516", "0.6593381", "0.6506166", "0.64994407", "0.6483518", "0.64797056", "0.64578557", "0.6441216", "0.63811713", "0.63773805", "0.6366333", "0.63217646", "0.6301816", "0.63009787", "0.6294436", "0.62940663", "0.6292164", "0.62917984", "0.62836355", "0.6242686", "0.6241917", "0.62210834", "0.6214862", "0.62125784", "0.619428", "0.617912", "0.617705", "0.61735916", "0.6163706", "0.61532795", "0.6152666", "0.6148062", "0.6123372", "0.61180484", "0.61088324", "0.6106139", "0.60925204", "0.608326", "0.60711503", "0.606551", "0.60216546", "0.6018924", "0.6015004", "0.60106766", "0.6008301", "0.6008301", "0.60028726", "0.60020626", "0.5999236", "0.59931505", "0.5993037", "0.59917194", "0.5982164", "0.5968051", "0.5960277", "0.5960268", "0.5960012", "0.59594494", "0.5954652", "0.5954304", "0.59440255", "0.59404963", "0.59404963", "0.59401006", "0.593522", "0.5932182", "0.5925528", "0.5924541", "0.5918796", "0.59123147", "0.5910144", "0.5909186", "0.5907257", "0.5899382", "0.5897783", "0.58972496", "0.58958495", "0.58948576", "0.5892734", "0.5888056", "0.58843875", "0.58818483", "0.5873746", "0.58700997", "0.5870056", "0.5869255", "0.58668107", "0.58662325", "0.5865003", "0.5862908", "0.5862406", "0.58614665", "0.5859661", "0.585562", "0.5855185", "0.58523446", "0.58504915" ]
0.0
-1
returns a xml of the url to gets directly
def http_get_direct(url) log("http get : #{url}") if $opt["debug"] begin html = Net::HTTP.get_response(URI.parse(url)).body # XXX must fix the rescue its not working rescue => err log("Error: #{err}") exit 2 end html end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geturl() \n\t\treturn self.response.geturl()\n end", "def get(url); end", "def url\n Addressable::URI.new :scheme => 'http',\n :host => endpoint.host,\n :path => '/onca/xml',\n :query_values => parameters\n end", "def get_url\n Nokogiri::HTML(open(@url))\n end", "def get_channnel_xml( url )\n path = url.sub(/http:\\/\\/gdata\\.youtube\\.com/,'')\n xml = \"\"\n\n Net::HTTP.version_1_2\n Net::HTTP.start(\"#{@url}\", \"#{@port}\") do |http|\n response = http.get(\"/#{path}\")\n xml = response.body\n end\n\n return xml\n end", "def get_xml(url)\n Nokogiri::XML.parse(get(url), nil, nil, Nokogiri::XML::ParseOptions::STRICT)\n end", "def url\n @parser.request_url\n end", "def get_url\n \"http://#{self.domain}/#{self.path}#{self.params.it_keys_to_get_param}\"\n end", "def get_url\n @url\n end", "def url_value\n xml_value\n end", "def url\n @url\n end", "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end", "def url\n @url\n end", "def url\n @url\n end", "def get_xml(url, options = {})\n\t\t\t\n\t\t\t# better way of doing this?\n\t\t\t# Map custom keys to the HTTP request values\n\t\t\treqs = {\n\t\t\t\t:character_name => 'n',\n\t\t\t\t:realm => 'r',\n\t\t\t\t:search => 'searchQuery',\n\t\t\t\t:type => 'searchType',\n\t\t\t\t:guild_name => 'n',\n\t\t\t\t:item_id => 'i',\n\t\t\t\t:team_size => 'ts',\n\t\t\t\t:team_name => 't',\n\t\t\t\t:group => 'group'\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tparams = []\n\t\t\toptions.each do |key, value|\n\t\t\t\tparams << \"#{reqs[key]}=#{u(value)}\" if reqs[key]\n\t\t\tend\n\t\t\t\n\t\t\tquery = '?' + params.join('&') if params.size > 0\n\t\t\t\n\t\t\tbase = self.base_url(options[:locale], options)\n\t\t\tfull_query = base + url + query\n\t\t\t\n\t\t\tputs full_query if options[:debug]\n\t\t\t\n\t\t\tif options[:caching]\n\t\t\t\tresponse = get_cache(full_query, options)\n\t\t\telse\n\t\t\t\tresponse = http_request(full_query, options)\n\t\t\tend\n\t\t\t\t\t\t\n\t\t\tdoc = Hpricot.XML(response)\n\t\t\terrors = doc.search(\"*[@errCode]\")\n\t\t\tif errors.size > 0\nbegin\n\t\t\t\terrors.each do |error|\n\t\t\t\t\traise Wowr::Exceptions::raise_me(error[:errCode], options)\n\t\t\t\tend\nrescue\nend\n\t\t\telsif (doc%'page').nil?\n\t\t\t\traise Wowr::Exceptions::EmptyPage\n\t\t\telse\n\t\t\t\treturn (doc%'page')\n\t\t\tend\n\t\tend", "def url\n end", "def url_content\n urn\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def url\n uri\n end", "def url\n uri\n end", "def url\n @url ||= \"https://#{@host}/#{druid_without_prefix}.xml\"\n end", "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "def url\n uri.to_s\n end", "def xml_url\n \"https://#{Nuncium.configuration.xml_url}\"\n end", "def url\n end", "def get_xml(url, options = {})\n\t\t\tresponse = get_file(url, options)\n\t\t\tdoc = Hpricot.XML(response)\n\t\t\terrors = doc.search(\"*[@errCode]\")\n\t\t\tif errors.size > 0\n\t\t\t\terrors.each do |error|\n\t\t\t\t\traise Wowr::Exceptions::raise_me(error[:errCode], options)\n\t\t\t\tend\n\n elsif (doc%'achievements')\n\t\t\t return doc\n\t\t\telsif (doc%'dungeons')\n\t\t\t\treturn doc\n\t\t\telsif (doc%'page').nil?\n\t\t\t\traise Wowr::Exceptions::EmptyPage\n\t\t\telse\n\t\t\t\treturn (doc%'page')\n\t\t\tend\n\t\tend", "def do_get url\n\t\turi = URI.parse(url)\n\t\tNet::HTTP.get_response(uri)\n\tend", "def url\n uri.to_s\n end", "def content_get\n\t\t\t# compress GET requests to try and stay under that 8KB request limit\n\t\t\tdeflated_request = Zlib::Deflate.deflate(@request, 9)[2..-5]\n\t\t\t# strict_encode64() isn't available? sub out the newlines\n\t\t\t@request_params[\"SAMLRequest\"] = Base64.encode64(deflated_request).gsub(/\\n/, \"\")\n\t\t\t\n\t\t\tLogging.debug \"SAMLRequest=#{@request_params[\"SAMLRequest\"]}\"\n\t\t\turi = Addressable::URI.parse(@URL)\n\t\t\turi.query_values = @request_params\n\t\t\turl = uri.to_s\n\t\t\t#url = @URL + \"?SAMLRequest=\" + @request_params[\"SAMLRequest\"]\n\t\t\tLogging.debug \"Sending to URL #{url}\"\n\t\t\treturn url\n\t\tend", "def url\n \[email protected]_s\n end", "def get_response_url\n\tdoc = Nokogiri::HTML(open(lease_break_url))\nend", "def get_url path\n\t\t\t\[email protected] path, {}, {'REQUEST_URI' => ['http://example.org', path].join('/')}\n\t\t\t\tresponse = @browser.last_response\n\t\t\t\tresponse.body\n\t\t\tend", "def content_get\n # compress GET requests to try and stay under that 8KB request limit\n deflated_request = Zlib::Deflate.deflate(@request, 9)[2..-5]\n # strict_encode64() isn't available? sub out the newlines\n @request_params[\"SAMLRequest\"] = Base64.encode64(deflated_request).gsub(/\\n/, \"\")\n \n Logging.debug \"SAMLRequest=#{@request_params[\"SAMLRequest\"]}\"\n uri = Addressable::URI.parse(@URL)\n if uri.query_values == nil\n uri.query_values = @request_params\n else\n # solution to stevenwilkin's parameter merge\n uri.query_values = @request_params.merge(uri.query_values)\n end\n url = uri.to_s\n #Logging.debug \"Sending to URL #{url}\"\n return url\n end", "def url\n response[\"url\"]\n end", "def fetch_xml(uri)\n http = Net::HTTP.new(uri.host, uri.port)\n\n if uri.scheme == 'https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n http.read_timeout = GoogleCustomSearch.configuration.timeout\n\n request = Net::HTTP::Get.new(uri.request_uri)\n request.initialize_http_header({ 'User-Agent' => user_agent })\n\n response = http.request(request)\n\n raise GoogleCustomSearch::InvalidRequest if response.code.match(/[34]\\d{2}/)\n raise GoogleCustomSearch::ServerError if response.code.match(/5\\d{2}/)\n\n response.body\n end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url\n ''\n end", "def get\n @html = Nokogiri::HTML(URI.open(@url))\n\n self\n end", "def url\n @url.to_s\n end", "def url_content\n url(:content)\n end", "def consume_url; end", "def get url\n net_http_response = self.connection.get url\n [net_http_response.body, net_http_response.code.to_i, net_http_response.message]\n end", "def url\n endpoint+'?'+query_string\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def url\n @doc.url\n end", "def getUrl(url)\n puts url if @options[\"show-url\"]\n RestClient.get(url)\n end", "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def get(url)\n uri = URI.parse(url)\n response = nil\n opt = {:use_ssl => true}\n #start(address, port=nil, p_addr=nil, p_port=nil, p_user=nil, p_pass=nil, opt, &block)\n Net::HTTP.start(uri.host, uri.port, p_addr=nil, p_port=nil, p_user=nil, p_pass=nil, opt) { |http|\n request = Net::HTTP::Get.new uri\n request['Referer'] = REFERER\n response = http.request request # Net::HTTPResponse object\n }\n return response\nend", "def get_content\n send_get_content(url)\n end", "def get_listings_xml(url)\n @client.get_content(url)\n end", "def get\n execute_request { faraday_connection.get(href || '') }\n end", "def get_url(url)\n myurl = URI.parse(url)\n req = Net::HTTP::Get.new(url)\n res = Net::HTTP.start(myurl.host, myurl.port) { |http|\n http.request(req)\n }\n \n res.body # return\n end", "def to_s; @url; end", "def request_uri; end", "def get\n\t\t\tself.make_request!({uri: self.to_uri, method: :get})\n\t\tend", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def uri; end", "def get_xml(params = {:format => :xml, :action => :query})#TODO put these in so that they're default and not lost when we pass stuff in...\n url = _form_url(params)\n \n #TODO wonder if I should make a generic library for external url requests, to standardize the header/etc?\n #requests without user-agents are refused. See:\n #http://www.mooduino.co.uk/2010/04/wikipedia-api-user-agent-string-in-php.html\n retries = 2\n begin\n http = Net::HTTP.new(WIKI_API_SERVER) #en.wikipedia.org\n resp = http.request_get(WIKI_API_PATH + url, 'User-Agent' => 'WikipediaAntiSpamBot/0.1 (+hincapie.cis.upenn.edu)')\n \n raise \"POST FAILED:\" + resp.inspect unless resp.is_a? Net::HTTPOK or resp.is_a? Net::HTTPFound\n #retry if resp.body.to_s.empty?\n resp.body\n rescue Net::HTTPBadResponse, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::ECONNREFUSED, SocketError, \n Timeout::Error, Errno::EINVAL, EOFError, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n if retries > 0\n retries -= 1\n retry\n else\n raise Exception.new(\"Connection timed out after more than 3 retries: #{e}\")\n end\n end\nend", "def rest_url\n # Transifex API doc says always use a trailing slash even if the last element is a slug\n build_nodes_url.to_s + '/'\n end", "def get\n @response = Net::HTTP.get_response(URI(@url))\n end", "def get\n subclass(:Response).new connection.get do |req|\n req.url uri\n end\n end", "def request_url(command, params)\n url = \"http://www.openaustralia.org/api/#{command}?key=#{@key}&output=xml\"\n params.each do |k,v|\n key = CGI::escape(k.to_s)\n value = CGI::escape(v.to_s)\n url += \"&#{key}=#{value}\"\n end\n url\n end", "def get(url)\n uri = URI(url)\n Net::HTTP.get(uri)\nend", "def get()\n html = html_for(baseurl)\n scrape html, baseurl\n end", "def http_get(url)\n Net::HTTP.get_response(URI.parse(url)).body.to_s\n end", "def get(url)\n call(url: url)\n end", "def api_call(url_string)\n uri = URI.parse(url_string)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri)\n http.read_timeout = get_param(:timeout)\n #todo use JSON calls where available vs xml\n if get_param(:action_name)=='ADMIN'\n xstring = Nokogiri::XML(open(url_string))\n else\n response = http.request(request)\n puts \"Response: #{response.code} #{response.message} #{response.class.name}\"\n puts \"#{request}\"\n end\n end", "def get(url)\n raise \"Needs to be implemented\"\n end", "def base_url\n 'http://ow.ly/api/1.1/url/shorten'\n end" ]
[ "0.7261925", "0.7104539", "0.70842385", "0.6907188", "0.686918", "0.6806073", "0.6665297", "0.665751", "0.6652347", "0.66441536", "0.6614061", "0.6594597", "0.6586119", "0.6586119", "0.65776885", "0.6572553", "0.6556506", "0.6549474", "0.6549474", "0.6549474", "0.6549474", "0.6549474", "0.6524923", "0.6524923", "0.65059406", "0.64837545", "0.64619744", "0.6441677", "0.6436246", "0.63942105", "0.63809377", "0.6377617", "0.63665164", "0.63619244", "0.6357715", "0.63322335", "0.63314676", "0.6325598", "0.63035333", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.6299673", "0.62931573", "0.6286939", "0.62831026", "0.6273852", "0.6264826", "0.62636656", "0.6263409", "0.62505424", "0.6247997", "0.6245598", "0.62364113", "0.6230431", "0.6223374", "0.61921704", "0.6189448", "0.61570686", "0.61479676", "0.6121405", "0.6112327", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6101541", "0.6082224", "0.6062028", "0.60614914", "0.60445666", "0.6036232", "0.6024213", "0.6020196", "0.6005486", "0.598959", "0.59824306", "0.5981142", "0.5976512" ]
0.0
-1
GET /items def index
def create @game = Game.new(game_params) @game.user_id = params[:game][:user].first[:id] @game.item_id = params[:game][:item].first[:id] if @game.save render json: @game, status: :created, location: @game else render json: @game.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.all\n end", "def index\n @items = Item.found\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n\t\t@items = Item.all\n end", "def index\n @items = Item.all\n\n end", "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @items }\n end\n end", "def index\n #@items = Item.all\n end", "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index \n\t\t@items = Item.all\n\tend", "def index\n @items = Item.all\n end", "def index\n @items = Item.find(:all, :order => 'id ASC')\n # @items = Item.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\r\n @items = Item.paginate(:page => params[:page])\r\n end", "def index\n @items = Item.paginate(:page => params[:page])\n end", "def index\n @items = Item.search(params[:search]).page(params[:page]).per(40)\n end", "def index\n @items = @list.items.all.order(id: :desc)\n return success_item_index\n end", "def index\n @page = (params[:page] || 1).to_i\n @items_per_page = (params[:num] || 50).to_i\n # @items = Item.all\n results = Item.search(\"\", @page, @items_per_page)\n @items = results[0]\n @count = results[1]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @items = @deal.items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @items = Item.accessible_by(current_ability)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n format.xml { render xml: @items }\n end\n end", "def index\n @items = Item.find_all_by_user_id(current_user.id)\n end", "def index\n @api_v1_items = Item.all\n render json: @api_v1_items\n end", "def index\n @items = Item.valid_items.search(params[:search],params[:action]).order(sort_column('Item', 'name') + ' ' + sort_direction).paginate(:page => params[:page], :per_page => 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end", "def index\n @items_count = Item.count\n @items = Item.find(:all, { :order => 'items.created_at DESC', :include => :user }.merge(@pagination_options))\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n format.rss { render :layout => false }\n end\n end", "def index\n @items = current_user.items\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end", "def index\n get\n end", "def index\n @items = Stat.all\n end", "def index\n\t\t @items = Item.find_my_items(current_user) \n end", "def index\n @items = @user.items\n end", "def index\n respond_to do |format|\n format.html\n format.json { render :json => Item.all}\n end\n\n end", "def index\n @items = Item.all.order(:id)\n end", "def index\n get('')\n end", "def index\n @items = Admin::Item.by_agency(@current_agency.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_items }\n end\n end", "def index\n @items_mobs = ItemsMob.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @items_mobs.to_xml }\n end\n end", "def index\n @items = @project.items.ready\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end", "def index\n @servico_items = ServicoItem.all\n end", "def item_index\n #@items = Item.all\n \n\tif (params[item_index_path].nil? ||\n params[item_index_path][:nome].empty?)\n nome = nil\n else\n nome = params[item_index_path][:nome]\n end\n if nome != nil\n @items = Item.where(\"nome like '%#{nome}%'\")\n else\n @items = Item.all\n end\n end", "def index\n @list = List.find(params[:list_id])\n @items = @list.items\n\n respond_with @items\n end", "def index\n @item_lists = ItemList.all\n end", "def index\n @items = @channel.items\n @items = @query.search(@items)\n @items = @items.order_by_published_at_desc\n @items = @items.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html\n format.json { render json: @items }\n end\n end", "def index\n\t\t@item = current_user.items\n\n\tend", "def index\n @items = Item.all.order(name: :asc) #Returns all items sorted by name.\n end", "def index\n @apiv1_items = Item.all.order(:name)\n end", "def index\n @found_items = FoundItem.all\n end", "def index\n if params[:search] == nil then\n @crafted_items = CraftedItem.all_cached_crafted_item.paginate(:page => params[:page])\n else\n @crafted_items = CraftedItem.search(params[:search], params[:page])\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @crafted_items }\n end\n end", "def items\n \tbegin\n \t@categories = Category.all.includes(items: [:dimensions])\n \t@ingredients = Ingredient.actives\n \trender 'api/v1/home/items', status: :ok\n \trescue Exception => e\n \t\terror_handling_bad_request(e)\n \tend\n\n\tend", "def index_rest\n @entry_items = EntryItem.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entry_items }\n end\n end", "def show\n @items = Item.find(params[:id])\n render json: @items\n end", "def index\n entries\n end", "def index \n \n begin\n @menu = @client.search_menu_items(params[:item])\n rescue RuntimeError\n @error = true\n @response = response.status\n end\n end", "def index\n @orden_items = OrdenItem.all\n end", "def index\n @urlitems = Urlitem.all\n end", "def index\n @items = Item.search(params[:search]).paginate(:per_page => 5, :page => params[:page])\n end", "def index\n @active_items = Item.select(&:active?).sort_by(&:name)\n @inactive_items = Item.select(&:inactive?).sort_by(&:name)\n\n @item = Item.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n render json: RequestItem.all\n end", "def index\n# @items = Item.all\n store_location\n @items = @items.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "def index\n @items = @current_user.items\n end", "def index\n @main_items = MainItem.all\n end", "def index\n @nav_items = NavItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nav_items }\n end\n end", "def index\n @goods_items = Goods::Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @goods_items }\n end\n end", "def index\n @front_page = true\n @items_count = Item.count\n @items = Item.all.paginate :page => params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n format.rss { render :layout => false }\n end\n end", "def index\n @items = @sale.items\n end", "def index\n @items = Item.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @boards }\n end\n end", "def index\n @items = ItemTemplate.search(params[:search]).order(sort_column+\" \"+sort_direction).paginate(:per_page => 10, :page => params[:page])\n @title = \"Items\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.js # index.js.erb\n format.xml { render :xml => @items }\n end\n end", "def index\n if @project\n @items = @project.items\n else\n @items = Item.all\n end\n end", "def index\n @item_inventories = ItemInventory.all\n end", "def index\n page_size = 12\n @page = params[:page].nil? ? 1 : params[:page].to_i\n @items = current_user.items.all\n @items = @items.where(name: params[:name]) unless params[:name].nil?\n # count total item before paging\n flash[:notice] = \"Total item found : #{@items.count}\"\n \n @items = @items.limit(page_size).offset((@page.to_i - 1) * page_size).order(date: :desc)\n @total_page = (current_user.items.count / page_size.to_f).ceil\n\n @paginator_iter_count = (1..10)\n @paginator_iter_count = (@page - 5..@page + 5) if @page >= 10 && @page <= @total_page - 10\n @paginator_iter_count = (@total_page - 10..@total_page) if @page > @total_page - 10\n\n @item_types = Item.new.item_type_option\n end", "def index\n render json: Item.paginate(page: params[:page], per_page: 25)\n end", "def show\n @items = Item.all\n end", "def index\n @action_items = ActionItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @action_items }\n end\n end", "def index\n @items = Item.order(:location).paginated(params[:page])\n end", "def index\n @item_type = params[:type] = \"C\"\n \n params[:id] = nil\n \n # 찜한 상품, 콜렉션\n @collections = Collection.itemList(params)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @collections }\n end\n \n end", "def index\n @list_items = ListItem.all\n end", "def index\n @list_items = ListItem.all\n end", "def index\n @art_items = ArtItem.all\n end" ]
[ "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.837347", "0.8370472", "0.834173", "0.8313729", "0.8285166", "0.82643354", "0.8261025", "0.8251453", "0.8251453", "0.8251453", "0.8251453", "0.8232961", "0.8213051", "0.80023813", "0.79410625", "0.7760845", "0.77532935", "0.77415556", "0.7736715", "0.77363497", "0.76976264", "0.768987", "0.7674778", "0.76300997", "0.76280206", "0.75981843", "0.75843734", "0.75799096", "0.7578139", "0.7572962", "0.7566504", "0.75658494", "0.7536754", "0.7510528", "0.75086844", "0.7470543", "0.74545044", "0.74399745", "0.7432213", "0.7426864", "0.74160343", "0.7393321", "0.7386832", "0.73865664", "0.7382627", "0.73765653", "0.7373526", "0.7367323", "0.7361822", "0.73504245", "0.7341453", "0.7340034", "0.7328558", "0.7327426", "0.73215526", "0.731772", "0.7314567", "0.73027825", "0.73016346", "0.72983956", "0.72864646", "0.7285832", "0.7277898", "0.72768843", "0.7267386", "0.7263024", "0.72559863", "0.7249612", "0.72465163", "0.7244464", "0.72409904", "0.72408956", "0.72344667", "0.72306633", "0.721764", "0.721764", "0.7214315" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_game @game = Game.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\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 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 workflow\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 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 before_action \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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; 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 setup(&blk)\n @setup_block = blk\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 callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); 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", "def duas1(action)\n action.call\n action.call\nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def call\n setup_context\n super\n end" ]
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", "0.5312988", "0.529798", "0.52968603", "0.52962637", "0.52577317", "0.5244704", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5233461", "0.52322435", "0.5227552", "0.52224743", "0.5217851", "0.521241", "0.52069896", "0.5206555", "0.5176617", "0.51738507", "0.51725876", "0.51660734", "0.51605034", "0.51571786", "0.5152762", "0.5152164", "0.5151477", "0.5145819", "0.51408994", "0.5134412", "0.5114031", "0.5113695", "0.5113695", "0.5108603", "0.5107358", "0.5090405", "0.50889385", "0.50817686", "0.5081617", "0.50658226", "0.50551206", "0.5051746", "0.5049091", "0.5049091", "0.5034681", "0.5024972", "0.5021291", "0.5016024", "0.50134826", "0.50008893", "0.50000244", "0.4999155", "0.49907947", "0.49907947", "0.49853387", "0.49796683", "0.4979596", "0.49778128", "0.49673793", "0.49662578", "0.49587822", "0.4956063", "0.49550167", "0.49523485", "0.4951614", "0.49452996", "0.49442068", "0.49336892", "0.49306205", "0.49264124", "0.49259305", "0.4925823", "0.49229056", "0.4918999", "0.49171805", "0.49167436", "0.4916559", "0.49153692", "0.49148256" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def game_params params.require(:game).permit() 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 get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\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 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 specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "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 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 special_device_list_params\n params.require(:special_device_list).permit(:name)\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 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.7123669", "0.7054077", "0.69472784", "0.6902165", "0.6736001", "0.671985", "0.6687218", "0.6676269", "0.66602534", "0.6556639", "0.6527985", "0.645892", "0.645072", "0.64494324", "0.6445436", "0.64350927", "0.6415061", "0.6415061", "0.6393001", "0.6378958", "0.6378958", "0.63741165", "0.636044", "0.63547933", "0.6285727", "0.6278816", "0.6246161", "0.6227885", "0.6225383", "0.622309", "0.62118614", "0.6209478", "0.6176166", "0.6172476", "0.6169111", "0.6158942", "0.6143792", "0.6136175", "0.6123085", "0.6108703", "0.6100308", "0.60760003", "0.6054003", "0.60426265", "0.6036683", "0.6029898", "0.6020772", "0.6020169", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.6019335", "0.60176134", "0.6006716", "0.6003403", "0.6001569", "0.5995689", "0.5994206", "0.599406", "0.5985532", "0.59828365", "0.5977637", "0.59767246", "0.5970349", "0.59662646", "0.5966073", "0.5966073", "0.5957612", "0.5951802", "0.5950822", "0.59498274", "0.5942674", "0.59319496", "0.5931201", "0.59265846", "0.59238476", "0.5918484", "0.59172106", "0.59133804", "0.59125537", "0.59080327", "0.59065026", "0.5906122", "0.59027356", "0.59009796", "0.589672", "0.5895543", "0.5893694" ]
0.0
-1
Denies access for public users to private projects
def require_proj_access if params[:gr] @project ||= Group.find(params[:gr]).project else @project = Project.find(params[:id] || params[:pr]) end if ((not is_logged?) || current_user.is_public?) && @project.is_private? flash_msgs(1, "Access denied.") redirect_to root_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_unauthorized_proc\n # no-op\n end", "def define_global_privileges\n can :read, Project, public_can_view?: true\n can :index, Project\n can :read, Group\n end", "def authorize_manageable\n unless @project_group.is_child_of?(@project)\n deny_access\n end\n true\n end", "def restrict_access\n head :unauthorized and return false unless current_user\n end", "def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend", "def cannot_any?(user, projects)\n !can_any?(user, :reader, projects)\n end", "def authorize\n super(:projects, projects_url)\n end", "def can_access?\n project = Project.find(params[:id])\n \n if logged_in?\n user = User.find(session[:user_id])\n unless user.projects.include?(project) or project.visibility == \"Public\"\n redirect_to root_url, :notice => \"You're not authorized to access this project!\"\n end\n elsif project.visibility != \"Public\"\n redirect_to root_url, :notice => \"You're not authorized to access this project!\"\n end\n end", "def cannot_all?(user, projects)\n !can_all?(user, :reader, projects)\n end", "def admin_only\n deny_access(\"Necesitas tener privilegios de administrador para entrar.\") unless signed_in_as_admin?\n end", "def authenticate_project_owner\n unless current_user && (current_user.admin || current_user.id == @project.user.id)\n redirect_to action: 'show', controller: 'videos', project_id: @project.id, id: @video.id, notice: 'Permission denied.'\n end\n end", "def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def authorized_user\n @project = current_user.projects.find_by_id(params[:id])\n if @project.nil?\n flash[:error] = \"You can only edit your own projects.\"\n redirect_to root_path\n end\n end", "def allow_access\n !@current_user.nil?\n end", "def show\n authorize(@project)\n end", "def cannot?(user, project)\n !can?(user, :reader, project)\n end", "def index\n @project = Project.find(params[:project_id].to_i)\n authorize_user!( @project )\n end", "def deny_all_access\n @permissions = 0\n end", "def skip_authorization; end", "def make_public\n self.private = false\n save\n self.collaborators.clear # remove collaborators when user is downgraded, and wiki is made public\n end", "def deny_access\n if not current_user\n authenticate_user!\n elsif current_user.member?\n redirect_to root_path, :alert => \"Access denied.\"\n end\n end", "def check_if_public_user\n if session[:public_user]\n session[:public_user] = nil\n session[:user_id] = nil\n flash[:notice] = \"RESTRICTED: You do not have access\"\n redirect_to controller: :access, action: :user_menu\n false\n end\n end", "def restrict_access\n redirect_to root_path if is_superuser_or_admin? == false\n end", "def isAuthorizedUser\n redirect_to groups_path unless current_user.id == @project.user_id\n end", "def access_control\n \n end", "def show\n @project = Project.find(params[:id])\n @owner = User.find(@project.user_id)\n\n if signed_in?\n if @owner.id != current_user.id && @project.private?\n throw_403\n return\n end\n else\n if @project.private?\n throw_403\n return\n end\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "def permit_unprotected_actions\n # Allow clients to download packages\n can [:download, :icon], Package\n # Allow client computer requests\n can :checkin, Computer\n can [:show_plist, :show_resource], Computer\n # Allow any request to retrieve catalogs\n can :read, Catalog\n # Allow everyone to edit their user record\n can [:read, :update], User, :id => @user.id\n # Allow anyone to login and logout\n can [:create, :destroy], :session\n # Allow anyone to view their dashboard\n can :manage, :dashboard\n end", "def must_be_admin!\n access_denied! unless current_admin?\n end", "def users_only\n deny_access(\"You must be signed in to access this page.\") unless signed_in?\n end", "def standard_authorized_user_rights\n public_access + protected_access \n end", "def is_view_permitted?(user_or_project = nil)\n return false\n end", "def authorize_access\n redirect_to admin_sites_url unless @site || current_user.admin?\n end", "def authorize_only_for_admin\n unless authorized?(Admin)\n render :file => \"#{RAILS_ROOT}/public/404.html\", \n :status => 404\n end\n end", "def allow_anon\n end", "def authorize\r\n # check if action is allowed on public projects\r\n if @project.is_public? and Permission.allowed_to_public \"%s/%s\" % [ @params[:controller], @params[:action] ]\r\n return true\r\n end \r\n # if action is not public, force login\r\n return unless require_login \r\n # admin is always authorized\r\n return true if self.logged_in_user.admin?\r\n # if not admin, check membership permission \r\n @user_membership ||= Member.find(:first, :conditions => [\"user_id=? and project_id=?\", self.logged_in_user.id, @project.id]) \r\n if @user_membership and Permission.allowed_to_role( \"%s/%s\" % [ @params[:controller], @params[:action] ], @user_membership.role_id ) \r\n return true\t\t\r\n end\t\t\r\n render :nothing => true, :status => 403\r\n false\r\n end", "def authorize_access\n # byebug\n redirect_to root_path, alert: \"Access Denied\" unless can? :modify, Post\n end", "def access_denied\n end", "def only_create\n if [email protected]_project_create\n raise Exceptions::GitlabApiException.new(\"Access forbidden for this user\")\n end\n\n # only admin can change anyone project\n if [email protected]? && params[:owner_id] && params[:owner_id] != @user.id\n raise Exceptions::GitlabApiException.new(\"Access forbidden for this user\")\n end\n\n true\n end", "def only_create\n if [email protected]_project_create\n raise Exceptions::GitlabApiException.new(\"Access forbidden for this user\")\n end\n\n # only admin can change anyone project\n if [email protected]? && params[:owner_id] && params[:owner_id] != @user.id\n raise Exceptions::GitlabApiException.new(\"Access forbidden for this user\")\n end\n\n true\n end", "def standard_authorized_user_rights\n Lockdown::System.public_access + Lockdown::System.protected_access \n end", "def restrict_anonymous_access\n return unless current_user.nil?\n\n handle_http_401(t('application.errors.restricted_access'))\n end", "def allow_access\n !current_cas_user.nil?\n end", "def private_to_public\n current_user.wikis.each do |wiki|\n wiki.update_attributes(:private => false)\n end\n end", "def enforce_public\n return unless current_user\n\n Rails.logger.info('Authenticated user accessing public page - redirecting to dashboard')\n redirect_to dashboard_url\n end", "def require_admin\n deny_wrong_user if !admin?\n end", "def permission_required \n render_403 unless admin? || @user == current_user\n end", "def publicize\n @access_control = 'public'\n end", "def set_project\n @project = Project.find_by!(slug: params[:id])\n\n # rubocop:disable Style/GuardClause\n if @project.user_id != @current_user.id\n render status: :forbidden, json: { error: 'You are not allowed to make this action.' }\n false\n end\n # rubocop:enable Style/GuardClause\n end", "def authorize\r\n # check if action is allowed on public projects\r\n if @project.is_public? and Permission.allowed_to_public \"%s/%s\" % [ @params[:controller], @params[:action] ]\r\n return true\r\n end \r\n # if user not logged in, redirect to login form\r\n unless session[:user]\r\n store_location\r\n redirect_to(:controller => \"account\", :action => \"login\")\r\n return false\r\n end\r\n # if logged in, check if authorized \r\n if session[:user].admin? or Permission.allowed_to_role( \"%s/%s\" % [ @params[:controller], @params[:action] ], session[:user].role_for_project(@project.id) ) \r\n return true\t\t\r\n end\t\t\r\n flash[:notice] = \"Acces denied\"\r\n redirect_to(:controller => \"\")\r\n false\r\n end", "def access_denied\n\n end", "def access!(user, access)\n return if access?(user, access)\n\n raise Exceptions::NotAuthorized\n end", "def check_auth\n if current_user.company_id != @company.id && !current_user.manager? && !current_user.admin?\n redirect_to projects_path, :alert => \"Access denied.\" and return\n end\n end", "def without_access_control\n previous_state = Authorization.ignore_access_control\n Authorization.ignore_access_control(true)\n result = yield\n ensure\n Authorization.ignore_access_control(previous_state)\n result\n end", "def define_user_privileges(user)\n # Projects\n can :create, Project\n can [:read, :save, :activate], Project, owner: user\n can :read, Project do |project|\n project.confirmation_approver? user\n end\n\n can :destroy, Project, owner: user, state: :active\n can :destroy, Project, owner: user, state: :inactive\n can :destroy, Project, owner: user, state: :unconfirmed\n\n # Note: this 'update' refers to the Update and Edit actions of ProjectsController,\n # not the ability to create Update objects associated with a project\n can :update, Project, owner: user, can_edit?: true\n\n can :create, Update do |update|\n update.project.can_update? and\n update.project.owner == user\n end\n\n can :destroy, Video do |video|\n video.project.owner = user\n end\n\n can :create, Comment if user.id\n can :destroy, Comment do |comment|\n comment.user == user and comment.body != \"comment deleted\"\n end\n\n can :create, Contribution do |contribution|\n contribution.project.owner != user and\n contribution.project.contributions.find_by_user_id(user.id).nil? and\n contribution.project.end_date >= Time.zone.today\n end\n # If the user is logged in, doesn't own the project, and has a contribution on this project,\n # they can edit\n can :update, Contribution do |contribution|\n !contribution.project.contributions.find_by_user_id(user.id).nil?\n end\n\n # Groups\n can [:create], Group\n can :remove_project, Group # had to move check for admin or project owner to controller\n\n can [:update, :admin, :destroy], Group, owner: user\n\n #Aprovals\n can :create, Approval\n can [:approve, :reject], Approval do |approval|\n approval.group.owner == user\n end\n\n can :read, User, id: user.id\n end", "def show\n authorize! :show, @project\n end", "def access_robot\n raise 'unauthorised' if current_user != @robot.user \n end", "def accessible?\n admin? || owner? || @project.is_open_source?\n end", "def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end", "def protected!\n redirect(\"/privateLogin\") unless admin?\n end", "def user_access_control\n bot = Bot.find(params[:id])\n\n if current_user.admin?\n @bot = User.find(bot.account.user_id).admin? ? current_user.bots.find(params[:id]) : bot\n else\n @bot = current_user.bots.find(params[:id])\n end\n\n rescue\n response_access_denied\n end", "def denied\n end", "def open_to_public?\n allow_external_students? || allow_external_volunteers?\n end", "def visible?(user=User.current)\n user.allowed_to?(:view_pulls, self.project)\n end", "def restrict_access\n render :\"/home/http_404\" unless @pet && @pet.user == current_user\n end", "def restrict_access\n render :\"/home/http_404\" unless @profile && @profile.user == current_user\n end", "def publicly_available?\n return false unless access_rights.present?\n\n access_rights.none? do |value|\n value == 'deny' || %w[allow:icus allow:pdus].include?(value)\n end\n end", "def restricted_should_authenticate\n authenticate_user! unless @document.public?\n end", "def restrict_access\n # check if the request has an API key as part of it...\n end", "def index\n prevent_non_admin\n end", "def admin_only\n logged_in_as_admin? || admin_only_access_denied\n end", "def restrict_access\n\t authenticate_or_request_with_http_token do |token, options|\n\t User.exists?(api_key: token)\n\t end\n\tend", "def editable_by?(usr)\n if wiki.project &&\n wiki.project.module_enabled?('wiki') &&\n wiki.project.module_enabled?('redmine_advanced_wiki_permissions')\n !protected? || usr.wiki_allowed_to?(self, :protect_wiki_pages)\n else\n !protected? || usr.allowed_to?(:protect_wiki_pages, wiki.project)\n end\n end", "def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n User.find_by_api_key(token).present?\n end\n end", "def shared_access_allowed\n @settings.get_value(\"Shared Access\") == \"true\"\n end", "def require_admin\n not_authorized(\"Invalid credentials.\") unless is_admin?\n end", "def project\n user.private_files_project\n end", "def project_access(project)\n get(\"/projects/#{project}/access\")\n end", "def visible?(user=User.current)\n user.allowed_to?(:view_issues, self.project)\n end", "def user_access_control_all\n @user = User.find(params[:user_id])\n\n unless [email protected]? && current_user.admin? || current_user?(@user)\n response_access_denied\n end\n\n rescue\n response_access_denied\n end", "def allow_access_by_any_user\n @attributes[:allow_access_by_any_user]\n end", "def require_member_of_group_if_private\n if !current_group.public\n require_member_of_group\n end\n end", "def set_project\n @project = Project.includes(:user).find(params[:id])\n if @project.user != current_user\n render plain: '', status: :forbidden\n end\n end", "def include_public_users?\n true\n end", "def only_authorize_admin!\n authorize!(is?(:admin))\n end", "def admin_authorize\n unless admin?\n unauthorized_access\n end\n end", "def authorize_read_group!\n unless @group and (@projects.present? or can?(current_user, :read_group, @group))\n if current_user.nil?\n return authenticate_user!\n else\n return render_404\n end\n end\n end", "def authorized\n\t unless admin?\n\t redirect_to root_path\n\t end\n end", "def show_private_tab\n current_user && (current_user.admin? || # if current_user is an admin\n current_user.premium? || # current_user is a premium\n current_user.wiki_collaborations.any?) # current_user has any private wiki collaborations\n end", "def authorize_access_to(obj)\n unless authorized?(obj)\n raise Repia::Errors::Unauthorized\n end\n end", "def restrict_developer\n if (controller_name == 'user_sessions' and action_name == 'destroy') or\n (controller_name == 'users' and (action_name == 'edit' || action_name == 'update'))\n return\n end\n if current_user and is_developer \n redirect_to :controller => 'efforts'\n end\n end", "def set_project\n @project = Project.find(params[:id])\n \tauthorize [:admin, @project]\n end", "def show\n skip_authorization\n end", "def admin_only\n deny_access(\"You must be signed in as an admin to access this page.\") unless signed_in_as_admin?\n end", "def adminprotected!\n if authorized? == true and isuseradmin? == true\n return\n else redirect '/denied'\n end\n end", "def admin_in!\n access_denied! unless current_user.admin?\n end", "def is_public?\n is_public == true && requires_login == false\n end", "def public?\n # first line just for formatting\n false || \\\n object_acl.any? { |g| g.grantee.type == \"Group\" && g.grantee.uri =~ /AllUsers/ } || \\\n object_acl.any? { |g| g.grantee.type == \"Group\" && g.grantee.uri =~ /AuthenticatedUsers/ }\n end" ]
[ "0.7277191", "0.7218941", "0.7210982", "0.7198158", "0.7187759", "0.7020269", "0.7002725", "0.6990869", "0.6851059", "0.67871827", "0.6787141", "0.6766111", "0.67153335", "0.67153335", "0.67153335", "0.6681467", "0.6669373", "0.6658646", "0.66570187", "0.66124827", "0.66024005", "0.6599915", "0.6587584", "0.6579234", "0.6536145", "0.65178907", "0.65039593", "0.647809", "0.6445599", "0.64314085", "0.642865", "0.64155304", "0.6408789", "0.64076465", "0.63937515", "0.6386166", "0.63852745", "0.6380148", "0.6367797", "0.6361988", "0.6357067", "0.6357067", "0.63514215", "0.6349864", "0.6349791", "0.63492006", "0.63416135", "0.63405323", "0.63365793", "0.63218737", "0.63142854", "0.6310372", "0.63058424", "0.6302161", "0.6296223", "0.6290984", "0.62866783", "0.6283387", "0.627847", "0.626144", "0.6261228", "0.62610155", "0.6258295", "0.6251492", "0.6247278", "0.6241658", "0.6238765", "0.62273747", "0.6224444", "0.6206194", "0.61968726", "0.61949986", "0.618867", "0.61787057", "0.61772853", "0.61741793", "0.61663663", "0.6166248", "0.6164907", "0.61586404", "0.615755", "0.6154728", "0.6150354", "0.6146327", "0.6143304", "0.61385494", "0.61375076", "0.61156195", "0.61152184", "0.6109291", "0.61084586", "0.6099097", "0.60988414", "0.6094196", "0.60934734", "0.60934556", "0.60914695", "0.60906947", "0.608986", "0.6088189" ]
0.75092643
0
The number will be passed in as a string of only digits. It should return a five digit integer. The number passed may be as large as 1000 digits. 283910 91 is the greatest sequence of 2 digits. The method will be for 5 digits
def largest_five(digits) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solution(digits)\n digits.scan(/\\d{5}/).max.to_i\nend", "def solution(digits)\n digits.to_s.split(\"\").each_cons(5).max.join.to_i\nend", "def solution(digits)\n digits.split('').each_cons(5).max.join.to_i\nend", "def maxNumber(num)\n \n num.digits.sort {|a,b| b <=> a}.join.to_i\n \nend", "def solution(digits)\n digits.chars.each_cons(5).max_by(&:itself).join.to_i\nend", "def max_number(string)\n string.scan(/\\d/).size\nend", "def largest(number_of_digits)\n ('9' * number_of_digits).to_i\nend", "def largest_consecutives_5(number)\n\tnumber = number.split('')\n\tproduct= 0 \n\n\twhile number.size > 0\n\t\tnew_product = number[0].to_i * number[1].to_i * number[2].to_i * number[3].to_i * number[4].to_i \n#convert the splitted digits to single ones\n\t\tproduct = new_product > product ? new_product : product\n #if the new product is greater than the original, then the new_product becomes the original. if true, the variable before the ':' will pass. if not, the latter\n \t\tnumber.shift\n #removes the first number and returns it\n \tend\n \tproduct\n end", "def solution(digits)\n\tstop = digits.length - 4\n\tgo = 0\n\tlargest_number = 0\n\tindex = 0\n\n\twhile go < stop\n\t\ttest = \"\"\n\t\textra_index = index\n\t\t5.times do \n\t\t\ttest += digits[extra_index].to_s\n\t\t\textra_index += 1 \n\t\tend\n\t\tif test.to_i > largest_number\n\t\t\tlargest_number = test.to_i\n\t\tend \n\t\tindex += 1\n\t\tgo += 1 \n\tend \n\tlargest_number\nend", "def solution(digits)\n greatest = 0\n (0..(digits.size - 1)).each do |pos|\n num = digits[pos..pos+5].to_i\n greatest = num if num > greatest\n end\n greatest \nend", "def featured(number)\n max = 9_876_543_210\n number += 1\n number += 1 until number.odd? && number % 7 == 0\n loop do\n number_chars = number.to_s.chars\n if number_chars.size == number_chars.uniq.size\n return number\n end\n if number > max\n break\n end\n number += 14\n end\n \"ERROR! No next featured number!\"\nend", "def get_actual_number(number)\n if number >= 31\n return number + 2\n else\n return number + 1\n end\n end", "def featured(integer)\n return \"There is no possible number that fulfills those requirements\" if \n integer >= 9_876_543_210\n integer += 1\n until integer % 7 == 0 && integer.odd? && integer.digits.uniq! == nil\n integer += 1\n end\n integer\nend", "def solution(digits)\n result = 0\n digits.size.times do |n|\n new_number = digits[n...(n + 5)].to_i\n result = new_number if new_number > result\n end\n result\nend", "def largest_digit(input)\n\t\tcreate_array(input).max.to_i\n\tend", "def smallest_n_digit_number(n)\n 10 ** (n-1)\nend", "def featured(int)\n next_num = 0\n loop do\n next_num = int.succ\n break if next_num.odd? && next_num % 7 == 0\n int = next_num\n end\n loop do\n break if next_num >= 9_876_543_210\n if next_num.to_s.chars.uniq == next_num.to_s.chars\n return next_num\n else next_num += 14\n end\n end\n \"There is no possible number that fulfills those requirements.\"\nend", "def last_n_digits(num, n)\r\n # your code goes here\r\n num % 10**n\r\nend", "def max_number(n)\nn = n.to_s\narr = []\n n.length.times do |i|\n arr << n[i].to_i\n end\narr.sort!.reverse!\nstr= \"\"\narr.each do |i| str = str + \"#{i}\"\nend\nstr.to_i\nend", "def featured(int)\n if int >= 9_876_543_210\n return 'There is no possible number that fulfills those requirements.'\n end\n \n featured_num = 0\n until featured_num > int\n loop do\n featured_num += 7\n next if featured_num.even?\n next if featured_num.digits != featured_num.digits.uniq\n break\n end\n end\n featured_num\nend", "def getMaxNumber(str, num)\n number = 0\n dict = countCardValue(str)\n dict.each do |i, j|\n if j == num\n number = i\n end\n end\n replaceCharToNumber(number)\nend", "def featured(integer)\n return \"Error: There is no possible number that fulfills those requirements\" if integer >= 9_876_543_210\n counter = integer + 1\n counter += 1 until counter % 7 == 0 && counter.odd?\n \n loop do\n return counter if counter.digits.uniq.size == counter.digits.size\n counter += 14\n end\nend", "def decent_num num\n\n arr = []\n\n if num % 5 == 0\n arr << (\"3\"*num).to_i\n end\n\n num.downto(1).each do |fi|\n th = num - fi\n if th % 5 == 0 && fi % 3 == 0\n arr << (\"5\"*fi + \"3\"*th).to_i\n break\n end\n end\n\n\n if arr.empty?\n -1\n else\n arr.max\n end\n\nend", "def featured2(number)\n number += 1\n number += 1 until number.odd? && number % 7 == 0\n\n loop do\n number_chars = number.to_s.split('')\n return number if number_chars.uniq == number_chars\n number += 14\n break if number >= 9_876_543_210\n end\n\n 'There is no possible number that fulfills those requirements.'\nend", "def get_first_digit n \n n / 10**length(n) \nend", "def check_digit(number: 0)\n sum = 0\n number.to_s.chars.each_with_index do |digit, idx|\n position = idx + 1\n sum += (digit.to_i * (11 - position))\n end\n result = 11 - (sum % 11)\n\n # A value of 11 is considered the same as 0\n # See https://en.wikipedia.org/wiki/NHS_number\n return 0 if result == 11\n\n result\n end", "def compute_number(digits)\n digits.length == 1 ? (digits.to_i) : (digits[-1].to_i + 10*compute_number(digits[0..-2]))\nend", "def find_digit_amount(num)\n\treturn num.to_s.length()\nend", "def largest_number_digit\n (@primes.last ** 2).to_s.length\n end", "def featured(int)\n for num in (int + 1...9_999_999_999) \n return num if num.odd? && num % 7 == 0 && num.digits == num.digits.uniq\n end\n \"There is no possible number that fulfills those requirements\"\nend", "def max_rotation(number)\n number_digits = number.to_s.size\n number_digits.downto(2) do |n|\n number = rotate_rightmost_digits(number, n)\n end\n number\nend", "def max_rotation(number)\n number_digits = number.to_s.size\n number_digits.downto(2) do |n|\n number = rotate_rightmost_digits(number, n)\n end\n number\nend", "def super_digit(n)\n return n if n < 10 \n return super_digit(n.to_s.chars.map(&:to_i).sum)\nend", "def get_max_num\n r,t,a = 0, 0, 9**self\n while r < t.to_s.size\n r,t = r + 1, t+a\n end\n return t\n end", "def num_of_num(number)\n\tnumber_of_num=1\n\tnumber_size=number.to_s.size\n while number_size > 1 do\n number_of_num = number_of_num * \tnumber_size\n number_size = number_size - 1 \n end\n return number_of_num\nend", "def solution(n)\n n.to_s(2).reverse.to_i.to_s.split('1').map(&:length).max || 0\nend", "def featured(number)\n number += 1\n number += 1 until number.odd? && number % 7 == 0\n\n loop do\n number_chars = number.to_s.split('')\n return number if number_chars.uniq == number_chars\n number += 14\n break if number > 9_876_543_210\n end\n\n 'There is no possible number that fulfills those requirements.'\nend", "def featured(number)\n number += 1\n number += 1 until number.odd? && number % 7 == 0\n\n loop do\n number_chars = number.to_s.split('')\n return number if number_chars.uniq == number_chars\n number += 14\n break if number >= 9_876_543_210\n end\n\n 'There is no possible number that fulfills those requirements.'\nend", "def find_max_nth_power(n)\r\n\tnum_of_digits = 2\r\n\r\n\t(num_of_digits += 1) until (num_of_digits * 9 ** n) < ((\"9\" * num_of_digits).to_i + 1)\r\n\r\n\t(\"9\" * (num_of_digits)).to_i\r\nend", "def max_rotation(num)\n num_out = num\n num.to_s.length.downto(1) {|n|\n num_out = rotate_rightmost_digits(num_out, n)\n }\n num_out.to_i\nend", "def super_digit(n)\n return n if n < 10\n sum = n.to_s.chars.map(&:to_i).sum\n return super_digit(sum)\nend", "def last_digit(int)\n # your code goes here\n return int % 10\nend", "def last_n_digits(num, n)\n # your code goes here\n if n == 1\n return num % 10\n else\n \treturn num % 100\n end\nend", "def last_digit(num)\n num.to_s[-1].to_i\nend", "def super_digit(n)\n return n if n / 10 < 1\n \n string = n.to_s.split(\"\")\n sum = 0\n \n string.each do |num|\n sum += num.to_i\n end\n \n return super_digit(sum)\nend", "def two_digits_number(x)\n x < 10 ? \"0#{x}\" : x.to_s\n end", "def max_number_in_string(string=\"89563 4777 10\")\n array = string.gsub(/[^\\d]/, '|').split('|')\n new_array = Array.new\n array.each {|el| new_array.push(el.to_i) }\n puts new_array.max\n end", "def greatest_product(digits)\r\n\t# Get Number in one string. Can probably do this with greater optimization\r\n\tnumber = \"73167176531330624919225119674426574742355349194934\"\r\n number += \"96983520312774506326239578318016984801869478851843\"\r\n\tnumber += \"85861560789112949495459501737958331952853208805511\"\r\n\tnumber += \"12540698747158523863050715693290963295227443043557\"\r\n\tnumber += \"66896648950445244523161731856403098711121722383113\"\r\n\tnumber += \"62229893423380308135336276614282806444486645238749\"\r\n\tnumber += \"30358907296290491560440772390713810515859307960866\"\r\n\tnumber += \"70172427121883998797908792274921901699720888093776\"\r\n\tnumber += \"65727333001053367881220235421809751254540594752243\"\r\n\tnumber += \"52584907711670556013604839586446706324415722155397\"\r\n\tnumber += \"53697817977846174064955149290862569321978468622482\"\r\n\tnumber += \"83972241375657056057490261407972968652414535100474\"\r\n\tnumber += \"82166370484403199890008895243450658541227588666881\"\r\n\tnumber += \"16427171479924442928230863465674813919123162824586\"\r\n\tnumber += \"17866458359124566529476545682848912883142607690042\"\r\n\tnumber += \"24219022671055626321111109370544217506941658960408\"\r\n\tnumber += \"07198403850962455444362981230987879927244284909188\"\r\n\tnumber += \"84580156166097919133875499200524063689912560717606\"\r\n\tnumber += \"05886116467109405077541002256983155200055935729725\"\r\n\tnumber += \"71636269561882670428252483600823257530420752963450\"\r\n\t\r\n\tanswer = 0\r\n\r\n\t# Run through all possible 13 digit combinations\r\n\t(0..number.length-digits).each do |x|\r\n\t\t# Set localized product to the first digit in combo\r\n\t\tproduct = number[x].to_i\r\n\t\t# Multiply the rest of the digits in combo together\r\n\t\t((x+1)...x+digits).each do |n|\r\n\t\t\tproduct *= number[n].to_i\r\n\t\tend\r\n\t\t# If localized product is highest so far, set to answer\r\n\t\tanswer = product if product > answer\r\n\tend\r\n\tputs answer\r\nend", "def digit_fifth_powers\r\n fifth_power_nums = []\r\n#the highest we need to search, 9**5 * 6 = 354294\r\n (1..354294).each do |x|\r\n sum = 0\r\n x.to_s.split(\"\").each do |x|\r\n sum += x.to_i ** 5\r\n end \r\n fifth_power_nums << x if x == sum unless x == 1\r\n end \r\n return fifth_power_nums.reduce(:+)\r\nend", "def validate_number(number)\n sum = 0\n number.to_s.each_char do |digit|\n sum += digit.to_i ** 5\n end\n if number == sum\n puts number\n return number\n else\n return 0\n end\nend", "def super_digit(n)\n while n >= 10\n n = n % 10 + super_digit(n / 10)\n end\n return n\nend", "def super_digit(n)\n num_array = n.to_s.chars.map(&:to_i)\n sum = num_array.sum\n if sum <9\n return sum\n else \n return super_digit(sum)\n end\n \nend", "def delete_digit(n)\n (s = n.to_s.chars).combination(s.size-1).max.join.to_i\nend", "def super_digit(n)\n if 10 > n\n return n\n end\n\n last_digit = n % 10\n sum = n / 10 + last_digit \n \n return super_digit(sum)\nend", "def max_rotation(num)\n number_string = num.to_s\n\n number_string.size.downto(2) do |i|\n num = rotate_rightmost_digits(num, i)\n end\n num\nend", "def find_max_number_of_digits(string=\"00 000 0\")\n array = string.gsub(/[^\\d]/, '|').split('|')\n max_number_of_digits = Array.new\n array.each {|el| max_number_of_digits.push(el.length) }\n puts max_number_of_digits.max\n end", "def longest_digit_run(digit)\nend", "def max_rotation(number)\n starting_num = number.to_s.length\n starting_num.downto(2) do |digits|\n number = rotate_rightmost_digits(number, digits)\n end\n number\nend", "def featured(int)\n int += 1\n int += 1 until int % 7 == 0 && int.odd?\n \n loop do\n double_check = int.to_s.split(\"\")\n if double_check.uniq == double_check\n return int\n else\n int += 14\n end \n break if int >= 9_876_543_210 \n end\n \"There is no possible number that fulfills those requirements\"\nend", "def super_digit(n)\n while n > 9\n n = n % 10 + super_digit(n / 10)\n end\n return n\nend", "def largest_number(n)\n num = []\n n.times do\n num << 9\n end\n puts num.join('').to_i\nend", "def get_number_from_string(s)\n s.scan(/\\d/).map(&:to_i).join.to_i\nend", "def super_digit(n)\n n < 10 ? n : super_digit(n / 10 + n % 10)\nend", "def nDigits n,a\n return 1000 if a == 10 && n == 1000 # incorrect test\n ((Math.log10(a)*n)+1).to_i\nend", "def euler038\n (9213..9876)\n .map{ |x| x.to_s + (x*2).to_s }\n .select{ |f| f.chars.sort.join == \"123456789\" }\n .map{ |f| f.to_i }\n .max\nend", "def next_bigger_num(num)\r\n digits = num.digits\r\n sorted_digits = digits.sort { |a, b| b <=> a }\r\n if digits.count(digits[0]) == digits.size || digits.size < 2 || sorted_digits == digits.reverse\r\n return -1\r\n end\r\n \r\n permutation = digits.permutation.to_a.map do |sub_arr|\r\n sub_arr.join('').to_i\r\n end\r\n \r\n sorted_permutation = permutation.sort\r\n \r\n sorted_permutation.each do |current_num|\r\n return current_num if current_num > num\r\n end\r\nend", "def featured(integer)\n count = 0\n\n loop do \n break if count >= 9_999_999_999\n count += 7\n if count.odd? && count % 7 == 0 && count.digits.uniq == count.digits && count > integer\n return count\n end\n end\n \"There is no possible number that fulfills those requirements.\"\nend", "def biggest_possible_digit_factorial\n digits = 1\n \n loop do \n digits += 1\n break if digits * factorial(9) < ('9' * digits).to_i\n end\n ('9' * digits).to_i\nend", "def s(n)\n n.to_s.gsub(/\\d/) { |d| d.to_i**2 }.to_i\nend", "def max_valid_same_digits(k,num_digits)\n 10**num_digits/k\nend", "def next_bigger_num(num)\n return -1 if num if num.digits.all? {|digit| digit == num[0]}\n return -1 if num.digits.sort! {|a,b| b <=> a}.join.to_i == num\n \n combinations = num.digits.permutation(num.digits.length).to_a\n \n combinations.map! do |arr|\n arr.join.to_i\n end.sort!\n \n combinations.each.with_index do |number, index|\n return combinations[index + 1] if number == num\n end\n \nend", "def max_rotation(number)\n num_array = number.to_s.split(//)\n rotation = num_array.length\n loop do\n break if rotation == 1\n number = rotate_rightmost_digits(number, rotation)\n rotation -= 1\n end\n number\nend", "def featured(number)\n number += 1\n\n until number % 7 == 0 && number.odd?\n number += 1\n end\n\n loop do\n if number.digits.uniq == number.digits\n return number\n else\n number += 14\n end\n break if number.digits.size > 10\n end\n\n \"Error\"\nend", "def featured(num)\n num += 1\n num += 1 until num.odd? && (num % 7).zero?\n loop do\n return num if num.to_s.chars.size == num.to_s.chars.uniq.size\n num += 14\n break if num > 9_876_543_210\n end\n 'There is no possible number that fulfills those requirements'\nend", "def cat_number(string)\n return string.split('-',5)[1].to_i\n end", "def grab_input_number\n string = ''\n string << @input.slice!(0) while input.length != 0 and ('0'..'9').include?(input[0])\n string.to_i\n end", "def max_rotation(int)\n int_digits = int.to_s.length\n rotation_iterations = int_digits - 1\n rotated_number = int\n rotation_iterations.times { |iteration| rotated_number = rotate_rightmost_digits(rotated_number, int_digits - iteration) }\n rotated_number\nend", "def largest_palindrome(num_of_digits)\r\n\tmax_number_string = \"\"\r\n\tnum_of_digits.times { max_number_string += \"9\"}\r\n\tmax_product = max_number_string.to_i ** 2\t\t# e.g: 999* 999 = 998001\r\n\t\r\n\tsub_string = (max_product.to_s)[0..(max_product.to_s).length/2 - 1]\r\n\tsub_string_number = sub_string.to_i \r\n\t\r\n\tdelta = 1\r\n\tdelta.upto(sub_string_number) { |x|\r\n\t\tpalindrome = ((sub_string_number - x).to_s + (sub_string_number - x).to_s.reverse).to_i\r\n\t\t\r\n\t\tfactor = sub_string_number\r\n\t\tfactor.downto(10**(num_of_digits - 1)) { |div|\r\n\t\t\treturn div, (palindrome/div) if (palindrome % div == 0) and (palindrome/div).to_s.length == num_of_digits\r\n\t\t}\r\n\t}\r\nend", "def featured(int)\n loop do \n int += 1\n if int.odd? && int % 7 == 0\n return int if int.to_s.chars.uniq == int.to_s.chars\n end\n break if int == 9_999_999\n end\n \"There is no possible number that fulfils those requirements\"\nend", "def solution(n)\n # write your code in Ruby 2.2\n max = 0\n count = 0\n\n n.to_s(2).sub(/^0*/, '').each_char do |d|\n if d == '0'\n count += 1\n else\n max = count if max < count\n count = 0\n end\n end\n \n max\nend", "def max_rotation(int)\n rotated = int\n count = int.digits.size\n\n until count < 2\n rotated = rotate_rightmost_digits(rotated, count)\n count -= 1\n end\n rotated\nend", "def checkdigit(number)\n\t\t\tdigits = number.to_s.reverse.scan(/\\d/).map { |x| x.to_i }\n\t\t\tdigits = digits.each_with_index.map { |d, i|\n\t\t\t d *= 2 if i.even?\n\t\t\t d > 9 ? d - 9 : d\n\t\t\t}\n\t\t\tsum = digits.inject(0) { |m, x| m + x }\n\t\t\tmod = 10 - sum % 10\n\t\t\tmod==10 ? 0 : mod\n \tend", "def solution(n)\n max = 0\n tmp = 0\n n.to_s(2).each_char do |s|\n if s == \"0\"\n tmp += 1\n else\n max = [tmp, max].max\n tmp = 0\n end\n end\n max\nend", "def delete_digit_x(n)\n n.digits.reverse.combination(n.digits.size-1).max.join.to_i\nend", "def find_largest_5 string\n max, number_array = 0, string.split(\"\").map(&:to_i)\n (0...number_array.size-4). each do |i|\n product = number_array[i..i+4].inject(:*)\n max = product if(product>max)\n end\n max\nend", "def super_digit(n)\n n_array = n.to_s.split('').map {|i| i.to_i}\n return n if n_array.length == 1\n return super_digit(n_array.sum)\nend", "def super_digit(n)\n new_num = 0\n numbers = n.to_s.split(\"\")\n if numbers.length <= 1\n return n\n end\n numbers.each do |i|\n new_num += i.to_i\n end\n return super_digit(new_num)\nend", "def get_last_num(sn)\n sn = sn[5,5]\n sn = sn.to_i\n return sn\n end", "def super_digit(n)\n sum = 0\n while n >= 10 do\n sum += n % 10\n n /= 10\n end\n sum += n\n return sum < 10 ? sum : super_digit(sum)\nend", "def my_number_parse(num_str)\n output = 0\n\n num_str.split(\"\").reverse.each_with_index do |num, index|\n output = output + num.to_i * (10 ** index)\n end\n\n output\nend", "def max_num_of_digits(string)\n split_string = string.split('')\n digits = split_string.select { |el| el.to_i.to_s == el.to_s }\n return digits.count\nend", "def last_n_digits(num, n)\n # your code goes here\n puts num.digits.first(n)\nend", "def first_3_digits_round_down(num, n)\n num.to_s.chars.map.with_index{ |c, i| n > 2 ? \"0\" : c }.join.to_i\nend", "def super_digit(n)\n return n if n/10 == 0\n \n sum = n % 10\n while n/10 != 0\n n = n/10\n sum += n % 10\n end\n return super_digit(sum)\nend", "def featured(number)\n sum = 7\n loop do \n return \"There is no possible number that fulfills those requirements\" if number >= 9_876_543_210\n if sum <= number\n sum += 7\n elsif sum.even?\n sum += 7\n elsif sum.digits.uniq != sum.digits\n sum += 7\n else\n break\n end\n end\n sum\nend", "def next_bigger(n)\n return -1 if n / 10 == 0 || same_digits?(n) || biggest?(n)\n digits_array = n.to_s.chars.map(&:to_i)\n n_length = digits_array.length\n i = 1\n until i == n_length\n if digits_array[n_length - i] > digits_array[n_length - 1 - i]\n # find next bigger num from the right\n b = digits_array[(n_length - i)..-1].sort.find { |x| x > digits_array[n_length - 1 - i] }\n digits_array.insert(n_length - 1 - i, b)\n # sort everything on the right and delete inserted num\n sorted = digits_array[(n_length - i)..-1].sort!\n sorted.delete_at(sorted.index(b))\n digits_array[(n_length - i)..-1] = sorted\n return digits_array.join.to_i\n end\n i += 1\n end\nend", "def max_rotation(num)\n num.to_s.size.downto(2) do |rotators|\n num = rotate_rightmost_digits(num, rotators)\n end\n num\nend", "def solution(n)\n # write your code in Ruby 2.2\n a = n.to_s(2)\n arr = []\n if a[-1] == '1'\n arr = a.split('1')\n else\n arr = a.split('1')\n arr.pop\n end\n if arr.max.nil?\n 0\n else\n arr.max.length\n end\nend", "def max_num_of_not_digits(string)\n split_string = string.split('')\n not_digits = split_string.select { |el| el.to_i.to_s != el.to_s }\n return not_digits.count\nend", "def reverse(number)\n digits = number.to_s.split(\"\")\n digits.reverse!\n return digits.to_s.to_i\nend" ]
[ "0.7970989", "0.74801236", "0.7467983", "0.7159385", "0.715295", "0.6978879", "0.69550556", "0.6925982", "0.69242203", "0.6923695", "0.68725497", "0.6770586", "0.6758361", "0.6739801", "0.67067766", "0.66976756", "0.66780496", "0.6676357", "0.66540116", "0.664578", "0.6613756", "0.65861094", "0.6583215", "0.65831894", "0.6556866", "0.653514", "0.6534961", "0.65242", "0.6511173", "0.6499227", "0.64959985", "0.64959985", "0.64837384", "0.64768165", "0.64646524", "0.64613664", "0.645751", "0.6445368", "0.6444632", "0.6404662", "0.63919055", "0.6381468", "0.6380339", "0.63785636", "0.6378017", "0.63763654", "0.63689464", "0.6361038", "0.6345461", "0.634139", "0.63375473", "0.63313884", "0.63244665", "0.63240385", "0.63196695", "0.63147724", "0.63140136", "0.6300623", "0.630002", "0.62998694", "0.62784654", "0.6272474", "0.6269386", "0.6264102", "0.6260502", "0.6260102", "0.6256712", "0.6248751", "0.622981", "0.62260723", "0.62227756", "0.62106854", "0.6203131", "0.6200492", "0.6200234", "0.6199818", "0.6187548", "0.6184171", "0.6183226", "0.6182311", "0.61801475", "0.6175227", "0.6173999", "0.61691064", "0.61688656", "0.6168502", "0.6167563", "0.6162299", "0.61610454", "0.61602783", "0.61536455", "0.6141441", "0.6115981", "0.6102352", "0.6093653", "0.608672", "0.607151", "0.6070507", "0.60703", "0.6051633" ]
0.72620165
3
GET /step_commands GET /step_commands.json
def index @step_commands = StepCommand.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n \n @steps = @quest.steps\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def states_to_commands(states, timestep)\n diff_states = objectify_json(states_to_diff_states(refine_states(states), timestep).to_json)\n commands = objectify_json(diff_states_to_commands(diff_states).to_json)\n end", "def create\n @step_command = StepCommand.new(step_command_params)\n\n respond_to do |format|\n if @step_command.save\n format.html { redirect_to @step_command, notice: 'Step command was successfully created.' }\n format.json { render :show, status: :created, location: @step_command }\n else\n format.html { render :new }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_command_params\n params.require(:step_command).permit(:step_id, :command_id)\n end", "def set_step_command\n @step_command = StepCommand.find(params[:id])\n end", "def commands(params = {})\n res = @client.get(\"#{path}/commands\", params)\n\n res.json[\"commands\"].map { |atts| M2X::Client::Command.new(@client, atts) } if res.success?\n end", "def index\n @commands = Command.all\n render :json => @commands\n end", "def index\n @steps = Step.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def cmd_execute(endpoint, commands)\n url = \"http://#{host}:#{port}/#{endpoint.to_s}?#{query_string(commands)}\"\n open(url) do |file|\n JSON.parse(file.read)\n end\n end", "def commands\n COMMANDS\n end", "def commands\n {\n }\n end", "def destroy\n @step_command.destroy\n respond_to do |format|\n format.html { redirect_to step_commands_url, notice: 'Step command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def commands\n {}\n end", "def task_steps_simple\n # this is a read-only display of workflow steps needed or completed\n # D - C - P - B - S\n # maybe it'll contain a id of the related item\n steps = Task.find_all_by_job_id(self).sort { |a, b| (a.order || 1) <=> (b.order || 1) } \n \n #puts steps.class\n end", "def update\n respond_to do |format|\n if @step_command.update(step_command_params)\n format.html { redirect_to @step_command, notice: 'Step command was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_command }\n else\n format.html { render :edit }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def step\n n = gets\n if n == nil\n puts \"\"\n return 0\n end\n n.chomp!\n meth = n.split(' ')[0]\n if n.split(' ').size > 1\n arg = n[n.index(' ')..-1].strip\n else\n arg = nil\n end\n if commands.keys.include?(meth)\n commands[meth].call( arg )\n else\n puts \"Command '#{meth}' not recognized.\"\n end\n end", "def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end", "def steps\n %w[first last]\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def commands; end", "def get_commands\n return nil\n end", "def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end", "def index\n @steps = Step.collated.ordered.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def execute(step)\n end", "def command\n wall = Wall.find_by(path: params[:path])\n cmd = params[:wall][:command]\n ce = CommandExecutor.new(wall: wall, command: cmd)\n\n result = ce.run!\n\n respond_to do |format|\n if result[:success]\n flash[:notice] = 'Command Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 200 }\n else\n flash[:notice] = 'Command Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 406 }\n end\n end\n end", "def index\n @steps = Step.all\n end", "def index\n @steps = Step.all\n end", "def index\n @steps = Step.all\n end", "def index\n @steps = Step.all\n end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.all\n end", "def steps\n @steps ||= []\n end", "def steps\n %w[/14/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/educations\n /12/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /13/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_scores\n /41/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /42/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /15/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/work/characteristics/index\n /29/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_immunization/show\n /ASSESSMENT/disability/characteristics/index\n /ASSESSMENT/mental/characteristics/index\n /35/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/substance_abuse/characteristics/index\n /32/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/domestic/characteristics/index\n /38/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /39/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/clients/medical_pregnancy/show\n /19/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /21/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /22/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /23/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /24/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /25/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /26/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /2/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/employments\n /ASSESSMENT/legal/characteristics/index\n /7/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /assessment_careers/interest_profiler_questions/interest_profiler_question_wizard_initialize\n ]\n\n end", "def commands\n\t\t{ }\n\tend", "def steps\n %w[name time]\n end", "def commands\n\t\tall = {\n\t\t\t\"webcam_list\" => \"List webcams\",\n\t\t\t\"webcam_snap\" => \"Take a snapshot from the specified webcam\",\n\t\t\t\"record_mic\" => \"Record audio from the default microphone for X seconds\"\n\t\t}\n\t\treqs = {\n\t\t\t\"webcam_list\" => [ \"webcam_list\" ],\n\t\t\t\"webcam_snap\" => [ \"webcam_start\", \"webcam_get_frame\", \"webcam_stop\" ],\n\t\t\t\"record_mic\" => [ \"webcam_record_audio\" ],\n\t\t}\n\n\t\tall.delete_if do |cmd, desc|\n\t\t\tdel = false\n\t\t\treqs[cmd].each do |req|\n\t\t\t\tnext if client.commands.include? req\n\t\t\t\tdel = true\n\t\t\t\tbreak\n\t\t\tend\n\n\t\t\tdel\n\t\tend\n\n\t\tall\n\tend", "def steps\n @steps ||= parser.parse\n end", "def available_commands(options)\n commands = %w[/start /checkin /checkout]\n response_to_user(options, commands.to_s)\n end", "def all_steps\n\t#make calls to step here...\nend", "def getsteps\n\t\t@hide_menu = true\n\n puts \"In Steps\"\n recId = params['query'].inspect\n #this is the link to the API\n url = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/\" + recId[1..-2] + \"/analyzedInstructions?stepBreakdown=true\"\n stepss = Unirest.get url,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n allSteps = stepss.body\n\n recSteps = Hash.new\n\n counter = 1\n #this is how the recipe information is formatted\n allSteps.each do |key|\n key.each do |key2,steps|\n if(key2.eql? \"steps\")\n steps.each do |step|\n step.each do |key3, lastStep|\n if(key3.eql? \"step\")\n recSteps[counter] = lastStep\n counter += 1\n #this gives each step a number, for ease of use\n end\n end\n end\n end\n end\n end\n puts recSteps\n\n @recipeData = recSteps\n render template: \"recipes/data3\"\n end", "def commands\n load_commands unless @commands\n @commands\n end", "def steps\n steps_keywords = %w(Given When Then And But)\n nsteps = 0\n @steps = []\n while true\n print \"Add step [Y/n]: \"\n choice = gets\n if choice.downcase.strip != \"n\"\n puts \"Step #{nsteps +1}:\"\n step = gets.capitalize\n init_step_word = step.split(' ').first\n if steps_keywords.include?(init_step_word)\n @steps << step\n nsteps = nsteps ++ 1\n else\n puts \"Error: #{init_step_word} unsupported initial value\"\n puts \"Use only #{steps_keywords} keywords\"\n end\n elsif choice.downcase.strip == \"n\"\n break\n else\n \"please enter a valid choice.\"\n end\n end\n write_feature\n end", "def index\n @steps = @guide.steps\n end", "def index\n\n if params[:task_id] \n task = Task.find(params[:task_id])\n if task != nil\n @steps = task.steps\n else\n @steps = []\n end\n else \n @steps = Step.all\n end\n end", "def index\n @goal_steps = GoalStep.all\n end", "def show\n @step = @script.steps.build\n end", "def new\n \n @step = Step.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def index\n @steps = Step.all\n end", "def commands\n @commands ||= []\n end", "def commands\n {\n # meta commands\n 'dradis_config' => \"Show Dradis API configuration (#{config_file})\",\n 'dradis_help'\t => 'Displays help',\n 'dradis_version' => 'Displays version information',\n\n # API commands\n 'dradis_add_node' => 'Add a new Node to dradis',\n 'dradis_nodes' => 'List all nodes'\n }\n end", "def extract_steps file\n in_cmd_block = false\n cmd = nil\n code = []\n @steps = []\n file.each do |line|\n if line =~ /^end/\n in_cmd_block = false\n command = Command.new\n command.command, command.regex = extract_regex cmd\n command.code = code\n @steps << command\n code = []\n elsif line =~ /^(Given|When|Then|And)/\n in_cmd_block = true\n cmd = line\n else\n code << line if in_cmd_block\n end\n end\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([email protected]?(current))\n current = @walker.move(@goal, current, self)\n end\n current\n end", "def supported_commands\n commands.keys\n end", "def index\n @commands = Command.find(:all)\n display @commands\n end", "def index\n @commands = Command.order(created_at: :desc).page(params[:page])\n end", "def command_line\n command_line = \"\"\n metadata['pipeline']['actions'].each do |action|\n command_line += action['commands'].join(' ') + \"\\n\"\n end\n command_line.chomp(\"\\n\")\n end", "def add_commands\n end", "def commands\n self.class.commands\n end", "def select_command_module_commands\n commands = []\n i=0\n\n # get params\n zombie_session = @params['zombie_session'] || nil\n (print_error \"Zombie session is nil\";return) if zombie_session.nil?\n command_module_id = @params['command_module_id'] || nil\n (print_error \"command_module id is nil\";return) if command_module_id.nil?\n # validate nonce\n nonce = @params['nonce'] || nil\n (print_error \"nonce is nil\";return) if nonce.nil?\n (print_error \"nonce incorrect\";return) if @session.get_nonce != nonce\n \n # get the browser id\n zombie = Z.first(:session => zombie_session)\n (print_error \"Zombie is nil\";return) if zombie.nil?\n zombie_id = zombie.id\n (print_error \"Zombie id is nil\";return) if zombie_id.nil?\n \n C.all(:command_module_id => command_module_id, :hooked_browser_id => zombie_id).each do |command|\n commands.push({\n 'id' => i, \n 'object_id' => command.id, \n 'creationdate' => Time.at(command.creationdate.to_i).strftime(\"%Y-%m-%d %H:%M\").to_s, \n 'label' => command.label\n })\n i+=1\n end\n \n @body = {\n 'success' => 'true', \n 'commands' => commands}.to_json\n \n end", "def commands\n\t\t{\n\t\t\t\"add_user\" => \"Attempt to add a user with all tokens\",\n\t\t\t\"add_localgroup_user\" => \"Attempt to add a user to a local group with all tokens\",\n\t\t\t\"add_group_user\" => \"Attempt to add a user to a global group with all tokens\",\n\t\t\t\"list_tokens\" => \"List tokens available under current user context\",\n\t\t\t\"impersonate_token\" => \"Impersonate specified token\",\n\t\t\t\"snarf_hashes\" => \"Snarf challenge/response hashes for every token\"\n\t\t}\n\tend", "def new\n @step = Step.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def list_commands\n puts UI_ARROW.light_yellow + \" \" + \"'fight', 'f', or 'battle' to view enemies and fight.\"\n puts UI_ARROW.light_yellow + \" \" + \"'armoury' or 'a' to go to the armoury.\"\n puts UI_ARROW.light_yellow + \" \" + \"'stats' to view your current status.\"\n puts UI_ARROW.light_yellow + \" \" + \"'clear' or 'cls' to clear the screen.\"\n puts UI_ARROW.light_yellow + \" \" + \"'quit', 'q', or 'exit' to abandon your journey.\"\nend", "def action_steps(ordered: true)\n steps(ordered: ordered).map do |step|\n matches = step.match(/^((.*?)[.?!])\\s+(.+)/)\n [matches[1], matches[3]]\n end\n end", "def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend", "def run_step(step)\n cmd, opts = step['command'], step['options']\n in_path, out_path = input_path_for(step), output_path_for(step)\n `gm #{cmd} #{opts} #{in_path} #{out_path}`\n save(out_path) \n end", "def steps\n %i[upload setup order]\n end", "def steps\n %w[\n household_member_demographics_step\n household_member_address_step\n household_member_address_search_results_step\n household_member_citizenship_step\n household_member_education_step\n household_member_employments_step\n household_member_assessment_employment_step\n household_member_incomes_step\n household_member_unearned_incomes_step\n household_member_expenses_step\n household_member_resources_step\n household_member_relations_step\n ]\n end", "def commands\r\n @help_commands\r\n end", "def steps\n find_solution\n end", "def commands\n {\n \"power_shell\" => \"Execute a powershell command.\",\n \"power_view\" => \"Download and execute Veil's PowerView Framework\",\n \"power_up\" => \"Download and execute the PowerUp Framework\",\n \"power_katz\" => \"Invoke-Mimikatz into memory using PowerShell\",\n \"power_scan\" => \"Invoke-PortScan from meterpreter using PowerShell\"\n }\n end", "def create\n @step = Step.new(step_params)\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to api_v1_step_url(@step), notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @step = @guide.steps.find(params[:id])\n end", "def describe\n puts \"name: #{self.name}\"\n puts \"commands (#{self.commands.count}):\"\n\n self.commands.asc(:ordering_number).each do |command|\n puts \" ordering_number: #{command.ordering_number}\"\n puts \" job_name: #{command.job_name}\"\n puts \" input_from_command_with_number: #{command.input_from_command_with_number}\"\n puts \" create_media: #{command.create_media}\"\n command.options.each do |option|\n puts \"\\t key: #{option.key}\"\n puts \"\\t value: #{option.value}\"\n puts \"\\t param_key_name: #{option.params_key_name}\"\n end\n end\n nil\n end", "def command; datastore['COMMAND']; end", "def steps\n step_flows.collect(&:current_step)\n end", "def index\n redirect_to wizard_path(steps.first, request.query_parameters)\n end", "def commands\n {\n \"sample\" => \"A sample command added by the sample plugin\",\n \"notifier_start\" => \"Start session watcher\",\n \"notifier_stop\" => \"Stop session watcher\",\n \"notifier_set_user\" => \"Set Dashboard user name\",\n \"notifier_set_pass\" => \"Set Dashboard password\",\n \"notifier_set_dashboard_url\" => \"Set Dashboard base URL\",\n \"notifier_show_config\" => \"Show notifier config\",\n \"notifier_dashboard_login\" => \"Log in to dashboard\",\n \"notifier_dashboard_permissions\" => \"Get dashbaord user permissions\"\n }\n end", "def commands\n abstract!\n end", "def commands\n\t\t{\n\t\t\t\"execute\" => \"Execute a command\",\n\t\t\t\"shell\" => \"Drop into a system command shell\",\n\t\t}\n\tend", "def show\n @step = Step.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def index\n @steps = Step.where shop_id: session[:shopify]\n end", "def index\n @command_items = CommandItem.all\n end", "def command_params\n params[:command]\n end", "def requestCommands\n # Request input in a loop until QUIT is read\n quit = false\n until quit do\n input = @view.captureInput\n # Check if input is QUIT\n quit = input =~ /^#{Command::Q}$/i\n unless quit\n processCommand(input)\n end\n end\n end", "def select_command\n \n # get params\n command_id = @params['command_id'] || nil\n (print_error \"Command id is nil\";return) if command_id.nil?\n command = BeEF::Core::Models::Command.first(:id => command_id.to_i) || nil\n (print_error \"Command is nil\";return) if command.nil?\n\n command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id)\n (print_error \"command_module is nil\";return) if command_module.nil?\n\n if(command_module.path.split('/').first.match(/^Dynamic/))\n dyn_mod_name = command_module.path.split('/').last\n e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new\n else\n command_module_name = command_module.name\n e = BeEF::Core::Command.const_get(command_module_name.capitalize).new(command_module_name)\n end\n \n @body = {\n 'success' => 'true', \n 'command_module_name' => command_module_name,\n 'command_module_id' => command_module.id,\n 'data' => BeEF::Module.get_options(command_module_name),\n 'definition' => JSON.parse(e.to_json)\n }.to_json\n\n end", "def index\n @user_steps = UserStep.all\n end", "def show\n @step_activity = StepActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step_activity }\n end\n end", "def index\n @process_steps = ProcessStep.all\n end", "def get_word_by_step\n @words = Word.where(step: params[:step]).order(created_at: :desc).page params[:page]\n end", "def commands\n @commands.keys.sort\n end", "def pbBeginCommandPhase\n end", "def pbBeginCommandPhase\n end", "def show\n @steps = @tutorial.steps\n @step = @tutorial.steps.build\n end", "def create\n @step = Step.new(params[:step])\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step.phase_template, notice: 'Step was successfully added.' }\n format.json { render json: @step, status: :created, location: @step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @step_type = StepType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step_type }\n end\n end", "def set_commands; end", "def index\n @step_ms = StepM.all\n end", "def commands\n {\n 'help' => 'Help menu',\n 'background' => 'Backgrounds the current shell session',\n 'sessions' => 'Quickly switch to another session',\n 'resource' => 'Run a meta commands script stored in a local file',\n 'shell' => 'Spawn an interactive shell (*NIX Only)',\n 'download' => 'Download files (*NIX Only)',\n 'upload' => 'Upload files (*NIX Only)',\n 'source' => 'Run a shell script on remote machine (*NIX Only)',\n 'irb' => 'Open an interactive Ruby shell on the current session',\n 'pry' => 'Open the Pry debugger on the current session'\n }\n end" ]
[ "0.6461117", "0.6175543", "0.61444855", "0.60349464", "0.6008792", "0.5862901", "0.5835542", "0.57502186", "0.5742752", "0.571677", "0.5697392", "0.5643747", "0.56167805", "0.5600292", "0.5594215", "0.55886674", "0.5573473", "0.55557066", "0.55469584", "0.55469584", "0.55469584", "0.5545635", "0.5527267", "0.5516804", "0.5505378", "0.55023336", "0.55022097", "0.5501578", "0.5501578", "0.5501578", "0.5501578", "0.5495153", "0.5495153", "0.5482537", "0.5477251", "0.54733175", "0.54475087", "0.54307127", "0.5425552", "0.54233557", "0.54104316", "0.53817356", "0.53606904", "0.53506696", "0.5345062", "0.5344185", "0.5343776", "0.53355527", "0.5325185", "0.5319442", "0.53094107", "0.52761465", "0.52523524", "0.5242159", "0.5240921", "0.5226514", "0.5225745", "0.5220869", "0.521156", "0.5207592", "0.5207027", "0.5206552", "0.519982", "0.5195173", "0.51898664", "0.51852834", "0.51736444", "0.51679987", "0.5157249", "0.5151453", "0.51458466", "0.513839", "0.51374215", "0.5136997", "0.513247", "0.5130847", "0.51280946", "0.51249886", "0.51132077", "0.51125526", "0.5108608", "0.5093072", "0.5091971", "0.5080682", "0.5080547", "0.5080412", "0.5079361", "0.5069621", "0.50692683", "0.50665295", "0.5058216", "0.504543", "0.5036903", "0.5036903", "0.503446", "0.50342786", "0.50291777", "0.5019921", "0.5015659", "0.5010938" ]
0.7444896
0
GET /step_commands/1 GET /step_commands/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @step_commands = StepCommand.all\n end", "def index\n \n @steps = @quest.steps\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def create\n @step_command = StepCommand.new(step_command_params)\n\n respond_to do |format|\n if @step_command.save\n format.html { redirect_to @step_command, notice: 'Step command was successfully created.' }\n format.json { render :show, status: :created, location: @step_command }\n else\n format.html { render :new }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_step_command\n @step_command = StepCommand.find(params[:id])\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = Step.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def new\n \n @step = Step.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def index\n @steps = Step.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def command(id)\n res = @client.get(\"#{path}/commands/#{id}\")\n\n M2X::Client::Command.new(@client, res.json) if res.success?\n end", "def step_command_params\n params.require(:step_command).permit(:step_id, :command_id)\n end", "def index\n @commands = Command.all\n render :json => @commands\n end", "def show\n @step2 = Step2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step2 }\n end\n end", "def new\n @step = Step.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def update\n respond_to do |format|\n if @step_command.update(step_command_params)\n format.html { redirect_to @step_command, notice: 'Step command was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_command }\n else\n format.html { render :edit }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @step_command.destroy\n respond_to do |format|\n format.html { redirect_to step_commands_url, notice: 'Step command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def show\n @step = @script.steps.build\n end", "def show\n @step_type = StepType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step_type }\n end\n end", "def show\n @step = Step.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @step = @guide.steps.find(params[:id])\n end", "def new\n @step = Step.new :phase_template_id => params[:phase_template_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def getsteps\n\t\t@hide_menu = true\n\n puts \"In Steps\"\n recId = params['query'].inspect\n #this is the link to the API\n url = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/\" + recId[1..-2] + \"/analyzedInstructions?stepBreakdown=true\"\n stepss = Unirest.get url,\n headers:{\n \"X-Mashape-Key\" => \"UpZLcnOR83mshtXvuIOPFXBkfhn5p1UWi1ejsnsTLWoVXrOppm\",\n \"Accept\" => \"application/json\"\n }\n allSteps = stepss.body\n\n recSteps = Hash.new\n\n counter = 1\n #this is how the recipe information is formatted\n allSteps.each do |key|\n key.each do |key2,steps|\n if(key2.eql? \"steps\")\n steps.each do |step|\n step.each do |key3, lastStep|\n if(key3.eql? \"step\")\n recSteps[counter] = lastStep\n counter += 1\n #this gives each step a number, for ease of use\n end\n end\n end\n end\n end\n end\n puts recSteps\n\n @recipeData = recSteps\n render template: \"recipes/data3\"\n end", "def show\n @step_activity = StepActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step_activity }\n end\n end", "def step\n n = gets\n if n == nil\n puts \"\"\n return 0\n end\n n.chomp!\n meth = n.split(' ')[0]\n if n.split(' ').size > 1\n arg = n[n.index(' ')..-1].strip\n else\n arg = nil\n end\n if commands.keys.include?(meth)\n commands[meth].call( arg )\n else\n puts \"Command '#{meth}' not recognized.\"\n end\n end", "def command\n wall = Wall.find_by(path: params[:path])\n cmd = params[:wall][:command]\n ce = CommandExecutor.new(wall: wall, command: cmd)\n\n result = ce.run!\n\n respond_to do |format|\n if result[:success]\n flash[:notice] = 'Command Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 200 }\n else\n flash[:notice] = 'Command Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 406 }\n end\n end\n end", "def step1\n\n end", "def new\n @step2 = Step2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step2 }\n end\n end", "def create\n @step = Step.new(step_params)\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to api_v1_step_url(@step), notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @steps = Step.all\n end", "def index\n @steps = Step.all\n end", "def index\n @steps = Step.all\n end", "def index\n @steps = Step.all\n end", "def set_step\n begin\n @step = Step.find(params[:id])\n rescue => e\n puts e.message\n render json: { message: \"Id do step não encontrado\" }, status: :not_found\n end\n end", "def show\n @command_item = CommandItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @command_item }\n end\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([email protected]?(current))\n current = @walker.move(@goal, current, self)\n end\n current\n end", "def commands(params = {})\n res = @client.get(\"#{path}/commands\", params)\n\n res.json[\"commands\"].map { |atts| M2X::Client::Command.new(@client, atts) } if res.success?\n end", "def index\n @steps = Step.collated.ordered.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def index\n @commands = Command.all\n end", "def index\n @commands = Command.all\n end", "def new\n @step = Step.new\n @selection = Selection.find(params[:selection_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def show\n @steps_log = StepsLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @steps_log }\n end\n end", "def execute(step)\n end", "def show\n @next_step = NextStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @next_step }\n end\n end", "def steps\n %w[/14/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/educations\n /12/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /13/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_scores\n /41/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /42/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /15/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/work/characteristics/index\n /29/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_immunization/show\n /ASSESSMENT/disability/characteristics/index\n /ASSESSMENT/mental/characteristics/index\n /35/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/substance_abuse/characteristics/index\n /32/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/domestic/characteristics/index\n /38/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /39/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/clients/medical_pregnancy/show\n /19/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /21/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /22/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /23/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /24/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /25/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /26/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /2/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/employments\n /ASSESSMENT/legal/characteristics/index\n /7/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /assessment_careers/interest_profiler_questions/interest_profiler_question_wizard_initialize\n ]\n\n end", "def task_steps_simple\n # this is a read-only display of workflow steps needed or completed\n # D - C - P - B - S\n # maybe it'll contain a id of the related item\n steps = Task.find_all_by_job_id(self).sort { |a, b| (a.order || 1) <=> (b.order || 1) } \n \n #puts steps.class\n end", "def states_to_commands(states, timestep)\n diff_states = objectify_json(states_to_diff_states(refine_states(states), timestep).to_json)\n commands = objectify_json(diff_states_to_commands(diff_states).to_json)\n end", "def show\n @recipe = Recipe.find(params[:id])\n @step = @recipe.steps.build #build a new step, this new one does not have sequence_id YET\n @ingredient = @recipe.ingredients.build #build new ingredient\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "def index\n\n if params[:task_id] \n task = Task.find(params[:task_id])\n if task != nil\n @steps = task.steps\n else\n @steps = []\n end\n else \n @steps = Step.all\n end\n end", "def commands\n {\n }\n end", "def run_step_one\n puts \"Executing Step ONE\"\n end", "def step1\n \n end", "def create\n @step = Step.new(params[:step])\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step.phase_template, notice: 'Step was successfully added.' }\n format.json { render json: @step, status: :created, location: @step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step = Step.new(step_params) \n\n if @step.save\n render :show, status: :created, location: @step\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def index\n @steps = @guide.steps\n end", "def destroy\n @step = Step.find(params[:id])\n @step.status = \"deleted\"\n @step.save!\n\n respond_to do |format|\n format.json { render :json => \"success\" }\n end\n end", "def select_command\n \n # get params\n command_id = @params['command_id'] || nil\n (print_error \"Command id is nil\";return) if command_id.nil?\n command = BeEF::Core::Models::Command.first(:id => command_id.to_i) || nil\n (print_error \"Command is nil\";return) if command.nil?\n\n command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id)\n (print_error \"command_module is nil\";return) if command_module.nil?\n\n if(command_module.path.split('/').first.match(/^Dynamic/))\n dyn_mod_name = command_module.path.split('/').last\n e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new\n else\n command_module_name = command_module.name\n e = BeEF::Core::Command.const_get(command_module_name.capitalize).new(command_module_name)\n end\n \n @body = {\n 'success' => 'true', \n 'command_module_name' => command_module_name,\n 'command_module_id' => command_module.id,\n 'data' => BeEF::Module.get_options(command_module_name),\n 'definition' => JSON.parse(e.to_json)\n }.to_json\n\n end", "def show\n @steps = @tutorial.steps\n @step = @tutorial.steps.build\n end", "def new\n @step_type = StepType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step_type }\n end\n end", "def cmd_execute(endpoint, commands)\n url = \"http://#{host}:#{port}/#{endpoint.to_s}?#{query_string(commands)}\"\n open(url) do |file|\n JSON.parse(file.read)\n end\n end", "def commands\n COMMANDS\n end", "def commands\n {}\n end", "def set_step\n @step = @recipe_item.steps.find(params[:id])\n end", "def destroy\n @step = Step.find(params[:id])\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to quest_steps_url(@quest) }\n format.json { head :ok }\n end\n end", "def show\n @pre_step = PreStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pre_step }\n end\n end", "def show\n \t@step = Step.find(params[:id])\n \t\n \trespond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @step }\n end\n end", "def create\n @step = Step.new(step_params)\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step, notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @mallet_command = MalletCommand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mallet_command }\n end\n end", "def show\n @command_parameter = CommandParameter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @command_parameter }\n end\n end", "def command; datastore['COMMAND']; end", "def index\n @goal_steps = GoalStep.all\n end", "def new\n @step_activity = StepActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step_activity }\n end\n end", "def command\n consume 1, :command\n end", "def index\n @steps = Step.all\n end", "def command_uri\n return \"/api_#{@command_name}.php\"\n end", "def commands; end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_steps_url, notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def commands\n\t\t{ }\n\tend", "def create\n \n @step = @quest.steps.new(params[:step])\n\n \n \n if @step.save\n redirect_to (quest_path(@quest)), notice: 'Step was successfully created.'\n\n else\n render action: \"new\" \n end\n end", "def json_cmd_one(cmd, key, path)\n unless path\n [\"JSON.#{cmd.upcase}\", key]\n else\n [\"JSON.#{cmd.upcase}\", key, path]\n end\n end", "def destroy\n @step = Step.find(params[:id])\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to steps_url }\n format.json { head :no_content }\n end\n end", "def new\n @next_step = NextStep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @next_step }\n end\n end", "def show\n @tc_detail_step = TcDetailStep.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tc_detail_step }\n end\n end", "def show\n respond_to do |format|\n if @command.present?\n format.json { render json: @command }\n else\n msg = { :status => 'error', message: 'Records Not Found'}\n format.json { render json: msg }\n end\n end\n end", "def update\n if @step.update(step_params)\n render :show, status: :ok, location: @step\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def index\n @commands = Command.order(created_at: :desc).page(params[:page])\n end", "def new\n @pre_step = PreStep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pre_step }\n end\n end", "def index\n redirect_to wizard_path(steps.first, request.query_parameters)\n end", "def update\n respond_to do |format|\n if @step.update(step_params)\n format.html { redirect_to api_v1_step_url(@step), notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def set_step\n @step = Step.find(params[:id])\n end", "def index\n @commands = Command.find(:all)\n display @commands\n end", "def create\n @step = Step.new(params[:step])\n @step.test_case_id = params[:test_case_id].to_i\n\n respond_to do |format|\n if @step.save\n @step_activity = StepActivity.new(:activity_type => 'edit', :description => @step.description)\n @step_activity.user = current_user\n @step_activity.step = @step\n @step_activity.save!\n format.json { render :json => @step, :status => :created, :location => @step }\n format.html { redirect_to(project_test_case_path(@step.test_case.project, @step.test_case)) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def steps\n %w[name time]\n end", "def command; end" ]
[ "0.7163539", "0.6556283", "0.62362355", "0.6160644", "0.61228", "0.61228", "0.61228", "0.59111863", "0.58725196", "0.58522624", "0.58506435", "0.58409035", "0.5790016", "0.57700557", "0.57681084", "0.56802523", "0.5677451", "0.56744397", "0.56687266", "0.5645199", "0.5606066", "0.55878866", "0.5584094", "0.5574081", "0.55639404", "0.5563854", "0.5543406", "0.55371517", "0.5512054", "0.5512054", "0.5512054", "0.5512054", "0.55037206", "0.5476032", "0.54565454", "0.54552597", "0.54413164", "0.54357886", "0.54357886", "0.5430234", "0.5430059", "0.54281336", "0.5424146", "0.54216623", "0.5418862", "0.5407524", "0.5403057", "0.54025704", "0.539362", "0.53934246", "0.5392861", "0.5365124", "0.5363269", "0.5361815", "0.5359672", "0.5334393", "0.5323518", "0.5316184", "0.5304645", "0.53043866", "0.5299428", "0.5295202", "0.52857304", "0.5273248", "0.5272022", "0.5257574", "0.52498734", "0.52477837", "0.524731", "0.5243596", "0.5233786", "0.52292365", "0.522798", "0.5226464", "0.5212072", "0.5210702", "0.52089024", "0.5207916", "0.5201851", "0.51918924", "0.5188573", "0.51873237", "0.5182509", "0.5176051", "0.5163961", "0.5156653", "0.51559055", "0.5151462", "0.5146767", "0.5146767", "0.5146767", "0.5146767", "0.5146767", "0.5146767", "0.5146767", "0.5146767", "0.5146767", "0.51409495", "0.5134684", "0.5130941", "0.5130656" ]
0.0
-1
POST /step_commands POST /step_commands.json
def create @step_command = StepCommand.new(step_command_params) respond_to do |format| if @step_command.save format.html { redirect_to @step_command, notice: 'Step command was successfully created.' } format.json { render :show, status: :created, location: @step_command } else format.html { render :new } format.json { render json: @step_command.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step_command_params\n params.require(:step_command).permit(:step_id, :command_id)\n end", "def create\n @step = Step.new(params[:step])\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step.phase_template, notice: 'Step was successfully added.' }\n format.json { render json: @step, status: :created, location: @step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step = Step.new(step_params)\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to api_v1_step_url(@step), notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_step_command\n @step_command = StepCommand.find(params[:id])\n end", "def index\n @step_commands = StepCommand.all\n end", "def create\n \n @step = @quest.steps.new(params[:step])\n\n \n \n if @step.save\n redirect_to (quest_path(@quest)), notice: 'Step was successfully created.'\n\n else\n render action: \"new\" \n end\n end", "def step_params\n params.require(:step).permit(:instruction)\n end", "def create\n @step = Step.new(step_params) \n\n if @step.save\n render :show, status: :created, location: @step\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def create\n @step = Step.new(step_params)\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step, notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n step_attributes = step_params\n fields_attributes = step_attributes.delete(\"fields\")\n\n @step = Step.new(step_attributes)\n @step.fields = Field.createFields(fields_attributes)\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step, notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step = Step.new(params[:step])\n @step.test_case_id = params[:test_case_id].to_i\n\n respond_to do |format|\n if @step.save\n @step_activity = StepActivity.new(:activity_type => 'edit', :description => @step.description)\n @step_activity.user = current_user\n @step_activity.step = @step\n @step_activity.save!\n format.json { render :json => @step, :status => :created, :location => @step }\n format.html { redirect_to(project_test_case_path(@step.test_case.project, @step.test_case)) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def step_params\n params.require(:step).permit(:step_number, :points, :name, :quest_id, :answer, :body)\n end", "def create\n @testcase = Testcase.find(params[:testcase_id])\n @step = @testcase.steps.new(step_params)\n byebug\n if @step.save\n render :show, status: :created\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def create_steps(stage_steps)\n sequence = 1\n stage_steps.map do |stage_step|\n step = Step.new\n step.sequence = sequence\n\n begin\n action_name = stage_step['action']\n plugin = Cyclid.plugins.find(action_name, Cyclid::API::Plugins::Action)\n\n step_action = plugin.new(stage_step)\n raise if step_action.nil?\n rescue StandardError => ex\n # XXX Rescue an internal exception\n halt_with_json_response(404, INVALID_ACTION, ex.message)\n end\n\n # Serialize the object into the Step and store it in the database.\n step.action = Oj.dump(step_action)\n step.save!\n\n sequence += 1\n\n step\n end\n end", "def create\n\n # params[:post][:step4] = \"TESTING4\";\n params[:post][:steps] = \"\"\n \n if params[:post][:step]\n params[:post][:step].each do |k, v|\n if params[:post][:step].length == k.to_i\n params[:post][:steps] << v\n else\n params[:post][:steps] << v + '|'\n end\n end\n params[:post].delete(\"step\")\n end\n\n #return render :text => params[:post]\n @post = current_user.posts.create(params[:post])\n\n if @post.save\n flash[:success] = 'Post was successfully created.'\n redirect_to @post\n else\n render :new\n end\n\n end", "def command_params\n params.require(:command).permit(:name, :json)\n end", "def step_params\n params.require(:step).permit(:post_id, :name)\n end", "def execute(step)\n end", "def create\n @step = @task.steps.build(params[:step])\n\n if @step.save\n redirect_to [@task,@step]\n else\n render :action => \"new\"\n end\n end", "def destroy\n @step_command.destroy\n respond_to do |format|\n format.html { redirect_to step_commands_url, notice: 'Step command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def steps\n steps_keywords = %w(Given When Then And But)\n nsteps = 0\n @steps = []\n while true\n print \"Add step [Y/n]: \"\n choice = gets\n if choice.downcase.strip != \"n\"\n puts \"Step #{nsteps +1}:\"\n step = gets.capitalize\n init_step_word = step.split(' ').first\n if steps_keywords.include?(init_step_word)\n @steps << step\n nsteps = nsteps ++ 1\n else\n puts \"Error: #{init_step_word} unsupported initial value\"\n puts \"Use only #{steps_keywords} keywords\"\n end\n elsif choice.downcase.strip == \"n\"\n break\n else\n \"please enter a valid choice.\"\n end\n end\n write_feature\n end", "def states_to_commands(states, timestep)\n diff_states = objectify_json(states_to_diff_states(refine_states(states), timestep).to_json)\n commands = objectify_json(diff_states_to_commands(diff_states).to_json)\n end", "def create\n @step = Step.new(params[:step])\n @test_case = TestCase.find(params[:test_case_id])\n @step.test_case_id = @test_case.id\n\n if @step.save\n flash[:notice] = \"Successfully created step.\"\n end\n respond_with @step\n end", "def step_params\n params.require(:step).permit(:number, :description, :locator, :skip, :testcase_id, :actionValue)\n end", "def create\n @process_step = ProcessStep.new(process_step_params)\n\n respond_to do |format|\n if @process_step.save\n format.html { redirect_to @process_step, notice: 'Process step was successfully created.' }\n format.json { render :show, status: :created, location: @process_step }\n else\n format.html { render :new }\n format.json { render json: @process_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step_command.update(step_command_params)\n format.html { redirect_to @step_command, notice: 'Step command was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_command }\n else\n format.html { render :edit }\n format.json { render json: @step_command.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_params\n params.require(:step).permit(:title, :position, :board_id)\n end", "def steps\n %i[upload setup order]\n end", "def create\n @step = Step.new(step_params)\n\n respond_to do |format|\n if @step.save\n format.js\n else\n format.html { render :new }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step = Step.new(step_params)\n @step.shop_id = session[:shopify]\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to @step, notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_params\n params.require(:step).permit(:recipe_id, :number, :description, :timer)\n end", "def create\n @user_step = UserStep.new(user_step_params)\n\n respond_to do |format|\n if @user_step.save\n format.html { redirect_to @user_step, notice: 'User step was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_step }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step_m = StepM.new(step_m_params)\n\n respond_to do |format|\n if @step_m.save\n format.html { redirect_to @step_m, notice: 'Step m was successfully created.' }\n format.json { render :show, status: :created, location: @step_m }\n else\n format.html { render :new }\n format.json { render json: @step_m.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @command = current_user.commands.build(command_params)\n\n respond_to do |format|\n if @command.save\n format.html { redirect_to @command, notice: \"Command is queued to run...\" }\n format.json { render :show, status: :created, location: @command }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @selection = Selection.find(params[:selection_id])\n @step = @selection.steps.new(params[:step])\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to selection_step_path(@step.selection, @step), notice: 'Step was successfully created.' }\n format.json { render json: @step, status: :created, location: @step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @command = Command.new(command_params)\n\n if @command.save\n render :show, status: :created, location: @command\n else\n render json: @command.errors, status: :unprocessable_entity\n end\n end", "def create\n @post = Post.find(params[:post_id])\n @step = Step.new(:post=>@post)\n secureEnter @step\n @step = Step.create(step_params)\n @step.content = \"\"\n respond_to do |format|\n if @step.save\n format.html { redirect_to edit_post_path(@post.id), notice: 'Step was successfully created.' }\n format.json { render :show, status: :created, location: @step }\n else\n format.html { render :new }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recipe = Recipe.find(params[:recipe_id])\n @step = @recipe.steps.new(step_params)\n\n if @step.save\n redirect_to @recipe, notice: 'Step was successfully created.'\n else\n render :new\n end\n end", "def create\n \t@step = @tutorial.steps.build(params[:step])\n authorize! :create, @step\n respond_to do |format|\n if @step.save\n format.html { redirect_to(@tutorial, :notice => 'Step was successfully created.') }\n format.xml { render :xml => @tutorial, :status => :created, :location => @tutorial }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @step_type = StepType.new(params[:step_type])\n\n respond_to do |format|\n if @step_type.save\n format.html { redirect_to @step_type, notice: 'Step type was successfully created.' }\n format.json { render json: @step_type, status: :created, location: @step_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @command = Command.new(command_params)\n\n respond_to do |format|\n if @command.save\n format.json { render json: @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end", "def create\n @next_step = NextStep.new(params[:next_step])\n\n respond_to do |format|\n if @next_step.save\n format.html { redirect_to :back, notice: 'Next step was successfully created.' }\n format.json { render json: @next_step, status: :created, location: @next_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @next_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step_scenario = StepScenario.new(step_scenario_params)\n @step_scenario.scenario_id = current_scenario.id\n\n respond_to do |format|\n if @step_scenario.save\n format.html { redirect_to scenario_path(current_scenario), notice: \"Passo do cenário cadastrado com sucesso!\" }\n format.json { render :show, status: :created, location: @step_scenario }\n else\n format.html { render :new }\n format.json { render json: @step_scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_params\n params.require(:step).permit(:name, :step_url, :html, :collection_id, :next_step_id, :only_customer, :is_custom)\n end", "def create\n @project = Project.find(params[:project_id])\n position = Step.joins(:projects).where('projects.id = ?', @project.id).maximum('steps.position')\n position = 1 unless position\n @step = @project.steps.create(params[:step])\n @step.position = position - 1\n respond_to do |format|\n if @step.save\n ProjectMailer.notify_step_created(@step, current_user).deliver\n format.html { redirect_to @step, notice: 'Step was successfully created.' }\n format.json do\n render json: @step, status: :created\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n # ensure that the submitted parent_id actually exists\n if !Step.exists?(params[:step][:parent_id].to_i)\n logger.debug \"Step doesn't exist!\"\n if @project.steps.last\n params[:step][:parent_id] = @project.steps.last.id\n else\n params[:step][:parent_id] = nil\n end\n end\n\n if params[:step][:pin] && params[:step][:pin].empty?\n params[:step][:pin] = nil\n end\n\n @step = @project.steps.build(params[:step])\n authorize! :create, @step \n\n if params[:step][:position]\n @step.position = params[:step][:position]\n else\n @step.position = @numSteps\n end\n \n respond_to do |format|\n if @step.save\n\n # update corresponding collections\n @step.project.collections.each do |collection|\n collection.touch\n end\n \n # create an edit entry\n Edit.create(:user_id => current_user.id, :step_id => @step.id, :project_id => @project.id)\n\n # check whether project is published\n if @project.public? || @project.privacy.blank?\n @project.set_published(current_user.id, @project.id, @step.id)\n end\n\n @project.set_built\n\n # update the project updated_at date\n @project.touch\n\n # update the user last_updated_at date\n current_user.touch\n\n @step.update_attributes(:published_on => @step.created_at)\n\n # create a public activity for any added question\n if @step.question\n Rails.logger.debug(\"created new question\")\n @step.question.create_activity :create, owner: current_user, primary: true\n end\n\n # log the creation of a new step\n @project.delay.log\n\n format.html { \n\n # update all images with new step id\n new_step_images = @project.images.where(\"step_id = -1\")\n new_step_images.each do |image|\n image.update_attributes(:saved => true)\n image.update_attributes(:step_id => @step.id)\n end\n\n # update all videos with new step id\n new_step_videos = @project.videos.where(\"step_id = -1\")\n new_step_videos.each do |video|\n video.update_attributes(:saved=>true)\n video.update_attributes(:step_id=> @step.id)\n end\n\n # push project to village if it doesn't already exist\n if @project.village_id.blank? && current_user.from_village? && @project.public? && !access_token.blank?\n create_village_project\n elsif [email protected]_id.blank? && !access_token.blank?\n update_village_project\n end\n \n redirect_to project_steps_path(@project), :flash=>{:createdStep => @step.id}\n \n }\n \n format.json { render :json => @step }\n else\n Rails.logger.debug(@step.errors.inspect)\n format.html { render :action => \"new\" }\n format.json { render :json => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def step_params\n params.permit(:id, :order, :task_id, \n fields: [:id, :name, :fieldType, :validationRegex, :required, :errorMessage, :order, :value]\n )\n end", "def create\n @step_comment = StepComment.new(step_comment_params)\n\n respond_to do |format|\n if @step_comment.save\n format.html { redirect_to @step_comment, notice: 'Step comment was successfully created.' }\n format.json { render :show, status: :created, location: @step_comment }\n else\n format.html { render :new }\n format.json { render json: @step_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @next_step = NextStep.new(next_step_params)\n\n respond_to do |format|\n if @next_step.save\n format.html { redirect_to @next_step, notice: 'Next step was successfully created.' }\n format.json { render :show, status: :created, location: @next_step }\n else\n format.html { render :new }\n format.json { render json: @next_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_scenario_params\n params.require(:step_scenario).permit(:sequence, :description)\n end", "def command_params\n params.permit(:command_name, :post_id)\n end", "def create\n\n step_definition_attributes = step_definition_params\n field_definitions_attributes = step_definition_attributes.delete(\"field_definitions\")\n\n @step_definition = StepDefinition.new(step_definition_attributes)\n @step_definition.field_definitions = FieldDefinition.createFieldDefinitions(field_definitions_attributes)\n\n respond_to do |format|\n if @step_definition.save\n format.html { redirect_to @step_definition, notice: 'Step definition was successfully created.' }\n format.json { render :show, status: :created, location: @step_definition }\n else\n format.html { render :new }\n format.json { render json: @step_definition.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_commands\n end", "def send_steps(test_case,id)\n testrail_api_client.send_post(\"update_case/#{id}\",test_case_data(test_case))\n end", "def create\n @command_item = CommandItem.new(params[:command_item])\n\n respond_to do |format|\n if @command_item.save\n format.html { redirect_to @command_item, notice: 'Command item was successfully created.' }\n format.json { render json: @command_item, status: :created, location: @command_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step_activity = StepActivity.new(params[:step_activity])\n\n respond_to do |format|\n if @step_activity.save\n format.html { redirect_to @step_activity, notice: 'Step activity was successfully created.' }\n format.json { render json: @step_activity, status: :created, location: @step_activity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @project_step = ProjectStep.new(project_step_params)\n\n respond_to do |format|\n if @project_step.save\n format.html { redirect_to @project_step, notice: 'Project step was successfully created.' }\n format.json { render :show, status: :created, location: @project_step }\n else\n format.html { render :new }\n format.json { render json: @project_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @goal_step = GoalStep.new(goal_step_params)\n\n respond_to do |format|\n if @goal_step.save\n format.html { redirect_to @goal_step, notice: \"Goal step was successfully created.\" }\n format.json { render :show, status: :created, location: @goal_step }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @goal_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @command = Command.new(command_params)\n\n respond_to do |format|\n if @command.save\n format.html { redirect_to @command, notice: 'Command was successfully created.' }\n format.json { render :show, status: :created, location: @command }\n else\n format.html { render :new }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def step\n n = gets\n if n == nil\n puts \"\"\n return 0\n end\n n.chomp!\n meth = n.split(' ')[0]\n if n.split(' ').size > 1\n arg = n[n.index(' ')..-1].strip\n else\n arg = nil\n end\n if commands.keys.include?(meth)\n commands[meth].call( arg )\n else\n puts \"Command '#{meth}' not recognized.\"\n end\n end", "def update\n @post = Post.find(params[:id])\n\n params[:post][:steps] = \"\"\n if params[:post][:step] \n params[:post][:step].each do |k, v|\n if params[:post][:step].length == k.to_i\n params[:post][:steps] << v\n else\n params[:post][:steps] << v + '|'\n end\n end\n end\n params[:post].delete(\"step\")\n\n if @post.update_attributes(params[:post])\n flash[:success] = 'Post was successfully created.'\n redirect_to @post \n else\n render action: \"edit\"\n end\n end", "def create\n @pre_step = PreStep.new(params[:pre_step])\n\n respond_to do |format|\n if @pre_step.save\n format.html { redirect_to @pre_step, notice: 'Pre step was successfully created.' }\n format.json { render json: @pre_step, status: :created, location: @pre_step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pre_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_params\n params.require(:step).permit(:name, :time)\n end", "def new\n \n @step = Step.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @step }\n end\n end", "def create\n @step = Step.new(step_params)\n @step.screenshot = step_params[:screenshot]\n respond_to do |format|\n if @step.save\n if !params.has_key?(:bookmarklet)\n format.html { redirect_to assignment_path(@step.assignment.id)+\"/\"[email protected]_id.to_s+\"/\"[email protected]_s}\n else\n format.html { redirect_to bookmarkletSuccess_url}\n end\n else\n flash[:errors] = @step.errors\n format.html { redirect_to assignment_path(@step.assignment.id)+\"/\"[email protected]_id.to_s }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def step\n @queue << \"step\"\n end", "def create\n @methodstep = Methodstep.new(params[:methodstep])\n\n respond_to do |format|\n if @methodstep.save\n flash[:notice] = 'Methodstep was successfully created.'\n format.html { redirect_to(@methodstep) }\n format.xml { render :xml => @methodstep, :status => :created, :location => @methodstep }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @methodstep.errors, :status => :unprocessable_entity }\n end\n end\n end", "def steps=(new_value)\n @steps = new_value\n end", "def cmd_create argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.create(json, e)\n msg response\n return response\n end", "def steps\n %w[/14/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/educations\n /12/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /13/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_scores\n /41/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /42/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /15/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/work/characteristics/index\n /29/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/client_immunization/show\n /ASSESSMENT/disability/characteristics/index\n /ASSESSMENT/mental/characteristics/index\n /35/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/substance_abuse/characteristics/index\n /32/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/domestic/characteristics/index\n /38/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /39/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/clients/medical_pregnancy/show\n /19/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /21/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /22/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /23/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /24/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /25/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /26/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /2/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /ASSESSMENT/employments\n /ASSESSMENT/legal/characteristics/index\n /7/assessment_edit/session[:CLIENT_ASSESSMENT_ID]/edit_common_assessment\n /assessment_careers/interest_profiler_questions/interest_profiler_question_wizard_initialize\n ]\n\n end", "def run_step(step)\n cmd, opts = step['command'], step['options']\n in_path, out_path = input_path_for(step), output_path_for(step)\n `gm #{cmd} #{opts} #{in_path} #{out_path}`\n save(out_path) \n end", "def step_params\n params.require(:step).permit(\n :milestone_id, :reached_at, :notes\n )\n end", "def create\n @command_item = CommandItem.new(command_item_params)\n\n respond_to do |format|\n if @command_item.save\n format.html { redirect_to @command_item, notice: 'Блок успешно создан!' }\n format.json { render :show, status: :created, location: @command_item }\n else\n format.html { render :new }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def run_command\n cmd = case params[:button_id]\n when \"run-jsdoc\" then \"npm run jsdoc --silent\"\n when \"run-js-unit-tests\" then \"npm run teaspoon --silent\"\n when \"run-js-acceptance-tests\" then \"rails test:system RAILS_ENV=test\"\n when \"run-rails-unit-tests\" then \"rails test RAILS_ENV=test\"\n end\n\n task_id = Tasky.run cmd\n render json: params.merge(task_id: task_id)\n rescue Tasky::CommandError => e\n render json: params.merge(cmd_error: e.inspect)\n end", "def command_params\n params.fetch(:command, {}).permit(:name, :status, :executed_at)\n end", "def create\n @step2 = Step2.new(params[:step2])\n\n respond_to do |format|\n if @step2.save\n format.html { redirect_to @step2, notice: 'Step2 was successfully created.' }\n format.json { render json: @step2, status: :created, location: @step2 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step2.errors, status: :unprocessable_entity }\n end\n end\n end", "def commands\n {\n }\n end", "def step msg\n end", "def testStep(description)\n warn 'testStep method is deprecated, please use stepStart or stepEnd commands instead.'\n executeScript($START_STEP_COMMAND, {:name => description})\n end", "def step_params\n params.require(:step).permit(:recipe_item_id, :comment, cards: [:c_type, :c_id, :c_varient]\n)\n end", "def stepStart(description)\n executeScript($START_STEP_COMMAND, {:name => description})\n end", "def post\n if phase.has_key?('post')\n execute(\"post\", phase['post'])\n end\n end", "def new\n @step = @task.steps.build\n end", "def api_v11_cm_service_commands_start_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_commands_start_post ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/commands/start\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, 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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_commands_start_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def step_params\n params.require(:step).permit(:step_number, :pattern_step, :counter_open, :row_count, :rep_count, :pattern_id)\n end", "def index\n \n @steps = @quest.steps\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @steps }\n end\n end", "def generate_stage\n\t\tcmd = datastore['CMD'] || ''\n\t\tpayload =\n\t\t\t\"\\x6a\\x0b\\x58\\x99\\x52\\x66\\x68\\x2d\\x63\\x89\\xe7\\x68\" +\n\t\t\t\"\\x2f\\x73\\x68\\x00\\x68\\x2f\\x62\\x69\\x6e\\x89\\xe3\\x52\" +\n\t\t\tRex::Arch::X86.call(cmd.length + 1) + cmd + \"\\x00\" +\n\t\t\t\"\\x57\\x53\\x89\\xe1\\xcd\\x80\"\n\tend", "def steps\n %w[name time]\n end", "def goal_step_params\n params.require(:goal_step).permit(:name)\n end", "def create\n @taken_step = TakenStep.new(taken_step_params)\n\n respond_to do |format|\n if @taken_step.save\n format.html { redirect_to @taken_step, notice: 'Steps Taken was successfully created.' }\n format.json { render :show, status: :created, location: @taken_step }\n else\n format.html { render :new }\n format.json { render json: @taken_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @step_six = StepSix.new(step_six_params)\n\n respond_to do |format|\n if @step_six.save\n format.html { redirect_to \"/delivery_flows\", notice: 'Step six was successfully created.' }\n format.json { render :show, status: :created, location: @step_six }\n else\n format.html { render :new }\n format.json { render json: @step_six.errors, status: :unprocessable_entity }\n end\n end\n end", "def command\n wall = Wall.find_by(path: params[:path])\n cmd = params[:wall][:command]\n ce = CommandExecutor.new(wall: wall, command: cmd)\n\n result = ce.run!\n\n respond_to do |format|\n if result[:success]\n flash[:notice] = 'Command Successful'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 200 }\n else\n flash[:notice] = 'Command Failed'\n format.html { redirect_to wall_path wall }\n format.json { render json: result, status: 406 }\n end\n end\n end", "def create\n\n # puts \"---------------------\"\n # puts workflow_params.to_json\n\n # workflow_attributes = workflow_params\n # step_definitions_attributes = workflow_attributes.delete(\"step_definitions\")\n\n # @workflow = Workflow.new(workflow_attributes)\n\n # @workflow.step_definitions = StepDefinition.createStepDefinitions(step_definitions_attributes)\n\n @workflow = Workflow.new(workflow_params)\n respond_to do |format|\n if @workflow.save\n format.html { redirect_to @workflow, notice: 'Workflow was successfully created.' }\n format.json { render :show, status: :created, location: @workflow }\n else\n format.html { render :new }\n format.json { render json: @workflow.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_steps; end", "def test_steps; end", "def roadmap_step_params\n params.require(:roadmap_step).permit(:step)\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 cmd_execute(endpoint, commands)\n url = \"http://#{host}:#{port}/#{endpoint.to_s}?#{query_string(commands)}\"\n open(url) do |file|\n JSON.parse(file.read)\n end\n end", "def create\n @questionnaire = @participant.build_questionnaire(params[:questionnaire])\n @questionnaire.step = 1\n \n respond_to do |format|\n if @questionnaire.save\n format.html { redirect_to new_questionnaire_path }\n # format.json { render json: @questionnaire, status: :created, location: @questionnaire }\n else\n format.html { render \"questionnaires/steps/step0\" }\n # format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n end\n end\n end", "def step_params\n params.require(:step).permit(:location, :lon, :lat, :arrive_on, :stay, :trip_id)\n end" ]
[ "0.67982787", "0.6147115", "0.61442214", "0.61372846", "0.61294156", "0.60697025", "0.60692036", "0.6057771", "0.60301673", "0.59866357", "0.594803", "0.59067166", "0.58722496", "0.58406174", "0.5789548", "0.5762389", "0.5720796", "0.57131755", "0.5712075", "0.5710178", "0.5706", "0.5695519", "0.5676026", "0.5668664", "0.5657986", "0.5626309", "0.55882573", "0.5586843", "0.55539936", "0.5542061", "0.5538534", "0.55309397", "0.5516982", "0.551418", "0.5510152", "0.5510103", "0.55005485", "0.54990506", "0.549551", "0.5479693", "0.5473805", "0.5458293", "0.5443893", "0.5439244", "0.54321206", "0.54245925", "0.54219544", "0.54105526", "0.5404901", "0.54034066", "0.53984016", "0.53907937", "0.538756", "0.5375514", "0.5356161", "0.53550154", "0.53475344", "0.53269196", "0.5325127", "0.5321048", "0.53177464", "0.53014994", "0.52968657", "0.52858347", "0.527027", "0.5266117", "0.5232157", "0.5230769", "0.52275413", "0.5220158", "0.5216749", "0.5212139", "0.5204498", "0.52040666", "0.51987296", "0.5195161", "0.51936865", "0.5183443", "0.518279", "0.5181783", "0.5180982", "0.516859", "0.51666504", "0.5164457", "0.5164179", "0.5161811", "0.51552904", "0.51381993", "0.51344925", "0.5133538", "0.51273036", "0.51262736", "0.51115495", "0.5110498", "0.5110498", "0.51085615", "0.5097224", "0.5085494", "0.5085083", "0.50795084" ]
0.7359506
0
PATCH/PUT /step_commands/1 PATCH/PUT /step_commands/1.json
def update respond_to do |format| if @step_command.update(step_command_params) format.html { redirect_to @step_command, notice: 'Step command was successfully updated.' } format.json { render :show, status: :ok, location: @step_command } else format.html { render :edit } format.json { render json: @step_command.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @step = Step.find(params[:id])\n\n respond_to do |format|\n if @step.update_attributes(params[:step])\n format.html { redirect_to @step, notice: 'Step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step.update(step_params)\n format.html { redirect_to api_v1_step_url(@step), notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step = Step.find(params[:id])\n respond_to do |format|\n if @step.update_attributes(params[:step])\n format.html { redirect_to @step, notice: 'Step was successfully updated.' }\n format.json { render :json => {:message => \"Success\"} }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step.update_attributes(params[:step])\n format.html { redirect_to [@task,@step], notice: 'Step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step = @guide.steps.find(params[:id])\n\n respond_to do |format|\n if @step.update_attributes(params[:step])\n format.html { redirect_to [@guide, @step], notice: 'Step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step = Step.find(params[:id])\n\n respond_to do |format|\n if @step.update_attributes(params[:step])\n @step_activity = StepActivity.new(:activity_type => 'edit', :description => @step.description)\n @step_activity.user = current_user\n @step_activity.step = @step\n @step_activity.save!\n format.html { redirect_to(project_test_case_path(@step.test_case.project, @step.test_case)) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step.update(step_params)\n format.html { redirect_to @step, notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step.update(step_params)\n format.html { redirect_to @step, notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @step.update(step_params)\n render :show, status: :ok\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def update\n @step = Step.find(params[:id])\n\n respond_to do |format|\n if @step.update_attributes(params[:step])\n format.html { redirect_to selection_step_path, notice: 'Step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @step.update(step_params)\n render :show, status: :ok, location: @step\n else\n render json: @step.errors, status: :unprocessable_entity\n end\n end", "def update\n \n @step = Step.find(params[:id])\n\n if @step.update_attributes(params[:step])\n redirect_to (quest_path(@quest)), notice: 'Step was successfully updated.'\n\n else\n render action: \"edit\" \n end\n \n \n \n end", "def update\n\n step_attributes = step_params\n fields_attributes = step_attributes.delete(\"fields\")\n\n Field.updateFields(fields_attributes)\n\n respond_to do |format|\n if @step.update(step_attributes)\n format.html { redirect_to @step, notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n # workflow_attributes = workflow_params\n # step_definitions_attributes = workflow_attributes.delete(\"step_definitions\")\n\n # StepDefinition.updateStepDefinitions(step_definitions_attributes)\n\n respond_to do |format|\n if @workflow.update(workflow_params)\n format.html { redirect_to @workflow, notice: 'Workflow was successfully updated.' }\n format.json { render :show, status: :ok, location: @workflow }\n else\n format.html { render :edit }\n format.json { render json: @workflow.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step.update(step_params)\n format.html { redirect_to assignment_path(@step.assignment.id)+\"/\"[email protected]_id.to_s+\"/\"[email protected]_s}\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pre_step = PreStep.find(params[:id])\n\n respond_to do |format|\n if @pre_step.update_attributes(params[:pre_step])\n format.html { redirect_to @pre_step, notice: 'Pre step was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pre_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @process_step.update(process_step_params)\n format.html { redirect_to @process_step, notice: 'Process step was successfully updated.' }\n format.json { render :show, status: :ok, location: @process_step }\n else\n format.html { render :edit }\n format.json { render json: @process_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step_type = StepType.find(params[:id])\n\n respond_to do |format|\n if @step_type.update_attributes(params[:step_type])\n format.html { redirect_to @step_type, notice: 'Step type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step_activity = StepActivity.find(params[:id])\n\n respond_to do |format|\n if @step_activity.update_attributes(params[:step_activity])\n format.html { redirect_to @step_activity, notice: 'Step activity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step_activity.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @next_step = NextStep.find(params[:id])\n\n respond_to do |format|\n if @next_step.update_attributes(params[:next_step])\n format.html { redirect_to :back, notice: 'Next step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @next_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step2 = Step2.find(params[:id])\n\n respond_to do |format|\n if @step2.update_attributes(params[:step2])\n format.html { redirect_to @step2, notice: 'Step2 was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @step2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step = Step.find(params[:id])\n @test_case = TestCase.find(params[:test_case_id])\n @step.test_case_id = @test_case.id\n\n if @step.update_attributes(params[:step])\n flash[:notice] = 'Step was successfully updated.'\n end\n respond_with @step\n end", "def update\n respond_to do |format|\n if @command.update(command_params)\n format.json { render :json => @command }\n else\n format.json { render json: @command.errors, status: 401 }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_step.update(user_step_params)\n format.html { redirect_to @user_step, notice: 'User step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step_three.update(step_three_params)\n format.html { redirect_to @step_three, notice: 'Step three was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_three }\n else\n format.html { render :edit }\n format.json { render json: @step_three.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step_scenario.update(step_scenario_params)\n format.html { redirect_to scenario_path(current_scenario), notice: \"Passo do cenário atualizado com sucesso!\" }\n format.json { render :show, status: :ok, location: @step_scenario }\n else\n format.html { render :edit }\n format.json { render json: @step_scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step_m.update(step_m_params)\n format.html { redirect_to @step_m, notice: 'Step m was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_m }\n else\n format.html { render :edit }\n format.json { render json: @step_m.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n\n params[:post][:steps] = \"\"\n if params[:post][:step] \n params[:post][:step].each do |k, v|\n if params[:post][:step].length == k.to_i\n params[:post][:steps] << v\n else\n params[:post][:steps] << v + '|'\n end\n end\n end\n params[:post].delete(\"step\")\n\n if @post.update_attributes(params[:post])\n flash[:success] = 'Post was successfully created.'\n redirect_to @post \n else\n render action: \"edit\"\n end\n end", "def update\n respond_to do |format|\n if @stepone.update(stepone_params)\n format.html { redirect_to mainpage_path(@stepone.mainpage), notice: 'Stepone was successfully updated.' }\n format.json { render :show, status: :ok, location: @stepone }\n else\n format.html { render :edit }\n format.json { render json: @stepone.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @active_workflow_step.update(active_workflow_step_params)\n format.html { redirect_to @active_workflow_step, notice: 'Active workflow step was successfully updated.' }\n format.json { render :show, status: :ok, location: @active_workflow_step }\n else\n format.html { render :edit }\n format.json { render json: @active_workflow_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_process(job_id:, step:, status:, msg:)\n HTTParty.get(\"#{@host}/api/process/#{job_id}\", query: {\n process_code: @process_code,\n step: step,\n status: status,\n msg: msg,\n api_key: @api_key\n })\n end", "def update\n respond_to do |format|\n if @step_six.update(step_six_params)\n format.html { redirect_to @step_six, notice: 'Step six was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_six }\n else\n format.html { render :edit }\n format.json { render json: @step_six.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @project_step.update(project_step_params)\n format.html { redirect_to @project_step, notice: 'Project step was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_step }\n else\n format.html { render :edit }\n format.json { render json: @project_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @next_step.update(next_step_params)\n format.html { redirect_to @next_step, notice: 'Next step was successfully updated.' }\n format.json { render :show, status: :ok, location: @next_step }\n else\n format.html { render :edit }\n format.json { render json: @next_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step = Step.find(params[:id])\n @tutorial = @step.tutorial\n authorize! :update, @step\n respond_to do |format|\n if @step.update_attributes(params[:step])\n format.html { redirect_to(@tutorial, :notice => 'Step was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step_comment.update(step_comment_params)\n format.html { redirect_to @step_comment, notice: 'Step comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_comment }\n else\n format.html { render :edit }\n format.json { render json: @step_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @goal_step.update(goal_step_params)\n format.html { redirect_to @goal_step, notice: \"Goal step was successfully updated.\" }\n format.json { render :show, status: :ok, location: @goal_step }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @goal_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @step.update(step_params)\n format.js\n format.html { redirect_to home_path, notice: 'Step was successfully updated.' }\n format.json { render :show, status: :ok, location: @step }\n else\n format.html { render :edit }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step_ingredient = StepIngredient.find(params[:id])\n\n respond_to do |format|\n if @step_ingredient.update_attributes(params[:step_ingredient])\n format.html { redirect_to(@step_ingredient, :notice => 'Step ingredient was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @step_ingredient.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @book_step = BookStep.find(params[:id])\n\n respond_to do |format|\n if @book_step.update_attributes(params[:book_step])\n format.html { redirect_to @book_step, notice: 'Book step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @endpoint_info = args[:endpoint_info] if args.key?(:endpoint_info)\n @steps = args[:steps] if args.key?(:steps)\n end", "def step_command_params\n params.require(:step_command).permit(:step_id, :command_id)\n end", "def update\n @questionnaire = current_questionnaire\n @questionnaire.step += 1\n\n respond_to do |format|\n if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to new_questionnaire_path }\n # format.json { head :no_content }\n else\n format.html { render \"questionnaires/steps/step#{@questionnaire.step - 1}\" }\n # format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_step_command\n @step_command = StepCommand.find(params[:id])\n end", "def update\n respond_to do |format|\n if @taken_step.update(taken_step_params)\n format.html { redirect_to @taken_step, notice: 'Steps taken was successfully updated.' }\n format.json { render :show, status: :ok, location: @taken_step }\n else\n format.html { render :edit }\n format.json { render json: @taken_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @methodstep = Methodstep.find(params[:id])\n\n respond_to do |format|\n if @methodstep.update_attributes(params[:methodstep])\n flash[:notice] = 'Methodstep was successfully updated.'\n format.html { redirect_to(@methodstep) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @methodstep.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @use_case = UseCase.find(params[:id])\n @use_case.data = params[:data].to_json\n\n respond_to do |format|\n if @use_case.update_attributes(params[:use_case])\n\n if params[:subaction]==\"step\"\n format.html { redirect_to requirements_project_use_case_path(@use_case.project, @use_case, :type=>\"step\"), notice: 'Use case was successfully updated.' }\n else\n format.html { redirect_to project_use_case_path(@project, @use_case), notice: 'Use case was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n step_definition_attributes = step_definition_params\n field_definitions_attributes = step_definition_attributes.delete(\"field_definitions\")\n\n FieldDefinition.updateFieldDefinitions(field_definitions_attributes)\n\n respond_to do |format|\n if @step_definition.update(step_definition_attributes)\n format.html { redirect_to @step_definition, notice: 'Step definition was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_definition }\n else\n format.html { render :edit }\n format.json { render json: @step_definition.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @scenario.update(scenario_params)\n \trender json: @scenario\n else\n \trender json: {status: 'ERROR', data: @scenario.errors}\n end\n end", "def update\n if @command.update(command_params)\n render :show, status: :ok, location: @command\n else\n render json: @command.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @command.update(command_params)\n format.html { redirect_to @command, notice: 'Command was successfully updated.' }\n format.json { render :show, status: :ok, location: @command }\n else\n format.html { render :edit }\n format.json { render json: @command.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cooking_step.update(cooking_step_params)\n format.html { redirect_to @cooking_step, notice: 'Cooking step was successfully updated.' }\n format.json { render :show, status: :ok, location: @cooking_step }\n else\n format.html { render :edit }\n format.json { render json: @cooking_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @scenario = Scenario.find(params[:id])\n\n respond_to do |format|\n if @scenario.update_attributes(params[:scenario])\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @work_step.update(work_step_params)\n format.html { redirect_to @work_plan, notice: 'Work step was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_plan }\n else\n format.html { render :edit }\n format.json { render json: @work_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @step = @project.steps.find_by_position(params[:id])\n authorize! :update, @step \n\n # update corresponding collections\n @step.project.collections.each do |collection|\n collection.touch\n end\n \n @step.images.each do |image|\n image.update_attributes(:saved => true)\n end\n\n # remove question if question description is empty\n if params[:step][:question_attributes] && params[:step][:question_attributes][:description].length == 0 && @step.question\n @step.question.destroy\n end\n\n if params[:step][:published_on_date]\n date = params[:step][:published_on_date]\n logger.debug \"date: #{date}\"\n time = params[:step][:published_on_time]\n # retain the same seconds as the original published_on date\n time.insert 5, \":\" + @step.published_on.strftime(\"%S\")\n # logger.debug \"time: #{time}\"\n timeZone = params[:step][:timeZone]\n # logger.debug \"timeZone: #{timeZone}\"\n dateTime = date + \" \" + time + \" \" + timeZone\n # logger.debug \"dateTime: #{dateTime}\"\n dateTime = DateTime.strptime(dateTime, '%m/%d/%Y %I:%M:%S %p %Z')\n # logger.debug \"datetime: #{dateTime}\"\n \n params[:step][:published_on] = dateTime\n params[:step].delete :'published_on_date'\n params[:step].delete :\"published_on_time\"\n params[:step].delete :timeZone\n end\n\n # update the project \n @project.touch\n\n # update the user last updated date\n current_user.touch\n\n # remove any design attributes if they contain an ID that doesn't exist (the file had been removed)\n if params[:step][:design_files_attributes]\n params[:step][:design_files_attributes].values.each do |design_file|\n if DesignFile.exists?(design_file['id']) == false\n design_file.delete :id\n end\n end\n end\n \n respond_to do |format|\n\n if @step.update_attributes(params[:step])\n \n # clear label color if user didn't select color\n if @step.label == false\n @step.update_column(\"label_color\", nil)\n end\n\n # clear edit\n edit = Edit.where(\"user_id = ? AND step_id = ?\", current_user.id, @step.id).first\n edit.update_attributes(:started_editing_at => nil)\n if edit.project_id.blank?\n edit.update_attributes(:project_id => @project.id)\n end\n \n # check whether project is published\n if @project.public? || @project.privacy.blank?\n @project.set_published(current_user.id, @project.id, @step.id)\n end\n\n # check and set built attribute of project\n @project.set_built\n\n # create a public activity for any questions associated with the step if it doesn't already exist\n if @step.question && !PublicActivity::Activity.where(:trackable_type => \"Question\").where(:trackable_id => @step.question.id).exists?\n @step.question.create_activity :create, owner: current_user, primary: true\n end\n\n # create project on the village if the current user is a village user and the project doesn't already exist\n if @project.village_id.blank? && current_user.from_village? && !access_token.blank? && @project.public?\n create_village_project\n elsif [email protected]_id.blank? && !access_token.blank?\n update_village_project\n end\n\n format.html { \n redirect_to project_steps_path(@project), :notice => 'Step was successfully updated.', :flash => {:createdStep => @step.id} \n }\n format.json { head :no_content }\n else\n Rails.logger.info(@step.errors.inspect)\n format.html { render :action => \"edit\" }\n format.json { render :json => @step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @step = params[:step].to_i\n content = FetchContentService.new.(current_student.os, @step)\n current_student.steps << {title: content[:title] }\n current_student.save!\n\n redirect_to edit_students_path\n end", "def update\n @tc_detail_step = TcDetailStep.find(params[:id])\n\n respond_to do |format|\n if @tc_detail_step.update_attributes(params[:tc_detail_step])\n format.html { redirect_to @tc_detail_step, notice: 'Tc detail step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tc_detail_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n end", "def update\n respond_to do |format|\n if @step_seven.update(step_seven_params)\n format.html { redirect_to @step_seven, notice: 'Step seven was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_seven }\n else\n format.html { render :edit }\n format.json { render json: @step_seven.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @steps_log = StepsLog.find(params[:id])\n\n respond_to do |format|\n if @steps_log.update_attributes(params[:steps_log])\n format.html { redirect_to @steps_log, notice: 'Steps log was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @steps_log.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @project_step = ProjectStep.find(params[:id])\n\n respond_to do |format|\n if @project_step.update_attributes(params[:project_step])\n flash[:notice] = 'ProjectStep was successfully updated.'\n format.html { redirect_to(@project_step) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @project_step.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @scenario = Scenario.find(params[:id])\n\n respond_to do |format|\n if @scenario.update_attributes(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @lead_step = LeadStep.find(params[:id])\n\n respond_to do |format|\n if @lead_step.update_attributes(params[:lead_step])\n format.html { redirect_to @lead_step, notice: 'Lead step was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lead_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def destroy\n @step = Step.find(params[:id])\n @step.status = \"deleted\"\n @step.save!\n\n respond_to do |format|\n format.json { render :json => \"success\" }\n end\n end", "def update\n @command_item = CommandItem.find(params[:id])\n\n respond_to do |format|\n if @command_item.update_attributes(params[:command_item])\n format.html { redirect_to @command_item, notice: 'Command item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @command_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n respond_to do |format|\n if @step_four.update(step_four_params)\n format.html { redirect_to @step_four, notice: 'Step four was successfully updated.' }\n format.json { render :show, status: :ok, location: @step_four }\n else\n format.html { render :edit }\n format.json { render json: @step_four.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @stepsix = Stepsix.find(params[:id])\n\n respond_to do |format|\n if @stepsix.update_attributes(params[:stepsix])\n format.html { redirect_to(root_path, :notice => 'Stepsix was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stepsix.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @steplog.update(steplog_params)\n format.html { redirect_to @steplog, notice: 'Steplog was successfully updated.' }\n format.json { render :show, status: :ok, location: @steplog }\n else\n format.html { render :edit }\n format.json { render json: @steplog.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @scenario.update(scenario_params)\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { render :show, status: :ok, location: @scenario }\n else\n format.html { render :edit }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @project_step_m.update(project_step_m_params)\n format.html { redirect_to @project_step_m, notice: 'Project step m was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_step_m }\n else\n format.html { render :edit }\n format.json { render json: @project_step_m.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @option = args[:option] if args.key?(:option)\n @scenario = args[:scenario] if args.key?(:scenario)\n @status = args[:status] if args.key?(:status)\n end", "def cmd_modify argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.modify(json, e)\n msg response\n return response\n end", "def set_step\n begin\n @step = Step.find(params[:id])\n rescue => e\n puts e.message\n render json: { message: \"Id do step não encontrado\" }, status: :not_found\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n @city = City.find(params[:id])\n if @city.update_attributes(:name=>params[:body][:name],:step=>\"1\")\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@city.errors)\n end\n end", "def send_steps(test_case,id)\n testrail_api_client.send_post(\"update_case/#{id}\",test_case_data(test_case))\n end", "def update_resource_automation_parameters\n installed_component = InstalledComponent.find(params[:resource_installed_component_id]) if params[:resource_installed_component_id].present?\n old_installed_component_id = params[:resource_old_installed_component_id] || nil\n\n if params[:resource_step_id].present?\n step = Step.find(params[:resource_step_id])\n else\n # This means step object is a new record\n @request = Request.find(params[:resource_request_id]) if params[:resource_request_id].present?\n if @request.present?\n step = @request.steps.build\n step.component_id = params[:resource_component_id]\n step.installed_component_id = params[:resource_installed_component_id]\n step.script_id = params[:resource_script_id]\n step.script_type = params[:resource_script_type]\n step.owner = params[:resource_step_owner_type].constantize.find_by_id(params[:resource_step_owner_id]) unless params[:resource_step_owner_type].blank?\n end\n end\n script = Script.find(params[:resource_script_id])\n old_installed_component_hash = old_installed_component_id.nil? ? nil : {:old_installed_component_id => old_installed_component_id}\n argument_values = step.present? ? step.script_argument_values_display(old_installed_component_hash) : nil\n if request.xhr?\n arg_hsh = {}\n script.arguments.each do |argument|\n if argument.external_resource.present?\n new_argument_value = argument_values[argument.id][\"value\"] rescue nil\n ss = view_context.script_argument_value_input_display(step, argument, installed_component, new_argument_value, true)\n arg_hsh[argument.id] = ss\n end\n end\n render :json => arg_hsh.to_json\n end\n end", "def patch(path, **args); end", "def update\n @go_slim_sequence = GoSlimSequence.find(params[:id])\n\n respond_to do |format|\n if @go_slim_sequence.update_attributes(params[:go_slim_sequence])\n format.html { redirect_to @go_slim_sequence, notice: 'Go slim sequence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @go_slim_sequence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @additional_links = args[:additional_links] if args.key?(:additional_links)\n @gcloud_commands = args[:gcloud_commands] if args.key?(:gcloud_commands)\n @steps = args[:steps] if args.key?(:steps)\n end", "def change_translation(id, new_value)\n # puts(\"#{id} : #{new_value}\")\n return true unless $REAL\n\n new_value_json = { 'target' => new_value }.to_json\n # NOTE: This popen invocation does NOT go through the shell,\n # so we do not use shell escapes.\n IO.popen(\n [\n 'curl', '-i',\n '-H', \"x-api-key: #{$API_KEY}\",\n '-H', 'content-type: application/json',\n '--request', 'PATCH',\n \"https://translation.io/api/v1/segments/#{id}.json\",\n '--data', new_value_json\n ]\n ) do |io|\n curl_output = io.read\n puts curl_output # Very useful for debugging!\n io.close\n $CHILD_STATUS.success? # Return whether or not we succeeded\n end\nend", "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend", "def update\n respond_to do |format|\n if(@scenario.update_attributes(params[:scenario]))\n flash[:notice] = 'Scenario was successfully updated.' \n format.html { redirect_to edit_project_configuration_scenario_path(@project, @scenario) }\n format.xml { head :ok }\n else\n clear_fields\n format.html { render :action => :edit}\n format.api { render_validation_errors(@scenario) }\n end\n end\n end", "def update\n @startup = Startup.find(params[:id])\n\n respond_to do |format|\n\n if @startup.update_attributes(params[:startup])\n \tif params[:nextstep] == 'next' \n format.html { render action: \"editcapital\" }\n else\n format.html { render action: \"show\" }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @startup.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category_step.update(category_step_params)\n format.html { redirect_to @category_step, notice: 'Category step was successfully updated.' }\n format.json { render :show, status: :ok, location: @category_step }\n else\n format.html { render :edit }\n format.json { render json: @category_step.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @test_run.scenarios.map! do |s|\n s.test_run = @test_run\n s.config_template = @test_run.config\n s\n end\n if @test_run.update(test_run_params)\n redirect_to @test_run, notice: 'Test run was successfully updated.'\n else\n render action: 'edit'\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def change_translation(id, new_value)\n # puts(\"#{id} : #{new_value}\")\n # Add the following line to prevent ACTUAL changing of the translation:\n # return true\n new_value_json = { 'target' => new_value }.to_json\n # Note: This popen invocation does NOT go through the shell,\n # so we do not use shell escapes.\n IO.popen(\n [\n 'curl', '-i',\n '-H', \"x-api-key: #{API_KEY}\",\n '-H', 'content-type: application/json',\n '--request', 'PATCH',\n \"https://translation.io/api/v1/segments/#{id}.json\",\n '--data', new_value_json\n ]\n ) do |io|\n curl_output = io.read\n puts curl_output # Very useful for debugging!\n io.close\n $CHILD_STATUS.success? # Return whether or not we succeeded\n end\nend", "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend", "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend", "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend", "def edit\n redirect_to wizard_path(steps[0])\n end", "def update\n @order_line_item = OrderLineItem.find(params[:id])\n\n if @order_line_item.update(order_line_item_params)\n # set to manually completd\n @order_line_item.status = \"Manually Completed\"\n @order_line_item.save\n render json: @order_line_item\n else\n render json: @order_line_item.errors, status: :unprocessable_entity\n end\n end", "def update\n @stepnine = Stepnine.find(params[:id])\n\n respond_to do |format|\n if @stepnine.update_attributes(params[:stepnine])\n format.html { redirect_to(root_path, :notice => 'Stepnine was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stepnine.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n if @absence_request.update_attributes(params[:absence_request])\n format.html { redirect_to(@absence_request, :notice => 'Absence request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.6554455", "0.6538388", "0.6530585", "0.6492778", "0.6480338", "0.6408168", "0.6397069", "0.6397069", "0.6358154", "0.63412404", "0.6307371", "0.62299204", "0.6205627", "0.61104476", "0.6104414", "0.6048825", "0.6005242", "0.59993017", "0.59847736", "0.5973864", "0.5953699", "0.5945183", "0.5943341", "0.5937677", "0.59326637", "0.5916752", "0.59102654", "0.5895772", "0.58690536", "0.5860903", "0.5853325", "0.5839031", "0.58241135", "0.58135843", "0.573482", "0.5726045", "0.5720319", "0.57155544", "0.5710222", "0.5709882", "0.5694272", "0.5688715", "0.56861305", "0.5652042", "0.56503576", "0.563692", "0.56365025", "0.5624065", "0.55719364", "0.5558459", "0.55486053", "0.55457306", "0.5545262", "0.5541977", "0.5532847", "0.55278206", "0.55092084", "0.5493736", "0.5491334", "0.5484589", "0.5476333", "0.546514", "0.54548484", "0.5452918", "0.54447675", "0.5442033", "0.5432063", "0.54247254", "0.5398567", "0.53967214", "0.5394746", "0.5394746", "0.5394746", "0.5394746", "0.5393574", "0.5389717", "0.53750145", "0.53664494", "0.53541714", "0.53414357", "0.5341265", "0.5322878", "0.5321412", "0.531697", "0.53129256", "0.5311707", "0.5309063", "0.53063554", "0.5304692", "0.530285", "0.53021616", "0.5296527", "0.5294728", "0.5279071", "0.5279071", "0.5279071", "0.5272956", "0.52682054", "0.5263027", "0.52549213" ]
0.69682074
0
DELETE /step_commands/1 DELETE /step_commands/1.json
def destroy @step_command.destroy respond_to do |format| format.html { redirect_to step_commands_url, notice: 'Step command was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @step = Step.find(params[:id])\n @step.status = \"deleted\"\n @step.save!\n\n respond_to do |format|\n format.json { render :json => \"success\" }\n end\n end", "def destroy\n @step = Step.find(params[:id])\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to quest_steps_url(@quest) }\n format.json { head :ok }\n end\n end", "def destroy\n @step = Step.find(params[:id])\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @step = @guide.steps.find(params[:id])\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to guide_steps_path(@guide) }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_definition.destroy\n respond_to do |format|\n format.html { redirect_to step_definitions_url, notice: 'Step definition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to steps_url, notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to steps_url, notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to steps_url, notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to steps_url, notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_steps_url, notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to @task }\n format.json { head :no_content }\n end\n end", "def delete_workflow_step(id)\n @client.raw('delete', \"/crm/steps/#{id}\")\n end", "def destroy \n @step = Step.find(params[:id])\n @step.destroy\n\n respond_to do |format|\n format.html { redirect_to selection_path(params[:selection_id]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_scenario.destroy\n respond_to do |format|\n format.html { redirect_to step_scenarios_url, notice: 'Step scenario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_type = StepType.find(params[:id])\n @step_type.destroy\n\n respond_to do |format|\n format.html { redirect_to step_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @step.destroy\r\n respond_to do |format|\r\n format.html { redirect_to @tutorial, notice: 'Step was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @step2 = Step2.find(params[:id])\n @step2.destroy\n\n respond_to do |format|\n format.html { redirect_to step2s_url }\n format.json { head :ok }\n end\n end", "def destroy\n @step_three.destroy\n respond_to do |format|\n format.html { redirect_to step_threes_url, notice: 'Step three was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_workflow_step(id)\n return @client.raw(\"delete\", \"/crm/steps/#{id}\")\n end", "def destroy\n secureEnter @step\n @step.destroy\n respond_to do |format|\n format.html { redirect_to edit_post_path(@step.post.id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_activity = StepActivity.find(params[:id])\n @step_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to step_activities_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @id = @step.board_id\n @step.destroy\n respond_to do |format|\n format.html { redirect_to board_url(@id), notice: 'Step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_m.destroy\n respond_to do |format|\n format.html { redirect_to step_ms_url, notice: 'Step m was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_six.destroy\n respond_to do |format|\n format.html { redirect_to step_sixes_url, notice: 'Step six was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step.destroy\n end", "def destroy\n @step.destroy\n end", "def destroy\n @next_step = NextStep.find(params[:id])\n @next_step.destroy\n\n respond_to do |format|\n format.html { redirect_to next_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_step.destroy\n respond_to do |format|\n format.html { redirect_to user_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stepone.destroy\n respond_to do |format|\n format.html { redirect_to mainpage_path(@stepone.mainpage), notice: 'Stepone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tc_detail_step = TcDetailStep.find(params[:id])\n @tc_detail_step.destroy\n\n respond_to do |format|\n format.html { redirect_to tc_detail_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pre_step = PreStep.find(params[:id])\n @pre_step.destroy\n\n respond_to do |format|\n format.html { redirect_to pre_steps_url }\n format.json { head :ok }\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 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 @goal_step.destroy\n respond_to do |format|\n format.html { redirect_to goal_steps_url, notice: \"Goal step was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @process_step.destroy\n respond_to do |format|\n format.html { redirect_to process_steps_url, notice: 'Process step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @next_step.destroy\n respond_to do |format|\n format.html { redirect_to next_steps_url, notice: 'Next step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step2 = Proce.find(params[:id])\n @step2.destroy\n\n respond_to do |format|\n format.html { redirect_to(step2s_url) }\n format.xml { head :ok }\n format.json { render :text => '{status: \"success\"}'}\n end\n end", "def destroy\n @lead_step = LeadStep.find(params[:id])\n @lead_step.destroy\n\n respond_to do |format|\n format.html { redirect_to lead_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_four.destroy\n respond_to do |format|\n format.html { redirect_to step_fours_url, notice: 'Step four was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @steps_log = StepsLog.find(params[:id])\n @steps_log.destroy\n\n respond_to do |format|\n format.html { redirect_to steps_logs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @steplog.destroy\n respond_to do |format|\n format.html { redirect_to steplogs_url, notice: 'Steplog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @taken_step.destroy\n respond_to do |format|\n format.html { redirect_to taken_steps_url, notice: 'steps taken was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @scenario = Scenario.find(params[:id])\n @scenario.destroy\n\n respond_to do |format|\n format.html { redirect_to scenarios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @scenario = Scenario.find(params[:id])\n @scenario.destroy\n\n respond_to do |format|\n format.html { redirect_to scenarios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @project_step.destroy\n respond_to do |format|\n format.html { redirect_to project_steps_url, notice: 'Project step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @project_step = ProjectStep.find(params[:id])\n @project_step.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_steps_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @step = Step.find(params[:id])\n @step.destroy\n authorize! :destroy, @step\n respond_to do |format|\n format.html { redirect_to(@tutorial) }\n format.xml { head :ok }\n end\n end", "def destroy\n @step_ingredient = StepIngredient.find(params[:id])\n @step_ingredient.destroy\n\n respond_to do |format|\n format.html { redirect_to(step_ingredients_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @step_seven.destroy\n respond_to do |format|\n format.html { redirect_to step_sevens_url, notice: 'Step seven was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end", "def destroy\n @methodstep = Methodstep.find(params[:id])\n @methodstep.destroy\n\n respond_to do |format|\n format.html { redirect_to(methodsteps_url) }\n format.xml { head :ok }\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 @stepsix = Stepsix.find(params[:id])\n @stepsix.destroy\n\n respond_to do |format|\n format.html { redirect_to(stepsixes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @step = Step.find(params[:id])\n @step.destroy\n flash[:notice] = \"Successfully destroyed step.\"\n\n if(params[:test_case_id])\n @test_case = TestCase.find(params[:test_case_id])\n end\n @step = Step.new\n respond_with @step\n end", "def destroy\n @book_step = BookStep.find(params[:id])\n @book_step.destroy\n\n respond_to do |format|\n format.html { redirect_to book_steps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @command_item = CommandItem.find(params[:id])\n @command_item.destroy\n\n respond_to do |format|\n format.html { redirect_to command_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @step_comment.destroy\n respond_to do |format|\n format.html { redirect_to step_comments_url, notice: 'Step comment was successfully destroyed.' }\n format.json { head :no_content }\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 delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @cooking_step.destroy\n respond_to do |format|\n format.html { redirect_to cooking_steps_url, notice: 'Cooking step was successfully destroyed.' }\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 destroy\n @project_step_m.destroy\n respond_to do |format|\n format.html { redirect_to project_step_ms_url, notice: 'Project step m was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @command.destroy\n respond_to do |format|\n msg = { :status => 'ok', message: 'Deleted Successfully'}\n format.json { render json: msg }\n end\n end", "def delete\n ruta = \"/actions/#{action_id}\"\n client.delete(ruta)\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'La commande a été détruite.' }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @active_workflow_step.destroy\n respond_to do |format|\n format.html { redirect_to active_workflow_steps_url, notice: 'Active workflow step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @stepnine = Stepnine.find(params[:id])\n @stepnine.destroy\n\n respond_to do |format|\n format.html { redirect_to(stepnines_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @command.destroy\n respond_to do |format|\n format.html { redirect_to commands_url, notice: 'Command was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @step = Step.find(params[:id])\n if @step.removable\n step_name = @step.name\n project = @step.projects.first\n @step.destroy\n\n ProjectMailer.notify_step_deleted(step_name, project, current_user).deliver\n respond_to do |format|\n format.html { redirect_to steps_url }\n format.json { render :json => {:message => \"Success\"} }\n end\n else\n respond_to do |format|\n format.html { redirect_to steps_url }\n format.json { render :json => \"Step #{@step.name} is not removable\", :status => :unprocessable_entity}\n end\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 destroy\n @scenario.destroy\n respond_to do |format|\n format.html { redirect_to scenarios_url, notice: 'Scenario was successfully destroyed.' }\n format.json { head :no_content }\n end\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 @scenario.destroy\n respond_to do |format|\n format.html { redirect_to scenarios_url, notice: 'Cenário deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def delete\n request(:delete)\n end", "def destroy\n @daily_step.destroy\n respond_to do |format|\n format.html { redirect_to daily_steps_url, notice: 'Daily step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mallet_command = MalletCommand.find(params[:id])\n @mallet_command.destroy\n\n respond_to do |format|\n format.html { redirect_to mallet_commands_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exercise_execution.destroy\n respond_to do |format|\n format.html { redirect_to exercise_executions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tutorial_quest = Tutorial::Quest.find(params[:id])\n @tutorial_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorial_quests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @category_step.destroy\n respond_to do |format|\n format.html { redirect_to category_steps_url, notice: 'Category step was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @go_slim_sequence = GoSlimSequence.find(params[:id])\n @go_slim_sequence.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slim_sequences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @fourth_scenario.destroy\n respond_to do |format|\n format.html { redirect_to fourth_scenarios_url, notice: 'Fourth scenario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sample_line = SampleLine.find(params[:id])\n @sample_line.destroy\n\n respond_to do |format|\n format.html { redirect_to sample_lines_url }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @second_scenario.destroy\n respond_to do |format|\n format.html { redirect_to second_scenarios_url, notice: 'Second scenario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @command_item.destroy\n respond_to do |format|\n format.html { redirect_to command_items_url, notice: 'Блок успешно удален' }\n format.json { head :no_content }\n end\n end", "def delete\n api(\"Delete\")\n end", "def delete!\n request! :delete\n end", "def delete_story_version(id)\n @client.raw('delete', \"/content/story-versions/#{id}\")\n end", "def delete\n \n end", "def destroy\n @command_parameter = CommandParameter.find(params[:id])\n @command_parameter.destroy\n\n respond_to do |format|\n format.html { redirect_to command_parameters_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @completed_quest = CompletedQuest.find(params[:id])\n @completed_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to completed_quests_url }\n format.json { head :ok }\n end\n end", "def delete\n\n end" ]
[ "0.7437388", "0.7244521", "0.7208565", "0.70813864", "0.6999222", "0.69943357", "0.69943357", "0.69943357", "0.69943357", "0.69869477", "0.6973408", "0.6933595", "0.68245447", "0.6823274", "0.68181705", "0.6816827", "0.6814283", "0.6811396", "0.6802149", "0.67974985", "0.67620426", "0.67441976", "0.6727023", "0.6724242", "0.6705224", "0.6705224", "0.6684872", "0.66680855", "0.66372603", "0.6628717", "0.6623738", "0.6622346", "0.66042256", "0.65805286", "0.6575184", "0.65387344", "0.65212524", "0.6507739", "0.6480353", "0.64745307", "0.64726424", "0.64683086", "0.64570713", "0.64570713", "0.6453814", "0.64496464", "0.644319", "0.6438114", "0.64175355", "0.6411509", "0.64005697", "0.6393713", "0.6391166", "0.6385261", "0.63786477", "0.63653815", "0.63653773", "0.63593876", "0.63408965", "0.6328321", "0.63134193", "0.6309892", "0.6305099", "0.6301231", "0.62838423", "0.62830555", "0.6274298", "0.62709254", "0.6269935", "0.62462896", "0.6244608", "0.6234838", "0.6234838", "0.6234838", "0.6234838", "0.6191731", "0.61845493", "0.61699164", "0.61697435", "0.61442846", "0.6143157", "0.6136503", "0.6124784", "0.61116403", "0.6101346", "0.60991025", "0.6081827", "0.6073348", "0.6062119", "0.6058577", "0.60532665", "0.6039342", "0.6001323", "0.5992665", "0.59666324", "0.59642714", "0.59601516", "0.5959893", "0.5955686", "0.5941543" ]
0.7589281
0
Use callbacks to share common setup or constraints between actions.
def set_step_command @step_command = StepCommand.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 set_actions\n actions :all\n end", "def define_action_helpers?; 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 setup_handler\n end", "def before_actions(*logic)\n self.before_actions = logic\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 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 workflow\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 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 before_action \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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 setup(easy)\n super\n easy.customrequest = @verb\n end", "def save_action; 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 setup(&blk)\n @setup_block = blk\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 callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); 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", "def duas1(action)\n action.call\n action.call\nend", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def call\n setup_context\n super\n end" ]
[ "0.61642385", "0.60448", "0.5945487", "0.5915654", "0.58890367", "0.58330417", "0.5776098", "0.5703048", "0.5703048", "0.5654613", "0.5620029", "0.5423114", "0.540998", "0.540998", "0.540998", "0.5393666", "0.53783023", "0.53568405", "0.53391176", "0.5339061", "0.53310865", "0.5312988", "0.529798", "0.52968603", "0.52962637", "0.52577317", "0.5244704", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5236856", "0.5233461", "0.52322435", "0.5227552", "0.52224743", "0.5217851", "0.521241", "0.52069896", "0.5206555", "0.5176617", "0.51738507", "0.51725876", "0.51660734", "0.51605034", "0.51571786", "0.5152762", "0.5152164", "0.5151477", "0.5145819", "0.51408994", "0.5134412", "0.5114031", "0.5113695", "0.5113695", "0.5108603", "0.5107358", "0.5090405", "0.50889385", "0.50817686", "0.5081617", "0.50658226", "0.50551206", "0.5051746", "0.5049091", "0.5049091", "0.5034681", "0.5024972", "0.5021291", "0.5016024", "0.50134826", "0.50008893", "0.50000244", "0.4999155", "0.49907947", "0.49907947", "0.49853387", "0.49796683", "0.4979596", "0.49778128", "0.49673793", "0.49662578", "0.49587822", "0.4956063", "0.49550167", "0.49523485", "0.4951614", "0.49452996", "0.49442068", "0.49336892", "0.49306205", "0.49264124", "0.49259305", "0.4925823", "0.49229056", "0.4918999", "0.49171805", "0.49167436", "0.4916559", "0.49153692", "0.49148256" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def step_command_params params.require(:step_command).permit(:step_id, :command_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
do not require login for feedback permit "feedback_admin", :except => [:index, :new, :create]
def index new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorized_user\n @feedback = current_user.feedbacks.find_by_hashed_id(params[:id])\n redirect_to feedbacks_path, notice: \"Not authorized to edit this feedback\" if @feedback.nil?\n end", "def ignore_request_unless_permitted\n return if permitted?\n flash_notice(:permission_denied.t)\n redirect_to(action: \"index_article\") and return\n end", "def login_required\n raise Forbidden unless @current_member #ログイン状態でないとForbiddenを発生させる\n end", "def admin_only\n deny_access(\"Necesitas tener privilegios de administrador para entrar.\") unless signed_in_as_admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def check_permission\n permit \"site_admin\",\n { :login_required_message => I18n.t(\"authorization.login_required_msg\"),\n :permission_denied_message => I18n.t(\"authorization.permission_denied_msg\") }\n end", "def permission_required \n render_403 unless admin? || @user == current_user\n end", "def request_feedback\n @plan = Plan.find(params[:id])\n if @plan.present?\n authorize @plan\n @plan_roles = @plan.roles.where(active: true)\n else\n redirect_to(plans_path)\n end\n end", "def admin_only\n return if admin_user?\n\n add_message 'Insufficient permission to view page'\n redirect_to '/'\n end", "def feedback_params\n params.require(:feedback).permit(:comment, :grade)\n end", "def feedback_params\n #params.fetch(:feedback, {})\n params.require(:feedback).permit(:tenant_id, :date, :username, :age_type, :rating, :tenant_id, :favourite_dish, :least_dish, :comment, :reason)\n end", "def authorize_access\n # byebug\n redirect_to root_path, alert: \"Access Denied\" unless can? :modify, Post\n end", "def index\n if session[:user_id]\n @current_user = User.find(session[:user_id])\n if @current_user.is_admin\n @feedbacks = Feedback.all\n else\n @feedbacks = Feedback.where('email=?', @current_user.email)\n end\n else\n flash[:notice] = \"Please login to view your feedback.\"\n redirect_to login_path\n end\n \n end", "def new\n @feedback = Feedback.new\n if current_user.admin?\n flash[:success] = \"Here is your feedback\"\n @feedbacks = Feedback.all\n render 'feedbacks/show_feedback'\n else\n render 'static_pages/feedback'\n end\n end", "def require_login\n\t\tauthorize_request || render_unauthorized(\"Access Denied\")\n\tend", "def require_admin\n unless admin?\n flash[:warning] = \"Sorry, only administrators can do that.\"\n redirect_to Warnings_url\n end\n end", "def admin_only\n unless current_user.admin?\n redirect_to :back, :alert => \"Access denied.\"\n end\n end", "def restrict_access\n unless logged_in?\n flash[:error] = \"You have to login to access this page.\"\n redirect_to login_url\n end\n end", "def admin_cannot_actions\n [:new, :create].freeze\n end", "def permitted?; end", "def params_not_permitted\n logger.warn('exception: params not permitted')\n render plain: \"403 ForbiddEn\", status: 403\n end", "def help\r\n\r\n @user_actions = Access.where(:table_sid => \"dev_feedbacks\", :action_sid => [\"index\", \"list\", \"new\", \"create\", \"show\", \"edit\", \"update\", \"destroy\", \"search\", \"download\", \"feed\", \"help\", \"adv_search\"]).includes([:user_accesses, :profile_accesses]).reject{|a| @current_user.can_run?(a) }\r\n render(:layout => !request.xhr?)\r\n end", "def restrict_to_admin\n unless is_admin\n flash[:danger] = \"You are not an administrator.\"\n redirect_to root_url\n end\n end", "def feedback_params\n params.require(:feedback).permit(:comment)\n end", "def user_feedback_params\n params.require(:user_feedback).permit(:email, :feedback)\n end", "def require_admin\n unless admin?\n flash[:warning] = \"Sorry, only administrators can do that.\"\n redirect_to messages_url\n end\n end", "def feedback_params\n params.require(:feedback).permit(:email, :content, :category)\n end", "def index\n prevent_non_admin\n end", "def feedback_params\n params.require(:feedback).permit(:name, :email, :comment)\n end", "def restrict_access\n head :unauthorized and return false unless current_user\n end", "def feedback_params\n params.require(:feedback).permit(:title, :content, :comment, :responded)\n end", "def restrict_users\n \t\tif user_signed_in?\n \t\t\tif current_user.has_role? :client\n \t\t\t\tif current_user.profile.agreed == nil\n \t\t\t\t\tredirect_to edit_profile_path(current_user.profile)\n \t\t\t\tend\n \t\t\tend\n\n \t\tend\n\n \tend", "def skip_authorization; end", "def require_login\n authorize_request || render_unathorized(\"Access denied\")\n end", "def feedback_params\n params.require(:feedback).permit(:username, :pesan, :user_id)\n end", "def require_login\n not_authorized(\"Please sign up or log in above to access this resource.\") unless current_user\n end", "def show\n skip_authorization\n end", "def feedback_params\n params.require(:feedback).permit(:text, :email)\n end", "def feedback_params\n params.require(:feedback).permit(:message)\n end", "def feedback_params\n params.require(:feedback).permit(:yes, :message)\n end", "def feedback_params\n params.require(:feedback).permit(:title, :email, :category, :body)\n end", "def require_admin\n deny_wrong_user if !admin?\n end", "def admin_required\n current_user.is_admin? || access_denied\n end", "def disallow_teaching_staff_force_submit_assessment_submissions\n cannot :force_submit_assessment_submission, Course::Assessment\n end", "def feedback_params\n params.require(:feedback).permit(:title, :description, :rating, :user_id)\n end", "def new_feedback\n\n end", "def feedback_params\n params.require(:feedback).permit(:content, :course_id)\n end", "def allow_if_admin\n unless is_admin?\n flash[:danger] = \"Administration permissions needed to access to this page\"\n redirect_to new_user_session_path\n end\n end", "def require_admin\n redirect_to(access_denied_path) unless current_user.is_admin_of?(@department)\n end", "def make_admin\n flash[:success] = \"This feature is currently Disabled\"\n redirect_to users_url\n end", "def feedback_params\n params.require(:feedback).permit(:message_link, :user_name, :user_link, :feedback_type, :post_link)\n end", "def authorize_user!\n \n unless can?(:manage, @question)\n flash[:alert] = \"Access denied!\"\n redirect_to root_path\n end\n end", "def appctrl_not_permitted\n render( { :text => 'Action not permitted', :status => 403 } )\n end", "def feedback_params\n params.require(:feedback).permit(:parent_id, :user_id, :email, :kind, :subject, :description, :priority, :status)\n end", "def feedback_params\n params.require(:feedback).permit(:update_id, :user_id, :description)\n end", "def restrictToAdmin! ; redirect to('/login'),303 unless admin? ; end", "def admin_required\n if current_user && current_user.admin\n return\n end\n redirect_to \"/login\", notice: 'Logga in som administratör.'\n end", "def access_feedback\n error_string = ''\n error_string << I18n.t('auth.invalid_access') unless authenticated?\n error_string << I18n.t('auth.invalid_permissions') unless admin?\n error_string\n end", "def feedback_params\n params.require(:feedback).permit(:title, :description)\n end", "def authorize_admin\n redirect_to :login unless current_user.permission.manage_app ||\n current_user.permission.manage_attrs ||\n current_user.permission.manage_achievement_categories ||\n current_user.permission.manage_talent_trees ||\n current_user.permission.manage_talents ||\n current_user.permission.manage_quests ||\n current_user.permission.manage_skills ||\n current_user.permission.manage_achievements ||\n current_user.permission.manage_items ||\n current_user.permission.manage_titles\n end", "def users_only\n deny_access(\"Necesitas crear una cuenta para entrar a esta sección\") unless signed_in?\n end", "def require_admin\n if logged_in? and !current_user\n flash[:danger] = \"Only admin users can perform that action.\"\n redirect_to root_path\n end\n end", "def feedback_params\n params.require(:feedback).permit(:user_id, :title, :content, :image, :status)\n end", "def admin_user\n render_forbidden unless current_user.admin?\n end", "def require_admin\n if logged_in? and !current_user.admin?\n #flash[:danger] = 'Only admin users can perform that action'\n redirect_to root_path\n end\n end", "def forbidden\n\n render_error( :forbidden )\n\n end", "def validate_access\n if @user_logged_in != @answer.user\n render status: :forbidden\n end\n end", "def feedback_params\r\n params.require(:feedback).permit(:rate, :evaluation_id, :feedback_type_id)\r\n end", "def only_authorize_admin!\n authorize!(is?(:admin))\n end", "def forbidden\n head :forbidden\n end", "def permission_required \n render_403 unless admin? || @item.is_editable_by?(current_user)\n end", "def admin_only\n deny_access(\"You must be signed in as an admin to access this page.\") unless signed_in_as_admin?\n end", "def login_required\n not_authorized unless current_user\n end", "def authorize\n if current_user.nil?\n redirect_to login_url, alert: \"Please Log in or Sign Up to comment!\"\n \tend\n end", "def admin_only\n if !Volt.current_user.admin\n redirect_to '/login'\n end\n end", "def reject_admin\n @admin = Admin.find_by(email: params[:admin][:email].downcase)\n if @admin\n if @admin.valid_password?(params[:admin][:password]) && (@admin.active_for_authentication? == false)\n flash[:danger] = \"退会済みです。\"\n redirect_to new_admin_session_path\n end\n else\n flash.now[:notice] = \"必須項目を入力してください。\"\n end\n end", "def must_be_admin!\n access_denied! unless current_admin?\n end", "def feedback_params\n params.require(:feedback).permit(:description)\n end", "def require_login\n end", "def feedback\n end", "def only_admin\n if user_role == 'admin'\n else\n redirect_to clients_path, notice: \"У вас нет прав для просмотра даного раздела, или редактирования информации\"\n end\n end", "def require_admin\n unless env['warden'].user.advisor? || env['warden'].user.resident?\n flash.error = \"You are not authorized to access that page.\"\n redirect '/'\n end\n end", "def admin_required!\n if current_user.blank?\n redirect_to new_user_session_path, :flash => {:notice => \"Please login to access that page.\"}\n elsif !current_user.is_superadmin? && !current_user.is_admin?\n redirect_to root_path, :flash => {:notice => \"You are not authorized user to access that page.\"}\n end\n end", "def permit_user\n if (!current_user.lunches_admin?) \n flash[:alert] = 'You not allowed to see all orders.'\n respond_to do |format| \n format.html {redirect_to(root_url)}\n end\n end\n end", "def require_admin\n unless current_user.admin\n flash[:notice] = \"Need admin account.\"\n redirect_to(\"/login\")\n end\n end", "def require_admin\n unless admin?\n flash[:notice] = \"Sorry, only administrators can do that.\"\n redirect_to :controller => 'typus', :action => 'dashboard'\n end\n end", "def feedback_params\n params.permit(:name)\n end", "def handle_admin_permissions()\n if !session[:debater].is_admin\n redirect_to(:controller => :debater, :action => :login_form, :message => \"must login as admin to make specified request\")\n return false\n end\n return true\n end", "def prevent_multiple_feedback_reviews\n @feedback_review = @review.feedback_reviews.find_by(user_id: @current_api_user)\n if @feedback_review.present?\n invalid_resource!(@feedback_review)\n end\n end", "def require_login\n return head(:forbidden) unless current_user\n end", "def login_not_required\n false\n end", "def permit_unprotected_actions\n # Allow clients to download packages\n can [:download, :icon], Package\n # Allow client computer requests\n can :checkin, Computer\n can [:show_plist, :show_resource], Computer\n # Allow any request to retrieve catalogs\n can :read, Catalog\n # Allow everyone to edit their user record\n can [:read, :update], User, :id => @user.id\n # Allow anyone to login and logout\n can [:create, :destroy], :session\n # Allow anyone to view their dashboard\n can :manage, :dashboard\n end", "def access_denied\n\n end", "def admin_only\n current_client == current_user\n unless current_user.admin? || @client == current_user\n redirect_to clients_path, :alert => \"Access denied.\"\n end\n end", "def admin_only\n false\n end", "def authorize_admin\n return unless !current_admin\n redirect_to root_path, alert: 'Admins only!'\n end", "def create_permitted?\n acting_user.administrator?\n end", "def create_permitted?\n acting_user.administrator?\n end", "def create_permitted?\n acting_user.administrator?\n end" ]
[ "0.67702556", "0.6682841", "0.6556267", "0.6510401", "0.64803153", "0.64803153", "0.64803153", "0.6440691", "0.6427315", "0.6423005", "0.63905466", "0.6361235", "0.634025", "0.63273245", "0.6309206", "0.62967724", "0.6268982", "0.6258446", "0.6243287", "0.6240538", "0.62319297", "0.62313676", "0.6228253", "0.62087536", "0.6202437", "0.61946374", "0.6190781", "0.61886734", "0.6186115", "0.61762947", "0.61725885", "0.61576444", "0.6155716", "0.61550283", "0.615466", "0.61531144", "0.61478996", "0.61441624", "0.6136385", "0.6134088", "0.6122264", "0.61215657", "0.6103183", "0.6088042", "0.6085605", "0.6078004", "0.60648537", "0.60644543", "0.605706", "0.60553885", "0.6041659", "0.60361075", "0.6018128", "0.601711", "0.60162044", "0.60122424", "0.60118634", "0.60066867", "0.5998266", "0.5997356", "0.59933394", "0.5986192", "0.5984014", "0.5973896", "0.5972629", "0.5972375", "0.5970266", "0.5967283", "0.59672195", "0.5965066", "0.59622645", "0.5959229", "0.59579355", "0.59549254", "0.5951266", "0.5941723", "0.59416914", "0.5935334", "0.59347576", "0.59293425", "0.592834", "0.59215415", "0.5921536", "0.59201396", "0.59178245", "0.5892474", "0.5892371", "0.5888499", "0.5882529", "0.58804625", "0.5879738", "0.5879648", "0.58729595", "0.5868021", "0.586293", "0.5860063", "0.58562016", "0.5854046", "0.58531123", "0.58531123", "0.58531123" ]
0.0
-1
Remember that we can access an array element at particular index with the following syntax: array[index_number] !!!
def position_taken?(board,index) if board[index] == " " false elsif board[index] == "" false elsif board[index] == nil false else board[index] == "X" || "O" true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def at(index)\n \t@array[index]\n end", "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend", "def retrieve_element_from_index(array, index_number)\n array[index_number]\nend", "def retrieve_element_from_index(array, index_number)\n return array[index_number]\nend", "def element_at(arr, index)\n arr[index]\nend", "def element_at(arr, index)\n arr[index]\n # or arr.at(index)\nend", "def at(array, i)\n array[i]\nend", "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index] \n end", "def []( index )\r\n @ary.at(index + @offset)\r\n end", "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n return arr[index]\nend", "def element_at(arr, index)\n # return the element of the Array variable `arr` at the position `index`\n # arr.at(index) # or\n # arr[index]\n arr[index]\nend", "def by_index(index)\n @arr[index]\n end", "def [](index); @data[index]; end", "def [](index) # i.e. array style index lookup.\n end", "def [](indx)\n elements[indx]\n end", "def at( index )\r\n @ary.at(index + @offset)\r\n end", "def [](index)\n self.__getitem__ index\n end", "def at(index)\n self[index]\n end", "def [](index)\n raise ArgumentError, \"index must be < #{size}\" if index >= size\n number[index]\n end", "def [] i\n @array[i]\n end", "def [](index); end", "def [](index)\n @index[index]\n end", "def get(index)\n @array_list.get(index)\n end", "def index(array, position)\n array.at(position) if array.respond_to?(:at)\n end", "def [](index)\n # raises IndexOutOfBoundsException if index is out of bounds [0, @length)\n # TODO\n end", "def third_element(array)\n array[2]\nend", "def third_element(array)\n array[2]\nend", "def [](index)\n @val[index]\n end", "def [](idx)\n send(idx)\n end", "def [](index)\n cast get(index)\n end", "def at(idx)\n Ruby.primitive :array_aref\n end", "def [](idx)\n Ruby.primitive :array_aref\n end", "def at(index); end", "def [](index)\n return @elements[index] if index.kind_of? Numeric\n return @element_map[index] if @element_map[index] \n return @element_map[index.to_s] \n end", "def element i=0\n @array[i]\n end", "def [](i); @x[i]; end", "def [] index\r\n @list[index]\r\n end", "def [](i)\n @elements[i]\n end", "def [](index)\n end", "def [](index)\n end", "def [](index)\r\n @internal_list[index]\r\n end", "def [](idx)\n items[idx]\n end", "def get_item(index_num)\r\n @arr.fetch(index_num)\r\n end", "def [](index)\n Array.new([index])\n end", "def [](index)\n all[index]\n end", "def [](index)\n beam[index]\n end", "def [](index)\n get(index)\n end", "def [](index)\n lookup(index.to_sym)\n end", "def [](index)\n entries[index]\n end", "def [](offset = 0)\n array_element(-1 - offset)\n end", "def [](index)\n @values[index]\n end", "def [](index)\n parts[index]\n end", "def [](index)\n @list[index]\n end", "def [](n)\n @data[n]\n end", "def get(index)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index]\n\tend", "def get(index)\n\t\traise OutOfBoundsException if index >= @size\n\t\t@data[index]\n\tend", "def [](index)\n @items[index]\n end", "def [](index)\n @items[index]\n end", "def [](index); @args[index] end", "def update_element_from_index(array, index_number, element)\nreturn array[index_number] = element\n\nend", "def [](key)\n index = self.keys.index(key) unless @array.empty?\n value = @array[index][1] if index\n end", "def [](index)\n return get(index)\n end", "def [](index)\n @values[index]\n end", "def [](index)\n\t\t@sequence[index]\n\tend", "def [](index)\n entries[index]\n end", "def index(element); end", "def []( index )\n @records[index]\n end", "def []( index )\n reg = to_reg()\n reg[index]\n end", "def d\r\n a = [1, 2, 1.0]\r\n a[2]\r\nend", "def index\n @array = [45, 6, 32, 0]\n end", "def [](index)\r\n words[index]\r\n end", "def item(index = self.index)\n @data[index]\n end", "def [](index)\r\n @library[index]\r\n end", "def [](i)\n end", "def [](i)\n end", "def item_at_index(array, indices)\n item = array\n indices.each do |each|\n item = item.slice(each)\n end\n item\n end", "def [](i)\n @elem[i]\n end", "def item; @data[@index]; end", "def third_element(array)\n taylor_swift = [\"Welcome to New York\", \"Blank Space\", \"Style\", \"Out of The Woods\"]\n taylor_swift[2]\nend", "def [](index)\n Base.typecast(CF.CFArrayGetValueAtIndex(self, index))\n end", "def [](index)\n @data_items[index]\n end", "def [](i)\n \t@vector[i] \n end", "def [](point)\n @array[point.first][point.last]\n end", "def [](name)\n @index[name]\n end", "def [](index)\n to_s[index]\n end", "def [](idx)\n\t\t@bar[idx]\n\tend", "def [](index)\n line[index]\n end", "def [](index)\n @rows[index]\n end", "def [](i)\n\t\t\t@elements[i]\n\t\tend", "def [](idx)\n row(:index, idx)\n end", "def [](index)\n return @items[index]\n end", "def [](x)\n @data[x]\n end", "def [](index)\n lines.public_send(:[], index)\n end", "def [](offset = 0)\n return self.array_element(- 1 + offset)\n end", "def element\n @collection[index]\n end", "def [](index)\n # Handle a negative index\n index = size + index if index < 0\n\n # Get or create the dependency\n dep = (@array_deps[index] ||= Dependency.new)\n\n # Track the dependency\n dep.depend\n\n # Return the index\n @array[index]\n end", "def [](*index)\n\n if (index.size != 0)\n @local_index[*index]\n elsif (@local_iterator)\n @local_iterator.get_current\n else\n raise \"No iterator defined! Cannot get element\"\n end\n\n end", "def at(idx)\n Ruby.primitive :array_aref\n idx = Type.coerce_to idx, Fixnum, :to_int\n idx += @total if idx < 0\n\n return nil if idx < 0 or idx >= @total\n\n @tuple.at @start + idx\n end", "def [] num\n array = self.to_a\n if num > array.length\n raise \"Could not find #{num} elements matching #{self}, found #{array.length}\"\n end\n element = array[num]\n element\n end", "def input_to_index(argument)\n index=argument.to_i-1\n\n # arrray=[\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",]\n # array[index]=\"x\"\nend", "def [](index = nil)\n to_alloc[index]\n end" ]
[ "0.8498926", "0.81891465", "0.81891465", "0.81244844", "0.8106756", "0.8051382", "0.7925698", "0.7925468", "0.7889423", "0.78102285", "0.77996475", "0.77171576", "0.7704119", "0.76779974", "0.76263857", "0.74634", "0.7406151", "0.73249674", "0.7315973", "0.72953916", "0.72841275", "0.7269553", "0.72550994", "0.7217724", "0.72156644", "0.7208289", "0.7208289", "0.720414", "0.71946454", "0.71363896", "0.7136171", "0.7129356", "0.710247", "0.7094177", "0.7076426", "0.7040698", "0.70294005", "0.70219123", "0.70026", "0.70026", "0.69983554", "0.69885606", "0.697446", "0.6957307", "0.69293624", "0.6904046", "0.6885848", "0.68808806", "0.68693393", "0.68684745", "0.6860614", "0.6836094", "0.6828649", "0.6813415", "0.6793654", "0.6793654", "0.678906", "0.678906", "0.6788924", "0.67832994", "0.6780424", "0.6780285", "0.6774895", "0.67721504", "0.6737123", "0.6727999", "0.6727395", "0.67244714", "0.6721907", "0.67165333", "0.6714279", "0.67108613", "0.67050916", "0.66964966", "0.66964966", "0.66932845", "0.667923", "0.66661656", "0.66631526", "0.6652588", "0.66420233", "0.6630958", "0.6626986", "0.66212016", "0.6620045", "0.6619356", "0.6612253", "0.6608003", "0.66042", "0.6603353", "0.65948975", "0.6588932", "0.65877086", "0.6565273", "0.656427", "0.6562803", "0.6550138", "0.6525716", "0.6524933", "0.6513201", "0.6493485" ]
0.0
-1
Create a SmartView connection for the specified provider URL.
def initialize(provider_url, logger=nil) @url = provider_url @req = Request.new @preferences = Preferences.new @http = HTTPClient.new @http.proxy = nil unless logger require 'logger' logger = Logger.new(STDOUT) end @logger = logger end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(driver_url, config)\n super(driver_url, config)\n\n uri = URI(driver_url)\n @connect_options = {\n provider: 'vsphere',\n host: uri.host,\n port: uri.port,\n use_ssl: uri.use_ssl,\n insecure: uri.insecure,\n path: uri.path\n }\n\n if driver_options\n @connect_options[:user] = driver_options[:user]\n @connect_options[:password] = driver_options[:password]\n end\n end", "def connectURL\n\t\t\"http://beta.stoffiplayer.com/auth/#{provider}\"\n\tend", "def connect(url, opts = {})\n # Backwards compatible with old connect(options)\n if url.is_a? Hash and opts.empty?\n opts = url\n url = nil\n end\n conn = self.connection(opts[:handler])\n conn.container = self.container_id || generate_uuid\n connector = Connector.new(conn, url, opts)\n return conn\n end", "def new\n begin\n provider = OauthRemoteServiceProvider.find(params[:oauth_remote_service_provider_id])\n consumer = OAuth::Consumer.new(provider.consumer_key, \n provider.consumer_secret,\n {:site => provider.site_url})\n # contact the remote service, for request token, returns request token object\n request_token = consumer.get_request_token\n # this means one pending oauth request peruser, might want to replace with db table\n session[:pending_oauth_access_request] = {:provider_id => params[:oauth_remote_service_provider_id], \n :request_token => request_token }\n # redirect to providers site for user authentication\n respond_to do |format|\n format.html { redirect_to(request_token.authorize_url) }\n format.xml { redirect_to(request_token.authorize_url) }\n end\n rescue ActiveRecord::RecordNotFound # raised if cannot find remote provider\n redirect_to_error\n rescue Net::HTTPServerException => e # consumer not setup properlly, key or secret are faulty\n redirect_to_error\n rescue Errno::ETIMEDOUT => e # network failure with provider, possibly due to bad url\n redirect_to_error\n end\n end", "def connect\n configuration = VSphereAutomation::Configuration.new.tap do |c|\n c.host = config[:vcenter_host]\n c.username = config[:vcenter_username]\n c.password = config[:vcenter_password]\n c.scheme = \"https\"\n c.verify_ssl = config[:vcenter_disable_ssl_verify] ? false : true\n c.verify_ssl_host = config[:vcenter_disable_ssl_verify] ? false : true\n end\n\n @api_client = VSphereAutomation::ApiClient.new(configuration)\n api_client.default_headers[\"Authorization\"] = configuration.basic_auth_token\n\n session_api = VSphereAutomation::CIS::SessionApi.new(api_client)\n session_id = session_api.create(\"\").value\n\n api_client.default_headers[\"vmware-api-session-id\"] = session_id\n end", "def connect(url)\n begin\n content = open(url)\n rescue\n raise UnableToConnect\n end\n end", "def connect( url, session = nil, token = nil )\n #\n # Sync up the session authentication tokens with the ones in the\n # class variables.\n #\n # This will allow users to still connect to instances even if they\n # shutdown the WebUI or remove their cookies.\n #\n @@tokens ||= {}\n session['tokens'] ||= {} if session\n @@tokens[url] = token if token\n\n session['tokens'].merge!( @@tokens ) if session\n @@tokens.merge!( session['tokens'] ) if session\n session['tokens'].merge!( @@tokens ) if session\n\n tmp_token = session ? session['tokens'][url] : @@tokens[url]\n\n Arachni::RPC::Client::Instance.new( @opts, url, tmp_token )\n end", "def connect(overwrite_from_fields = false)\n msg = \"Connecting to #{provider}\"\n Maestro.log.info msg\n write_output \"#{msg}...\"\n\n opts = connect_options\n # used for deprovision, get the fields set by the provision task\n # the field names could have been overwritten by other tasks\n if overwrite_from_fields\n opts.each do |k,v|\n field_value = get_field(k.to_s)\n opts[k] = field_value if field_value\n end\n end\n opts.each { |k,v| set_field(k.to_s, v) }\n\n start = Time.now\n connection = Fog::Compute.new(opts.merge(:provider => provider))\n\n Maestro.log.debug \"Connected to #{provider} (#{Time.now - start}s)\"\n write_output(\"done (#{Time.now - start}s)\\n\")\n return connection\n rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT => e\n raise PluginError, \"Unable to connect to #{provider}: #{e}\"\n end", "def connection\n open(url)\n end", "def connect(options = {})\n conn = self.connection(options[:handler])\n conn.container = self.container_id || generate_uuid\n connector = Connector.new(conn)\n conn.overrides = connector\n if !options[:url].nil?\n connector.address = URLs.new([options[:url]])\n elsif !options[:urls].nil?\n connector.address = URLs.new(options[:urls])\n elsif !options[:address].nil?\n connector.address = URLs.new([Qpid::Proton::URL.new(options[:address])])\n else\n raise ::ArgumentError.new(\"either :url or :urls or :address required\")\n end\n\n connector.heartbeat = options[:heartbeat] if !options[:heartbeat].nil?\n if !options[:reconnect].nil?\n connector.reconnect = options[:reconnect]\n else\n connector.reconnect = Backoff.new()\n end\n\n connector.ssl_domain = SessionPerConnection.new # TODO seems this should be configurable\n\n conn.open\n\n return conn\n end", "def connect_to(url)\n raise \"Already been init\" if @has_been_init\n url = URI(url)\n raise ArgumentError.new \":url must be a valid websocket secure url!\" unless url.scheme == \"wss\"\n\n @socket = OpenSSL::SSL::SSLSocket.new(TCPSocket.new url.host, 443)\n socket.connect # costly and blocking !\n\n internalWrapper = (Struct.new :url, :socket do\n def write(*args)\n self.socket.write(*args)\n end\n end).new url.to_s, socket\n\n # this, also, is costly and blocking\n @driver = WebSocket::Driver.client internalWrapper\n driver.on :open do\n @connected = true\n unless callbacks[:open].nil?\n callbacks[:open].call\n end\n end\n\n driver.on :error do |event|\n @connected = false\n unless callbacks[:error].nil?\n callbacks[:error].call event\n end\n end\n\n driver.on :message do |event|\n data = MultiJson.load event.data\n unless callbacks[:message].nil?\n callbacks[:message].call data\n end\n end\n\n driver.start\n @has_been_init = true\n end", "def connect(uri, options = T.unsafe(nil)); end", "def new\n @provider = Provider.new\n end", "def build_connection(url)\n\n if config[:proxy]\n proxy = URI.parse(config[:proxy])\n http = Net::HTTP::Proxy(proxy.host, proxy.port).new(url.host, url.port)\n else\n http = Net::HTTP.new(url.host, url.port)\n end\n\n http.set_debug_output($stderr) if config[:debug]\n\n if url.scheme == \"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n if config[:certificate_path]\n cert = File.read(config[:certificate_path])\n http.key = OpenSSL::PKey::RSA.new(cert)\n http.cert = OpenSSL::X509::Certificate.new(cert)\n end\n\n http\n end", "def connect_to_server\n @service.connect(connect_settings)\n end", "def connect\n connector = StripeConnect.new( current_user )\n connect_url, error = connector.connect_url( redirect_uri: confirm_users_url )\n\n if connect_url.nil?\n flash[:error] = error\n redirect_to user_path( current_user )\n else\n redirect_to connect_url\n end\n end", "def initialize url, auth_scheme = nil\n super url, auth_scheme\n @client = Sfcc::Cim::Client.connect( { :uri => url, :verify => false } )\n @product = _identify\n end", "def url(size = 'large')\n send(\"#{provider}\", size)\n end", "def create_simple_provider_source\n create_source(PROVIDER_TEMPLATE, provider_path)\n end", "def connect(uri)\n uri = URI.parse uri\n Net::HTTP.new uri.host, uri.port\n end", "def connect\n @connection.create\n end", "def create_sesame_con\n @os_conn = EventMachine::HttpRequest.new($open_sesame_url)\n end", "def connect url, user = nil, pass = nil\n # WARNING do not use rewritten urls never ever...\n # url should be the base url so url/index.php url/api.php should be there\n @wiki_url = \"http://#{url}/api.php\"\n @client = Viziwiki::Mediawiki::API.new @wiki_url\n @client.log_in user, pass if @client and user and pass\n end", "def connect_to_instance( *args )\n url = token = nil\n\n if args.size == 2\n url, token = *args\n elsif args.first.is_a? Hash\n options = args.first\n url = options['url'] || options[:url]\n token = options['token'] || options[:token]\n end\n\n @instance_connections ||= {}\n @instance_connections[url] ||= Client::Instance.new( opts, url, token )\n end", "def new\n @oauth_remote_service_provider = OauthRemoteServiceProvider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oauth_remote_service_provider }\n end\n end", "def create_connection\n self.setup\n RfmAdaptor::Connection.new(self.server_name)\n end", "def create_uri url\n uri = URI.parse url\n uri.user = @login\n uri.password = @password\n uri\n end", "def connect\n # Configure the connection to vCenter\n lookup_service_helper = LookupServiceHelper.new(lookup_service_host)\n vapi_urls = lookup_service_helper.find_vapi_urls\n debug(\"Found vAPI endpoints: [\" + vapi_urls.to_s + \"]\")\n\n vim_urls = lookup_service_helper.find_vim_urls\n debug(\"Found VIM endpoints: [\" + vim_urls.to_s + \"]\")\n\n node_id = vim_urls.select { |id, url| url.include? vcenter_host }.keys.first\n debug(\"NodeID of vCenter \" + config[:vcenter_host] + \" is \" + node_id.to_s)\n\n vapi_url = lookup_service_helper.find_vapi_url(node_id)\n debug(\"vAPI Endpoint for vCenter is \" + vapi_url)\n\n # Create the VAPI config object\n ssl_options = {}\n ssl_options[:verify] = config[:vcenter_disable_ssl_verify] ? :none : :peer\n @vapi_config = VAPI::Bindings::VapiConfig.new(vapi_url, ssl_options)\n\n # get the SSO url\n sso_url = lookup_service_helper.find_sso_url\n sso = SSO::Connection.new(sso_url).login(config[:vcenter_username], config[:vcenter_password])\n token = sso.request_bearer_token\n vapi_config.set_security_context(\n VAPI::Security.create_saml_bearer_security_context(token.to_s)\n )\n\n # Login and get the session information\n @session_svc = Com::Vmware::Cis::Session.new(vapi_config)\n @session_id = session_svc.create\n vapi_config.set_security_context(\n VAPI::Security.create_session_security_context(session_id)\n )\n end", "def initialize\n engine_uri = URI(ENV.fetch 'ENGINE_URL')\n @conn = Rserve::Simpler.new hostname: engine_uri.host\n end", "def create\n @url_connector = UrlConnector.new(params[:url_connector])\n\n respond_to do |format|\n if @url_connector.save\n format.html { redirect_to @url_connector, notice: 'Url connector was successfully created.' }\n format.json { render json: @url_connector, status: :created, location: @url_connector }\n else\n format.html { render action: \"new\" }\n format.json { render json: @url_connector.errors, status: :unprocessable_entity }\n end\n end\n end", "def connect_with_sst(token, options={})\n create_authenticated_connection(options.merge({:cookies => {'GDCAuthSST' => token}}))\n end", "def initialize url, callback_port = nil\n @target_url, @initial_path = (Connection.split_url url)\n #Gom::Remote.connection and (raise \"connection already open\")\n Gom::Remote.connection = self\n\n @subscriptions = []\n @callback_server = init_callback_server callback_port\n end", "def make_connection(url, adapter_args = nil, opts = {})\n adapter_args ||= [Faraday.default_adapter]\n options = { :headers => { :user_agent => USER_AGENT } }.merge(opts)\n\n if token = PuppetForge::Connection.authorization\n options[:headers][:authorization] = token =~ AUTHORIZATION_TOKEN_REGEX ? \"Bearer #{token}\" : token\n end\n\n if lang = PuppetForge::Connection.accept_language\n options[:headers]['Accept-Language'] = lang\n end\n\n if proxy = PuppetForge::Connection.proxy\n options[:proxy] = proxy\n end\n\n Faraday.new(url, options) do |builder|\n builder.use Faraday::FollowRedirects::Middleware\n builder.response(:json, :content_type => /\\bjson$/, :parser_options => { :symbolize_names => true })\n builder.response(:raise_error)\n builder.use(:connection_failure)\n\n builder.adapter(*adapter_args)\n end\n end", "def connect \\\n config,\n blurb,\n options: nil,\n &block\n request = {\n config: config,\n blurb: blurb\n }.delete_if { |_, v| v.nil? }\n request = Google::Gax.to_proto request, Google::Showcase::V1alpha3::ConnectRequest\n @connect.call(request, options, &block)\n end", "def new\n @url = Url.new\n end", "def create_http_connection(uri); end", "def new\n @url_connector = UrlConnector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url_connector }\n end\n end", "def client(url)\n client_params = { :url => url }\n if RubyProvisioningApi.configuration.ca_file\n client_params[:ssl] = {:ca_path => RubyProvisioningApi.configuration.ca_file}\n end\n client = Faraday.new(client_params) do |faraday|\n faraday.request :url_encoded # form-encode POST params\n faraday.response :logger if RubyProvisioningApi.configuration.http_debug # log requests to STDOUT\n faraday.adapter Faraday.default_adapter # make requests with Net::HTTP\n end\n end", "def new\n @url = Url.new\n end", "def new\n @url = Url.new\n end", "def initialize url\n\n if marmiton_host? url\n fetch_from_marmiton url\n\n elsif g750_host? url\n fetch_from_g750 url\n\n elsif cuisineaz_host? url\n fetch_from_cuisineaz url\n\n else\n raise ArgumentError, \"Instantiation cancelled (Host not supported).\"\n end\n end", "def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n flash[:notice] = 'Provider was successfully created.'\n format.html { redirect_to providers_path }\n format.xml { render :xml => @provider, :status => :created, :location => @provider }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new_provider(port,bool)\n stub_framework(bool)\n fill_in \"provider[name]\", :with => \"ec2-testprovider\"\n fill_in \"provider[url]\", :with => \"http://localhost:#{port}/api\"\n select(\"Amazon EC2\", :from => \"provider_provider_type_id\")\n click_button \"Create Provider\"\nend", "def connection\n v = ENV.fetch(@var, nil)\n raise \"The environment variable #{@var.inspect} is not set\" if v.nil?\n uri = URI(v)\n Pgtk::Wire::Direct.new(\n host: uri.host,\n port: uri.port,\n dbname: uri.path[1..-1],\n user: uri.userinfo.split(':')[0],\n password: uri.userinfo.split(':')[1]\n ).connection\n end", "def initialize(options = {})\n @model = options.delete(:model)\n @site = construct_site(options.delete(:site))\n\n @url = URI.parse @site\n\n @path = @url.path\n @credentials = [@url.user, @url.password].compact.join(\":\")\n @credentials = @credentials + \"@\" unless @credentials.blank?\n @host = \"#{@url.scheme}://#{@credentials}#{@url.host}\" \n \n establish_connection \n end", "def establish_connection(url, token)\n Faraday.new(url: url) do |faraday|\n faraday.request :json\n faraday.headers[\"Authorization\"] = token\n faraday.headers['Accept'] = 'application/json'\n faraday.response :json\n faraday.response :raise_error\n faraday.options.open_timeout = 2\n faraday.options.timeout = 100\n faraday.adapter Faraday.default_adapter\n end\n end", "def connect\n service\n end", "def new\n @url = url_for(:controller => \"connect\", :action => \"confirm\", :only_path => false)\n @connect_url = generate_login_url({\"redirect_uri\" => @url})\n end", "def new_http(uri); end", "def create\n provider = Manage::Provider.find_by(login: manage_provider_params[:login])\n if provider\n flash_msg('danger', \"此账号已经存在\", 'new')\n else\n manage_provider = Manage::Provider.new(manage_provider_params)\n begin\n if manage_provider.save\n flash_msg('success', '添加供应商成功!', 'index')\n end\n rescue Exception => e\n flash_msg('danger', \"添加供应商失败!#{error_msg(manage_provider)}\", 'new')\n end\n end\n end", "def create_url\n uri = Addressable::URI.new\n uri.query_values = properties\n \"#{ BASE_URI }#{ Hubspotter.configuration.portal_id }#{ create_endpoint }#{ uri.query }\"\n end", "def create\n @oauth_remote_service_provider = OauthRemoteServiceProvider.new(params[:oauth_remote_service_provider])\n\n respond_to do |format|\n if @oauth_remote_service_provider.save\n flash[:notice] = 'OauthRemoteServiceProvider was successfully created.'\n format.html { redirect_to(@oauth_remote_service_provider) }\n format.xml { render :xml => @oauth_remote_service_provider, :status => :created, :location => @oauth_remote_service_provider }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @oauth_remote_service_provider.errors, :status => :unprocessable_entity }\n end\n end\n end", "def identity_service_connection\n @identity_service_connection = HTTP::CardsServiceConnection.new(\n nil,\n self.identity_service_url\n )\n\n end", "def new(*args)\n my = self.init\n my.connect(*args)\n end", "def connect\n @connection_manager.connect\n end", "def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: \"new\" }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end", "def consumer\n @consumer = OAuth::Consumer.new session[:consumer_key], session[:consumer_secret], :site => MISO_SITE\nend", "def new\n \t@url = Url.new\n end", "def connect(uri)\n request = authenticate(uri)\n\n req_options = { use_ssl: uri.scheme == 'https' }\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n response\n end", "def connection_for_entity_type(_entity_type)\n connection_manager.connect(:base_url => tower_hostname, :username => tower_user, :password => tower_passwd)\n end", "def connect(user_or_sso, password = nil)\n if @provider\n raise AlreadyConnected, \"Cannot change provider once connected\" if @provider\n end\n\n # Obtain a session id\n if password.nil?\n # Connect via SSO token\n @sso = user_or_sso\n @logger.info \"Connecting to #{@url} using SSO token\"\n @req.ConnectToProvider do |xml|\n xml.ClientXMLVersion CLIENT_XML_VERSION\n xml.sso @sso\n xml.lngs({:enc => 0}, \"en_US\")\n end\n else\n # Connect via userid and password\n @user = user_or_sso\n @password = password\n @logger.info \"Connecting to #{@url} using userid/password\"\n @req.ConnectToProvider do |xml|\n xml.ClientXMLVersion CLIENT_XML_VERSION\n xml.usr @user\n xml.pwd @password\n xml.lngs({:enc => 0}, \"en_US\")\n end\n end\n doc = invoke\n @session_id = doc.at('//res_ConnectToProvider/sID').inner_html\n set_provider doc.at('//res_ConnectToProvider/provider').inner_html\n end", "def initialize(url=\"\")\n @serverURL = url\n end", "def connection\n Fog::Storage.new(\n :provider => provider,\n :aws_access_key_id => access_key_id,\n :aws_secret_access_key => secret_access_key,\n :region => region\n )\n end", "def add_connection(uri) #:nodoc:\n publisher = SlaveProxy.new(@caller_id, uri)\n begin\n protocol, host, port = publisher.request_topic(@topic_name, [[\"TCPROS\"]])\n if protocol == \"TCPROS\"\n connection = TCPROS::Client.new(host, port, @caller_id, @topic_name, @topic_type, uri, @tcp_no_delay)\n connection.start\n else\n puts \"not support protocol: #{protocol}\"\n raise \"not support protocol: #{protocol}\"\n end\n connection.id = \"#{@topic_name}_in_#{@connection_id_number}\"\n @connection_id_number += 1\n @connections.push(connection)\n return connection\n rescue\n#\tputs \"request to #{uri} fail\"\n return false\n end\n end", "def provider_object(connect)\n connect.vpc(:region => ext_management_system.provider_region).instances.instance(ems_ref)\n end", "def provider_object(connect)\n connect.vpc(:region => ext_management_system.provider_region).instances.instance(ems_ref)\n end", "def create\n @provider = Provider.new(provider_params)\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render action: 'show', status: :created, location: @provider }\n else\n format.html { render action: 'new' }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end", "def connect\n if (@type == \"db2\")\n @config\n Models::Databases::SiteDatabase::Base.setup_connection(@config)\n elsif (@type == \"bops\")\n @config\n Models::Databases::Bops::Base.setup_connection(@config)\n else\n Models::Databases::Dyces::Base.setup_connection(@config)\n end\n\n @connection = @type\n\n Log.instance.debug \"Connected to #@db_url\"\n self\n end", "def connect\n Connection.new\n end", "def create\n @title = t('view.providers.new_title')\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: t('view.providers.correctly_created') }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: 'new' }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end", "def connect\n @connector.connect\n @p.set_connection @connector\n end", "def new_connection(params)\n Pod4.logger.info(__FILE__){ \"Connecting to DB\" }\n client = TinyTds::Client.new(params)\n raise \"Bad Connection\" unless client.active?\n\n client.execute(\"use [#{self.class.db}]\").do\n\n client\n\n rescue => e\n handle_error(e)\n end", "def connect_controller()\n\n @udr = UniversalDomRemote.new debug: @debug\n\n end", "def create\n @provider = Provider.new(provider_params)\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @provider }\n else\n format.html { render :new }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end", "def open(options={}, &block)\n begin\n # Call the appropriate client's open method.\n if self.client\n self.client.open(options)\n else\n if self.uri\n raise Retrieve::NoClientError,\n \"No client was registered to handle the \" +\n \"'#{self.uri.scheme}' scheme.\"\n else\n raise Retrieve::NoClientError,\n \"Cannot find a client without a URI scheme.\"\n end\n end\n if block\n # If we were supplied a block, yield to it, then close.\n yield self\n else\n self\n end\n ensure\n # Make sure we close if there's a block.\n self.close if block rescue nil\n end\n end", "def connect_client(token)\n @client = Soundcloud.new(access_token: token)\n end", "def connect\n raise NotImplementedError, \"#connect should be overriden by adapters\"\n end", "def initialize(url, &on_reconnect)\n @url = url\n @beanstalk = nil\n @on_reconnect = on_reconnect\n connect!\n end", "def initialize(url)\n self.url = url\n end", "def initialize(url, secret = nil)\n self.url = URI.parse(url.to_s)\n self.secret = secret\n end", "def do_open(url, options = {:auth_needed => false})\n\n\t\tauth_needed = options.delete :auth_needed\n options = options.merge({:http_basic_authentication => [username, password]}) if auth_needed\n options = options.merge({'me2_application_key'=> config['app_key']}) if auth_needed\n\n open(url, options)\n end", "def make_conn(spec)\n case @handling_mode\n when :cache\n cache_connect(spec)\n when :pool\n # not yet implemented\n nil\n else\n nil\n end\n end", "def connect\n @connection_manager.connect\n return self\n end", "def new\n @consumer = oauth_consumer\n \n @request_token = @consumer.get_request_token\n \n session[:request_token]=@request_token.token\n session[:request_token_secret]=@request_token.secret\n \n @authorize_url = @request_token.authorize_url({\n :oauth_consumer_key => NETFLIX_KEY,\n :application_name => NETFLIX_APP_NAME,\n :oauth_callback => url_for(:controller => :netflix, :action => :create)\n })\n \n redirect_to @authorize_url\n end", "def create url\n function = ''\n \n post_data = {}\n post_data[:url] = url\n\n request(@resource, function, nil, 'post', post_data)\n end", "def new\n self.default_provider.new\n end", "def connect\n platform.connect\n end", "def create\n @url = Url.new(url_params)\n \n set_url_host_model\n \n respond_to do |format|\n if @url.save\n format.html { redirect_to @url, notice: 'Url was successfully created.' }\n format.json { render :show, status: :created, location: @url }\n else\n format.html { render :new }\n format.json { render json: @url.errors, status: :unprocessable_entity }\n end\n end\n end", "def connect\n raise NotImplementedError, \"#connect should be overridden by adapters\"\n end", "def initialize(url, params = {})\n uri = URI.parse(url)\n @connection = {\n :headers => {},\n :host => uri.host,\n :mock => Excon.mock,\n :path => uri.path,\n :port => uri.port.to_s,\n :query => uri.query,\n :scheme => uri.scheme\n }.merge!(params)\n\n # use proxy from the environment if present\n if ENV.has_key?('http_proxy')\n @proxy = setup_proxy(ENV['http_proxy'])\n elsif params.has_key?(:proxy)\n @proxy = setup_proxy(params[:proxy])\n end\n\n if https?\n # use https_proxy if that has been specified\n if ENV.has_key?('https_proxy')\n @proxy = setup_proxy(ENV['https_proxy'])\n end\n end\n\n if @proxy\n @connection[:headers]['Proxy-Connection'] ||= 'Keep-Alive'\n end\n\n @socket_key = '' << @connection[:host] << ':' << @connection[:port]\n reset\n end", "def connect_remote\n #ENV['DATABASE_URL'] ||= \"postgres://glue.pumpingstationone.org/?pool=5\"\n #ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])\n ActiveRecord::Base.establish_connection(\n :adapter => 'postgresql',\n :encoding => 'unicode',\n :database => ENV['DB_NAME'], # accessmon\n :username => ENV['DB_USERNAME'], # accessmon\n :password => ENV['DB_PASSWORD'],\n :pool => POOL_COUNT,\n :port => PORT_NUMBER,\n :host => ENV['DB_HOST'])\n end", "def create_openstack_connection\n Ankus::Openstack.new @credentials[:os_auth_url], @credentials[:os_username], @credentials[:os_password], @credentials[:os_tenant], @log, @mock\n end", "def cards_connection\n @_cards_connection ||= HTTP::CardsServiceConnection.new(\n self.access_token,\n self.cards_service_url\n )\n end", "def connect!\n request! :connect\n end", "def new\r\n @provider = Provider.new\r\n render_new\r\n end", "def initialize(url)\n @url = url\n end", "def with_uri_credentials(uri); end", "def new\n @cloud_provider = current_user.cloud_providers.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cloud_provider }\n end\n end", "def initialize(api_key, url='http://localhost:9001/api')\n @uri = URI.parse(url)\n raise ArgumentError, \"#{url} is not a valid url\" unless @uri.host and @uri.port\n @api_key = api_key\n connect!\n end", "def initialize_provider(provider=nil)\n prv = cleanup_provider(Souffle::Config[:provider])\n Souffle::Provider.const_get(prv).new\n rescue Souffle::Exceptions::InvalidAwsKeys => e\n Souffle::Log.error \"#{e.message}:\\n#{e.backtrace.join(\"\\n\")}\"\n rescue Exception\n raise Souffle::Exceptions::InvalidProvider,\n \"The provider Souffle::Provider::#{prv} does not exist.\"\n end" ]
[ "0.5747511", "0.56846124", "0.56257814", "0.5373718", "0.5366145", "0.5270639", "0.5259747", "0.51902616", "0.51664376", "0.5135227", "0.51301056", "0.5121687", "0.50935215", "0.505513", "0.50501424", "0.50497156", "0.50401026", "0.5023072", "0.49926826", "0.49881086", "0.49829605", "0.49762857", "0.49719325", "0.49624", "0.49542502", "0.49527872", "0.49499997", "0.488916", "0.48860005", "0.48840857", "0.48793837", "0.48774898", "0.48749733", "0.48709616", "0.48482773", "0.48419574", "0.4827192", "0.48218304", "0.48178416", "0.48178416", "0.4815641", "0.48080623", "0.4807481", "0.4780697", "0.47736278", "0.4767232", "0.47565457", "0.47448027", "0.47258678", "0.47202107", "0.4718595", "0.4701773", "0.4693522", "0.46930227", "0.46784458", "0.46678883", "0.46592516", "0.46582508", "0.46530974", "0.4651468", "0.4645875", "0.46449846", "0.46441504", "0.46408597", "0.46308842", "0.46308842", "0.46282786", "0.46276826", "0.46246016", "0.4619228", "0.461499", "0.4610946", "0.46056172", "0.45934454", "0.45891324", "0.45848638", "0.45815423", "0.45748144", "0.456295", "0.4562065", "0.45529374", "0.45526737", "0.45521858", "0.4548381", "0.45455912", "0.4543367", "0.45276237", "0.45246956", "0.45240676", "0.45198447", "0.451869", "0.45150664", "0.45139557", "0.45101312", "0.45089486", "0.45056188", "0.45055375", "0.4502109", "0.45000288", "0.44992685" ]
0.49561828
24
Sets the preferences to be applied to this session.
def preferences=(prefs) unless prefs.kind_of? Preferences raise InvalidPreference, "Preference settings must be an instance of SmartView::Preferences" end @preferences = prefs end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_preferences( opts={} )\n options.merge!( opts )\n end", "def set_preferences\n unless current_user.preference\n pref = Preference.create(user_id: current_user.id,theme: \"default-right\",bgcolor: \"white\",rows: 20, wallpaper: false)\n else\n pref = Preference.where(user_id: current_user.id).first\n end\n session[:theme] = pref.theme\n session[:bgcolor] = pref.bgcolor\n session[:rows] = pref.rows\n session[:wallpaper] = pref.wallpaper\n end", "def set_user_preferences\n @user_preferences = UserPreferences.find_or_create_by!(:user => current_user)\n end", "def set(preferences={})\n config = self.instance\n preferences.each do |key, value|\n config.set_preference(key, value)\n end\n config.save\n Rails.cache.delete(\"configuration_#{config.id}\".to_sym)\n end", "def set_preference\n @preference = @user.preferences.find(params[:id])\n end", "def remember_preference settings\n self.preference = Preference.find_or_create_by user_id: self\n self.preference.update settings\n end", "def set_config\n @me = current_user\n @profile = Profile.find_by user_id: current_user.id\n @preference = Preference.find_by user_id: current_user.id\n end", "def set_preference\n @preference = Preference.find(params[:id])\n end", "def set_pref\n @pref = Pref.find(params[:id])\n end", "def update_prefs\n current_user.preferences = params[:preferences]\n render plain: \"1\"\n end", "def set_preference\n preference = Preference.find(params[:id])\n end", "def set_user_preference\n @user_preference = UserPreference.find(params[:id])\n end", "def store(prefs)\n prefs.each do |key, value|\n self[key] = value\n end if prefs.respond_to?(:each)\n end", "def set_preference(prefs_section, pref, value)\n driver.setPref(prefs_section, pref, value.to_s)\n end", "def email_notification_preferences=(prefs_attributes)\n prefs = self.email_notification_preferences # init the object if it wasn't there\n prefs_attributes.each{|key, val| prefs.send(\"#{key}=\", val==\"true\")}\n write_attribute(:email_notification_preferences, prefs)\n end", "def reset\n set(default_preferences)\n end", "def set_preference\n begin\n @preference = Preference.find(params[:id])\n rescue\n flash[:danger] = \"You don't have permission for this action.\"\n redirect_to preferences_path\n end\n end", "def add_preference(name, value)\n @options[:prefs][name] = value\n end", "def set_pref(key, value)\n preferences.where(key: key).first_or_create.set(value)\n end", "def update_email_preferences\n prefs = preference_params\n authorize User\n pref = current_user.pref\n # does user not have prefs?\n if pref.blank?\n pref = Pref.new\n pref.settings = {}\n pref.user = current_user\n end\n pref.settings['email'] = booleanize_hash(prefs['prefs'])\n pref.save\n\n # Include active tab in redirect path\n redirect_to \"#{edit_user_registration_path}#notification-preferences\",\n notice: success_message(pref, _('saved'))\n end", "def use_static_preferences!\n @preference_store = default_preferences\n end", "def change_preference_list\n\t\tcheck_if_myself\n\t\tuser = current_user\n\t\tnew_preference_list = user_pref_list_params[:preference_list]\n\t\tif new_preference_list != user.preference_list\n\t\t\tuser.update_attributes(user_pref_list_params)\n\t\t\tuser.save\n\t\t\tRecomputeMeetingParticipationsJob.perform_later (0..6).to_a, user\n\t\tend\n\t\tredirect_to settings_page_path\n\tend", "def preferences\n @user = current_user\n @mode = \"general\"\n\n respond_to do |format|\n format.html\n end\n end", "def set_user_setting\n @current_user.create_default_user_setting unless @current_user.user_setting\n @user_setting = @current_user.user_setting\n end", "def set_storage_permissions(preferences: false, statistics: false)\n cookie_permissions.permission('necessary', true)\n cookie_permissions.permission('preferences', preferences)\n cookie_permissions.permission('statistics', statistics)\n manually_set_cookie(cookie_permissions.write, 1.year)\n\n # Also write to say they have seen the message, if not already set\n return if cookies[:'cookie-notification-acknowledged']\n\n cookies[:'cookie-notification-acknowledged'] = { value: Base64.strict_encode64('yes'), expires: 1.year }\n end", "def pref=(ispref)\n if ispref\n pvalue_iadd('TYPE', 'PREF')\n else\n pvalue_idel('TYPE', 'PREF')\n end\n end", "def setup_notification_preferences\n n = NotificationPreference.create!(user_id: id)\n self.notification_preference_id = n.id\n end", "def set_pref(key, value)\n prefs unless @prefs_fetched # update cache first\n success = _set_pref(key, value)\n @prefs_cache[key] = value if success\n success\n end", "def load_all\n parse_json(get(PREFERENCE_URL))['prefs'].each do |p|\n @@greader_preferences[p['id']] = p['value']\n end\n end", "def use_legacy_db_preferences!\n @preference_store = ScopedStore.new(self.class.name.underscore)\n end", "def preferences_with_defaults\n DEFAULT_PREFS.merge(read_attribute(:preferences) || {})\n end", "def preferences\n @page_title = 'Schedule View Preferences'\n @instructors = Group.users_in_group('instructor')\n @aircraft_types = AircraftType.find(:all)\n @offices = Office.find :all\n @instructors.sort!{|a,b| a.first_names<=>b.first_names}\n @aircraft_types.sort!{|a,b| a.type_name<=>b.type_name}\n \n if request.method == :post\n session[:schedule][:preferences] = params[:preferences]\n flash[:notice] = 'Preferences Saved.'\n end\n \n session[:schedule][:preferences] ||= {}\n session[:schedule][:preferences][:types] ||= {}\n session[:schedule][:preferences][:instructors] ||= {}\n \n end", "def set_profil\n @profil = Profil.find_by user_id: current_user.id\n end", "def current_preferences(update_params = nil)\n update_params ||= params[:preferences]\n prefs = if logged_in?\n current_user.preferences\n else\n session[:preferences] ||= User.preference_definitions.inject({}) do |memo, pair|\n name, pref = pair\n memo[name] = pref.default_value\n memo\n end\n end\n \n update_params = update_params.to_h.reject{|k,v| v.blank?} if update_params\n if update_params.is_a?(Hash) && !update_params.empty?\n # prefs.update(update_params)\n if logged_in?\n update_params.each do |k,v|\n new_value = if v == \"true\"\n true\n elsif v == \"false\"\n false\n elsif v.to_i > 0\n v.to_i\n else\n v\n end\n current_user.write_preference(k, new_value) unless new_value.blank?\n end\n else\n prefs.update(update_params)\n end\n end\n \n if logged_in?\n current_user.save if current_user.preferences_changed?\n current_user.preferences\n else\n session[:preferences] = prefs\n end\n end", "def set_hacknu_preference\n @hacknu_preference = HacknuPreference.find(params[:id])\n end", "def settheme\n ct = Theme.find_by_filename(params[:preference][:theme])\n unless ct.wallpaper\n session[:wallpaper] = false\n current_user.preference.wallpaper = false\n end\n \n respond_to do |format|\n if current_user.preference.update_attributes(params[:preference])\n set_session\n format.html {redirect_to :back}\n format.js {render \"reminder_save\"}\n else\n format.js {render \"shared/save_failed\"}\n end\n end\n end", "def set_session\n @session = current_session\n end", "def reset_prefs(new_prefs)\n driver.resetOperaPrefs(new_prefs)\n end", "def set_settings_will_change\n self.settings_will_change!\n end", "def save_autoshare_prefs(network, params)\n events = params.select {|k,v| v == '1'}.keys\n rv = preferences.save_autoshare_opt_ins(network, events)\n if rv\n @preferences = rv\n true\n else\n false\n end\n end", "def set_params params\n raise \"No Params\" if params.nil?\n params.each do |key, value|\n raise \"key nil\" if key.nil?\n raise \"value nil\" if value.nil?\n self.preferences[key.to_sym] = value if valid_key?(key)\n end\n raise \"save failed: #{errors}\" unless self.save\n assure_created_zip\n end", "def set_profile_mode(opts)\n opts = check_params(opts,[:modes])\n super(opts)\n end", "def set_profile_mode(opts)\n opts = check_params(opts,[:modes])\n super(opts)\n end", "def set_setting\n @setting = Setting.for_user(current_user).find(params[:id])\n end", "def []=(key, value)\n case value\n when String\n if Util.stringified?(value)\n raise ArgumentError, \"preference values must be plain strings: #{key.inspect} => #{value.inspect}\"\n end\n\n value = %{\"#{value}\"}\n when TrueClass, FalseClass, Integer, Float\n value = value.to_s\n else\n raise TypeError, \"invalid preference: #{value.inspect}:#{value.class}\"\n end\n\n @additional_prefs[key.to_s] = value\n end", "def []=(key, value)\n case value\n when String\n if Util.stringified?(value)\n raise ArgumentError, \"preference values must be plain strings: #{key.inspect} => #{value.inspect}\"\n end\n\n value = %{\"#{value}\"}\n when TrueClass, FalseClass, Integer, Float\n value = value.to_s\n else\n raise TypeError, \"invalid preference: #{value.inspect}:#{value.class}\"\n end\n\n @additional_prefs[key.to_s] = value\n end", "def settings=(new_settings)\n settings.merge!(new_settings)\n end", "def set_book_preference\n @book_preference = OptedOut.find_by_book_id_and_user_id(params[:book_id], current_user.id)\n end", "def save_preferences\n template = Template.find(params[:id])\n authorize Template\n\n args = preference_params\n args[:customize_output_types] = params[:customize_output_types_sel] != '0'\n args[:customize_licenses] = params[:customize_licenses_sel] != '0'\n\n # Template.transaction do\n # Get the current template or a new version if applicable\n @template = get_modifiable(template)\n @template.update(template_output_types: [], licenses: [], repositories: [], metadata_standards: [])\n\n if preference_params[:customize_repositories] != '0'\n # Create custom repositories if applicable and add them to selected repos\n args[:repositories_attributes] = create_custom_repositories(\n existing: args[:repositories_attributes], custom: custom_repo_params\n )\n end\n if preference_params[:customize_metadata_standards] != '0'\n # Create custom metadata standards if applicable and add them to selected standards\n args[:metadata_standards_attributes] = create_custom_standards(\n existing: args[:metadata_standards_attributes], custom: custom_standard_params\n )\n end\n\n if @template.update(args)\n flash.now[:notice] = \"#{success_message(@template, _('saved'))} Don't forget to publish your changes.\"\n else\n flash.now[:alert] = failure_message(@template, _('save'))\n end\n\n render 'preferences', locals: {\n partial_path: 'edit',\n template: @template,\n output_types: ResearchOutput.output_types,\n preferred_licenses: License.preferred.map { |license| [license.identifier, license.id] },\n licenses: License.selectable.map { |license| [license.identifier, license.id] },\n referrer: referrer\n }\n end", "def update_prefs(user_id:, prefs:)\n path = '/users/{userId}/prefs'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n if prefs.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"prefs\"')\n end\n\n params = {\n prefs: prefs,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Preferences\n )\n end", "def preference(method, data = {})\n call_endpoint(Endpoint::Preference, method, data)\n end", "def set_dietary_preference\n @dietary_preference = DietaryPreference.find(params[:id])\n end", "def set_props(props)\n @props.merge!(props)\n end", "def preference(value)\n fresh.tap do |criteria|\n criteria.preference_value = value\n end\n end", "def kiosk_mode_allow_voice_over_settings=(value)\n @kiosk_mode_allow_voice_over_settings = value\n end", "def user_pref(pref, for_user=nil)\n user = for_user || @current_user || User.current_user\n user.preferences[pref] if user\n end", "def set_cleaners_preference\n @cleaners_preference = Cleaners::Preference.find(params[:id])\n end", "def settings=(value)\n @settings = value\n end", "def settings=(value)\n @settings = value\n end", "def configure_spree_preferences\n config = Rails.application.config.spree.preferences\n yield(config) if block_given?\n end", "def defined_preferences\n super - [:server]\n end", "def review_settings=(value)\n @review_settings = value\n end", "def set_email_preference\n @email_preference = EmailPreference.find(params[:id])\n end", "def update_pref\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n desktop = Desktop.get_for(@login_user, true)\n\n params[:desktop].delete(:user_id)\n\n desktop.update_attributes(params.require(:desktop).permit(Desktop::PERMIT_BASE))\n\n params.delete(:desktop)\n\n show\n render(:action => 'show')\n end", "def set_settings(new_settings, options = {}, request_options = {})\n client.put(Protocol.settings_uri(name, options), new_settings.to_json, :write, request_options)\n end", "def set_conf\n @conf = Conf.find(params[:id])\n end", "def set_conf\n @conf = Conf.find(params[:id])\n end", "def enforced_settings=(value)\n @enforced_settings = value\n end", "def set_setting\n end", "def prefs_params\n params.require(:preference).permit(:facebook,:twitter,:telephone,:telephone2,:email,:key,:value,:paypal)\n end", "def preference_form\n @preferences = Preference.find_by users_id: current_user.id\n if @preferences == nil\n @preferences = Preference.new(:wallpaper => params[:wallpaper], :fontSize => params[:fontSize], :font => params[:font], :profilePicture => params[:profilePicture], :privacy => params[:privacy], :fontColor => params[:fontColor], :users_id => current_user[:id])\n else\n\n @preferences.privacy = params[:privacy];\n\n end\n\n if @preferences.save\n\n Logger.new(\"#{Rails.root}/log/cache_read.log\").error(Rails.root + \"app/assets/stylesheets/application.css\")\n # File.open(Rails.root + \"app/assets/stylesheets/application.css\",'w') do |cssFile|\n # cssFile.puts \"body { \" + params[:wallpaper] + \"}\"\n # end\n flash[:success] = \"Successfully updated your preferences.\"\n else\n flash[:error] = \"Could not update your preferences, please try again.\"\n end\n redirect_to \"/static_pages/home\"\n end", "def write_preferences(dict, path)\n dict.writeToFile_atomically(path, true)\n end", "def update\n resource = client.post_preferences(params.permit(:email_address, :frequency))\n render json: resource,\n serializer: MessagingPreferenceSerializer\n end", "def preference_params\n params.require(:preference).permit(:main_style, :jacket_id, :shoe_id, :pant_id, :hat_id)\n end", "def set(hash)\n hash.each do | key, value |\n setting = settings.find_by_key(key) || settings.new(:key => key)\n setting.value = value\n setting.save!\n end\n end", "def set_security_preference(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetSecurityPreference'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :enable_save_m_f_a_ticket\n\t\t\targs[:query]['EnableSaveMFATicket'] = optional[:enable_save_m_f_a_ticket]\n\t\tend\n\t\tself.run(args)\n\tend", "def set_settings\r\n @settings[\"deck_name\"] = @curr_deck_key if @curr_deck_key\r\n end", "def preferences\n @template = Template.find(params[:id])\n authorize Template\n\n editable = @template.latest? && @template.id.present? && @template.org_id = current_user.org.id\n page = editable ? 'preferences' : 'preferences_show'\n\n render page, locals: {\n partial_path: 'edit',\n template: @template,\n output_types: ResearchOutput.output_types,\n preferred_licenses: License.preferred.map { |license| [license.identifier, license.id] },\n licenses: License.selectable.map { |license| [license.identifier, license.id] },\n referrer: referrer\n }\n end", "def set_mandarin_preference\n @mandarin_preference = MandarinPreference.find(params[:id])\n end", "def set_persistence_mode(opts)\n opts = check_params(opts,[:modes])\n super(opts)\n end", "def implicit_grant_settings=(value)\n @implicit_grant_settings = value\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def cleaners_preference_params\n params.require(:cleaners_preference).permit(:preferred_time, :preferred_area, :pet_preference, :other_preference).merge(cleaner_id: current_cleaner.id)\n end", "def set_commodity_prefs(commodity, ideal_stock, buys, sells)\n @inventory.set_ideal_stock_of(commodity, ideal_stock)\n\n @trade_prefs[commodity] = (buys ? BUYS : 0) | (sells ? SELLS : 0)\n end", "def default_settings=(hash)\n @default_settings = hash\n end", "def add_preference(name, value); end", "def add_preference(name, value); end", "def set_user\n @comments = Comment.all\n @favorites = Favorite.all\n @votes = Vote.all\n end", "def settings\n\t\tcheck_if_myself\n\t\t@user = current_user\n\tend", "def update_preferred_modes params\n self.preferred_trip_types = params.map{ |m| m.to_s.gsub('mode_',\"\")}\n self.save\n end", "def update_table_preferences\n table_code = table_preference_params[:table_code]\n sort_params = table_preference_params[:sort]\n table_prefs = eval(current_user.table_preferences || \"{}\")\n \n #Turn all the keys and values from string to sym\n keyed_params = []\n sort_params.each do |kp|\n kp.each do |k,v|\n new_hash = {}\n new_hash[k.to_sym] = v.to_sym\n keyed_params << new_hash \n end\n end\n\n sort_params = {sort: keyed_params}\n table_prefs[table_code.to_sym] = sort_params\n current_user.update(table_prefs: table_prefs)\n\n render status: 200, json: current_user.table_preferences(table_code)\n end", "def update_preferences\n params[:columns].each do |k,v|\n col = @grid.get_column(params[:field])\n\n if col\n #RailsPowergrid::Preference.update(get_current_user, self, params[:field], v)\n end\n\n end\n render json: {}\n end", "def set_profile\n @profile = current_user.profile\n end", "def set_profile\n @profile = current_user.profile\n end", "def set_profile\n @profile = current_user.profile\n end", "def set_profile\n @profile = current_user.profile\n end", "def automatic_user_consent_settings=(value)\n @automatic_user_consent_settings = value\n end", "def secure_score_control_profiles=(value)\n @secure_score_control_profiles = value\n end", "def update!(**args)\n @quiz_settings = args[:quiz_settings] if args.key?(:quiz_settings)\n end", "def system_preferences\n #TODO remove true from the following line after presentation. Dont want the invitation only session to get bogged up during pres\n if true or session[:system_preferences].blank?\n active_preferences = HashWithIndifferentAccess.new()\n system_preferences = SystemPreference.all(:conditions => ['active = ?', true])\n system_preferences.each do |preference|\n if (preference.start_date.blank? or preference.start_date <= Date.now) and (preference.end_date.blank? or preference.end_date >= Date.now)\n if preference.constraints.blank? or eval(preference.constraints)\n active_preferences[preference.preference_key] = preference.preference_value\n end\n end\n end\n session[:system_preferences] = active_preferences\n return active_preferences\n else\n return session[:system_preferences]\n end\n end" ]
[ "0.723686", "0.71732646", "0.66902983", "0.6452161", "0.6273506", "0.61761403", "0.59947884", "0.59088665", "0.589031", "0.5856656", "0.5852435", "0.57856405", "0.5726554", "0.5705812", "0.565109", "0.5616993", "0.5522836", "0.5482973", "0.5471249", "0.5431318", "0.53080773", "0.52999973", "0.5219827", "0.52128375", "0.5211313", "0.5158492", "0.51198846", "0.51153904", "0.5109251", "0.50943136", "0.5088529", "0.50535274", "0.5034275", "0.50284314", "0.5017857", "0.4989254", "0.498336", "0.4974447", "0.49691802", "0.49640855", "0.49366322", "0.493409", "0.493409", "0.4933623", "0.49177197", "0.49177197", "0.4901315", "0.4861184", "0.48491943", "0.48461565", "0.4831392", "0.48308513", "0.48289332", "0.48170304", "0.4812255", "0.48042265", "0.47948277", "0.47663984", "0.47663984", "0.4737899", "0.47299477", "0.47230235", "0.47185615", "0.4715019", "0.4698875", "0.46914458", "0.46901768", "0.4688791", "0.4687379", "0.46859208", "0.46796316", "0.46785706", "0.46692535", "0.46656445", "0.4663258", "0.46575397", "0.46533382", "0.46531802", "0.46460316", "0.46430025", "0.46309692", "0.46165478", "0.46091208", "0.46003503", "0.46002087", "0.45998177", "0.45998177", "0.45917043", "0.45767838", "0.45766476", "0.45711923", "0.45705038", "0.45634305", "0.45634305", "0.45634305", "0.45634305", "0.4554843", "0.4542918", "0.45412722", "0.45401728" ]
0.69856644
2
Connect to the SmartView provider and obtain a session id. Two methods of connection are supported: 1. Userid and password 2. SSO token If only a single parameter is passed, the SSO method is assumed; if two parameters are passed, these are assumed to be userid and password.
def connect(user_or_sso, password = nil) if @provider raise AlreadyConnected, "Cannot change provider once connected" if @provider end # Obtain a session id if password.nil? # Connect via SSO token @sso = user_or_sso @logger.info "Connecting to #{@url} using SSO token" @req.ConnectToProvider do |xml| xml.ClientXMLVersion CLIENT_XML_VERSION xml.sso @sso xml.lngs({:enc => 0}, "en_US") end else # Connect via userid and password @user = user_or_sso @password = password @logger.info "Connecting to #{@url} using userid/password" @req.ConnectToProvider do |xml| xml.ClientXMLVersion CLIENT_XML_VERSION xml.usr @user xml.pwd @password xml.lngs({:enc => 0}, "en_US") end end doc = invoke @session_id = doc.at('//res_ConnectToProvider/sID').inner_html set_provider doc.at('//res_ConnectToProvider/provider').inner_html end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connect\n configuration = VSphereAutomation::Configuration.new.tap do |c|\n c.host = config[:vcenter_host]\n c.username = config[:vcenter_username]\n c.password = config[:vcenter_password]\n c.scheme = \"https\"\n c.verify_ssl = config[:vcenter_disable_ssl_verify] ? false : true\n c.verify_ssl_host = config[:vcenter_disable_ssl_verify] ? false : true\n end\n\n @api_client = VSphereAutomation::ApiClient.new(configuration)\n api_client.default_headers[\"Authorization\"] = configuration.basic_auth_token\n\n session_api = VSphereAutomation::CIS::SessionApi.new(api_client)\n session_id = session_api.create(\"\").value\n\n api_client.default_headers[\"vmware-api-session-id\"] = session_id\n end", "def start_session_with_smart_token\n require_relative '../../../lib/util/smart_token'\n smart_token = SmartToken.from_str(params['smart_token'])\n user = smart_token ? User.first(:guid => smart_token.guid) : nil\n\n if user and user.is_smart_token_valid? smart_token\n return user\n else\n return nil\n end\n end", "def connect!\n retrieve_auth_token unless connected?\n auth_token[:token]\n end", "def connect\n\n # Initialize the gem\n ShopifyAPI::Session.setup({api_key: @api_key, secret: @shared_secret})\n\n # Instantiate the session\n session = ShopifyAPI::Session.new(@url, @password)\n\n # Activate the Session so that requests can be made\n return ShopifyAPI::Base.activate_session(session)\n\n end", "def login\n\t\tbegin\n\t\t\tr = execute(make_xml('LoginRequest', { 'sync-id' => 0, 'password' => @password, 'user-id' => @username }))\n\t\trescue APIError\n\t\t\traise AuthenticationFailed.new(r)\n\t\tend\n\t\tif(r.success)\n\t\t\t@session_id = r.sid\n\t\t\treturn true\n\t\tend\n\tend", "def connect\n info \"Connecting to #{ @host }\"\n\n begin @session.open(@credentials)\n rescue Exception => e\n error e.message\n end\n \n info \"Transport is #{ @session.transport.class }\"\n end", "def login\n params = {\n 'method' => :post,\n 'command' => '/sessions'\n }\n\n response, headers = send_request(params)\n\n if !headers.has_key?(:x_vcloud_authorization)\n raise \"Unable to authenticate: missing x_vcloud_authorization header\"\n end\n\n @auth_key = headers[:x_vcloud_authorization]\n end", "def login\n params = {\n 'method' => :post,\n 'command' => '/sessions'\n }\n\n response, headers = send_request(params)\n\n if !headers.has_key?(:x_vcloud_authorization)\n raise \"Unable to authenticate: missing x_vcloud_authorization header\"\n end\n\n extensibility_link = response.css(\"Link[rel='down:extensibility']\")\n @extensibility = extensibility_link.first['href'] unless extensibility_link.empty?\n\n @auth_key = headers[:x_vcloud_authorization]\n end", "def connect( url, session = nil, token = nil )\n #\n # Sync up the session authentication tokens with the ones in the\n # class variables.\n #\n # This will allow users to still connect to instances even if they\n # shutdown the WebUI or remove their cookies.\n #\n @@tokens ||= {}\n session['tokens'] ||= {} if session\n @@tokens[url] = token if token\n\n session['tokens'].merge!( @@tokens ) if session\n @@tokens.merge!( session['tokens'] ) if session\n session['tokens'].merge!( @@tokens ) if session\n\n tmp_token = session ? session['tokens'][url] : @@tokens[url]\n\n Arachni::RPC::Client::Instance.new( @opts, url, tmp_token )\n end", "def login\n params = {\n 'method' => :post,\n 'command' => '/sessions'\n }\n\n response, headers = send_request(params)\n\n if !headers.has_key?(:x_vcloud_authorization)\n raise \"Unable to authenticate: missing x_vcloud_authorization header\"\n end\n\n @auth_key = headers[:x_vcloud_authorization]\n end", "def connect_with_sst(token, options={})\n create_authenticated_connection(options.merge({:cookies => {'GDCAuthSST' => token}}))\n end", "def open_session_with_login\n $system_config ||= load_config(@@SERVER_CONFIG_PATH)\n url = \"#{$system_config.protocol}://#{$system_config.host}:#{$system_config.port}\"\n Util.open_session(url)\n Util.login($system_config.user, $system_config.password)\n end", "def login(params = {})\n begin\n params.merge!(common_params)\n document = MagentoApiWrapper::Requests::Login.new(params)\n request = MagentoApiWrapper::Request.new(magento_url: params[:magento_url], call_name: :login)\n request.body = document.body\n login = MagentoApiWrapper::Login.new(request.connect!)\n @session_id = login.key\n login.key\n rescue MagentoApiWrapper::AuthenticationError => e\n raise e\n end\n end", "def login\n client.login(\n params[:user],\n params[:password],\n authParams: {\n scope: 'openid name email'\n },\n connection: 'Username-Password-Authentication'\n )\n end", "def connect!\n @connection = user ? connection_for_user : connection_for_application\n @auth_token = @connection.token\n BeaconClient.logger.debug(\"Client token: #{@auth_token}\") if BeaconClient.config.debug?\n @auth_token\n rescue OAuth2::Error => error\n BeaconClient.logger.error(error.message)\n BeaconClient.logger.error(error.backtrace.join(\"\\n\"))\n end", "def login\n user = User.last\n login!(user)\n ses = session[:session_token]\n render json: {\"ses\": ses}\n end", "def login\n options = {\n type: 'OneView',\n file_env_var: 'ONEVIEW_AUTH_FILE',\n env_var_url: 'ONEVIEW_URL',\n filename: '/login.json'\n }\n credentials = load_authentication_settings(options)\n credentials[:hardware_variant] ||= 'C7000'\n credentials[:hardware_variant] = credentials[:hardware_variant].to_s.capitalize\n credentials\nend", "def connect(options = {})\n raise MiqException::MiqHostError, \"No credentials defined\" if missing_credentials?(options[:auth_type])\n\n auth_token = authentication_token(options[:auth_type])\n username = options[:user] || authentication_userid(options[:auth_type])\n password = options[:pass] || authentication_password(options[:auth_type])\n host = options[:host] || address\n port = options[:port] || self.port\n self.class.raw_connect(username, password, host, port).login\n end", "def auth\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"params=#{params}\",\n \"\" ] if browse_everything_controller_debug_verbose\n # params contains the access code with with the key :code\n provider_session.token = provider.connect(params, provider_session.data, connector_response_url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider_session.token=#{provider_session.token}\",\n \"\" ] if browse_everything_controller_debug_verbose\n provider_session.token\n end", "def connect_to_server\n puts \"==>connect_to_server\"\n if session[:client_id].length == 0 \n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end", "def connect!\n sessions\n self\n end", "def login(user, password, sid = nil)\n sid ||= IDMIN + rand(IDMAX-IDMIN)\n @nurl ||= \"https://localhost:8834/\"\n post = { \"username\" => user, \"password\" => password, 'seq' => sid }\n\n response_json = nessus_request('session', post)\n\n if response_json['token']\n @token = response_json['token']\n @name = user\n @seqid = sid\n # Compatibility with XMLRPC ivar\n user_permissions = nessus_request('session', auth_header, :get)['permissions']\n @admin = ([64,128].any? {|perm| perm == user_permissions}).to_s.upcase\n return @token\n else\n raise \"Cannot authenticate to #{@nurl} as #{user} with #{password} due to #{response_json['error']}\"\n end\n\n end", "def login(params={})\n params = {:session => {}}\n \n # if both username and password given as parameters or instance variables\n if ((@username && @password) || (params[:username] && params[:password]))\n params[:session][:username] = params[:username] || @username\n params[:session][:password] = params[:password] || @password\n end\n params[:session][:app_name] = @app_name || APP_CONFIG.asi_app_name\n params[:session][:app_password] = @app_password || APP_CONFIG.asi_app_password\n\n resp = RestHelper.make_request(:post, @@session_uri, params , nil, true)\n\n #@headers[\"Cookie\"] = resp[1].headers[:set_cookie].to_s\n @cookie = resp[1].cookies\n @person_id = resp[0][\"entry\"][\"user_id\"]\n end", "def connect\n # Configure the connection to vCenter\n lookup_service_helper = LookupServiceHelper.new(lookup_service_host)\n vapi_urls = lookup_service_helper.find_vapi_urls\n debug(\"Found vAPI endpoints: [\" + vapi_urls.to_s + \"]\")\n\n vim_urls = lookup_service_helper.find_vim_urls\n debug(\"Found VIM endpoints: [\" + vim_urls.to_s + \"]\")\n\n node_id = vim_urls.select { |id, url| url.include? vcenter_host }.keys.first\n debug(\"NodeID of vCenter \" + config[:vcenter_host] + \" is \" + node_id.to_s)\n\n vapi_url = lookup_service_helper.find_vapi_url(node_id)\n debug(\"vAPI Endpoint for vCenter is \" + vapi_url)\n\n # Create the VAPI config object\n ssl_options = {}\n ssl_options[:verify] = config[:vcenter_disable_ssl_verify] ? :none : :peer\n @vapi_config = VAPI::Bindings::VapiConfig.new(vapi_url, ssl_options)\n\n # get the SSO url\n sso_url = lookup_service_helper.find_sso_url\n sso = SSO::Connection.new(sso_url).login(config[:vcenter_username], config[:vcenter_password])\n token = sso.request_bearer_token\n vapi_config.set_security_context(\n VAPI::Security.create_saml_bearer_security_context(token.to_s)\n )\n\n # Login and get the session information\n @session_svc = Com::Vmware::Cis::Session.new(vapi_config)\n @session_id = session_svc.create\n vapi_config.set_security_context(\n VAPI::Security.create_session_security_context(session_id)\n )\n end", "def connect\n require 'restforce' unless defined?(::Restforce)\n username = additional_params[:username] || \"\"\n password = additional_params[:password] || \"\"\n security_token = additional_params[:security_token] || \"\"\n client_id = additional_params[:client_id] || \"\"\n client_secret = additional_params[:client_secret] || \"\"\n instance_url = additional_params[:instance_url] || \"\"\n\n @client = Restforce.new(\n username: username,\n password: password,\n security_token: security_token,\n client_id: client_id,\n client_secret: client_secret,\n instance_url: instance_url\n )\n\n @oauth = @client.authenticate!\n super\n end", "def sign_in(username, password, api_key, platform)\n session.username = username\n session.password = password\n session.api_key = api_key\n session.platform = platform\n\n session.sign_in\n end", "def open_session; end", "def get\n params.required(:id)\n\n # Grab the device that is trying to authenticate\n unathenticated_error unless @api_consumer.is_a? Service\n service = @api_consumer\n\n @session = service.sessions.find(params[:id])\n end", "def connect_to_server\n @service.connect(connect_settings)\n end", "def setup_session_with_username\n method = 'smugmug.login.withPassword'\n setup_session_with [\"method=#{method}\",\"EmailAddress=#{@smug_user.email}\",\"Password=#{@smug_user.password}\"]\n end", "def login\n if params[:un].nil? || params[:pw].nil? || params[:server_url].nil?\n TextMate::UI.alert(:warning, \"MavensMate\", \"Please provide Salesforce.com credentials before selecting metadata\")\n abort\n end\n \n begin\n TextMate.call_with_progress( :title => \"MavensMate\", :message => \"Validating Salesforce.com Credentials\" ) do\n self.client = MavensMate::Client.new({ :username => params[:un], :password => params[:pw], :endpoint => params[:server_url] })\n end\n #$stdout.flush\n #flush\n if ! self.client.sid.nil? && ! self.client.metadata_server_url.nil?\n puts \"<input type='hidden' value='#{self.client.sid}' id='sid'/>\"\n puts \"<input type='hidden' value='#{self.client.metadata_server_url}' id='murl'/>\"\n end\n rescue Exception => e\n TextMate::UI.alert(:warning, \"MavensMate\", e.message)\n return\n end\n end", "def login\n\t\turl = \"https://accounts.spotify.com/authorize\"\n\t\tquery_params = {\n\t\t\tclient_id: Rails.application.secrets.SPECTRIFY_CLIENT_ID,\n\t\t\tresponse_type: \"code\",\n\t\t\tredirect_uri: Rails.application.secrets.SPECTRIFY_REDIRECT_URI,\n\t\t\tscope: \"user-read-email user-read-currently-playing user-read-playback-state user-modify-playback-state\",\n\t\t\tshow_dialog: true\n\t\t}\n\t\t# redirects user's browser to Spotify's authorisation page\n\t\t# the URL details the scopes Spectrify is requesting\n\t\tredirect_to \"#{ url }?#{ query_params.to_query }\"\n\tend", "def ds_connection\n if session[:int_key].nil? || session[:email].nil? || session[:password].nil?\n redirect_to new_login_path\n else\n @connection ||= Docusign::Base.login(\n :integrators_key => session[:int_key],\n :email => session[:email],\n :password => session[:password],\n :endpoint_url => Docusign::Config[:default_endpoint_url],\n :wiredump_dev => STDOUT #This echoes all SOAP calls to standard out. Change this to log somewhere else, or comment out to eliminate logging.\n )\n end\n end", "def session(token)\n get(:signed, {:method => \"auth.getSession\", :token => token})\n end", "def connectSession\n # not having valid device id or session number or device type. \n if (params.has_key?(:session_id) == false || params[:session_id].empty? ||\n params.has_key?(:did) == false || params[:did].empty? || \n params.has_key?(:dtype) == false || params[:dtype].empty? ||\n params.has_key?(:experiment_id) == false || params[:experiment_id].empty? ||\n (@experiment = UteExperiment.where(:experiment_code => params[:experiment_id]).first) == nil ||\n (@deviceType = DeviceType.where(name: params[:dtype]).first) == nil ||\n (@session = @experiment.ute_ex_sessions.where(:session_code => params[:session_id], :is_active => true).first) == nil)\n respond_to do |format|\n format.html { render text: 'Unauthorized', :status => :unauthorized }\n format.json { \n render :json => [], :status => :unauthorized \n }\n end\n return\n end\n\n @deviceId = params[:did]\n @sessionconnection = @session.ute_ex_session_connections.where(:device_id => @deviceId, :device_type => @deviceType.id).first\n if(@sessionconnection == nil)\n @sessionconnection = @session.ute_ex_session_connections.create(device_id: @deviceId, device_model: params[\"model\"], device_type: @deviceType.id, is_active: true, connected_at: Time.now.getutc.to_f);\n else\n @sessionconnection.is_active = true\n @sessionconnection.connected_at = Time.now.getutc.to_f\n @sessionconnection.save!\n end\n \n #torender = { \n # 'status' => 'OK',\n # 'created_at' => @session.created_at.to_time.to_f,\n # 'settings' => {\n # 'version' => 1.0,\n # 'maximumRecordingDuration' => 0,\n # 'sensors' => [\n # { :name => 'accelerometer', :freq => 50 },\n # { :name => 'magnetometer', :freq => 50 },\n # { :name => 'gyroscope', :freq => 50 },\n # { :name => 'gps', :freq => 1 }\n # ],\n # 'label' => {\n # 'type' => 'interval',\n # 'schema' => [\n # { 'set' => [ 'standing', 'sitting', 'walking', 'running' ], 'is_nullable' => true, 'only_can_select_one' => true }\n # ]\n # }\n # }\n # }.to_json \n torender = { \n 'status' => 'OK',\n 'created_at' => @sessionconnection.connected_at,\n 'settings' => @experiment.read_attribute(:settings)\n }.to_json \n respond_to do |format|\n format.html { render text: 'Session Status: Connected<br/>' + torender }\n format.json { \n render json: torender\n }\n end\n end", "def connect_to_patient_server\n puts \"==>connect_to_patient_server\"\n if session[:client_id].length == 0 \n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n return # We do not have authentication\n end\n if session.empty? \n err = \"Session Expired\"\n # binding.pry \n redirect_to root_path, alert: err\n end\n if session[:iss_url].present?\n @patient_client = FHIR::Client.new(session[:iss_url])\n @patient_client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @patient_client.set_bearer_token(session[:access_token])\n end\n rescue StandardError => exception\n reset_session\n err = \"Failed to connect: \" + exception.message\n redirect_to root_path, alert: err\n end", "def connect\n @comm.connect(opts.user, opts.password, opts.server)\n end", "def login (login = nil, password = nil, account_id=nil, external_auth=nil, domain=nil)\n\n if (login != nil && password == nil)\n # user given --> use generic user password\n # TODO: generate password (see https://forge.switch.ch/redmine/issues/2355)\n password = @pointconfig[\"generic_user_password\"]\n elsif (login == nil) && (password == nil)\n login = @pointconfig[\"username\"]\n password = @pointconfig[\"password\"]\n end\n\n res = query(\"login\",\n \"login\" => login,\n \"password\" => password,\n \"account-id\" => account_id,\n \"external-auth\" => external_auth,\n \"domain\" => domain)\n\n cookies = res.response[\"set-cookie\"]\n puts cookies.inspect\n cookies.split(\";\").each{|s|\n array = s.split(\"=\")\n if array[0] == \"BREEZESESSION\"\n @sessionid = array[1]\n end\n }\n puts \"ACS: Logged in\"\n return res.body\n end", "def session_get\n nessus_rest_get(\"session\")\n end", "def mobile_session(username, authToken)\n get(:signed, {:method => \"auth.getMobileSession\", :username => username, :authToken => authToken})\n end", "def login\n request_params = {\n host_url_with_protocol: host_url_with_protocol,\n host_url: host_url,\n entity_type: GlobalConstant::TemplateType.login_template_type\n }\n service_response = GlobalConstant::StTokenSale.get_client_details(request_params)\n\n # Check if error present or not?\n unless service_response.success?\n render_error_response(service_response)\n return\n end\n\n @presenter_obj = ::Web::Client::Setup.new(service_response, params)\n redirect_to '/token-sale-blocked-region', status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.is_blacklisted_ip?(get_ip_to_aml_countries)\n set_page_meta_info(@presenter_obj.custom_meta_tags)\n end", "def signOn()\n begin\n response_xml = HTTParty.get(SIGNON_URL,\n headers: { \"Content-Type\" => \"application/json\", \n \"Authorization\" => \"Basic #{encode_token(identity_token)}\"},\n verify: false,:timeout => 60 )\n encode_token(response_xml)\n rescue Exception => ex\n return \"invalid session token\"\n end\n end", "def connect_to_server\n if session.empty? \n err = \"Session Expired\"\n binding.pry \n redirect_to root_path, flash: { error: err }\n end\n if session[:iss_url].present?\n @client = FHIR::Client.new(session[:iss_url])\n @client.use_r4\n token_expires_in = session[:token_expiration] - Time.now.to_i\n if token_expires_in.to_i < 10 # if we are less than 10s from an expiration, refresh\n get_new_token\n end\n @client.set_bearer_token(session[:access_token])\n end\n rescue => exception\n err = \"Connection failed: Ensure provided url points to a valid FHIR server\"\n redirect_to root_path, flash: { error: err }\n end", "def login\n openid_url = params[:openid_url]\n\n authenticate_with_open_id(openid_url) { |result, identity_url, sreg|\n if result.successful?\n @open_id_credential = OpenIdCredential.find_by_identity_url(identity_url)\n if @open_id_credential\n @open_id_credential.login!\n session[:user_id] = @open_id_credential.user_id\n set_notice(p_(\"MultiAuth\", \"Logged in successfully.\"))\n redirect_to(root_path)\n else\n set_notice(p_(\"MultiAuth\", \"This OpenID has not been registered yet.\"))\n redirect_to(:controller => \"signup/open_id\", :action => \"index\")\n end\n else\n failed_login(result.message)\n end\n }\n end", "def get_session( params )\n LastFM.get( \"auth.getSession\", params, :secure )\n end", "def start_session(id, token_hash, user_id=KalturaNotImplemented, type=KalturaNotImplemented, expiry=KalturaNotImplemented, udid=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.add_param(kparams, 'tokenHash', token_hash)\n\t\t\tclient.add_param(kparams, 'userId', user_id)\n\t\t\tclient.add_param(kparams, 'type', type)\n\t\t\tclient.add_param(kparams, 'expiry', expiry)\n\t\t\tclient.add_param(kparams, 'udid', udid)\n\t\t\tclient.queue_service_action_call('apptoken', 'startSession', 'KalturaSessionInfo', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def login(username, password, device_id, push_token = '')\n values = {\n username: username,\n password: password,\n device_id: device_id,\n push_token: push_token\n }\n\n @client.make_request :post, auth_path('login'), values\n end", "def connect\n self.user_id = find_verified_user\n end", "def establish_chip_session\n redis_handler.token = token.fetch\n redis_handler.save\n session_from_redis\n end", "def login\n @client = Octokit::Client.new(login: username, oauth_token: token)\n end", "def connect_to_nylas(data)\n code = nylas_code(data)\n data = {\n :client_id => NYLAS_CLIENT_ID,\n :client_secret => NYLAS_CLIENT_SECRET,\n :code => code\n }\n nylas_access_token = nylas_token(data)\n session[:nylas_access_token] = nylas_access_token\nend", "def session(&block) # :yields: session\n @socket = TCPSocket.open(@host, @port, @local_host, @local_port)\n \n # print connection settings and get return code\n @socket.print(connection_settings)\n return_code = @socket.recv(1).unpack(\"c\").first\n \n if return_code == RECEIVED_SETTINGS\n login\n block.call(self)\n logout\n else\n if @logger\n error = @socket.read\n @logger.error(\"connection couldn't be established: %s\" % error)\n end\n @socket.close\n end\n end", "def sign_in(username, password)\n \n # If #login_with is called before we have a session_id instance variable\n # then call initialize_session\n initialize_session unless session_valid?\n\n # Use Suds to call the 'SignIn' SOAP action\n response = @soap_client.call :sign_in, \n message: { 'wsdl:sessionID' => @session_id, \n 'wsdl:username' => username, \n 'wsdl:password' => password }\n\n # Assign the customer_login_id variable to the string in the SOAP response\n @customer_login_id = response.body[:sign_in_response][:sign_in_result]\n\n end", "def connect!(in_user, in_password, in_host)\n begin\n @sa_connection=OpswareClient\n @sa_connection.connect(\"https\".to_java, in_host, port, in_user, in_password, true)\n require 'sasync/hpsa_tools/hpsa_tools'\n extend Sasync::HpsaTools\n rescue NativeException => e\n puts \"Error during connection with error: #{e}\"\n return\n end\n\n self.initialize_framework\n #puts @sa_connection.isConnected\n #puts connection_info\n end", "def login\n self.session = GData::Client::Calendar.new if session.nil?\n @token = session.clientlogin(username,password)\n true\n end", "def login\n make_login_call\n end", "def login(luser, password)\n @sid = @connection.call(\"auth.login\", luser, password)\n end", "def set_connection(key, pwd, name)\n ShopifyAPI::Base.site = \"https://#{key}:#{pwd}@#{name}.myshopify.com/admin\"\n shop = ShopifyAPI::Shop.current\n\n $shop_name = name\n $currency = shop.money_with_currency_format\n\n session[:logged_in] = true\n open_connection\n rescue SocketError, ActiveResource::ResourceNotFound => e\n puts \"Exception: #{e}\"\n close_connection\n end", "def login\n raise SocketError, \"Socket must be opened before logging in\" if !@socket or @socket.closed?\n\n xml = new_epp_request\n\n xml.root << command = Node.new(\"command\")\n command << login = Node.new(\"login\")\n\n login << Node.new(\"clID\", tag)\n login << Node.new(\"pw\", password)\n\n login << options = Node.new(\"options\")\n\n options << Node.new(\"version\", version)\n options << Node.new(\"lang\", lang)\n\n login << services = Node.new(\"svcs\")\n\n services << Node.new(\"objURI\", \"urn:ietf:params:xml:ns:domain-1.0\")\n services << Node.new(\"objURI\", \"urn:ietf:params:xml:ns:contact-1.0\")\n services << Node.new(\"objURI\", \"urn:ietf:params:xml:ns:host-1.0\")\n\n services << extensions_container = Node.new(\"svcExtension\") unless extensions.empty?\n\n for uri in extensions\n extensions_container << Node.new(\"extURI\", uri)\n end\n\n command << Node.new(\"clTRID\", SecureRandom.uuid)\n\n response = Hpricot::XML(send_request(xml.to_s))\n\n handle_response(response)\n end", "def connect\n # Get the token from the session if available or exchange the authorization\n # code for a token.\n if !session[:token]\n # Make sure that the state we set on the client matches the state sent\n # in the request to protect against request forgery.\n if session[:state] == params[:state]\n $gplus_client = GooglePlusSignInHelper::GooglePlusClient.new\n tokeninfo, token_pair = $gplus_client.exchange_token(request)\n if tokeninfo['error']\n logger.debug \"Session token error: #{tokeninfo['error']}\"\n render :json => {:status => \"error\",\n :message => \"Session token error: #{tokeninfo['error']}\"},\n :status => :unauthorized and return\n end\n if tokeninfo['issued_to'] != Settings.gplus_signin.client_id\n logger.debug \"Session token issued-to mismatch: #{tokeninfo['issued_to']} != #{Settings.gplus_signin.client_id}\"\n render :json => {:status => \"error\",\n :message => \"Session token issued-to mismatch: #{tokeninfo['issued_to']} != #{Settings.gplus_signin.client_id}\"},\n :status => :unauthorized and return\n end\n\n if current_user\n #\n # There is already a user logged in. If current user is not connected to\n # this gplus_id, make the connection.\n #\n session[:token] = token_pair\n session[:gplus_id] = tokeninfo['user_id']\n if current_user.gplus_id.blank?\n render :json => {:status => \"gplus_associate\",\n :message => \"Google+ id #{session['gplus_id']} just logged in\"},\n :status => 200 and return\n else\n render :json => {:status => \"gplus_existing\",\n :message => \"Google+ id #{session['gplus_id']} just logged in\"},\n :status => 200 and return\n end\n else\n user = User.find_by_gplus_id(tokeninfo['user_id'])\n if user\n logger.debug(\"User by Google+ ID #{tokeninfo['user_id']} = #{user.fullname}\")\n session[:user_id] = user.id\n session[:username] = user.username\n session[:token] = token_pair\n session[:gplus_id] = tokeninfo['user_id']\n render :json => {:status => \"gplus_existing\",\n :message => \"Google+ id #{session['gplus_id']} just logged in\"},\n :status => 200 and return\n else\n session[:token] = token_pair\n session[:gplus_id] = tokeninfo['user_id']\n # GooglePlusSignInHelper::GooglePlusClient.clean_google_plus_session(session)\n render :json => {:status => \"gplus_create\",\n :message => \"Google+ id #{tokeninfo['user_id']} not associated with any user\"},\n :status => 200 and return\n end\n end\n else\n render :json => {:status => \"error\",\n :message => \"Unauthorized access\"},\n :status => :unauthorized and return\n end\n else\n logger.debug \"Session has token : #{session}\"\n render :json => {:status => \"gplus_logged_in\",\n :message => \"Google+ id #{session['gplus_id']} already logged in\"},\n :status => 200 and return\n end\n end", "def login\n debug 'Trying to login'\n _response = self.signed_request '/api/v1/login', 'POST', {\n user: $config.get_username,\n password: $config.get_password\n }\n\n if _response['status'] != 'success'\n puts 'Unable to login!'\n exit 1\n else\n debug 'Signed in successfully'\n end\n\n @auth_token = _response['data']['authToken']\n @user_id = _response['data']['userId']\n end", "def login\n @login ||= begin\n client.user.login\n rescue Octokit::Unauthorized, Faraday::ConnectionFailed\n nil\n end\n end", "def initiate_xmlrpc_session\n begin\n response = xmlrpc_client.call(\"login\", @settings[\"webfaction_user\"], @settings[\"webfaction_password\"])\n id = response.first\n rescue XMLRPC::FaultException, Timeout::Error => e\n raise \"Error during connection. Please try again later.\"\n end\n id \n end", "def login(login,pass,hash = nil)\n\n #login_from_session_ok = false\n #if (!hash.nil? && hash.length>0)\n #\t@connect = Connect.new\n #\t@id = @connect.login_from_cookie(hash)\n #\tif(!@id)\n #\t\t@connect = nil\n #\telse\n #\t\tlogin_from_session_ok = true\n #\t\t@me = true\n #\tend\n #end\n #unless(login_from_session_ok)\n @connect = Connect.new(login,pass)\n @id = @connect.login\n return @id unless @id\n @me = true\n #end\n\n self\n end", "def connection_for_application\n oauth_client.client_credentials.get_token\n end", "def login\n response = @session.create\n @auth_token = response[\"token\"]\n @rest.default_headers = { 'Content-Type' => 'application/json', 'Auth-Token' => @auth_token }\n response\n end", "def sessionGet(options = {})\n assert_valid_keys(options, :accessKey, :testMode, :sessionId)\n assert_keys_exists(options, :sessionId)\n execute(:sessionGet, options)\n end", "def connect\n raise ArgumentError unless (params[:fname] == '_opener')\n raise ArgumentError unless connect = ActiveSupport::JSON.decode(params[:session])\n\n @user = User.find_by_facebook_uid(connect['uid'])\n\n if @user.nil?\n # create a new user for the Facebook User if not present\n @user = User.new\n @user.facebook_uid = connect['uid']\n\n # XXX this is crap: login, country and email should be fetched from the facebook. Why?\n # because: login clashes could occur (if an user names itself fb_123456), the \"unknown\"\n # country is BAD design, because it's a corner case to cope with in views, and the fake\n # email is USELESS to send mewsic e-mail notifications to the user.\n #\n @user.login = \"fb_#{@user.facebook_uid}\" # XXX\n @user.country = \"unknown\" # XXX\n @user.email = \"#{@user.facebook_uid}@users.facebook.com\" # XXX\n\n @user.password = @user.password_confirmation = rand(2**32).to_s\n @user.save!\n end\n\n session[:fb_connect] = true\n self.current_user = @user\n\n # render the cross-domain communication channel\n render :layout => false\n\n rescue ActiveRecord::ActiveRecordError\n debugger\n head :forbidden\n\n rescue ArgumentError\n head :bad_request\n end", "def login(retries = 2)\n options = {\n 'body' => {\n 'userName' => @user,\n 'password' => @password,\n 'authLoginDomain' => @domain\n }\n }\n response = rest_post('/rest/login-sessions', options)\n body = response_handler(response)\n return body['sessionID'] if body['sessionID']\n raise ConnectionError, \"\\nERROR! Couldn't log into OneView server at #{@url}. Response: #{response}\\n#{response.body}\"\n rescue StandardError => e\n raise e unless retries > 0\n @logger.debug 'Failed to log in to OneView. Retrying...'\n return login(retries - 1)\n end", "def login\n \t\t response = @client.request :login do\n soap.body = { username: self.zconfig.user_name, password: self.zconfig.password}\n \t\t end\n \t\t response.to_hash\n \t \t self.session = response.to_hash[:login_response][:result][:session]\n end", "def login(username,password,quick=false)\n if (!username.kind_of?(String))\n raise ArgumentError, \"Expected String for username, but #{username.class} provided.\"\n end\n\n if (!password.kind_of?(String))\n raise ArgumentError, \"Expected String for password, but #{password.class} provided.\"\n end\n\n\n # open a socket to the server\n socket = open_socket()\n\n # make start packet\n header = TacacsPlus::TacacsHeader.new\n if (@session_id)\n header.session_id = @session_id\n else\n header.randomize_session_id!\n end\n body = TacacsPlus::AuthenticationStart.new\n body.action_login!\n body.authen_type_ascii!\n body.priv_lvl = 1\n body.user = username if (quick)\n\n session = ClientSession.new()\n session.request = PacketStruct.new(header,body)\n session.type = :authentication\n session.getuser = username\n session.getpass = password\n\n # process server dialog\n attempt = process_response(session, socket)\n\n return(attempt)\n end", "def start_session(endpoint); end", "def connect(options)\n # @api_client = establish_remote_appliance_connection(options)\n @api_client = establish_remote_appliance_connection(options.merge({:skip_verify_access_token => true, :skip_login => true}))\n @whoami_interface = @api_client.whoami\n end", "def authorize_client session_token\n base_url = \"#{APP_CONFIG['okta_base_url']}/oauth2/v1/authorize\"\n redirect_uri = \"#{APP_CONFIG['okta_openid_redirect_uri']}\"\n client_id = \"#{APP_CONFIG['okta_client_id']}\"\n scopes = [\"openid\", \"email\", \"groups\"].join(\"%20\")\n url = \"#{base_url}?sessionToken=#{session_token}&redirect_uri=#{redirect_uri}&response_type=id_token&client_id=#{client_id}&scope=#{scopes}&response_mode=fragment\"\n\n begin\n HttpClient.get(url)\n rescue HTTParty::RedirectionTooDeep => e\n open_id_token = e.response.header['location']\n end\n open_id_token.split('=').last\n end", "def login!\n session[:user_id] = @user.id\n end", "def connect\n\t\tif !@twitter && @active && password\n\t\t\tputs \"connecting\"\n\t\t\t\n\t\t\t@twitter = OSX::MGTwitterEngine.alloc.initWithDelegate(self)\n\t\t\[email protected] = true\n\t\t\[email protected]_password(@username,password)\n\t\tend\n\tend", "def connect\n \t\t#Se sigue la convencion para la identificacion del usuario\n \t\t#y buscamos alusuario que se intenta conectar\n \t\tself.current_user = find_user\n \tend", "def connect(silent = false)\n info \"starting ssh session to #{config.host}:#{config.port} ...\" unless silent\n options = { :port => config.port, :keys => [config.private_key_path] }\n @shell = Net::SSH.start(config.host, config.username, options).shell\n end", "def start_session\n generate_token(:token)\n setup_session\n update_last_session\n end", "def connect\n self.current_user = find_verified_user # define current_user property once user sucessfully connected\n end", "def get_session(options = {})\n get_session!(options)\n rescue Error::SessionsNotSupported\n nil\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n\n self.login = user_info['screen_name']\n self.twitter_name = user_info['name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def setup_session\n @session_id ||= if @smug_user.email\n setup_session_with_username\n else \n setup_session_anonymously\n end\n end", "def connect\n self.current_user = find_verified_user\n end", "def connect\n self.current_user = find_verified_user\n end", "def connect\n self.current_user = find_verified_user\n end", "def get_session\n @authenticator.get_session\n end", "def login\n #puts \"logging in with: \"+self.password\n begin\n response = self.pclient.request :login do\n #soap.body = { :username => self.username, :password => self.password }\n soap.body = '<ins0:username>'+self.username+'</ins0:username><ins0:password>'+self.password+'</ins0:password>'\n end\n rescue Savon::SOAP::Fault => fault\n raise Exception.new(fault.to_s)\n # TODO: handle incorrect password gracefully\n # if fault.to_s.include? \"INVALID_LOGIN\"\n # self.password = TextMate::UI.request_secure_string(\n # :title => \"MavensMate\", \n # :prompt => 'Your login attempt failed. Please re-enter your password',\n # :button2 => 'Cancel'\n # )\n # TextMate.exit_discard if self.password == nil\n # is_retry = true\n # login\n # else\n # raise Exception.new(fault.to_s)\n # end \n end\n \n # if is_retry == true\n # MavensMate.add_to_keychain(MavensMate.get_project_name, self.password)\n # end \n \n begin\n res = response.to_hash\n self.metadata_server_url = res[:login_response][:result][:metadata_server_url]\n self.sid = res[:login_response][:result][:session_id].to_s\n self.user_id = res[:login_response][:result][:user_id].to_s\n self.pclient.wsdl.endpoint = res[:login_response][:result][:server_url] \n rescue Exception => e\n #puts e.message \n end\n end", "def session_token\n @session_token ||= begin\n result = request :post, \"/merchant/#{merchant_id}/session\"\n if result.success?\n result.response['session']['id']\n else\n raise SessionTokenException.new, result.explanation\n end\n end\n end", "def login(host)\n # Set the timeout to 15 minutes\n @session_timeout = (Time.new.to_i + 900)\n\n login_headers = { 'referer' => \"https://#{@uri.host}/ipa/ui/index.html\", 'Accept' => 'application/json' }\n\n if @method == :keberose\n login_method = 'login_kerberos'\n gssapi = GSSAPI::Simple.new(@uri.host, 'HTTP')\n # Initiate the security context\n token = gssapi.init_context\n login_headers.merge!('Authorization' => \"Negotiate #{Base64.strict_encode64(token)}\", 'Content-Type' => 'application/json')\n login_request = { method: 'ping', params: [[], {}] }\n elsif @method == :user_pass\n login_method = 'login_password'\n login_headers.merge!('Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'text/plain')\n login_request = @credentials\n end\n\n login_uri = URI.parse(\"https://#{@uri.host}/ipa/session/#{login_method}\")\n\n resp = @http.post(login_uri, login_request, login_headers)\n\n return unless resp.status != 200\n\n # invalid passowrd could also mean invalid username\n puts \"HTTP #{resp.status.to_s + ':' + resp.reason} Error authenticating user: #{resp.headers['X-IPA-Rejection-Reason']}\"\n end", "def create_session\n @connection.create_session(@config || {})\n end", "def connect\n self.send({\n msg: :connect,\n version: @version,\n support: @support\n })\n\n #handle incoming response form the server\n self.onmessage = lambda do |event|\n\n res = JSON.parse(event.data)\n\n if res.has_key? 'session'\n #connection is successful - update session and record version\n @session = res['session'].to_s\n @@last_suc_version = @version\n\n else #there was a failed connection\n @version = res['version']\n #retry the send request with the version specified by the server\n self.send({\n msg: :connect\n version: @version,\n support: @support\n })\n end\n\n end\n end", "def do_authentication\n params.required(:id)\n params.required(:token)\n\n # Grab the device that is trying to authenticate\n unathenticated_error unless @api_consumer.is_a? Device\n device = @api_consumer\n\n @session = Session.find(params[:id])\n\n return handle_error('An authentication attemp has already been made against this session.', 'invalid_request_error', 406) unless @session.is_authenticated.nil?\n\n # Get the account for that device/service\n device_account = device.device_accounts(@session.service_id).first\n\n # Add the device's IP address to the session, regardless if the authentication is sucessful or not\n @session.device_ip_address = request.remote_ip\n @session.device = device\n\n if device_account\n begin\n # Create an verify key from the device's public key\n raise unless (verify_key = Crypto::VerifyKey.new(device_account.public_key, :hex))\n rescue\n return handle_error('A public key is not available for the device.', 'api_error', 500)\n end\n \n begin\n # Verify the provided token with the device's public key\n @session.is_authenticated = verify_key.verify(@session.token, params[:token], :hex)\n rescue\n # Unsuccessful authentication\n handle_error(\"Unsuccessful authentication.\", 'invalid_request_error', 401)\n end\n else\n handle_error('There is no account for this device with this service. You must register the device first to the service before authenticating.')\n end\n\n # Make sure we didn't mess up\n api_error_check && return\n\n @session.save\n end", "def get_session(options = {})\n resp = @connection.post do |req|\n req.headers = { :Accept => 'application/json'}\n req.url 'v1/sessions'\n req.body = options.to_json\n end\n check_response_for_errors resp.body\n end", "def open_session\n s = Session.wrap(Cproton.pn_session(@impl))\n s.open\n return s\n end", "def create_smite_api_session\n session_timestamp = Time.now.getutc.strftime(\"%Y%m%d%H%M%S\")\n session_string = \"#{ENV['SMITE_API_DEV_ID']}\" + 'createsession' + \"#{ENV['SMITE_API_AUTHKEY']}\" + session_timestamp\n session_signature = Digest::MD5.hexdigest(session_string)\n\n smite_session = RestClient.get(\"#{SMITE_PC_URL}/createsessionJson/#{ENV['SMITE_API_DEV_ID']}/#{session_signature}/#{session_timestamp}\")\n JSON.parse(smite_session)['session_id']\nend", "def create_session\n login, password = get_login_and_password\n create_session_with authenticate_user(login, password, :trace => true)\n end", "def login\n state_json = {\n redirect_url: params[:redirect_url],\n access_token: params[:access_token],\n ip: request.remote_ip\n }\n\n unless params[:mixpanel_id].blank?\n state_json.merge!(mp_id: params[:mixpanel_id])\n end\n\n encoded_state = LinkedAccount::Base.encode_state(state_json)\n\n case params[:provider]\n when 'github'\n redirect_to LinkedAccount::Github::User.oauth_url(scope: params[:scope], state: encoded_state)\n\n when 'facebook'\n redirect_to LinkedAccount::Facebook.oauth_url(scope: params[:scope], state: encoded_state)\n\n when 'twitter'\n redirect_to LinkedAccount::Twitter.oauth_url(scope: params[:scope], state: encoded_state)\n\n else render json: { error: 'Unsupported provider' }, status: :bad_request\n end\n end", "def login(speaker)\n token = SecureRandom.urlsafe_base64(20)\n speaker.session_token = token\n speaker.save\n session[:session_token] = token\n @current_speaker = speaker\n end", "def new_session(options={})\n if supports_sessions?\n api.rest_method('ADD_AUTHORIZATION', {\n :scope => 'session',\n :note => \"RHC/#{RHC::VERSION::STRING} (from #{Socket.gethostname rescue 'unknown'} on #{RUBY_PLATFORM})\",\n :reuse => true\n }, options)\n end\n end" ]
[ "0.66164184", "0.64917696", "0.63756776", "0.63701886", "0.6324099", "0.63041717", "0.62165165", "0.62163514", "0.6191902", "0.61862093", "0.61747026", "0.6160866", "0.614915", "0.61008275", "0.60882986", "0.60718054", "0.60709864", "0.59751415", "0.59738153", "0.5973302", "0.59621346", "0.5961064", "0.5957799", "0.5844359", "0.582246", "0.58041966", "0.58010715", "0.57709473", "0.5745172", "0.57296973", "0.5702396", "0.56993735", "0.56778556", "0.56714237", "0.5665782", "0.5639154", "0.5599109", "0.5594244", "0.5587142", "0.55849105", "0.55617505", "0.55545855", "0.55454403", "0.55427605", "0.55394465", "0.55331165", "0.5532661", "0.55260634", "0.5513886", "0.55130166", "0.5503983", "0.54882777", "0.54877156", "0.54744774", "0.54732186", "0.54670405", "0.54661524", "0.54651463", "0.54645836", "0.5447303", "0.54471415", "0.5445504", "0.5442687", "0.54322374", "0.542299", "0.54212826", "0.54180473", "0.54151785", "0.5413682", "0.5403961", "0.539637", "0.5391389", "0.5389824", "0.5380714", "0.5379505", "0.53742164", "0.5373146", "0.5370863", "0.53679574", "0.5366797", "0.5364402", "0.53636986", "0.53543794", "0.5353166", "0.5353166", "0.5353166", "0.5351283", "0.5343682", "0.53415114", "0.5334985", "0.53285563", "0.53257525", "0.53204805", "0.53171664", "0.53163177", "0.53097236", "0.53003114", "0.52986956", "0.529506", "0.5287743" ]
0.6722323
0
Open an application via the configured SmartView provider.
def open_app(server, app, cube) raise NotConnectedError, "No provider connection established" unless @session_id && @provider # Reset app state @dimensions = nil # Connect to application @logger.info "Opening cube #{app}.#{cube} on #{server}" @req.OpenApplication do |xml| xml.sID @session_id if @sso xml.sso @sso else xml.usr @user xml.pwd @password end xml.srv server xml.app app end invoke # Obtain an SSO token for subsequent use unless @sso @req.GetSSOToken do |xml| xml.sID @session_id end @sso = invoke.at('//res_GetSSOToken/sso').inner_html @password = nil # Don't remember password any longer than we need to end # Open cube @req.OpenCube do |xml| xml.sID @session_id xml.srv server xml.app app xml.cube cube end invoke @app = app @cube = cube # Get default POV default_pov end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def launch_app\n @bridge.launch_app\n end", "def open\n app = heroku.info(extract_app)\n url = app[:web_url]\n display \"Opening #{url}\"\n Launchy.open url\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n UIApplication.sharedApplication.openURL(url)\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n UIApplication.sharedApplication.openURL(url)\n end", "def open_in_viewer\n fork { exec \"#{Seee::Config.application_paths[:pdf_viewer]} \\\"#{current_path}\\\"\" }\n end", "def open_url(url)\n if RbConfig::CONFIG['host_os'] =~ /darwin/\n system %(open \"#{url}\")\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system %(xdg-open \"#{url}\")\n else\n puts 'Not Supported OS!'.red\n end\n end", "def launch(url)\n Java::limelight.Context.instance.os.launch(url)\n end", "def open\n require \"launchy\"\n\n Launchy.open(BASE_URL)\n end", "def launch_browser(url)\n case RUBY_PLATFORM\n when /darwin/\n system \"open\", url\n when /mswin|mingw|cygwin/\n system \"start\", url\n else\n system \"xdg-open\", url\n end\n end", "def open\n authorize! :open, @application\n @application.open\n respond_to do |format|\n if @application.save\n format.html { redirect_to @application, notice: 'Application was successfully opened.' }\n format.json { head :no_content }\n else\n format.html { redirect_to @application, flash: { error: 'Unable to accept opened.' } }\n format.json { render json: 'Unable to open application', status: :unprocessable_entity }\n end\n end\n end", "def launch(app_name, *options)\n options = combine_options(*options)\n \n compatible_call :launch, app_name, options\n end", "def open url\r\n command 'open', url_arg(url)\r\n end", "def open url\r\n command 'open', url_arg(url)\r\n end", "def open_window url, window_id\r\n command 'openWindow', url, window_id\r\n end", "def open_in_browser\n link = \"http://www.bandsintown.com/cities/pittsburgh-pa\"\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n system \"start #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n system \"open #{link}\"\n elsif RbConfig::CONFIG['host_os'] =~ /linux|bsd/\n system \"xdg-open #{link}\"\n end\n end", "def open_home_page\n open(configuration.browser_url)\n end", "def open_window(options = nil)\n window = terminal.make( :new => :terminal )\n window.launch_ :session => 'New session'\n end", "def open_url(url)\n url = NSURL.URLWithString(url) unless url.is_a?(NSURL)\n NSWorkspace.sharedWorkspace.openURL(url)\n end", "def browser_open_linux(url)\n system(\"xdg-open\", url)\n end", "def launch(app_name, *options)\n options = combine_options(*options)\n\n ensure_window = nil\n begin\n ensure_window = send(\"ensure_window_for_#{ app_name.downcase }\")\n rescue\n end\n ensure_window ||= \"\"\n\n positioning = nil\n begin\n positioning = send(\"positioning_for_#{ app_name.downcase }\")\n rescue\n end\n unless positioning\n if options[:to]\n pos = \"#{options[:to][:left]}, #{options[:to][:top]}\"\n dims = \"#{options[:to][:left] + options[:to][:width]}, \" +\n \"#{options[:to][:top] + options[:to][:height]}\"\n if options[:to][:width]\n positioning = \"set bounds of front window to {#{pos}, #{dims}}\"\n else\n positioning = \"set position of front window to {#{pos}}\"\n end\n end\n end\n\n execute_applescript(%Q`\n tell application \"#{app_name}\"\n activate\n #{ensure_window}\n #{positioning}\n end tell\n `)\n end", "def open_url(url)\n unless url.is_a?(NSURL)\n url = NSURL.URLWithString(url)\n end\n NSWorkspace.sharedWorkspace.openURL(url)\n end", "def open_window(options = nil)\n session_number = @konsole.currentSession\n session_object = @konsole_service.object(\"/Sessions/#{session_number}\")\n session_object.introspect\n session_object[\"org.kde.konsole.Session\"]\n end", "def launch_web\n if !File.exist? 'build/app.html'\n puts \"No web app built!\"\n exit\n end\n open_cmd = 'open'\n case RUBY_PLATFORM\n when /linux/\n open_cmd = \"xdg-#{open_cmd}\"\n when /mingw/\n open_cmd = \"start\"\n end\n system \"#{open_cmd} build/app.html\"\nend", "def open_command\n if RbConfig::CONFIG[\"host_os\"] =~ /mswin|mingw/\n \"start\"\n elsif RbConfig::CONFIG[\"host_os\"] =~ /darwin/\n \"open\"\n else\n \"xdg-open\"\n end\nend", "def browse(url)\n if RUBY_PLATFORM =~ /darwin/\n `open #{url}`\n elsif ENV['OS'] == 'Windows_NT' or\n RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i\n `start \"\" \"#{url}\"`\n end\n end", "def launch_web\n if !File.exists? 'build/app.html'\n puts \"No web app built!\"\n exit\n end\n open_cmd = 'open'\n case RUBY_PLATFORM\n when /linux/\n open_cmd = \"xdg-#{open_cmd}\"\n when /mingw/\n open_cmd = \"start\"\n end\n system \"#{open_cmd} build/app.html\"\nend", "def launch(app_name, options)\n ensure_window = nil\n begin\n ensure_window = movie.send(\"ensure_window_for_#{ app_name.downcase }\")\n rescue\n end\n ensure_window ||= \"\"\n\n positioning = nil\n begin\n positioning = movie.send(\"positioning_for_#{ app_name.downcase }\")\n rescue\n end\n unless positioning\n if options[:to]\n pos = \"#{options[:to][:left]}, #{options[:to][:top]}\"\n dims = \"#{options[:to][:left] + options[:to][:width]}, \" +\n \"#{options[:to][:top] + options[:to][:height]}\"\n if options[:to][:width]\n positioning = \"set bounds of front window to {#{pos}, #{dims}}\"\n else\n positioning = \"set position of front window to {#{pos}}\"\n end\n end\n end\n\n execute_applescript(%Q`\n tell application \"#{app_name}\"\n activate\n #{ensure_window}\n #{positioning}\n end tell\n `)\n end", "def open_command\r\n if RbConfig::CONFIG[\"host_os\"] =~ /mswin|mingw/\r\n \"start\"\r\n elsif RbConfig::CONFIG[\"host_os\"] =~ /darwin/\r\n \"open\"\r\n else\r\n \"xdg-open\"\r\n end\r\nend", "def application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)\n # attempt to extract a token from the url\n FBSession.activeSession.handleOpenURL(url)\n end", "def open()\n \n #note we would want to check for the browser being open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://store.mage.dev/admin\") #note this should be from setting file\n event(\"Post\")\n end", "def open_in_browser\n puts url\n `#{open} #{url}`\n end", "def browse(url)\n if RUBY_PLATFORM =~ /darwin/\n `open #{url}`\n elsif RUBY_PLATFORM =~ /linux/\n `#{ENV['BROWSER']} #{url}`\n elsif ENV['OS'] == 'Windows_NT' or\n RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i\n `start \"\" \"#{url}\"`\n end\n end", "def open_command\n if darwin?\n 'open'\n elsif windows?\n 'start'\n else\n 'xdg-open'\n end\n end", "def execute_app(app)\n $LOAD_PATH.unshift(Dir.pwd)\n Shoes.configuration.backend = :swt\n load app\n end", "def open\n # Opening the simulator with a specific UDID will boot the device\n if booted\n shutdown\n end\n sim = %x[/usr/bin/xcode-select -p].gsub(\"\\n\", \"/Applications/iOS Simulator.app\")\n %x[open -g -a '#{sim}' --args -CurrentDeviceUDID #{self.id}]\n sleep 0.5\n end", "def app_mgmt_launch_app(screen, app)\r\n\r\n if (app == \"Eclipse\")\r\n\t\tspawn(\"sudo #{Cosmos::USERPATH}/../eclipse/eclipse/eclipse\")\r\n elsif (app == \"AppGen\")\r\n\t\tspawn(\"java -jar #{CFS_KIT_GEN_APP_DIR}/CreateApp.jar\")\r\n elsif (app == \"APP_SUMMARY\")\r\n display(\"CFS_KIT APP_SUMMARY_SCREEN\",50,50)\r\n else\r\n prompt(\"Error in screen definition file. Undefined commmand sent to app_mgmt_launch_app()\")\r\n end\r\n\r\nend", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n run \"open #{url}\"\n else\n # Ubuntu\n run \"xdg-open #{url}\"\n end\n end\n end\n end", "def open_url(url)\n @ole.OpenURL(url)\n end", "def open_in_browser\n selection = @list_view.selection\n if iter = selection.selected\n selected_category = iter.parent[0]\n task_index = iter[3]\n url = todo_data.get_trac_url(task_index)\n Launchy.open(url)\n end\n end", "def click\n p [ :app_click ]\n view.click\n end", "def open_mx_source\n `open -a \"TextMate.app\" \"#{src}\";`\n end", "def open\n\t \texec 'open '+@params[0]\n\t end", "def show\n currentapp_initialize\n end", "def open_command\n darwin? ? 'open' : 'xdg-open'\n end", "def cfs_kit_launch_app(screen, app)\n\n\n if (app == \"UPDATE_TUTORIAL\")\n # An exception will report any errors \n if cfs_kit_create_tutorial_screen\n prompt (\"Successfuly created tutorial screen file #{tutorial_scr_file}\\nusing #{tutorial_def_file}\")\n end\n elsif (app == \"PROTO_APPP\")\n #TODO - Investigate generic text table editor or tutorial screen\n\t Cosmos.run_process(\"ruby lib/OskCfeFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/cfs_kit/file_server/cfe_es_syslog.dat'\")\n\t #Cosmos.run_process(\"ruby lib/OskTxtFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/test.json'\")\n #require 'osk_tbl_editor'\n #Cosmos.run_process(\"ruby lib/OskTblEditor\")\n\t #require 'cfs_fcx_cmdgen'\n #Cosmos.run_process(\"ruby lib/CfsFcxCmdGen\")\n #Cosmos.run_process(\"ruby tools/ConfigEditor\")\n #Cosmos::OskTblEditor.run\n #Cosmos.run_cosmos_tool('ConfigEditor')\n\n elsif (app == \"TUTORIAL\")\n cfs_kit_launch_tutorial_screen\n end\n\nend", "def browser_open_darwin(url)\n system(\"open\", \"-a\", \"chrome\", url)\n end", "def ask_to_open_in_browser(url)\n if RUBY_PLATFORM =~ /darwin|linux/i\n open_in_browser = ask \"Would you like to open it in your browser? \"\n if open_in_browser =~ /^y/i\n if RUBY_PLATFORM =~ /darwin/i\n # OS X\n `open #{url}`\n else\n # Ubuntu\n `xdg-open #{url}`\n end\n end\n end\n end", "def launch_url\n Rails.application.routes.url_helpers.launch_url(tool_client_id: client_id)\n end", "def resolve_app(application, sdfile=nil, params={})\n return @vespa.resolve_app(application, sdfile, params)\n end", "def open(browser, url=\"\")\n case browser\n when 'chrome'\n `open -a '/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome' #{url}`\n when 'firefox'\n `open -a 'Firefox' #{url}`\n when 'safari'\n `open -a 'Safari' #{url}`\n end\nend", "def open(*args)\n cmd = RUBY_PLATFORM.match(/darwin/) ? 'open' : 'xdg-open'\n open_with(cmd, *args)\n end", "def startApplication(app_name, show_std=true)\n if @app_contexts.find { |v| v.orig_name == app_name }\n run_application(app_name, show_std)\n else\n warn \"No application with name '#{app_name}' defined in group #{@name}. Nothing to start\"\n end\n end", "def launch_flow (engine_name, launch_item)\n\n e = lookup_engine engine_name\n\n raise \"couldn't find engine named '#{engine_name}'\" unless e\n\n if e.is_a? OpenWFE::Engine\n\n e.launch launch_item\n\n elsif e.is_a? OpenWFE::Participant\n\n e.consume launch_item\n\n else\n raise \\\n \"cannot launch a flow via something of \"+\n \"class #{e.class.name}\"\n end\n end", "def open\n addon = args.shift\n app_addons = heroku.installed_addons(app).map { |a| a[\"name\"] }\n matches = app_addons.select { |a| a =~ /^#{addon}/ }\n\n case matches.length\n when 0 then\n if heroku.addons.any? {|a| a['name'] =~ /^#{addon}/ }\n error \"Addon not installed: #{addon}\"\n else\n error \"Unknown addon: #{addon}\"\n end\n when 1 then\n addon_to_open = matches.first\n display \"Opening #{addon_to_open} for #{app}...\"\n Launchy.open \"https://api.#{heroku.host}/myapps/#{app}/addons/#{addon_to_open}\"\n else\n error \"Ambiguous addon name: #{addon}\"\n end\n end", "def view\n\t `ruby #{File.dirname(__FILE__) + \"/viewer/viewer.rb\"}`\n end", "def open_viewer(urn,access_token)\n path = File.expand_path(File.dirname(__FILE__))\n url = \"file://#{path}/viewer.html?token=#{access_token}&urn=#{urn}\"\n text_to_print_in_color = \"Please open the following url in your favorite browser:\\n#{url}\"\n puts(\"\\e[7m#{text_to_print_in_color}\\e[27m\")\n\nend", "def launch\n install\n\n # If the app is the same, install will not launch the simulator.\n # In order to launch the app, the simulator needs to be running.\n # launch_simulator ensures that the sim is launched and will not\n # relaunch it.\n launch_simulator\n\n tries = app_launch_retries\n\n RunLoop.log_debug(\"Trying #{tries} times to launch #{app.bundle_identifier} on #{device}\")\n\n last_error = try_to_launch_app_n_times(tries)\n\n if last_error\n raise RuntimeError, %Q[\nCould not launch #{app.bundle_identifier} on #{device} after trying #{tries} times:\n\n#{last_error}:\n\n#{last_error.message}\n\n]\n end\n\n wait_for_app_launch\n end", "def open_project(path)\n UI.puts \"Opening '#{path}'\"\n `open \"#{path}\"`\n end", "def open_window_with_action(win_name, action_name, *params)\n if LoadActions.include?(action_name) then\n raise(DesktopExceptions::UnsupportedActionException, \"Action #{action_name} not supported\")\n end\n \n wait_start\n opera_desktop_action(action_name, *params)\n wait_for_window_shown(win_name)\n end", "def start_view(view)\n\treturn true if File.directory?(view_dir(view))\n\tKernel.system(\"cleartool startview #{view} > nul 2>&1\")\n\treturn $? == 0\nend", "def open_url(term)\n Defcli.open_in_browser search_url(term, :api => false)\n end", "def open_team_turn_window\n @team_turn_window.open\n end", "def launch(app_id, args)\n runcmd 'launch', \"#{app_id} #{args}\" \n end", "def open_window_with_action(win_name, action_name, *params)\n if LoadActions.include?(action_name) then\n raise(DesktopExceptions::UnsupportedActionException, \"Action #{action_name} not supported\")\n end\n\n wait_start\n opera_desktop_action(action_name, *params)\n wait_for_window_shown(win_name)\n end", "def open_software\n \"Open #{software_name}\"\n end", "def open_software\n \"Open #{software_name}\"\n end", "def show_about_window_for app\n app.show_about_window\n end", "def launch(command={})\n action_view = \"android.intent.action.VIEW\"\n action_send = \"android.intent.action.SEND\"\n action_dial = \"android.intent.action.DIAL\"\n key_list = command.keys\n launch_intent = case\n when key_list.include?(:sms)\n sms_intent = Android::Content::Intent.new(action_view)\n sms_intent.setData(Android::Net::Uri.fromParts(\"sms\", command[:sms].to_s, nil))\n when key_list.include?(:email)\n email_intent = Android::Content::Intent.new(action_view)\n email_string = \"mailto:#{command[:email]}\"\n email_string += \"?subject=#{command[:subject].to_s}\"\n email_string += \"&body=#{command[:message].to_s}\"\n email_intent.setData(Android::Net::Uri.parse(email_string))\n when key_list.include?(:web)\n web_intent = Android::Content::Intent.new(action_view)\n web_intent.setData(Android::Net::Uri.parse(command[:web]))\n when key_list.include?(:tel)\n tel_intent = Android::Content::Intent.new(action_dial)\n tel_intent.setData(Android::Net::Uri.fromParts(\"tel\", command[:tel], nil))\n when key_list.include?(:chooser)\n message_intent = Android::Content::Intent.new(action_send)\n message_intent.type = \"text/plain\"\n message_intent.putExtra(\"android.intent.extra.TEXT\", command[:chooser].to_s) if command[:chooser]\n Android::Content::Intent.createChooser(message_intent, nil)\n else\n mp \"[BP Warning] Launch type unknown - '#{command.keys.inspect}'\"\n nil\n end\n\n find.activity.startActivity(launch_intent) if launch_intent\n end", "def open(item)\n `#{open_command} '#{item.url.gsub(\"\\'\",\"\\\\'\")}'`\n\n \"Boom! We just opened #{item.value} for you.\"\n end", "def open_root_page\n @selenium.open \"/#{@config.app_context}\"\n @selenium.wait_for_page_to_load\n end", "def open\n @is_running = true\n run_interpreter\n end", "def open_browser_with_search(url)\n Launchy.open(url)\nend", "def open_start\r\n\r\n @simulator = WIN32OLE.new('AutoItX3.Control')\r\n\r\n Dir.chdir(@sim_gui_path)\r\n Dir.pwd\r\n \r\n @simulator.Run(\"V4SingleSimulatorGUI.exe\")\r\n @simulator.WinWaitActive(\"Emerson (Copyright 2012)\")\r\n @simulator.ControlClick(\"Emerson (Copyright 2012)\",\"Remote Control on Port:\",\"WindowsForms10.BUTTON.app.0.bb8560_r15_ad11\")\r\n @simulator.Send(\"{F1}\")\r\n @simulator.WinWaitActive(\"Open\")\r\n @simulator.ControlSetText(\"Open\", \"\",\"Edit1\",@sim_path)\r\n @simulator.ControlClick(\"Open\",\"&Open\",\"Button1\")\r\n @simulator.WinWaitActive(\"SelectIPAddress\")\r\n @simulator.ControlClick(\"SelectIPAddress\",\"Select\",\"WindowsForms10.BUTTON.app.0.bb8560_r15_ad12\")\r\n \r\n #Start simulator\r\n @simulator.Send(\"{F5}\")\r\n\r\n end", "def open_random\n Defcli.open_in_browser random_url(:api => false)\n end", "def open_article(article_id)\n Launchy.open(Article.find(article_id).url)\nend", "def open\n html_url = url.sub('.json?', '?')\n Launchy.open(html_url)\n end", "def goto\n navigate_application_to \"Report=>Custom Views\"\n end", "def open_dialog_with_url(dialog_name, url)\n wait_start\n opera_desktop_action(\"Open url in new page\", url)\n # The loading of the page will happen first then the dialog will be shown\n wait_for_window_shown(dialog_name)\n end", "def open_dialog_with_url(dialog_name, url)\n wait_start\n opera_desktop_action(\"Open url in new page\", url)\n # The loading of the page will happen first then the dialog will be shown\n wait_for_window_shown(dialog_name)\n end", "def open_tab(options = nil)\n session_number = @konsole.newSession\n session_object = @konsole_service.object(\"/Sessions/#{session_number}\")\n session_object.introspect\n session_object[\"org.kde.konsole.Session\"]\n end", "def open_compare_page\n cli.copy_to_clipboard compare_url\n cli.open compare_url\n end", "def view(name, locator)\n define_method(name) do\n platform.click_view(locator)\n end\n end", "def open_session(iter)\n Msf::Ui::Gtk2::Console::Shell.new(iter)\n end", "def open_pachube_registration(*ignored_args)\n desktop = Desktop.getDesktop()\n uri = Java::JavaNet::URI.new(\"https://pachube.com/plans\")\n desktop.browse(uri)\n end", "def show()\n @view__.show\n self\n end", "def open_tab(options = nil)\n current_terminal.launch_ :session => 'New session'\n end", "def show\n Rails.application.executor.wrap { @access_token = @lms_instance.oauth2_url.present? ? Lti13Service::GetAgsAccessToken.new(@lms_instance).call : nil }\n # caliper event background job\n # ToolUseEventWorker.perform_async(@lms_instance.id, @launch.id, root_url, request.uuid)\n end", "def execute_app(app)\n load app\n end", "def open()\n \n #note we would want to check for the browser bing open already\n #so we don't annoy people\n \n event(\"Pre\")\n require 'launchy'\n Launchy.open(\"http://local.general.dev/info.php\") #note this should be from setting file\n event(\"Post\")\n end", "def launch\n\n user = session[:user]\n\n lp_id = params[:id]\n\n lp = begin\n\n LaunchPermission.find lp_id\n\n rescue Exception => e\n\n return error_redirect(\"launch permission not found\")\n end\n\n if not lp.may_launch(user)\n #\n # preventing URLs from being fed directly to the webapp\n\n return error_redirect(\"not authorized to launch : #{lp.url}\")\n end\n\n fei = nil\n\n begin\n\n #fei = $openwferu_engine.launch(url)\n\n li = OpenWFE::LaunchItem.new\n li.workflow_definition_url = lp.real_url\n li.launcher = user.name\n fei = $openwferu_engine.launch li\n\n flash[:notice] = \"launched process '#{fei.workflow_instance_id}'\"\n\n session[:launched_fei] = fei\n\n rescue Exception => e\n\n #flash[:notice] = \"failed to launch : #{e.to_s}\"\n\n raise e\n end\n\n sleep 0.777\n #\n # give some time for the engine to proceed and store a potential workitem\n # for this user (the user doing the launch)\n\n wi = OpenWFE::Extras::Workitem.find_just_launched fei.wfid, user.name\n\n if wi\n #\n # follow\n #\n redirect_to :controller => :workitem, :action => :edit, :id => wi.id\n else\n #\n # else, stay in the launchp view\n #\n redirect_to :action => :index\n end\n end", "def open\n if os_x?\n 'open'\n elsif linux?\n 'xdg-open'\n else\n raise \"Platform #{RUBY_PLATFORM} not supported\"\n end\n end", "def open_document(filename)\n case RUBY_PLATFORM\n when /darwin/\n system(\"open\", filename)\n when /linux/\n system(\"xdg-open\", filename)\n when /windows/\n system(\"cmd\", \"/c\", \"\\\"start #{filename}\\\"\")\n else\n Output.warning(:dont_know_how_to_open_resume)\n end\n end", "def show\n redirect_to settings_app_path(@app)\n end", "def app\n StevenWilkinDotCom\nend", "def open\n system(ENV['EDITOR'], NIKKI_FILE)\n end", "def open_data_screen\n open OpenDataScreen.new(nav_bar: true)\n # open HelpScreen.new(nav_bar: true)\n end", "def darwin_app_list\n Launchy.log \"#{self.class.name} : Using 'open' application on darwin.\"\n [ find_executable('open') ]\n end", "def open_url\n opts = [config.oui_full_url]\n opts << { 'User-Agent' => config.user_agent } if config.user_agent\n open(*opts).read\n rescue OpenURI::HTTPError\n ''\n end", "def show\n @app = App.find_by_id(params[:id])\n if (@app)\n Rabl.render(@app, 'api/apps/show', view_path: 'app/views')\n else\n render status: 401, json: {error: \"Invalid app\"}\n end\n end", "def app_with_name name\n AX::Application.new name\n end" ]
[ "0.6452501", "0.62408775", "0.5983889", "0.5983889", "0.59739333", "0.5931315", "0.59281135", "0.5878003", "0.58317566", "0.5740969", "0.5739149", "0.5651114", "0.5651114", "0.560409", "0.56026983", "0.5595554", "0.5594757", "0.5579299", "0.55691963", "0.5557053", "0.5515799", "0.5435146", "0.5422633", "0.5389939", "0.5388031", "0.53785324", "0.53486127", "0.5346435", "0.5326835", "0.5324774", "0.5323626", "0.5321237", "0.53133816", "0.5311019", "0.5287381", "0.5276612", "0.5266607", "0.5240736", "0.52366716", "0.52356195", "0.52238613", "0.52173865", "0.5211299", "0.5203101", "0.51995635", "0.5191768", "0.5191747", "0.51627135", "0.5161624", "0.5158957", "0.51526064", "0.513957", "0.5119546", "0.50896895", "0.5086807", "0.507339", "0.5060309", "0.5055536", "0.5040912", "0.5038557", "0.5035744", "0.501806", "0.50136936", "0.5008073", "0.5002025", "0.5002025", "0.49966097", "0.4993126", "0.49888656", "0.4979627", "0.49538487", "0.49444824", "0.49442896", "0.49358708", "0.4930751", "0.49230605", "0.49198252", "0.4904921", "0.4904921", "0.48788643", "0.48730946", "0.48487318", "0.48453665", "0.48444092", "0.48370355", "0.48191923", "0.48136336", "0.4811309", "0.47953", "0.4785009", "0.4777977", "0.4776691", "0.47600102", "0.47588918", "0.4751293", "0.47505894", "0.4749881", "0.47293478", "0.4715241", "0.47129107" ]
0.55792034
18
Close the connection to the current application cube.
def close_app if @session_id && @app @logger.info "Disconnecting from #{@app}.#{@cube}" @req.Logout do |xml| xml.sID @session_id end invoke @app = nil @cube = nil @dimensions = nil @default_pov = nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close()\n\t\[email protected]\n\t\t@connection = nil\n\tend", "def close\n inactive!\n close_connections\n end", "def close\n @ole_connection.Close\n end", "def close!\n live_queries = @volt_app.channel_live_queries[@channel]\n\n if live_queries\n live_queries.each do |live_query|\n live_query.remove_channel(@channel)\n end\n end\n\n @volt_app.channel_live_queries.delete(@channel)\n end", "def close()\n @connection.disconnect\n @connection = nil\n end", "def close\n\t\[email protected]\n\tend", "def close\n @conn.disconnect\n end", "def close\n @channel.close\n @conn.close\n end", "def close\n self.disconnect\n end", "def close\n @connection.close # Close the active mailbox\n @connection.logout # Send the logout command\n @connection.disconnect # Close the actual connection\n end", "def close_connection\n current_connection.logout if current_connection?\n current_connection = nil\n end", "def close\n @channel.close\n @connection.close\n end", "def close\n conn.write(\"(api-quit)\") if connected?\n rescue Errno::ECONNRESET\n ensure\n self.conn = nil\n end", "def close()\n if isConnected()\n if @sentConnect\n @sentConnect = false # set in connect()\n @signedOn=false # set in signOn() inside connect()\n bye = VistaRPC.new(\"#BYE#\", RPCResponse::SINGLE_VALUE, true)\n retval = execute(bye)\n @socket.close()\n @socket = nil\n @duz = \"0\"\n @lastvistaerror = nil\n @currentContext = nil\n return retval\n end\n end\n end", "def close\n end_session\n if connected? && connection.CloseConnection.nil?\n @connected = false\n @connection = nil\n Connection.connections = Connection.connections - [self]\n end\n return !@connected # Returns false if CloseConnection failed.\n end", "def disconnect\n @conn.close\n end", "def disconnect\n @conn.close\n end", "def disconnect\n @conn.close\n end", "def disconnect\n @conn.close\n end", "def close\n close_connection(CLOSED, true)\n end", "def close()\n @connected = false\n @my.close()\n @my = nil\n end", "def close_app\n @bridge.close_app\n end", "def close\n @client.session.close unless @client.session.closed?\n end", "def close\n @logger.debug(@host) { 'Closing session' }\n @transport.close\n @transport = nil\n end", "def close!\n\n\t @connected = false\n\t return nil\n\n\tend", "def close_connection\n @endpoint.close\n end", "def close\n @channels.each{|channel,omegle|\n omegle.send(\"You have been connected to a message bridge, which is now shutting down. Goodbye.\")\n omegle.disconnect\n }\n end", "def quit\n session.connection.close\n end", "def close\n @connection_manager.close\n end", "def on_close(env)\n @connection.destroy if @connection\n end", "def close\r\n\t\[email protected]\r\n\tend", "def close\r\n unbind\r\n # try to stop eventmachine loop\r\n EM.stop rescue\r\n @on_close.call if @on_close\r\n WinRM::Log.debug(\":session => :close\")\r\n end", "def close\n\n # nothing to do here.\n end", "def do_close\n @cluster.close\n close_encrypter\n end", "def close\n return unless @target\n\n target.reload\n target.close\n rescue *CONNECTION_CLEAR_ERRORS => e\n Karafka.monitor.notice_error(self.class, e)\n ensure\n @target = nil\n end", "def close\n @conn.close\n end", "def close\n @registry[:transport][:session].close if @open\n @open = false\n end", "def disconnect\n _logout\n @connection.close\n end", "def close_connections\n @connections.values.each(&:close)\n end", "def disconnect\n @conn.close\nend", "def disconnect; @connection.close end", "def game_close\n @console_delegate.close\n end", "def close()\r\n _dprint(\"Closing Auth_WiKID connection ...\")\r\n unless $sslsocket.nil?\r\n unless $sslsocket.closed?\r\n $sslsocket.puts(\"QUIT\");\r\n $sslsocket.flush\r\n $sslsocket.close\r\n end\r\n $sslsocket = nil\r\n @socket.shutdown\r\n end\r\n @isConnected = false\r\n end", "def close\n\n @redis.quit\n end", "def close\n @window.close\n end", "def C_CloseSession()\n @pk.C_CloseSession(@sess)\n self\n end", "def close\n @connection.close\n end", "def close\n @connection.close\n end", "def close\n @mutex.synchronize { @conn.close }\n end", "def close\n @mutex.synchronize { @conn.close }\n end", "def close\n stop_monitoring_connection\n close_connection\n end", "def close\n connection.close\n end", "def disconnect!\n @connection.close rescue nil\n end", "def close()\n # If we don't have one we don't do anything\n return if !@is_scproxy or !self.has_session?\n\n # Send the call to the master\n response = self.proxy_close :port => @port, :master => true\n\n # Did we close it?\n if response[\"status\"] == true\n # Clear our session\n @port = nil\n else\n # Show an error\n raise response[\"message\"]\n end\n end", "def disconnect\n @connection.close if connected?\n @connection = nil\n end", "def disconnect\n database.close if connected?\n @@connections[name][db_name] = nil\n end", "def close\n @connection.close\n end", "def close\n @connection.close\n end", "def close\n if connected? && @soap_client\n @soap_client.EndSession(@ticket)\n @soap_client.CloseConnection\n @soap_client = nil\n @ticket = nil\n end \n end", "def destroy\n connection.close\n end", "def close\n redis.disconnect!\n end", "def close\n close!\n end", "def close_connection\n @db.close if @db\n end", "def close\n #active record should do our connections for us so just set to nil\n @connection = nil\n # Remove this connection from the list of open connections.\n #@@open_connection = @@open_connections.reject { |c| c[:db_url] == @db_url }\n Log.instance.debug \"Disconnected from #@db_url\"\n end", "def close\n self\n end", "def close\n @session.connection.close\n end", "def close_connection\n @connection.close\n end", "def disconnect\n disconnect_all\n end", "def closed\n if @user && @room\n @user.remove_session\n @room = nil\n end\n end", "def close_connection\n @connection.expunge\n @connection.logout\n @connection.disconnect\n end", "def quit\n client.quit\n end", "def close\n\t\t\[email protected]\n\t\tend", "def close\n if @connection\n @connection.close unless @connection.closed?\n end\n @connection = nil\n end", "def close\n bridge.close\n end", "def closeMQTTConn()\n\n if ( !@mqtt_client.nil? )\n begin\n @mqtt_client.disconnect(send_msg = false)\n rescue Exception => e\n #ignore it\n end\n end\n end", "def disconnect\r\n @connection.close_connection\r\n @connection = nil\r\n end", "def Close\n end", "def disconnect\n @tcp_socket.close\n end", "def destroy_connection\r\n\tbegin\r\n\t\[email protected] if @sock\r\n\tensure\r\n\t\t@connected=false\r\n\tend\r\n end", "def close\n write_message(Vertica::Protocol::Terminate.new)\n ensure\n close_socket\n end", "def close\n client.close\n @client = nil\n end", "def close\n Processing::App.current = nil\n control_panel.remove if respond_to?(:control_panel) && !online?\n container = (@frame || JRUBY_APPLET)\n container.remove(self)\n self.destroy\n container.dispose\n end", "def quit()\n @ole.Quit()\n end", "def close\n # ..\n end", "def close\n info { \"closing connection\" }\n socket.shutdown\n end", "def disconnect\n OmfCommon.comm.disconnect\n end", "def disconnect\n self.remote.close\n end", "def close\n if self.conn && !self.conn.closed?\n self.conn.shutdown\n self.conn.close\n end\n\n self.conn = nil\n end", "def close\n @ios.each(&:close)\n end", "def disconnect\n @connection.logout\n end", "def close(context)\n context.debug('Logout connection')\n @connection_info = nil\n @client.logout\n @client = nil\n @system = nil\n end", "def close\n IBM_DB.close(@conn)\n end", "def close\n @database.close if @database\n end", "def close\n @database.close if @database\n end", "def close\n @cluster.close\n end", "def close\n @socket.close\n end", "def close\n ensure_session!\n\n session.release!\n end", "def close\n statement = \"close #{@name}\"\n @connection.exec(statement)\n end", "def close\n logger.info(self.class.name) { \"Just Before #{self} closes RabbitMQ channel!\" }\n channel.close\n logger.info(self.class.name) { \"Just After #{self} closes RabbitMQ channel!\" }\n end", "def close\n\n @db.connection.close\n end" ]
[ "0.67616844", "0.6703403", "0.670213", "0.66807425", "0.66695905", "0.6618604", "0.6584358", "0.6582413", "0.64775676", "0.64548224", "0.63691366", "0.63080263", "0.62713736", "0.62651277", "0.6244815", "0.624187", "0.624187", "0.624187", "0.624187", "0.6206425", "0.61956555", "0.6185712", "0.6157644", "0.6151993", "0.6129406", "0.61140794", "0.6092801", "0.6091951", "0.60614204", "0.60597193", "0.6046725", "0.60430855", "0.6040019", "0.60233593", "0.6009861", "0.60056794", "0.60027665", "0.60004425", "0.5994347", "0.5988926", "0.59884727", "0.59813845", "0.59798", "0.5975249", "0.59746116", "0.5971338", "0.59689164", "0.59689164", "0.5960667", "0.5960667", "0.5955176", "0.59482324", "0.59481716", "0.5945947", "0.59450525", "0.5941425", "0.5930254", "0.5930254", "0.5922176", "0.59198844", "0.591724", "0.59153146", "0.59120035", "0.5904138", "0.58986425", "0.58963525", "0.58909166", "0.5882612", "0.58818495", "0.58798844", "0.58789504", "0.5872915", "0.5870612", "0.5870525", "0.58647835", "0.5861208", "0.58555627", "0.5855204", "0.5842577", "0.58422524", "0.583957", "0.583546", "0.5829669", "0.5818154", "0.5816955", "0.58153296", "0.5807959", "0.5807059", "0.5803998", "0.58028895", "0.5800632", "0.5791453", "0.57837063", "0.57837063", "0.5777845", "0.57771266", "0.5776509", "0.57731074", "0.57666516", "0.57661843" ]
0.7440572
0
Retrieve a list of dimensions for the current connection.
def get_dimensions check_attached @logger.info "Retrieving list of dimensions" @req.EnumDims do |xml| xml.sID @session_id xml.alsTbl @preferences.alias_table end @dimensions = [] invoke.search('//res_EnumDims/dimList/dim').each do |dim| @dimensions[dim['id'].to_i] = dim['name'] end @dimensions end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dimensions\n @dimensions ||= extract_dimensions\n end", "def dimensions\n data[:dimensions]\n end", "def dimensions\n return @dimensions if @dimensions\n @dimensions = {}\n (raw['Dimensions'] || {}).each do |name, values|\n values = [values] unless Array === values\n @dimensions[name] = values.map{|value| Dimension.new(value)}\n end\n @dimensions\n end", "def get_dimensions\n @netcdf_elmt.getDimensions()\n end", "def dimensions()\r\n @dimensions ||= questions.inject([]) do |l, question|\r\n question_dimension = question.dimension\r\n l << question_dimension unless l.include?(question_dimension) or question_dimension == \"unknown\"\r\n l\r\n end\r\n end", "def dimensions\n dim = [width, height]\n def dim.to_s\n join 'x'\n end\n dim\n end", "def cols\n @dimension\n end", "def dimensions(*fields)\n @dimensions ||= ListParameter.new(:dimensions, [])\n @dimensions << fields\n end", "def dimensions\n [width,height]\n end", "def get_dimensions\n case @options[:style]\n when 'horizontal'\n [@colors.size, 1]\n when 'vertical'\n [1, @colors.size]\n end\n end", "def rows\n @dimension\n end", "def dimensions\n\t\t[@n,@m]\n\tend", "def dimensions\n height = count\n width = collect { |a| a.length }.max\n [width, height]\n end", "def dimensions(cube_unique_name)\n @dimensions = {} if @dimensions.nil?\n\n @dimensions[cube_unique_name] ||= cube(cube_unique_name).get_dimensions.map do |dimension|\n {\n :unique_name => dimension.get_unique_name,\n :name => dimension.get_caption,\n :children => true,\n :type => dimension.get_dimension_type.to_s.downcase.to_sym\n }\n end\n end", "def dimensions(*measurements)\n @measurements = measurements\n end", "def list_dimensions(alert_name, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['AlertName'] = alert_name\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/alerts/[AlertName]/dimensions'\n\t\targs[:query]['Action'] = 'ListDimensions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :page\n\t\t\targs[:query]['Page'] = optional[:page]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tself.run(args)\n\tend", "def measures\n @dimensions.describe\n end", "def dimensions\n self.coords.count\n end", "def dim\n [x, y, w, h]\n end", "def length\n @dim\n end", "def dimensions(n=0)\n n += 1\n self.first.is_a?(Array) ? self.first.dimensions(n) : n\n end", "def dimension\n map { |qnt, exp| qnt.dimension * exp }.reduce SY::Dimension.zero, :+\n end", "def dimensions\n dimensions = identify(:layer => 0, :format => \"%wx%h\").chomp.split(\"x\")\n { :x => dimensions[0].to_i,\n :y => dimensions[1].to_i }\n end", "def dimensions(val); @dimensions = val; self; end", "def dimension_names\n two_dimensions | three_dimensions\n end", "def dimensions\n eval_cexpression(\"tcb->ndices\")\n end", "def dimensions\n @array_specs.spec_dimensions\n end", "def get_dimensions(id, range)\n\t \n\t image = @user.images.find(id)\n\t time_frame = range+'_dim'\n\t dim_params = image.send(time_frame)\n\t time_frame2 = range+'_z'\n\t z_params = image.send(time_frame2)\n\t # get width and height dimensions \n\t @z_index = z_params\n\n\t if dim_params\n\t @con_width = dim_params.split(\",\")[0].to_i \n\t @con_height = dim_params.split(\",\")[1].to_i \n\t @width = dim_params.split(\",\")[0].to_i \n\t @height = dim_params.split(\",\")[1].to_i \n\t else\n\t \t@con_width = \"\" \n\t @con_height = \"\" \n\t @width = \"\" \n\t @height = \"\"\n\t end\n\tend", "def dimensions(style_name=nil)\n style_name ||= reflection.default_style\n if style_name.equal?(:original)\n original_width = from_examination(:@original_width)\n original_height = from_examination(:@original_height)\n [original_width, original_height]\n else\n resize_dimensions(dimensions(:original), reflection.styles[style_name])\n end\n end", "def cols\n @size\n end", "def list_custom_dimensions request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_dimensions_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Analytics::Admin::V1alpha::ListCustomDimensionsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def store_dimensions #:nodoc:\n record = 0x0200 # Record identifier\n length = 0x000E # Number of bytes to follow\n reserved = 0x0000 # Reserved by Excel\n\n row_min = @dim_rowmin.nil? ? 0 : @dim_rowmin\n row_max = @dim_rowmax.nil? ? 0 : @dim_rowmax + 1\n col_min = @dim_colmin.nil? ? 0 : @dim_colmin\n col_max = @dim_colmax.nil? ? 0 : @dim_colmax + 1\n\n # Set member data to the new max/min value for use by _store_table().\n @dim_rowmin = row_min\n @dim_rowmax = row_max\n @dim_colmin = col_min\n @dim_colmax = col_max\n\n header = [record, length].pack(\"vv\")\n fields = [row_min, row_max, col_min, col_max, reserved]\n data = fields.pack(\"VVvvv\")\n\n return prepend(header, data)\n end", "def dim\n @structure.dim\n end", "def convert_package_to_dimensions_array(_package)\n []\n end", "def global_dimensions\n [@cluster_by, @sequence_group_by].flatten.compact\n end", "def width\n @dimensions.x\n end", "def dimensions\n Vector2d.new(metadata[:width], metadata[:height]) if valid?\n end", "def dimensionality\n return nil if self.points.count == 0\n self.points.first.dimensions\n end", "def dimension\n raise Error::UnsupportedOperation, \"Method Geometry#dimension not defined.\"\n end", "def lengths\n\t\t#NArray.calculate_dimensions(self) # doesn't work for some weird reason\n\t\tdimensions == 1 ? [length] : [length, *self[0].lengths]\n\tend", "def to_a\n dimensions + metrics\n end", "def get_dimensions(alert_name, dimensions_id, project_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:path]['AlertName'] = alert_name\n\t\targs[:path]['DimensionsId'] = dimensions_id\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:pattern] = '/projects/[ProjectName]/alerts/[AlertName]/dimensions/[DimensionsId]'\n\t\targs[:query]['Action'] = 'GetDimensions'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tself.run(args)\n\tend", "def actual_dimensions(version = nil)\n if :original == version || [:original] == version\n version = nil\n elsif :fullsize == version || [:fullsize] == version\n version = fullsize_version\n end\n current_version = version.present? ? get_version(*version) : self\n path = current_version.path\n image = {}\n image = MiniMagick::Image.open(path) if File.exists?(path)\n [image[:width], image[:height]]\n end", "def custom_dimensions\n @custom_dimensions ||= {}\n end", "def dimensions(style = default_style)\n m = meta_for_style(style)\n w = m[:width]\n h = m[:height]\n \"#{w}#{h && \"x#{h}\"}\" if w || h\n end", "def width\n dimensions.first\n end", "def to_dimensions\n self.split(/x/).map { |s|\n if s.include?('-')\n s.split(/-/).map { |r| r.to_i }\n else \n s.to_i\n end \n } \n end", "def getDimensions\r\n @imageheights = @image.length\r\n @imagewidth = @image[0].length\r\n puts \"image dimensions are #{@imagewidth} by #{@imageheights}\"\r\n end", "def find_unlimited_dimension\n NetCDF::Dimension.new(@netcdf_elmt.getUnlimitedDimension())\n end", "def dimension\n @unit.to_s\n end", "def shape\n status = Tensorflow::Status.new\n port = c\n ndims = Tensorflow::TF_GraphGetTensorNumDims(operation.g.c, port, status.c)\n raise 'Operation improperly specified.' if status.code != 0\n # This should not be possible since an error only occurs if\n # the operation does not belong to the graph. It should not\n # be possible to construct such an Operation object.\n return nil if ndims < 0\n return [] if ndims == 0\n c_array = Tensorflow::Long_long.new(ndims)\n Tensorflow::TF_GraphGetTensorShape(operation.g.c, port, c_array, ndims, status.c)\n dimension_array = []\n (0..ndims - 1).each do |i|\n dimension_array.push(c_array[i])\n end\n dimension_array\n end", "def dim\n @indexes.size\n end", "def extract_dimensions\n return unless is_image?\n {original: 'image_dimensions', resized: 'resized_dimensions'}.each_pair do |style, method|\n tempfile = media.queued_for_write[style]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.send(\"#{method}=\", [geometry.width.to_i, geometry.height.to_i])\n end\n end\n end", "def connections\n attributes[:connections]\n end", "def getCols\n return @grid.getCols\n end", "def server_configurations\n response = get \"server_size\"\n response[\"server_sizes\"][\"server_size\"]\n end", "def dim\n composition_string\n end", "def dim\n composition_string\n end", "def ctx_groupby_dim\n dim_group={}\n all_contexts= context\n all_contexts=[all_contexts] unless all_contexts.is_a?(Array)\n all_contexts.each do |ctx|\n ctx.explicit_dimensions.each do |dim|\n dim_group[dim] = [] if dim_group[dim].nil?\n dim_group[dim] << ctx\n end\n end\n dim_group\n end", "def size\n [width, height]\n end", "def size\n [width, height]\n end", "def cols\n shape[1]\n end", "def extract_lense_dimensions\n tempfile = lense.queued_for_write[:original]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.lense_dimensions = [geometry.width.to_i, geometry.height.to_i]\n end\n end", "def size\n @column ? [@dim, 1] : [1, @dim]\n end", "def width\n dimensions()[:x]\n end", "def cols\n @cols\n end", "def width\n length * xdim\n end", "def width\n length * xdim\n end", "def for_file(file)\n io_string_for(file).dimensions\n end", "def width\n cols\n end", "def size=(dimension); end", "def extract_dimensions\n tempfile = file.queued_for_write[:original]\n unless tempfile.nil?\n geometry = Paperclip::Geometry.from_file(tempfile)\n self.dimensions = [geometry.width.to_i, geometry.height.to_i]\n end\n end", "def extract_dimensions_from_worksheets \n log.info \"Starting to extract dimensions from worksheets\" \n dimension_file = intermediate('Worksheet dimensions')\n extractor = ExtractWorksheetDimensions.new\n worksheets do |name, xml_filename|\n log.info \"Extracting dimensions for #{name}\"\n dimension_file.write name\n dimension_file.write \"\\t\"\n \n extractor.extract(xml(xml_filename), dimension_file)\n close(xml_filename)\n end\n close(dimension_file)\n end", "def dimensions_for(style)\n reprocess_for(style)\n file_dimensions[style.to_s]\n end", "def size\n width_pointer = FFI::MemoryPointer.new :int, 1\n height_pointer = FFI::MemoryPointer.new :int, 1\n XDo::FFILib.xdo_get_window_size @_xdo_pointer, @_window, width_pointer,\n height_pointer\n [width_pointer.read_int, height_pointer.read_int]\n end", "def length\n return @panels.length\n end", "def image_dimensions\n unless self.height && self.width\n self.height, self.width = file.calculate_geometry\n if persisted?\n self.update_column(:height, self.height)\n self.update_column(:width, self.width)\n end\n end\n [self.height, self.width]\n end", "def connections\n @connections.size\n end", "def connections\n @connections.size\n end", "def xdim\n @xdim || 1\n end", "def xdim\n @xdim || 1\n end", "def xdim\n @xdim || 1\n end", "def dimension_offer\n base_query.dimension_offer\n .includes(:sector, :weeks, :group, :school)\n end", "def window_width; QuestData::LIST_WINDOW_WIDTH; end", "def window_width; QuestData::LIST_WINDOW_WIDTH; end", "def media_sizes\n return @media_sizes\n end", "def parse_metric_dimensions str\n return nil if (str.nil? or str=='')\n dims = [nil,nil,nil]\n str.split('x').each do |dim|\n dim_cm = to_cm(parse_metric_length(dim))\n if (dim_cm != 0)\n dims[0] = dim_cm if dim.match(/w/i) \n dims[1] = dim_cm if dim.match(/[dl]/i)\n dims[2] = dim_cm if dim.match(/h/i) \n end\n end\n return dims unless dims.uniq == [nil]\n return nil\n end", "def dimensions(style = :original)\n @dimensions ||= {}\n return {} unless is_bitmap? && File.exist?(attachment.path(style))\n @dimensions[style] ||= [:width, :height].zip(FastImage.size(attachment.path(style))).to_h\n end", "def dimensions(path)\n mp4info_output(path).split(\"\\n\").each do |line|\n matches = /video.*\\s(\\d+)x(\\d+)\\s/.match line\n next if matches.nil?\n\n return [matches[1].to_f, matches[2].to_f]\n end\n [nil, nil]\n end", "def containers\n return @containers\n end", "def set_dimensions!\n # Silently return, if there's no `width` and `height`\n # Prevents old migrations from crashing\n return unless self.respond_to?(:width) && self.respond_to?(:height)\n\n geometry = extract_dimensions\n\n if geometry\n self.width = geometry.width.to_i\n self.height = geometry.height.to_i\n end\n end", "def extent\n @size.map{|i| i * @pixels}\n end", "def devices\n return @devices\n end", "def guilds\n @data['guilds']\n end", "def get_data(dimensions)\n data = []\n (0...@m).each do |row_idx|\n row = []\n col_idx = 1\n while col_idx <= dimensions\n row << @x_matrix[row_idx, col_idx]\n col_idx += 1\n end\n row << @y_vector[row_idx, 0]\n data << row\n end\n data\n end", "def find_dimension(name)\n NetCDF::Dimension.new(@netcdf_elmt.findDimension(name))\n end", "def device_identities\n return @device_identities\n end", "def size\n @axis_object.size\n end", "def get_storage_names\n @schemas = self.get_schema\n @schemas.map { |schema| schema['id'] }\n end", "def length\n grid_shape.length\n end" ]
[ "0.7612927", "0.7491795", "0.7119689", "0.7065461", "0.69859594", "0.6833041", "0.6635644", "0.65700686", "0.6449944", "0.63648355", "0.6354532", "0.62309235", "0.6223252", "0.62107784", "0.6142987", "0.61411935", "0.6124049", "0.6081948", "0.60598814", "0.60243237", "0.60033613", "0.5994005", "0.5970974", "0.5963621", "0.59500974", "0.59274346", "0.58915675", "0.5870701", "0.5843346", "0.58431846", "0.5835575", "0.57686734", "0.5765707", "0.57541335", "0.5738842", "0.5695927", "0.5658593", "0.5639363", "0.56151867", "0.55939627", "0.55343187", "0.5516798", "0.5506337", "0.5503924", "0.55019504", "0.5454372", "0.5436658", "0.5428855", "0.54064393", "0.53799516", "0.5363767", "0.5337965", "0.532918", "0.5322162", "0.5317419", "0.5307059", "0.52968836", "0.52968836", "0.5286768", "0.5283964", "0.5283964", "0.527936", "0.51890653", "0.5181131", "0.5180477", "0.51622033", "0.5150246", "0.5150246", "0.5150054", "0.5148051", "0.51452345", "0.514267", "0.5136609", "0.5110415", "0.5097366", "0.5071023", "0.50630695", "0.5055557", "0.5055557", "0.5053452", "0.5053452", "0.5053452", "0.50233686", "0.50137013", "0.50137013", "0.5010763", "0.5005252", "0.49926266", "0.4992432", "0.49686486", "0.4968286", "0.4964076", "0.49630702", "0.49589851", "0.49566156", "0.4952993", "0.4951337", "0.49446854", "0.49329123", "0.491387" ]
0.8324431
0
Returns a list of available member filters for the specified dimension. A filter can be used to restrict a member query to a certain subset of members, such as the members in a member list.
def get_filters(dimension, force = false) check_attached if @fiters && @filters[dimension] && !force @logger.debug "Retrieving filters for #{dimension} from cache" filters = @filters[dimension] else @logger.info "Retrieving list of available member filters for #{dimension}" @req.EnumFilters do |xml| xml.sID @session_id xml.dim dimension end filters = [] invoke.search('//res_EnumFilters/filterList/filter').each do |filter| filters << Filter.new(filter) end @filters = {} unless @filters @filters[dimension] = filters end filters end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_members(dimension, filter_spec = nil, all_gens = true)\n check_attached\n\n @logger.info \"Retrieving list of members for #{dimension}\"\n filter_name, filter_args = process_filter(dimension, filter_spec)\n @req.EnumMembers do |xml|\n xml.sID @session_id\n xml.dim dimension\n xml.memberFilter do |xml|\n xml.filter('name' => filter_name) do |xml|\n insert_filter_args xml, filter_args\n end\n end\n xml.getAtts '0'\n xml.alsTbl @preferences.alias_table\n xml.allGenerations all_gens ? '1' : '0'\n end\n doc = invoke\n members = doc.at('//res_EnumMembers/mbrs').to_plain_text.split('|')\n members\n end", "def filters\n mentos(:get_all_filters)\n end", "def get_team_filters\n filters = []\n self.feed_teams.each do |ft|\n if ft.sharing_enabled?\n filters << ft.filters.to_h.reject{ |k, _v| PROHIBITED_FILTERS.include?(k.to_s) }.merge({ 'team_id' => ft.team_id })\n end\n end\n filters\n end", "def available_filters\n unless @available_filters\n initialize_available_filters\n @available_filters.each do |field, options|\n options[:name] ||= l(options[:label] || \"field_#{field}\".gsub(/_id$/, ''))\n end\n end\n @available_filters\n end", "def list_filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters.keys\n end", "def filter(arg, members)\n begin\n rescue\n members = []\n end\n\n return members\n end", "def set_filters\n @filters = []\n section_ids = Section.pluck(:id)\n\n [:ministers, :departments].each do |filter_type|\n if params[filter_type].present?\n id_list = params[filter_type].map(&:to_i)\n\n id_list.reject! do |item|\n !section_ids.include? item\n end\n\n @filters += Section.where(id: id_list)\n end\n end\n end", "def filters\n if @filters.empty?\n fetch_configuration()\n end\n return @filters\n end", "def filters\n if metaclass.method_defined? :_filters\n self._filters\n else\n []\n end\n end", "def lookup_user_filters(miq_group)\n filters = miq_group.try!(:get_filters).try!(:dup) || {}\n filters[\"managed\"] ||= []\n filters[\"belongsto\"] ||= []\n filters\n end", "def filters\n unless (@filters)\n @filters = {}\n return @filters unless @params[:f_inclusive]\n @params[:f_inclusive].each_pair do |field, value_hash|\n value_hash.each_pair do |value, type|\n @filters[field] ||= []\n @filters[field] << value\n end\n end \n end\n return @filters\n end", "def filters\n # Call model column on self (metadata since element in array is a string, not a variable hence we use send) <=> self.send(profile) == true\n %w[sight_seeing_adventurer art_lover serial_shopper nature_lover food_addict sport_lover history_passionate tech_fan relaxed city_wanderer].select! {|profile| send(profile) == true }\n end", "def filters\n end", "def whitelisted_filters_for(name, klass)\n requested_parameters = as_array(@params[name])\n if requested_parameters.empty?\n []\n else\n klass.where(slug: requested_parameters)\n end\n end", "def allowed_filters\n []\n end", "def filters\n\t\t@filters_array = Array(@profile[:filters]) unless(@filters_array)\n\t\t@filters_array.each do |filter|\n\n\t\t\tif respond_to?( \"filter_#{filter}\" )\n\t\t\t\[email protected] do |field|\n\t\t\t\t\t# If a key has multiple elements, apply filter to each element\n\t\t\t\t\t@field_array = Array( @form[field] )\n\n\t\t\t\t\tif @field_array.length > 1\n\t\t\t\t\t\t@field_array.each_index do |i|\n\t\t\t\t\t\t\telem = @field_array[i]\n\t\t\t\t\t\t\t@field_array[i] = self.send(\"filter_#{filter}\", elem)\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tif not @form[field].to_s.empty?\n\t\t\t\t\t\t\t@form[field] = self.send(\"filter_#{filter}\", @form[field].to_s)\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\t\t@form\n\tend", "def get_feed_filters\n filters = self.filters.to_h.reject{ |k, _v| PROHIBITED_FILTERS.include?(k.to_s) }\n filters.merge!({ 'report_status' => ['published'] }) if self.published\n filters\n end", "def get_filters(object)\n if @options[:using].is_a?(Array)\n gen_array_attribute_filters(object, @options[:using])\n else\n gen_map_attribute_filters(object, @options[:using])\n end\n end", "def get_filters\n session[:instances_filters]\n end", "def get_filters\n session[:instances_filters]\n end", "def get_report_filters()\n return MicrosoftGraph::DeviceManagement::Reports::GetReportFilters::GetReportFiltersRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def filters\n self.class.filters\n end", "def find_member(dimension, pattern, filter_spec = nil)\n check_attached\n\n @logger.info \"Finding members of #{dimension} matching '#{pattern}'\"\n filter_name, filter_args = process_filter(dimension, filter_spec)\n @req.FindMember do |xml|\n xml.sID @session_id\n xml.dim dimension\n xml.mbr pattern\n xml.filter 'name' => filter_name do |xml|\n insert_filter_args xml, filter_args\n end\n xml.alsTbl @preferences.alias_table\n end\n doc = invoke\n path_list = []\n doc.search('//res_FindMember/pathList/path').each do |path|\n path_list << path.at('mbrs').to_plain_text.split('|')\n end\n path_list\n end", "def acceptable_filter_scopes\n []\n end", "def filtered(collection, filter)\n collection.grep_v(FILTERS.fetch(filter, FILTERS[:default]))\n end", "def all\n @filters\n end", "def usage_filters\n get('/1/reporting/filters').to_a\n end", "def filters; end", "def filters; end", "def custom_filters(scope)\n scope\n end", "def filter *filters\n spawn :@filters, @filters + parse_filter_input(filters)\n end", "def filters\n @filters ||= {}\n end", "def filters\n @filters ||= {}\n end", "def parse_filters(params)\n if params['filters'].blank?\n Utilities::Geo::REGEXP_COORD.keys\n else\n params.permit(filters: [])[:filters].map(&:to_sym)\n end\n end", "def retrieve_members\n @root_member = nil\n @members = []\n shared = []\n @member_lookup = {}\n log.finer \"Retrieving members of dimension '#{@name}'\"\n alias_tbls = try{ @cube.get_alias_table_names.to_a }\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n spec = %Q{@IDESCENDANTS(\"#{self.name}\")}\n query = <<-EOQ.strip\n <OutputType Binary\n <SelectMbrInfo(MemberName, MemberAliasName, ParentMemberName,\n MemberGeneration, MemberLevel, Consolidation,\n ShareOption, MemberFormula, UDAList)\n EOQ\n @cube.instrument 'retrieve_members', dimension: self do\n try{ mbr_sel.execute_query(query, spec) }\n end\n mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = Member.new(self, ess_mbr, alias_tbls)\n @members << mbr\n if mbr.shared?\n shared << mbr\n else\n @member_lookup[mbr.name.upcase] = mbr\n end\n end\n # Link shared members to non-shared member (and vice versa)\n shared.each do |smbr|\n mbr = @member_lookup[smbr.name.upcase]\n smbr.instance_variable_set(:@non_shared_member, mbr)\n mbr.instance_variable_get(:@shared_members) << smbr\n end\n @root_member = @member_lookup[self.name.upcase]\n # Convert parent names to references to the parent Member object\n # This can only be done after we've seen all members, since the\n # member selection query returns parents after children\n @members.each do |mbr|\n par = @member_lookup[mbr.parent.upcase]\n mbr.instance_variable_set(:@parent, par)\n par.instance_variable_get(:@children) << mbr if par\n end\n ensure\n try{ mbr_sel.close }\n end\n log.finer \"Retrieved #{@members.size} members\"\n end", "def filtered_dataset\n filter_args_from_query.inject(@dataset) do |filter, cond|\n filter.filter(cond)\n end\n end", "def filter!(filters, options={})\n node_list = filter(filters, options)\n Util::assert! node_list.any?, \"Could not match any nodes from '#{filters.join ' '}'\"\n return node_list\n end", "def filtering_params(params)\n params.slice(:role, :query)\n end", "def filter\n do_authorize_class\n\n filter_response, opts = Settings.api_response.response_advanced(\n api_filter_params,\n Access::ByPermission.dataset_items(current_user, dataset_id: params[:dataset_id]),\n DatasetItem,\n DatasetItem.filter_settings(:reverse_order)\n )\n\n respond_filter(filter_response, opts)\n end", "def filter_group query_params, *types\n types = [:select, :scope, :date_range, :search] if types.empty?\n query_params.filters.each do |field, config|\n type = config[:type]\n concat render_filter(query_params, field, type) if types.include?(type || :search)\n end\n end", "def filters\n [\n [\"Id\", \"id\"],\n [\"Added By\", \"created_by\"], \n [\"Updated By\", \"updated_by\"]\n ]\n end", "def filters\n unless @filters\n @filters = {}\n return @filters unless @params[:f_inclusive] && @params[:f_inclusive].respond_to?(:each_pair)\n @params[:f_inclusive].each_pair do |field, value_array|\n @filters[field] ||= value_array.dup\n end\n end\n @filters\n end", "def search_filters(query) #:nodoc:\n filters = []\n query.conditions.each do |operator, attribute, value|\n next unless attribute.kind_of? Sphinx::Attribute\n filters << case operator\n when :eql, :like then attribute.filter(value)\n when :not then attribute.filter(value, false)\n else raise NotImplementedError.new(\"Sphinx: Query attributes do not support the #{operator} operator\")\n end\n end\n filters\n end", "def results\n\t\tcase @field\n\t\twhen nil\n\t\t\treturn Membership.all\n\t\t# Member only fields\n\t\twhen :first_name, :last_name\n\t\t\tscope = (\"members_\" + @field.to_s + \"_like\").to_sym\n\t\t\tresults = Membership.member_field_like(@field, @query)\n\t\t# Member or Membership fields\n\t\twhen :email, :phone\n\t\t\tresults = Membership.member_or_membership_field_like(@field, @query)\n\t\t# Membership only fields\n\t\twhen :address\n\t\t\tresults = Membership.address_like(@query)\n\t\twhen :number\n\t\t\tresults = Membership.where(:number => @query)\n\t\twhen :renewal_date\n\t\t\t#debugger\n\t\t\tresults = Membership.renewal_date_between(@query)\n\t\twhen :complex\n\t\t\tresults = eval(\"Membership.\" + @query)\n\t\tend\n\t\treturn results.order(:number.asc)\n\tend", "def apply_filtering(collection)\n @filters = Question.get_advanced_filter_collection(collection,true,'click')\n Question.filtering_scopes.each do |scope|\n collection = collection.filter_by(scope, filter_params[scope], \"email\") unless filter_params[scope].blank?\n end\n return collection\n end", "def prepare_orm_filters\n filters = [[]]\n date_format = I18n.t(:\"date.formats.default\", {:locale => I18n.locale })\n self.data_grid.columns.each_with_index do |col, col_index|\n if col.filter and !col.filter_value.blank?\n case col.filter\n when :boolean\n filters[0] << \"#{col.filter_by} = ?\"\n filters << (col.filter_value == '1') ? true : false\n when :auto\n filters[0] << \"#{col.filter_by} = ?\"\n filters << col.filter_value\n when :text\n filters[0] << \"#{col.filter_by} #{ActiveRecord::Base.connection.adapter_name.downcase.to_sym == :postgresql ? 'ILIKE' : 'LIKE'} ?\"\n filters << \"%#{col.filter_value}%\"\n when :number\n filters[0] << \"#{col.filter_by} = ?\"\n filters << col.filter_value.to_i\n when :range\n range = col.filter_value.split(DataGrid.range_separator)\n\n if !range[0].blank? and !range[1].blank?\n begin\n range[0] < 2\n rescue\n range[0] = range[0].to_f\n range[1] = range[1].to_f\n end\n filters[0] << \"#{col.filter_by} >= ? AND #{col.filter_by} <= ?\"\n filters << range[0]\n filters << range[1]\n elsif range[0].blank? and !range[1].blank?\n begin\n range[1] < 2\n rescue\n range[1] = range[1].to_f\n end\n filters[0] << \"#{col.filter_by} <= ?\"\n filters << range[1]\n elsif range[1].blank? and !range[0].blank?\n begin\n range[0] < 2\n rescue\n range[0] = range[0].to_f\n end\n filters[0] << \"#{col.filter_by} >= ?\"\n filters << range[0]\n end\n\n when :date\n range = col.filter_value.split(DataGrid.range_separator)\n\n if !range[0].blank? and !range[1].blank?\n begin\n range[0] < 2\n rescue\n range[0] = DateTime.strptime(range[0], date_format)\n range[1] = DateTime.strptime(range[1], date_format)\n end\n filters[0] << \"#{col.filter_by} >= ? AND #{col.filter_by} <= ?\"\n filters << range[0]\n filters << range[1]\n elsif range[0].blank? and !range[1].blank?\n begin\n range[1] < 2\n rescue\n range[1] = DateTime.strptime(range[1], date_format)\n end\n filters[0] << \"#{col.filter_by} <= ?\"\n filters << range[1]\n elsif range[1].blank? and !range[0].blank?\n begin\n range[0] < 2\n rescue\n range[0] = DateTime.strptime(range[0], date_format)\n end\n filters[0] << \"#{col.filter_by} >= ?\"\n filters << range[0]\n end\n end\n end\n end\n \n filters[0] = filters[0].join(' AND ')\n filters\n end", "def filter(column, options={}, &block)\n @filters ||= []\n @filters << Filter.new(@params, column, options, &block)\n end", "def filters\n @filters ||= FiltersProvider.new\n end", "def filter\n do_authorize_class\n get_project_if_exists\n do_authorize_instance(:show, @project) unless @project.nil?\n\n filter_response, opts = Settings.api_response.response_advanced(\n api_filter_params,\n list_permissions,\n Site,\n Site.filter_settings\n )\n respond_filter(filter_response, opts)\n end", "def filter!(filters)\n node_list = filter(filters)\n Util::assert! node_list.any?, \"Could not match any nodes from '#{filters}'\"\n return node_list\n end", "def typus_filters\n\n fields_with_type = ActiveSupport::OrderedHash.new\n\n if self.respond_to?('admin_filters')\n fields = self.admin_filters\n else\n return [] unless Typus::Configuration.config[self.name]['filters']\n fields = Typus::Configuration.config[self.name]['filters'].split(', ').collect { |i| i.to_sym }\n end\n\n fields.each do |field|\n attribute_type = self.model_fields[field.to_sym]\n if self.reflect_on_association(field.to_sym)\n attribute_type = self.reflect_on_association(field.to_sym).macro\n end\n fields_with_type[field.to_s] = attribute_type\n end\n\n return fields_with_type\n\n end", "def category_filter_groups\n return @category_filter_groups\n end", "def filter_for(meth, names_and_ids, session_filters, label = nil)\n label ||= _(meth.to_s.humanize.titleize)\n default = _('[Any %s', label)\n\n session_filters ||= {}\n selected = session_filters[meth] || []\n selected = names_and_ids.select { |name, id| selected.include?(id.to_s) }\n\n res = query_menu(\"filter[#{ meth }]\", names_and_ids, label)\n res += selected_filter_values(\"filter[#{ meth }]\", selected, label)\n\n return res\n end", "def all_filters(**args)\n params = parameters(args) do\n optional_params :type\n end\n request(:get, 'filters', params)\n end", "def gated_discovery_filters(permission_types = discovery_permissions, ability = current_ability)\n return [] if ability.admin?\n super\n end", "def build_filter filters, fields\n filters = [filters] unless filters.is_a? Array\n where = [Array.new(filters.count, associations_to_tables(fields).map { |f| \"#{f} LIKE ?\" }.join(\" || \")).join(\" || \")]\n filters.each do |filter|\n fields.count.times { |n| where << \"%#{filter}%\" }\n end\n where\n end", "def filters= options = {}\n prominent = [ :eid, :url ]\n narrowing = options.keys & Ydl::Videos.columns - prominent\n @filters = { prominent: prominent, narrowing: narrowing }\n end", "def filter\n filter = \"\"\n\n filter = filter_by_user\n filter += filter_by_status\n filter += filter_by_milestones_projects_and_customers\n filter += filter_by_properties\n\n if session[:hide_deferred].to_i > 0\n filter << \"(tasks.hide_until IS NULL OR tasks.hide_until < '#{@tz.now.utc.to_s(:db)}') AND \"\n end \n filter << \"(tasks.milestone_id NOT IN (#{@completed_milestone_ids}) OR tasks.milestone_id IS NULL) AND \"\n\n filter = filter.gsub(/( AND )$/, \"\")\n return filter\n end", "def filter(name, function)\n filters = (self.model.design_doc['filters'] ||= {})\n filters[name.to_s] = function\n end", "def matching_facets_and_filters\n facets_and_filters = []\n search_facets.each do |search_facet|\n facet = { id: search_facet.identifier, filters: [], db_facet: search_facet }\n filter_query = facet_filters.detect { |f| f.starts_with?(search_facet.identifier) }\n filter_query.split(':').last.split('|').each do |filter|\n matching_filter = search_facet.filters.detect { |f| f[:id] == filter }\n facet[:filters] << matching_filter if matching_filter.present?\n end\n facets_and_filters << facet if facet[:filters].any?\n end\n facets_and_filters\n end", "def filters\n [\n GoHiring::SlackMarkdown::Filters::MergeMethodFilter,\n GoHiring::SlackMarkdown::Filters::HeaderFilter,\n GoHiring::SlackMarkdown::Filters::EmptyBlockFilter,\n GoHiring::SlackMarkdown::Filters::BlockBreakerFilter\n ]\n end", "def filter_parameters\n if @filter_parameters\n @filter_parameters || []\n else\n defined?(Rails) && Rails.application.config.filter_parameters\n end\n end", "def filters\n @filters ||= {}\n end", "def available_filters_as_json\n json = {}\n available_filters.each do |field, options|\n json[field] = options.slice(:type, :name, :values).stringify_keys\n end\n json\n end", "def available_filters_as_json\n json = {}\n available_filters.each do |field, options|\n json[field] = options.slice(:type, :name, :values).stringify_keys\n end\n json\n end", "def default_metric_filters()\n return @metric_filters\n end", "def filter(filters)\n if filters.empty?\n return nodes\n end\n if filters[0] =~ /^\\+/\n # don't let the first filter have a + prefix\n filters[0] = filters[0][1..-1]\n end\n\n node_list = Config::ObjectList.new\n filters.each do |filter|\n if filter =~ /^\\+/\n keep_list = nodes_for_name(filter[1..-1])\n node_list.delete_if do |name, node|\n if keep_list[name]\n false\n else\n true\n end\n end\n else\n node_list.merge!(nodes_for_name(filter))\n end\n end\n return node_list\n end", "def filter(filtering_params)\n\t\t\tresults = self.where(nil)\n\t\t\tfiltering_params.each do |key, value|\n\t\t\t\tresults = results.public_send(key, value) if value.present?\n\t\t\tend\n\t\t\tresults\n\t\tend", "def filter_clause\n @filters[filter % @filters.size] unless @filters.size.zero?\n end", "def get_filter_values\n facet_filters.map { |facet_data| facet_data.split(':').last.split(',')}.flatten\n end", "def check_capabilities(filter)\n capabilities = ddl.discovery_interface[:capabilities]\n\n unless capabilities.include?(:classes)\n raise \"Cannot use class filters while using the '%s' discovery method\" % discovery_method unless filter[\"cf_class\"].empty?\n end\n\n unless capabilities.include?(:facts)\n raise \"Cannot use fact filters while using the '%s' discovery method\" % discovery_method unless filter[\"fact\"].empty?\n end\n\n unless capabilities.include?(:identity)\n raise \"Cannot use identity filters while using the '%s' discovery method\" % discovery_method unless filter[\"identity\"].empty?\n end\n\n unless capabilities.include?(:compound)\n raise \"Cannot use compound filters while using the '%s' discovery method\" % discovery_method unless filter[\"compound\"].empty?\n end\n end", "def fields(filter = nil)\n unless filter\n # Since we're returning the FieldMap object, which the caller\n # may mutate, we precautionarily mark dirty -- unless it's frozen\n # immutable.\n @fields.clean = false unless @fields.frozen?\n return @fields\n end\n @fields.reindex unless @fields.clean\n flds = []\n if filter.is_a?(String) && @fields.tags[filter]\n @fields.tags[filter].each do |idx|\n flds << @fields[idx]\n end\n elsif filter.is_a?(Array) || filter.is_a?(Range)\n @fields.each_by_tag(filter) do |tag|\n flds << tag\n end\n end\n flds\n end", "def list_filter_authorized?\n authorized_for?(:action => :read)\n end", "def liquid_filters\n [\n DesignResourceFilter,\n AttributeFilter\n ]\n end", "def get_filters_sql\n if self.filters.blank?\n return ''\n else\n conditions = JSON.parse self.filters\n sql_array = []\n conditions.each do |condition|\n if condition['values']\n values = condition['values'].map{|x| \"'#{x}'\"}.join(',')\n sql_array << \" #{condition['name']} in (#{values})\"\n else\n sql_array << \" #{condition['name']} between #{condition['from']} and #{condition['to']}\"\n end\n end\n sql_array.join(' AND ')\n end\n end", "def members\n _members = []\n time = Benchmark.measure do\n _members = Rails.cache.fetch(\"group/#{id}/members/#{updated_at.to_f}\") do\n Person.where(id: (memberships.pluck(:entity_id) + rule_member_ids).uniq)\n end\n end\n\n Rails.logger.warn \"Group.members for group with ID #{id} took #{time.real}\" if time.real > 0.50\n\n return _members\n end", "def list(*_filters)\n raise NotImplementedError\n end", "def gated_discovery_filters(permission_types = discovery_permissions, ability = current_ability)\n return [] if ability.current_user.administrator?\n super\n end", "def filtering_params\n params.slice(:country, :data_source, :vaccine,\n :date_updated_start_date, :date_updated_end_date,\n :first_vaccine_date_start, :first_vaccine_date_end)\n end", "def filtered_features(rollout, feature_names)\n feature_names.select do |feature_name|\n feature = rollout.get(feature_name)\n user_match = params[:user].nil? || feature.users.member?(params[:user])\n group_match = params[:group].nil? || feature.groups.member?(params[:group].to_sym)\n user_match && group_match\n end\n end", "def filter_collection_facet_for_access(solr_parameters)\n return if current_ability.admin?\n\n collection_ids = Hyrax::Collections::PermissionsService.collection_ids_for_view(ability: current_ability).map { |id| \"^#{id}$\" }\n solr_parameters['f.member_of_collection_ids_ssim.facet.matches'] = if collection_ids.present?\n collection_ids.join('|')\n else\n \"^$\"\n end\n end", "def input_filter_groups\n return @input_filter_groups\n end", "def filtered_items_list(filter, params = {})\n resp = @client.access_token.get(ItemList.merge_query_string(\"/reader/api/0/stream/contents/user/#{user_id}/state/com.google/#{filter}?output=json\", params))\n raise \"unable to retrieve the list of #{filter} items for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n Google::Reader::ItemList.new(@client, resp.body)\n end", "def applicable_filters\n fs = []\n fs << Spree::ProductFilters.taxons_below(self)\n ## unless it's a root taxon? left open for demo purposes\n\n fs << Spree::ProductFilters.price_filter if Spree::ProductFilters.respond_to?(:price_filter)\n fs << Spree::ProductFilters.brand_filter if Spree::ProductFilters.respond_to?(:brand_filter)\n #fs << Spree::ProductFilters.occasion_filter if Spree::ProductFilters.respond_to?(:occasion_filter)\n #fs << Spree::ProductFilters.holiday_filter if Spree::ProductFilters.respond_to?(:holiday_filter)\n fs << Spree::ProductFilters.selective_occasion_filter(self) if Spree::ProductFilters.respond_to?(:selective_occasion_filter)\n fs << Spree::ProductFilters.selective_holiday_filter(self) if Spree::ProductFilters.respond_to?(:selective_holiday_filter)\n fs\n end", "def applicable_filters\n fs = []\n fs << Spree::ProductFilters.taxons_below(self)\n ## unless it's a root taxon? left open for demo purposes\n\n fs << Spree::ProductFilters.price_filter if Spree::ProductFilters.respond_to?(:price_filter)\n fs << Spree::ProductFilters.brand_filter if Spree::ProductFilters.respond_to?(:brand_filter)\n #fs << Spree::ProductFilters.occasion_filter if Spree::ProductFilters.respond_to?(:occasion_filter)\n #fs << Spree::ProductFilters.holiday_filter if Spree::ProductFilters.respond_to?(:holiday_filter)\n fs << Spree::ProductFilters.selective_occasion_filter(self) if Spree::ProductFilters.respond_to?(:selective_occasion_filter)\n fs << Spree::ProductFilters.selective_holiday_filter(self) if Spree::ProductFilters.respond_to?(:selective_holiday_filter)\n fs\n end", "def file_filtering_conditions(resource_name)\n NfsStore::Filter::Filter.generate_filters_for resource_name, user: current_user\n end", "def config_filters\n []\n end", "def process_filters(search_opts = {})\n filter_str = ''\n if search_opts['filter']\n search_opts['filter'].each do |f|\n filter_str = \"#{filter_str} AND #{f}\"\n end\n search_opts.delete('filter')\n end\n filter_str\n end", "def filter_list(opts = {})\n data, _status_code, _headers = filter_list_with_http_info(opts)\n data\n end", "def set_filters\n @filters ||= begin\n filters = []\n filters << { attribute: Gemgento::ProductAttribute.find_by!(code: 'color'), value: params[:color] } unless params[:color].blank?\n filters\n end\n end", "def filters\n filters_class&.new(self.scoped)\n end", "def entries\n @filter\n end", "def applied_filter(_fragment, _filter, machines)\n machines\n end", "def filter\r\n q = self.query\r\n return nil if q.nil?\r\n filter_name = q.ole_methods.detect{|m| m.to_s =~ /Filter\\Z/}\r\n return nil if filter_name.nil?\r\n q.send(filter_name.to_s.to_sym)\r\n end", "def filter_scopes\n @filter_scopes ||= scopes.inject({}) do |result, element|\n result[element.first] = element.last if element.last[:type] != :boolean\n result\n end\n end", "def show_filter\n perm_links = ministry.lmi_show.map { |lmi| \"lmi_total_custom_#{lmi}\" }\n table[:perm_link].in(perm_links)\n end", "def do_params_filter scope\n filter_params.each do |k,value|\n if value.present?\n if self.class.custom_filter_fields[k].present?\n scope = self.class.custom_filter_fields[k].call scope, value\n elsif resource_class.column_names.include? k\n if resource_class.columns_hash[k].type == :boolean\n if value == '0'\n puts \"Should filter\"\n scope = scope.where(k => [false,nil])\n else\n scope = scope.where(k => true)\n end\n else\n scope = scope.where(k => value)\n end\n elsif resource_class.reflect_on_association(k.to_sym).present?\n klass = resource_class.reflect_on_association(k.to_sym).klass\n scope = do_inner_params_filter klass, value, scope\n else\n Rails.logger.warn(\"No filter is available for field #{k}\")\n end\n end\n end\n scope\n end", "def all_memberships\n Membership.all.select {|member_info| member_info.member_name == self}\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('flavorparamsoutput', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def filtered_params\n %i[roles provider_type]\n end" ]
[ "0.66000456", "0.6113546", "0.5663793", "0.558727", "0.5541264", "0.5440236", "0.5352249", "0.5334504", "0.5318193", "0.52901834", "0.5235585", "0.51865315", "0.5149339", "0.50871384", "0.5058165", "0.5041862", "0.504061", "0.50391406", "0.50339425", "0.50339425", "0.5019519", "0.4973254", "0.49722892", "0.49459755", "0.49449122", "0.49357772", "0.49350557", "0.49157497", "0.49157497", "0.48960945", "0.4864578", "0.48590633", "0.48590633", "0.4852505", "0.4847982", "0.48429817", "0.48288816", "0.48281303", "0.48191354", "0.48021024", "0.4799521", "0.47935787", "0.47793096", "0.47610056", "0.47553867", "0.47471267", "0.47316438", "0.473116", "0.47279206", "0.4718529", "0.47129038", "0.47090834", "0.47077835", "0.46933144", "0.46929803", "0.46894804", "0.46866697", "0.4682138", "0.46819815", "0.46808487", "0.46694392", "0.46687752", "0.4661392", "0.4653079", "0.4653079", "0.46512237", "0.46502432", "0.46485475", "0.46320167", "0.4631496", "0.46196783", "0.46149495", "0.46145695", "0.46102682", "0.4609603", "0.46075997", "0.46069014", "0.46047437", "0.45992777", "0.45855758", "0.4584365", "0.4578672", "0.45766652", "0.4575381", "0.4575381", "0.4569542", "0.45642424", "0.45627195", "0.45618597", "0.45562425", "0.4554546", "0.45542413", "0.4546149", "0.4543646", "0.45429808", "0.45407656", "0.453647", "0.45359835", "0.4526478", "0.45230642" ]
0.6618161
0
Retrieves a list of members for the specified dimension, optionally satisfying a filter.
def get_members(dimension, filter_spec = nil, all_gens = true) check_attached @logger.info "Retrieving list of members for #{dimension}" filter_name, filter_args = process_filter(dimension, filter_spec) @req.EnumMembers do |xml| xml.sID @session_id xml.dim dimension xml.memberFilter do |xml| xml.filter('name' => filter_name) do |xml| insert_filter_args xml, filter_args end end xml.getAtts '0' xml.alsTbl @preferences.alias_table xml.allGenerations all_gens ? '1' : '0' end doc = invoke members = doc.at('//res_EnumMembers/mbrs').to_plain_text.split('|') members end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(arg, members)\n begin\n rescue\n members = []\n end\n\n return members\n end", "def find_member(dimension, pattern, filter_spec = nil)\n check_attached\n\n @logger.info \"Finding members of #{dimension} matching '#{pattern}'\"\n filter_name, filter_args = process_filter(dimension, filter_spec)\n @req.FindMember do |xml|\n xml.sID @session_id\n xml.dim dimension\n xml.mbr pattern\n xml.filter 'name' => filter_name do |xml|\n insert_filter_args xml, filter_args\n end\n xml.alsTbl @preferences.alias_table\n end\n doc = invoke\n path_list = []\n doc.search('//res_FindMember/pathList/path').each do |path|\n path_list << path.at('mbrs').to_plain_text.split('|')\n end\n path_list\n end", "def retrieve_members\n @root_member = nil\n @members = []\n shared = []\n @member_lookup = {}\n log.finer \"Retrieving members of dimension '#{@name}'\"\n alias_tbls = try{ @cube.get_alias_table_names.to_a }\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n spec = %Q{@IDESCENDANTS(\"#{self.name}\")}\n query = <<-EOQ.strip\n <OutputType Binary\n <SelectMbrInfo(MemberName, MemberAliasName, ParentMemberName,\n MemberGeneration, MemberLevel, Consolidation,\n ShareOption, MemberFormula, UDAList)\n EOQ\n @cube.instrument 'retrieve_members', dimension: self do\n try{ mbr_sel.execute_query(query, spec) }\n end\n mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = Member.new(self, ess_mbr, alias_tbls)\n @members << mbr\n if mbr.shared?\n shared << mbr\n else\n @member_lookup[mbr.name.upcase] = mbr\n end\n end\n # Link shared members to non-shared member (and vice versa)\n shared.each do |smbr|\n mbr = @member_lookup[smbr.name.upcase]\n smbr.instance_variable_set(:@non_shared_member, mbr)\n mbr.instance_variable_get(:@shared_members) << smbr\n end\n @root_member = @member_lookup[self.name.upcase]\n # Convert parent names to references to the parent Member object\n # This can only be done after we've seen all members, since the\n # member selection query returns parents after children\n @members.each do |mbr|\n par = @member_lookup[mbr.parent.upcase]\n mbr.instance_variable_set(:@parent, par)\n par.instance_variable_get(:@children) << mbr if par\n end\n ensure\n try{ mbr_sel.close }\n end\n log.finer \"Retrieved #{@members.size} members\"\n end", "def get_filters(dimension, force = false)\n check_attached\n\n if @fiters && @filters[dimension] && !force\n @logger.debug \"Retrieving filters for #{dimension} from cache\"\n filters = @filters[dimension]\n else\n @logger.info \"Retrieving list of available member filters for #{dimension}\"\n @req.EnumFilters do |xml|\n xml.sID @session_id\n xml.dim dimension\n end\n filters = []\n invoke.search('//res_EnumFilters/filterList/filter').each do |filter|\n filters << Filter.new(filter)\n end\n @filters = {} unless @filters\n @filters[dimension] = filters\n end\n\n filters\n end", "def members\n _members = []\n time = Benchmark.measure do\n _members = Rails.cache.fetch(\"group/#{id}/members/#{updated_at.to_f}\") do\n Person.where(id: (memberships.pluck(:entity_id) + rule_member_ids).uniq)\n end\n end\n\n Rails.logger.warn \"Group.members for group with ID #{id} took #{time.real}\" if time.real > 0.50\n\n return _members\n end", "def get_members_by_id\n return filter_by_id(get_members) \n end", "def get_family_members (people, family)\n people.select { |key,person| person.family == family }\nend", "def only_members items\n only_ items, :member\nend", "def query_collection_members\n params[:q] = params[:cq]\n @response = repository.search(query_for_collection_members)\n @member_docs = @response.documents\n end", "def members\n resp = MU::Cloud::Google.admin_directory(credentials: @credentials).list_members(@cloud_id)\n members = []\n if resp and resp.members\n members = resp.members.map { |m| m.email }\n# XXX reject status != \"ACTIVE\" ?\n end\n members\n end", "def get_members(group_ldap_dn)\n ldap = Net::LDAP.new :host => SiteSetting.ldap_hostname,\n :port => SiteSetting.ldap_port,\n :auth => {\n :method => :simple,\n :username => SiteSetting.ldap_bind_dn,\n :password => SiteSetting.ldap_password\n }\n\n filter = Net::LDAP::Filter.construct('(memberOf='+ group_ldap_dn +')')\n \n treebase = SiteSetting.ldap_base\n\n result_attrs =[\"mail\"]\n \n group_members = []\n ldap.search(:base => treebase, :filter =>\n filter, :attributes => result_attrs,:return_result =>\n false) do |entry|\n group_members.append(entry[\"mail\"])\n end\n group_members\n end", "def dimensions(*fields)\n @dimensions ||= ListParameter.new(:dimensions, [])\n @dimensions << fields\n end", "def members\n @spec['members']\n end", "def members(entity) \n member_ids(entity).map{ |member| \"RubyProvisioningApi::#{entity}\".constantize.send(:find, member) }\n end", "def results\n\t\tcase @field\n\t\twhen nil\n\t\t\treturn Membership.all\n\t\t# Member only fields\n\t\twhen :first_name, :last_name\n\t\t\tscope = (\"members_\" + @field.to_s + \"_like\").to_sym\n\t\t\tresults = Membership.member_field_like(@field, @query)\n\t\t# Member or Membership fields\n\t\twhen :email, :phone\n\t\t\tresults = Membership.member_or_membership_field_like(@field, @query)\n\t\t# Membership only fields\n\t\twhen :address\n\t\t\tresults = Membership.address_like(@query)\n\t\twhen :number\n\t\t\tresults = Membership.where(:number => @query)\n\t\twhen :renewal_date\n\t\t\t#debugger\n\t\t\tresults = Membership.renewal_date_between(@query)\n\t\twhen :complex\n\t\t\tresults = eval(\"Membership.\" + @query)\n\t\tend\n\t\treturn results.order(:number.asc)\n\tend", "def members_of(collection)\n ActiveFedora::Base.where(member_of_collection_ids_ssim: collection.id)\n end", "def users(filter = {})\n handler[:people].filter(filter)\n end", "def fields(filter = nil)\n unless filter\n # Since we're returning the FieldMap object, which the caller\n # may mutate, we precautionarily mark dirty -- unless it's frozen\n # immutable.\n @fields.clean = false unless @fields.frozen?\n return @fields\n end\n @fields.reindex unless @fields.clean\n flds = []\n if filter.is_a?(String) && @fields.tags[filter]\n @fields.tags[filter].each do |idx|\n flds << @fields[idx]\n end\n elsif filter.is_a?(Array) || filter.is_a?(Range)\n @fields.each_by_tag(filter) do |tag|\n flds << tag\n end\n end\n flds\n end", "def members\n @source.get_elements('//Member').map { |item| Member.new(item) }\n end", "def members\n response = service.get_members\n response.map do |member_data|\n Member.new(member_data)\n end\n end", "def filtering_params(params)\n params.slice(:role, :query)\n end", "def filters\n mentos(:get_all_filters)\n end", "def entries\n @filter\n end", "def filtered_items_list(filter, params = {})\n resp = @client.access_token.get(ItemList.merge_query_string(\"/reader/api/0/stream/contents/user/#{user_id}/state/com.google/#{filter}?output=json\", params))\n raise \"unable to retrieve the list of #{filter} items for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n Google::Reader::ItemList.new(@client, resp.body)\n end", "def members\n Member.where(id: [member_1_id, member_2_id])\n end", "def get_guild_members(guild_id)\n @member_cache.select { |key| key[0] == guild_id }.values\n end", "def members *args\n page, per_page, options = TibbrResource.extract_params(args, 2)\n cache_lookup(MEMBERS, true, page, per_page) do\n TibbrResource.paginate_collection(get(:members, :params => {:include_group_members => options[:include_group_members], :page => page, :per_page => per_page}), User)\n end\n end", "def get_member_list\n members = []\n events.each do |event|\n event.attendees.each do |attendee|\n members.push(attendee) unless members.include?(attendee)\n end\n end\n members\n end", "def get_effective_logical_port_members(ns_group_id, opts = {})\n data, _status_code, _headers = get_effective_logical_port_members_with_http_info(ns_group_id, opts)\n data\n end", "def list(\n filter,\n *args,\n deadline: nil\n )\n return @remote_identity_groups.list(\n filter,\n *args,\n deadline: deadline,\n )\n end", "def my_department_members\n departments = employee&.departments&.ids || []\n Employee.where(id: Position.where.not(department_id: nil).where(department_id: departments).map(&:efective_id))\n end", "def members(*) end", "def list(\n filter,\n *args,\n deadline: nil\n )\n return @peering_group_nodes.list(\n filter,\n *args,\n deadline: deadline,\n )\n end", "def find_members \n Member.where(:user_guid => self.guid)\n end", "def members\n \n return @gemset.members\n \n end", "def list(filter, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter)\n\t\t\tclient.add_param(kparams, 'pager', pager)\n\t\t\tclient.queue_service_action_call('personalfeed', 'list', 'KalturaPersonalFeedListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def list_members\n HTTP.headers(:accept => @@accept, \"content-type\" => @@content_type).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/members\").parse[\"members\"]\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\t# A filter used to exclude specific types of permissions\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\t# A limit for the number of records to display on a page\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('permission', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def search_members(query, options = {})\n get search_path(\"members\"), options.merge(query: query)\n end", "def get(*members)\n keys = members.map { |tag| id_for(tag) }\n elements = @redis.sunion(keys)\n @redis.del(keys)\n \n scopes = members.delete_if {|a| not a.is_a? ActiveRecord::Base}\n\n elements += get_scope(*scopes)\n elements.flatten.uniq.compact\n end", "def members\n @members\n end", "def members\n @members\n end", "def scoped_members\n return @scoped_members\n end", "def category_members(category, options = {})\n titles = []\n apfrom = nil\n begin\n form_data = options.merge(\n {'action' => 'query',\n 'list' => 'categorymembers',\n 'apfrom' => apfrom,\n 'cmtitle' => category,\n 'cmlimit' => @options[:limit]})\n res, apfrom = make_api_request(form_data, '//query-continue/categorymembers/@apfrom')\n titles += REXML::XPath.match(res, \"//cm\").map { |x| x.attributes[\"title\"] }\n end while apfrom\n titles\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\t# A filter used to exclude specific types of permission items\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\t# A limit for the number of records to display on a page\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('permissionitem', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('flavorparamsoutput', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def list(\n filter,\n *args,\n deadline: nil\n )\n return @peering_groups.list(\n filter,\n *args,\n deadline: deadline,\n )\n end", "def find_group_and_members(name)\n results = find_group(name)\n filtered_results(results)\n end", "def members\n @members ||= population_group_members.collect(&:members).flatten.uniq\n end", "def get_effective_logical_port_members(ns_group_id, opts = {})\n data, _status_code, _headers = get_effective_logical_port_members_with_http_info(ns_group_id, opts)\n return data\n end", "def filtered(collection, filter)\n collection.grep_v(FILTERS.fetch(filter, FILTERS[:default]))\n end", "def get_member_objects()\n return MicrosoftGraph::Contacts::Item::GetMemberObjects::GetMemberObjectsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def members_get_info_v2(members:, trace: false)\n members_array = []\n members.each do |h|\n (tag, key) = h.to_a[0]\n case tag\n when 'team_member_id', 'email', 'external_id'\n members_array << { '.tag' => tag, \"#{tag}\" => \"#{key}\" }\n else\n raise 'members_get_info_v2() Only team_member_id, email or external_id can be used as indexes'\n end\n end\n dropbox_query(query: '2/team/members/get_info_v2', query_data: { 'members' => members_array }, trace: trace)\n end", "def group_members\n members(\"Group\")\n end", "def members\n return @members\n end", "def members\n return @members\n end", "def members\n return @members\n end", "def members\n return @members\n end", "def memberships\n #Access membership => [memberships]\n #Select all memberships for specific member\n Membership.all.select do |m|\n #compare whether or not lifter property == this lifter\n m.lifter == self\n end\n\n end", "def available_members()\n # added some logic in here to check whether the class is peak, and only supply a list\n # of premium members. Also want to check to see if there are available spaces for the\n # class, if not - return an empty array.\n if @spaces > 0\n if is_peak()\n sql = \"SELECT * from members WHERE id NOT IN (SELECT member_id FROM bookings WHERE gymclass_id = $1) AND premium = TRUE;\"\n else\n sql = \"SELECT * from members WHERE id NOT IN (SELECT member_id FROM bookings WHERE gymclass_id = $1);\"\n end\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|member| Member.new(member)}\n else\n return []\n end\n end", "def get_data_elements(patient, category, status = nil)\n matches = []\n patient.dataElements.each do |data_element|\n matches << data_element if data_element[:qdmCategory] == category && (data_element[:qdmStatus] == status || status.nil?)\n end\n matches\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('flavorparams', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def select(*filter, &select_cond)\r\n # Declare these variables before the code block so they don't go\r\n # after the code block is done.\r\n result_set = []\r\n\r\n # Validate that all names in filter are valid field names.\r\n validate_filter(filter)\r\n\r\n filter = @field_names if filter.empty?\r\n\r\n # Get all records that match the selection criteria and\r\n # return them in an array of Struct instances.\r\n return get_matches(:select, filter, select_cond)\r\n end", "def get_dimensions\n check_attached\n\n @logger.info \"Retrieving list of dimensions\"\n @req.EnumDims do |xml|\n xml.sID @session_id\n xml.alsTbl @preferences.alias_table\n end\n @dimensions = []\n invoke.search('//res_EnumDims/dimList/dim').each do |dim|\n @dimensions[dim['id'].to_i] = dim['name']\n end\n @dimensions\n end", "def list(filter, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter)\n\t\t\tclient.add_param(kparams, 'pager', pager)\n\t\t\tclient.queue_service_action_call('configurationgroupdevice', 'list', 'KalturaConfigurationGroupDeviceListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def get_mailing_members(id)\n get(\"/mailings/#{id}/members\")\n end", "def list(\n filter,\n *args,\n deadline: nil\n )\n return @nodes.list(\n filter,\n *args,\n deadline: deadline,\n )\n end", "def request_guild_members(guild_id, query: nil, limit: 0)\n payload = {guild_id: guild_id, query: query, limit: limit}.compact\n @websocket.send(op: OP_REQUEST_GUILD_MEMBERS, d: payload)\n end", "def filtering_params(params)\n params.slice(:id, :email, :password, :admin)\n end", "def rec_members(group)\n gmems = group.getMemberGroups\n mems = gmems.collect { |g| g} + group.getMembers.collect { |m| m}\n for g in gmems do\n mems += rec_members(g)\n end\n mems\nend", "def list_members(prefix = nil, options={})\n raise NotImplementedError\n end", "def filtered_dataset\n filter_args_from_query.inject(@dataset) do |filter, cond|\n filter.filter(cond)\n end\n end", "def member_of_collections\n return [] unless model.respond_to?(:member_of_collection_ids)\n wayfinder.decorated_collections\n end", "def members_list\n all_lifters.map {|lifters| lifters.name}\n end", "def [](filter = {})\n vertices(filter)\n end", "def member_collections\n collections\n end", "def list(filter)\n List.new(options.merge(filter: filter)).run\n end", "def list(filter)\n List.new(options.merge(filter: filter)).run\n end", "def department_members\n Department.where(id: department.id)\n Employee.where(id: Position.where.not(department_id: nil).where(department_id: department&.id).map(&:efective_id))\n end", "def group_members_list(external_group_id: nil, group_id: nil, trace: false, &block)\n if group_id != nil\n group_query = \"{\\\"group\\\":{\\\".tag\\\":\\\"group_id\\\",\\\"group_id\\\":\\\"#{group_id}\\\"}}\"\n elsif external_group_id != nil\n group_query = \"{\\\"group\\\":{\\\".tag\\\":\\\"group_external_id\\\",\\\"group_external_id\\\":\\\"#{external_group_id}\\\"}}\"\n else\n return nil\n end\n r = dropbox_query(query: '2/team/groups/members/list', query_data: group_query, trace: trace)\n r['members'].each(&block)\n while r['has_more']\n r = dropbox_query(query: '2/team/groups/members/list/continue', query_data: \"{\\\"cursor\\\":\\\"#{r['cursor']}\\\"}\", trace: trace)\n r['members'].each(&block)\n end\n end", "def get_members_for_org organization_name\n # Need to call GET /orgs/:org/members\n # Member names will be the keys in our @stats hash, so we can keep them there\n GithubApi.get(\"/orgs/#{organization_name}/members\").each do |m|\n member_name = m[\"login\"]\n # Initially, no additions, deletions, or changes\n @stats[ member_name ] = { \"a\" => 0, \"d\" => 0, \"c\" => 0 }\n end\n end", "def membership(user_dn, group_names)\n search(filter: group_filter(group_names, user_dn))\n end", "def members\n @model.getMemberGroups.collect { |p| p } + @model.getMembers.collect { |p| p }\n end", "def get(name)\n @filters.select {|f| f[:name] == name }\n end", "def children_lookup(cube_unique_name, member = nil, recursive = false)\n return dimensions cube_unique_name if member.nil?\n\n if member.split(\".\").length == 1\n cube(cube_unique_name).get_dimensions.reject { |dimension| dimension.get_unique_name != member }.first.get_hierarchies.map { |hierarchy| hierarchy.get_root_members.map { |member| dimension(member, recursive)} }.flatten\n else\n children cube(cube_unique_name).send(:lookup_member, Java::OrgOlap4jMdx::IdentifierNode.parse_identifier(member).get_segment_list()), recursive\n end\n end", "def get_effective_logical_port_members_with_http_info(ns_group_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiGroupingObjectsNsGroupsApi.get_effective_logical_port_members ...'\n end\n # verify the required parameter 'ns_group_id' is set\n if @api_client.config.client_side_validation && ns_group_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ns_group_id' when calling ManagementPlaneApiGroupingObjectsNsGroupsApi.get_effective_logical_port_members\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiGroupingObjectsNsGroupsApi.get_effective_logical_port_members, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiGroupingObjectsNsGroupsApi.get_effective_logical_port_members, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/ns-groups/{ns-group-id}/effective-logical-port-members'.sub('{' + 'ns-group-id' + '}', ns_group_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].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 # 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 => 'EffectiveMemberResourceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiGroupingObjectsNsGroupsApi#get_effective_logical_port_members\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def members\n # use this method instead of the 'has_many' macro\n Member.where(\"near_node_id = ? OR far_node_id = ?\", self.id, self.id)\n end", "def member_list(which_ones = :all)\n case which_ones\n when :manual\n ::User.with_role(:member, self).includes(user_profile: [:country]).sort_by { |u| u.full_name.downcase }\n when :automatic\n if is_subscription_only?\n ::User.paid_subscribers\n else\n owner ? owner.member_list : []\n end\n when :all\n member_list(:manual) + member_list(:automatic)\n end\n end", "def all_memberships\n Membership.all.select {|member_info| member_info.member_name == self}\n end", "def read_members(member_paths, options={})\n member_paths.map{|f| read_member(f, options) }\n end", "def group_members(id)\n get(\"/groups/#{id}/members\")\n end", "def members\n fetch if @members.nil? || @members[0].nil?\n @members\n end", "def members\n @members ||= relation_members.map do |member|\n [member.member_type, member.member_id, member.member_role]\n end\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('mediainfo', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def filtered_results(results)\n return [] if results.blank?\n\n members = results.first[:uniquemember]\n members = results.first[:member] if members.blank?\n members.map do |r|\n uid = r.split(\",\").first\n uid.split(\"=\", 2).last\n end\n end", "def get_activity_members(conversation_id, activity_id, opts = {})\n uri = \"/v3/conversations/#{conversation_id}/activities/#{activity_id}/members\"\n api_get(uri, opts)\n end", "def members; end", "def members; end", "def members; end", "def members; end" ]
[ "0.6106037", "0.5892731", "0.5737507", "0.5628034", "0.5616825", "0.54674816", "0.5147688", "0.50660956", "0.50398475", "0.5007623", "0.50068593", "0.5006542", "0.49880135", "0.49544948", "0.49335697", "0.4933323", "0.492662", "0.490732", "0.48770645", "0.48370168", "0.48106977", "0.4796478", "0.4786946", "0.4783149", "0.47805312", "0.47464395", "0.47421336", "0.47323298", "0.47031313", "0.46832618", "0.46739754", "0.46690091", "0.46685284", "0.4658412", "0.46367297", "0.4633545", "0.46288708", "0.462793", "0.46208686", "0.46205202", "0.46166608", "0.46166608", "0.4609965", "0.46080813", "0.46062303", "0.4606175", "0.46040738", "0.45986056", "0.45974052", "0.459679", "0.4593147", "0.459008", "0.45889157", "0.4587657", "0.45835617", "0.45835617", "0.45835617", "0.45835617", "0.45666572", "0.45553762", "0.4550161", "0.45501027", "0.45488173", "0.45359147", "0.4531617", "0.4531568", "0.45295674", "0.4523865", "0.45225188", "0.4521103", "0.4518844", "0.45093668", "0.450525", "0.450282", "0.45009023", "0.4494413", "0.44902033", "0.44902033", "0.44891047", "0.4483697", "0.4480392", "0.44803575", "0.44796625", "0.44793877", "0.44746453", "0.44723672", "0.4472318", "0.44715846", "0.44692174", "0.44647375", "0.44617376", "0.44611642", "0.44601133", "0.44593406", "0.44530016", "0.445106", "0.44502577", "0.44502577", "0.44502577", "0.44502577" ]
0.7164167
0
Search for the specified member name or pattern in a dimension. Returns an array of arrays, each inner array representing a path to a matching member.
def find_member(dimension, pattern, filter_spec = nil) check_attached @logger.info "Finding members of #{dimension} matching '#{pattern}'" filter_name, filter_args = process_filter(dimension, filter_spec) @req.FindMember do |xml| xml.sID @session_id xml.dim dimension xml.mbr pattern xml.filter 'name' => filter_name do |xml| insert_filter_args xml, filter_args end xml.alsTbl @preferences.alias_table end doc = invoke path_list = [] doc.search('//res_FindMember/pathList/path').each do |path| path_list << path.at('mbrs').to_plain_text.split('|') end path_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children_lookup(cube_unique_name, member = nil, recursive = false)\n return dimensions cube_unique_name if member.nil?\n\n if member.split(\".\").length == 1\n cube(cube_unique_name).get_dimensions.reject { |dimension| dimension.get_unique_name != member }.first.get_hierarchies.map { |hierarchy| hierarchy.get_root_members.map { |member| dimension(member, recursive)} }.flatten\n else\n children cube(cube_unique_name).send(:lookup_member, Java::OrgOlap4jMdx::IdentifierNode.parse_identifier(member).get_segment_list()), recursive\n end\n end", "def retrieve_members\n @root_member = nil\n @members = []\n shared = []\n @member_lookup = {}\n log.finer \"Retrieving members of dimension '#{@name}'\"\n alias_tbls = try{ @cube.get_alias_table_names.to_a }\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n spec = %Q{@IDESCENDANTS(\"#{self.name}\")}\n query = <<-EOQ.strip\n <OutputType Binary\n <SelectMbrInfo(MemberName, MemberAliasName, ParentMemberName,\n MemberGeneration, MemberLevel, Consolidation,\n ShareOption, MemberFormula, UDAList)\n EOQ\n @cube.instrument 'retrieve_members', dimension: self do\n try{ mbr_sel.execute_query(query, spec) }\n end\n mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = Member.new(self, ess_mbr, alias_tbls)\n @members << mbr\n if mbr.shared?\n shared << mbr\n else\n @member_lookup[mbr.name.upcase] = mbr\n end\n end\n # Link shared members to non-shared member (and vice versa)\n shared.each do |smbr|\n mbr = @member_lookup[smbr.name.upcase]\n smbr.instance_variable_set(:@non_shared_member, mbr)\n mbr.instance_variable_get(:@shared_members) << smbr\n end\n @root_member = @member_lookup[self.name.upcase]\n # Convert parent names to references to the parent Member object\n # This can only be done after we've seen all members, since the\n # member selection query returns parents after children\n @members.each do |mbr|\n par = @member_lookup[mbr.parent.upcase]\n mbr.instance_variable_set(:@parent, par)\n par.instance_variable_get(:@children) << mbr if par\n end\n ensure\n try{ mbr_sel.close }\n end\n log.finer \"Retrieved #{@members.size} members\"\n end", "def iterative_search(name)\n lower = 0\n upper = entries.length - 1\n \n while lower <= upper\n array_name = entries[lower].name\n \n if name == array_name\n return entries[lower]\n else lower += 1\n end\n end\n \n return nil\n end", "def read_members(member_paths, options={})\n member_paths.map{|f| read_member(f, options) }\n end", "def match_pattern(pattern, x, y)\n coords = []\n players = pattern.map do |coordinates|\n new_x = x + coordinates[0]\n new_y = y + coordinates[1]\n coords << [new_x, new_y]\n index = index_from_coords(new_x, new_y)\n if index == -1\n nil\n else\n @board[index]\n end\n end\n [players, coords]\n end", "def find(pattern)\n patterns= [pattern].flatten\n contents=[]\n self.each_pair do |path, content|\n patterns.each do |pattern|\n contents << content if Content.path_match? path, pattern\n end\n end\n contents\n end", "def find_neighbors(*point)\n point.flatten! # Ensure we have 1-D array\n raise ArgumentError, \"More than 2 coordinates received\" if point.size > 2\n\n find_neighbors_rec(point, root)\n end", "def my_array_finding_method(source, thing_to_find)\n return source.grep(/#{thing_to_find}/)\nend", "def search_for(term)\n results = Friendship.find_by_sql(query(term))\n\n results.map do |result|\n members = Member.where(id: result.path).order(\"array_position(array[#{result.path.join(',')}]::bigint[], members.id)\")\n members.map(&:full_name).join('->')\n end\n end", "def [](path)\n dsearch(path.split('/'))\n end", "def search(pattern_to_match)\n results = []\n caches = source_index_hash\n caches.each do |cache|\n results << cache[1].search(pattern_to_match)\n end\n results\n end", "def find_items pattern = nil\n items.values_at(*find_names(pattern))\n end", "def nested_block_reference_matching_pattern(pattern:, nodes:)\n value = []\n traverse_nodes_depth_first(nodes) {|node|\n if string_matches_pattern(pattern, node['string'])\n value << node[\"uid\"]\n end\n }\n\n value\nend", "def member_for(message)\n @members.find { |m| /#{m.pattern}/i =~ message }\n end", "def find(name, deep=true)\n sym = name.to_sym\n ms = matches.select {|m| m.has_name?(sym) }\n ms.concat(matches.map {|m| m.find(name, deep) }.flatten) if deep\n ms\n end", "def search(node, pattern)\n if (match = match?(node, pattern))\n yield node, match if block_given?\n match != true ? [node, match] : [node]\n else\n node.each_child_node\n .flat_map { |e| search(e, pattern) }\n .compact.flatten\n end\n end", "def recursive_find_ds(folder, name, exact = false)\n # @!visibility private\n # Comparator for object names\n def matches(child, name, exact = false)\n is_ds = child.class == RbVmomi::VIM::Datastore\n name_matches = (name == \"*\") || (exact ? (child.name == name) : (child.name.include? name))\n is_ds && name_matches\n end\n found = []\n folder.children.each do |child|\n if matches(child, name, exact)\n found << child\n elsif child.class == RbVmomi::VIM::Folder\n found << recursive_find_vm(child, name, exact)\n end\n end\n\n found.flatten\n end", "def search(points)\n if points.is_a?(String)\n points = [points]\n end\n stones = []\n @groups.each do |group|\n group.each do |stone|\n stones << stone if points.include? stone.point\n end\n end\n return stones\n end", "def select(name)\n group = nil\n name = name.upcase\n\n (group, name) = name.split('.', 2) if name.index('.')\n\n name = nil if name.blank?\n\n if name\n result = @children.key?(name) ? @children[name] : []\n\n if group.nil?\n return result\n else\n # If we have a group filter as well, we need to narrow it down\n # more.\n return result.select do |child|\n child.is_a?(Property) && (child.group || '').upcase == group\n end\n end\n end\n\n # If we got to this point, it means there was no 'name' specified for\n # searching, implying that this is a group-only search.\n result = []\n @children.each do |_, child_group|\n child_group.each do |child|\n if child.is_a?(Property) && (child.group || '').upcase == group\n result << child\n end\n end\n end\n\n result\n end", "def my_array_finding_method(source, thing_to_find)\n result = [] # result is the output array\n source.each do |word|\n word_array = word.to_s.split(//) # This creates an array of charaters of 'word'\n if word_array.include?(thing_to_find)\n result.push(word)\n end\n end\n return result\nend", "def [](path, pattern)\n glob(path, pattern, 0)\n end", "def search (pattern)\n\t\tputs \"Search host store based on the regular expression: #{pattern}\" if @verbose\n\t\tpattern=pattern.strip.downcase\n\t\tresults=Array.new\n\t\t@known_hosts.keys.map do |key|\n\t\t\tif key =~ /#{pattern}/i\n\t\t\t\tresults.push(key)\n\t\t\tend\n\t\tend\n\t\treturn results\n\trescue Exception => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\"\n\t\treturn nil\n\tend", "def getFlowcellDirectoryNames(searchPath, fcName)\n result = Array.new\n dirEntries = Dir.entries(searchPath)\n\n dirEntries.each do |dirEntry|\n if dirEntry.match(fcName)\n result << searchPath + \"/\" + dirEntry\n end\n end\n return result\n end", "def glob(pattern)\n root = self.root\n Pathname.glob(root.join(pattern)).map do |match|\n match.relative_path_from(root).to_s\n end\n end", "def find_me(arg)\n if @names[arg]\n return [true,nil]\n end\n @names.keys.each() do |name|\n if name =~ /^-(\\w)$/\n match_string = \"^\\\\-(\\\\w*)#{$1}(\\\\w*)$\"\n match_data = arg.match(match_string)\n if match_data\n # Note that if [1] and [2] were both empty \n # we'd have returned above\n return [true, \"-\" + match_data[1] + match_data[2]]\n end\n end\n end\n [false]\n end", "def group_members(selector,cycle={})\n return [selector] if !(selector =~ /^([&@])(.*)$/)\n selector_name = $2\n case $1\n when '&'\n name = @aliases[selector_name]\n fail \"Undefined #{selector}\" if !name\n return [name]\n when '@'\n if !@group_members_cache[selector_name]\n fail \"Cycle in definition of #{selector}\" if cycle[selector_name]\n fail \"Undefined #{selector}\" if !@groups[selector_name]\n cycle[selector_name] = true\n members = []\n @groups[selector_name].split(/,/).each do |member|\n members |= group_members(member.strip,cycle)\n end\n @group_members_cache[selector_name] = members\n end\n @group_members_cache[selector_name]\n end\n end", "def encontrar\t\n\t\[email protected]_i.times do |i| \n\t\t\[email protected]_i.times do |j| \t\t\t\t\n\t\t\t\tif yield(mat[i][j]) \n\t\t\t\t\treturn [i,j]\n\t\t\t\tend\t\t\t\t\t\n\t\t\tend\n\t\tend\n\tend", "def my_array_finding_method(source, thing_to_find)\n source.select { |item| item =~ /#{thing_to_find}/ } #=> Returns items from source array where item matches thing_to_find\nend", "def process_member_spec(spec)\n case spec.strip\n when /^['\"\\[]?(.+?)['\"\\]]?\\.(Parent|I?Children|I?R?Descendants|I?R?Ancestors|R?Level0|R?Leaves|I?Shared)$/i\n # Memer name with expansion macro\n mbr = self[$1]\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}' in #{spec}\" unless mbr\n mthd = $2.downcase\n mthd += '_members' if mthd =~ /shared$/\n rels = mbr.send(mthd.intern)\n rels.is_a?(Array) ? rels : [rels]\n when /^['\"\\[]?(.+?)['\"\\]]?\\.(R)?(Level|Generation|Relative)\\(?(\\d+)\\)?$/i\n # Memer name with level/generation expansion macro\n mbr = self[$1]\n sign = $3.downcase == 'level' ? -1 : 1\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}' in #{spec}\" unless mbr\n mbr.relative($4.to_i * sign, !!$2)\n when /^['\"\\[]?(.+?)['\"\\]]?\\.UDA\\(['\"]?(.+?)['\"]?\\)$/i\n # Memer name with UDA expansion macro\n mbr = self[$1]\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}' in #{spec}\" unless mbr\n mbr.idescendants.select{ |mbr| mbr.has_uda?($2) }\n when /[@:,]/\n # An Essbase calc function or range - execute query and use results to find Member objects\n mbrs = []\n mbr_sel = try{ @cube.open_member_selection(\"MemberQuery\") }\n begin\n mbr_sel.execute_query(<<-EOQ.strip, spec)\n <OutputType Binary\n <SelectMbrInfo(MemberName, ParentMemberName)\n EOQ\n mbr_sel.get_members && mbr_sel.get_members.get_all.each do |ess_mbr|\n mbr = self[ess_mbr.name]\n raise ArgumentError, \"No member in #{self.name} named '#{ess_mbr.name}'\" unless mbr\n if mbr.parent && mbr.parent.name != ess_mbr.parent_member_name\n mbr = mbr.shared_members.find{ |mbr| mbr.parent.name == ess_mbr.parent_member_name }\n raise \"Cannot locate #{ess_mbr.name} with parent #{ess_mbr.parent_member_name}\" unless mbr\n end\n mbrs << mbr\n end\n ensure\n mbr_sel.close\n end\n mbrs\n when /^['\"\\[]?(.+?)['\"\\]]?$/\n # Plain member name\n mbr = self[$1]\n raise ArgumentError, \"Unrecognised #{self.name} member '#{$1}'\" unless mbr\n [mbr]\n else\n raise ArgumentError, \"Unrecognised #{self.name} member '#{spec}'\"\n end\n end", "def perform_global_search(pattern, arr, dir)\n traverse(pattern, arr, dir)\n output_count(arr)\n end", "def my_array_finding_method(source, thing_to_find)\n i = 0\n t = 0\n output_array = []\n while i < source.length\n if source[i].to_s.include?(thing_to_find)\n output_array[t] = source[i].to_s\n t += 1\n end\n i +=1\n end\n return output_array\nend", "def find_column(column, columns=self.columns, create_dimpaths_from=nil)\n case column\n when Query::Column\n column if columns.include?(column)\n when Array\n if create_dimpaths_from\n Query::Column::DimensionPath.new(create_dimpaths_from, column)\n else\n columns.find {|col| col.is_a?(Query::Column::DimensionPath) && col.names == column}\n end\n else\n columns.find {|col| col.to_s == column.to_s}\n end\n end", "def find_in data, path=nil, &block\n return [] unless Array === data || Hash === data\n\n paths = []\n path ||= Path::Match.new\n path = Path::Match.new path if path.class == Array\n\n each_data_item data do |key, value|\n c_path = path.dup << key\n\n found, kmatch = match_node(@key, key) if @key\n found, vmatch = match_node(@value, value) if @value && (!@key || found)\n\n c_path.append_splat self, key if @recursive\n\n if found\n c_path.matches.concat kmatch.to_a\n c_path.matches.concat vmatch.to_a\n\n f_path = c_path.dup\n f_path.splat[-1][-1].pop if @key && !f_path.splat.empty?\n\n yield data, key, f_path if block_given?\n paths << f_path\n end\n\n paths.concat find_in(data[key], c_path, &block) if @recursive\n end\n\n paths\n end", "def get_array(path='.')\n Element.get_array(@element, path)\n end", "def my_array_finding_method(source, thing_to_find)\n found=[]\n source.each do |find|\n if find.to_s.include?(thing_to_find)\n found.push(find)\n end\n end\n return found\nend", "def my_array_finding_method(source, thing_to_find)\n result = source.select{ |word| word.to_s.include? (thing_to_find) }\n result\nend", "def recursive_search(args)\n name = args.shift\n cmd = find { |c| c.name == name }\n return cmd, args unless cmd&.parent? && cmd.children.find { |c| c.name == args[0] }\n\n # the command exists &&\n # the command has sub command &&\n # argument matches sub command name\n # -> should search more\n cmd.children.recursive_search(args)\n end", "def distance_members(matrix, i, j)\n distances = []\n distances[0] = matrix[i][j] / 2.to_f + (get_sum(matrix, i) - get_sum(matrix, j)) / (2.to_f * ($r - 2))\n distances[1] = matrix[i][j] - distances[0]\n distances\nend", "def get_array(path=\"\")\n Element.get_array(@element, path)\n end", "def my_array_finding_method(ary, letter)\n\t\n\tif !letter.is_a?(String)\n\t\traise ArgumentError.new('The Second Argument Should be a String')\n\tend\n\treturn ary.find_all {|element| element.include?(letter) if element.is_a?(String)}\nend", "def glob_data_paths(pattern,&block)\n return enum_for(:glob_data_paths,pattern).to_a unless block_given?\n\n DataPaths.paths.each do |path|\n Dir.glob(File.join(path,pattern),&block)\n end\n end", "def my_array_finding_method(source, thing_to_find)\n source.select{|value| value.to_s.include?(\"#{thing_to_find}\")}\nend", "def [](*args)\n pat = fill\n if args.length == 1 and (args[0].kind_of? Numeric)\n idx = args[0] % pat.length\n pat[idx,1]\n else\n # don't even try, just pass on to contents!\n contents.[](*args)\n end\n\n end", "def get_array_by_col()\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpTab = Array.new\n\t\tfor j in 0..@dim_j-1\n\t\t\ttmpTab.push get_col(j)\n\t\tend\n\t\treturn tmpTab\n\tend", "def my_array_finding_method(source, thing_to_find)\n source.select { |word| word.to_s.include? thing_to_find }\nend", "def search(pattern)\n entries.grep(Regexp.new(pattern))\n end", "def search(search_string)\n root = EmployeeFolder.root\n result = []\n key = search_string.downcase\n Dir.glob(\"#{root}/*/*\") do |folder|\n next unless Dir.exist? folder\n next unless folder[key]\n\n employee_spec = parse_dir folder\n next if project? employee_spec\n\n result << employee_spec.to_employee\n end\n result\n end", "def grep(pattern, &block)\n ary = []\n self.each{|*val|\n sv = val.__svalue\n if pattern === sv\n ary.push((block)? block.call(*val): sv)\n end\n }\n ary\n end", "def match_with(pattern)\n offset = 0\n conditions = [pattern]\n conditions << pattern[0..-2] if pattern != \"/\" && pattern.end_with?(\"/\")\n loop.with_object([]) do |_, candidacies|\n return candidacies unless conditions.any?{ |x| @regexps[offset] === x }\n route = @routes[offset..-1].detect{ |route| Regexp.last_match[\"_#{route.index}\"] }\n candidacies << route\n offset = route.index + 1\n end\n end", "def my_array_finding_method(source, thing_to_find)\n source.select { |word| word.to_s.include? thing_to_find}\nend", "def my_array_finding_method(source, thing_to_find)\n make_string = source.map { |e| e.to_s }\n make_string.select { |e| e.include?(thing_to_find) }\nend", "def [] name\n namevalue_glob(name)\n end", "def slice_files_from_search_path\n search_paths = Array(Merb::Plugins.config[:merb_slices][:search_path] || [Merb.root / \"slices\"])\n search_paths.inject([]) do |files, path|\n # handle both Pathname and String\n path = path.to_s\n if File.file?(path) && File.extname(path) == \".rb\"\n files << path\n elsif path.include?(\"*\")\n files += glob_search_path(path)\n elsif File.directory?(path)\n files += glob_search_path(path / \"**/lib/*.rb\")\n end\n files\n end\n end", "def fsmemberf(name)\n mlist = []\n if fexistf name\n fslitf().each do |i|\n if eval \"$#{i}.include? '#{i},set'\"\n if fslistf(i).include? name\n mlist.push i\n end\n end\n end\n return mlist\n else\n return []\n end\nend", "def my_array_finding_method(source, thing_to_find)\n # final_array = []\n # source.each do |word|\n # if word.class == thing_to_find.class && word.include?(thing_to_find) == true\n # final_array << word\n # end\n # end\n # return final_array\n ###### refactor\n return source.grep(/#{ thing_to_find }/)\nend", "def path_for(attribute, object = ScimRails.config.mutable_group_attributes_schema, path = [])\n at_path = path.empty? ? object : object.dig(*path)\n return path if at_path == attribute\n\n case at_path\n when Hash\n at_path.each do |key, value|\n found_path = path_for(attribute, object, [*path, key])\n return found_path if found_path\n end\n nil\n when Array\n at_path.each_with_index do |value, index|\n found_path = path_for(attribute, object, [*path, index])\n return found_path if found_path\n end\n nil\n end\n end", "def find_pattern(weight_string, pattern)\n indexes = []\n i = 0\n case pattern\n when String\n while (match = weight_string.index(pattern, i))\n i_end = match + pattern.length - 1\n indexes << (match..i_end)\n i = i_end + 1\n end\n when Regexp\n while (match = pattern.match(weight_string, i))\n i_start = match.begin(0)\n i_end = i_start + match[0].length - 1\n indexes << (i_start..i_end)\n i = i_end + 1\n end\n end\n indexes\n end", "def my_array_finding_method(source, thing_to_find)\n found_things_ary = Array.new\n\n source.each do |x|\n if x.to_s.include?(thing_to_find) == true\n found_things_ary.push(x)\n end\n end\n return found_things_ary\nend", "def iterative_neighbors(pattern, d)\n # IterativeNeighbors(Pattern, d)\n # Neighborhood ← set consisting of single string Pattern\n # for j = 1 to d\n # for each string Pattern’ in Neighborhood\n # add ImmediateNeighbors(Pattern') to Neighborhood\n # remove duplicates from Neighborhood\n # return Neighborhood\n\n neighborhood = [pattern]\n (1..d).each do |j|\n neighborhood.dup.each do |pattern1| \n immediate_neighbors(pattern1).each do |neighbor|\n neighborhood << neighbor\n end\n end\n neighborhood.uniq!\n end\n return neighborhood\n end", "def search(pattern)\n entries.inject(Rush::SearchResults.new(pattern)) do |results, entry|\n if !entry.dir? and matches = entry.search(pattern)\n results.add(entry, matches)\n end\n results\n end\n end", "def for_array_at_path_enumerate_types_and_paths(array_path:, types_and_paths:)\n array = @params.dig(*array_path)\n\n array.each.with_index.reduce([]) do |acc, (_, index)|\n [\n *acc,\n *self.class.prepend_path_to_paths(\n prepend_path: [*array_path, index],\n types_and_paths: types_and_paths\n )\n ]\n end\n rescue StandardError\n []\n end", "def find\n results = [] unless block_given?\n # paths = @path.is_a?(String) ? [@path] : @path\n\n begin\n exclude_dir_regex = @exclude_dir\n rescue => ex\n puts \"--exclude_dir regex Skipping, #{ex.message}\"\n exit\n end\n\n begin\n file_regex = (Regexp.new(@regex) if @regex)\n rescue => ex\n puts \"--rname regex : Skipping, #{ex.message}\"\n exit\n end\n\n recursively_find_file(exclude_dir_regex, path, results, file_regex)\n\n block_given? ? nil : results\n end", "def find_array\n set_pattern\n @array.reject! do |item|\n item.match(@pattern) == nil\n end\n end", "def find(*pattern)\n pattern = pattern.join('*')\n pattern << '*' unless pattern =~ /\\*$/\n \n packages = []\n @repositories.select{|label,_| @active.include? label }.each do |label, repos|\n repos.each do |repo|\n packages.concat(repo.scan(pattern))\n end\n end\n packages\n end", "def get_array(element, path='.')\n return unless element\n \n result = element/path\n if (result.is_a? Nokogiri::XML::NodeSet) || (result.is_a? Array)\n result.collect { |item| self.get(item) }\n else\n [self.get(result)]\n end\n end", "def find_by_pattern(pattern)\n pattern = decode_pattern(pattern)\n rotation { |offset| match?(offset, pattern) }\n end", "def get_path_by_names(start, stop)\n s1 = get_node(start)\n s2 = get_node(stop)\n if s1 != nil && s2 != nil\n return get_path(s1, s2)\n end\n Array.new \n end", "def find_pattern(arr, string)\n element = arr.select { |name| name.include? string }\n arr.rindex(element[0])\nend", "def expand_ic(xs, pattern)\n re1 = /\\A#{Regexp.quote(pattern)}/i\n result1 = xs.select {|x| x.name_match?(re1) }\n return [] if result1.empty?\n return result1 if result1.size == 1\n re2 = /\\A#{Regexp.quote(pattern)}\\z/i\n result2 = result1.select {|x| x.name_match?(re2) }\n return result1 if result2.empty?\n return result2 if result2.size == 1 # no mean\n result2\n end", "def my_array_finding_method(source, thing_to_find)\n ans = source.select {|x| x.to_s.include?(thing_to_find)}\n return ans\nend", "def linear_search(input)\n \n search_name = input.downcase.split(' ')\n search_name.each do |name_el|\n \n entries.each do |entry|\n \n name_array = entry.name.downcase.split(' ')\n \n if name_array.include?(name_el)\n return entry\n end\n end\n end\n return nil\n end", "def my_array_finding_method(source, thing_to_find)\n p final_array = source.select {|test| test.to_s.include?(thing_to_find.to_s)}\nend", "def my_array_finding_method(source, thing_to_find)\n p final_array = source.select {|test| test.to_s.include?(thing_to_find.to_s)}\nend", "def find_col(file, name)\n i=0\n found=nil\n while i<file[0]&.size.to_i\n cell = file[0][i]\n if cell&.value==name\n found=i\n break\n end\n i+=1\n end\n return found\n \n end", "def metadata_lookup(path, ctype=nil, mtype=nil, recursive=false, \n path_only=true, dirs=false)\n entries = []\n prune = recursive ? nil : 2\n @metadata_tree.with_subtree(path, ctype, mtype, prune) do |node|\n entries << [node.node_type, (path_only ? node.path : node)]\n end\n entries\n end", "def get_matching_strings(prefix)\n puts \"Matching for #{prefix}\"\n ptr = @root\n for i in 0..prefix.size-1\n ptr = ptr.children[prefix[i]]\n return nil unless ptr\n end\n arr = []\n arr << prefix if ptr.is_leaf\n arr << get_strings(ptr, prefix)\n arr\n end", "def search pattern\n\t\tresults = all.map {|key|\n\t\t\tkey if key.to_s =~ /#{pattern}/i\n\t\t}\n\t\tresults.delete nil\n\t\tresults\n\tend", "def find_metadata(*args)\n @files.select { |m| m.match?(*args) }\n end", "def my_array_finding_method(source, thing_to_find)\n answer = Array.new\n source.each do |x|\n if x.to_s.include?(thing_to_find)\n answer << x\n end\n end\n p answer\nend", "def locate part_name\n @parts[part_name]\n end", "def extract(node_name)\n lambda do |node|\n results = []\n results << node.send(node_name) if node.respond_to?(node_name)\n\n results.push *node.elements.select { |elem| elem.respond_to?(node_name) }.map { |elem| elem.send(node_name) }\n\n results\n end\n end", "def members\n _members = []\n time = Benchmark.measure do\n _members = Rails.cache.fetch(\"group/#{id}/members/#{updated_at.to_f}\") do\n Person.where(id: (memberships.pluck(:entity_id) + rule_member_ids).uniq)\n end\n end\n\n Rails.logger.warn \"Group.members for group with ID #{id} took #{time.real}\" if time.real > 0.50\n\n return _members\n end", "def columns_search \n column = [] \n search = @@boards_templates[1].to_s.scan(/./).each_slice(5).to_a\n for h in 0..4\n for v in 0..7 \n column << search[v][h] \n end \n end \n vertical_words = []\n vertical = column.join\n @@boards_templates[0].each do |x| \n if vertical.include?(x)\n vertical_words << x\n elsif vertical.reverse.include?(x)\n vertical_words << x \n end \n end \n vertical_words\n end", "def [](path)\n find_subpath(path, false)\n end", "def [](path)\n find_subpath(path, false)\n end", "def find_names name\n find_elements :name, name\n end", "def lookup(args)\n orig_prefix, args = @delimiter_handler.find_orig_prefix(args)\n prefix = orig_prefix\n loop do\n tool = lookup_specific(prefix)\n return [tool, args.slice(prefix.length..-1)] if tool\n prefix = prefix.slice(0..-2)\n end\n end", "def pattern_for(element)\n patterns.fetch(element.to_sym, element)\n end", "def by_name(name, level)\n assert(\"RelationGraphList#by_name: level != :src,:dst\") { [:src,:dst].include?(level) }\n lookup(@named[level], name, \"#{level}-name\", false)\n end", "def my_array_finding_method(source, thing_to_find)\n new_array = source.select do |element|\n element.to_s.include? thing_to_find\n end\n return new_array\nend", "def matrix_find(row, column)\n self[row*9 + column]\n end", "def find_group_and_members(name)\n results = find_group(name)\n filtered_results(results)\n end", "def path(start,predicate)\n array = Array.new\n start.each { |elem|\n array.push(elem)\n if predicate.call(elem)\n return array\n end\n }\n nil\n end", "def find_paths(&block)\n follow,kill,find,continue = SearchParams.process(&block)\n\n paths,path = [],[]\n search = lambda do |node|\n if find[node]\n paths << path.dup\n next if not continue[node]\n end\n next if kill[node]\n [*follow[node]].each do |n|\n next if path.include? n\n path.push(n)\n search[n]\n path.pop\n end\n end\n\n [*follow[self]].each do |n| \n path.push(n)\n search[n] \n path.pop\n end\n\n paths\n end", "def search_bound(node_id, bound = [])\n Base.log(\"Entered search bound\", \"#{node_id}\")\n \n if tree.nodes.measures(node_id).any?\n Base.log(\"Found measures in #{node_id}\")\n \n values = {}\n \n return values\n else\n Base.log(\"Didn't find any measures in #{node_id}\")\n \n dimensions = order(tree.nodes.dimensions(node_id))\n \n Base.log(\"node #{node_id} has dimensions #{dimensions.inspect}\")\n \n if dimensions.nil?\n Base.log(\"Didn't find any dimension from #{node_id}\")\n return nil\n else\n last_dimension = dimensions.last\n next_name = tree.nodes.children(node_id, dimensions.last).last\n next_node = tree.nodes.child(node_id, dimensions.last, next_name)\n \n if next_node.nil?\n return next_node\n else\n Base.log(\"Recursing to search for measures in #{next_node}\")\n return search_bound(next_node)\n end\n end\n end\n end", "def findArrayMatch(array, property, match)\n array.each do |item|\n return item if item[property] == match\n end\n return nil\nend", "def depth_first_search(array)\n array.append(self.name)\n self.children.each do |child|\n child.depth_first_search(array)\n end\n return array\n\n end", "def findArrayMatch(array, property, match)\n array.each do |item|\n return item if item[property] == match\n end\n return nil\nend", "def parseColumns(arg)\n if arg =~ /^(\\d+)-(\\d+)$/ # Range of column indices (e.g., 3-5)\n return (Integer($1)..Integer($2)).to_a\n elsif arg =~ /^([\\d,]+)$/ # Just a set of columns\n return arg.split(/,/).map{|x| Integer(x)}\n elsif arg =~ /^:(.*)$/ # Search to find the column\n query, rest = $1, $2\n result = nil\n @data.each { |row|\n (0...row.size).each { |col|\n if row[col].to_s =~ /#{query}/\n result = col\n break\n end\n }\n }\n return [result] if result\n raise \"Can't identify column from #{arg}\"\n else\n # Comma-separated list of names\n matches = []\n arg.split(/,/).each { |a|\n @header.each_with_index { |name,i|\n matches << i if name =~ /^#{a}$/\n }\n }\n raise \"Not valid header: #{arg}, possible headers: #{@header.inspect}\" if matches.size == 0\n return matches\n end\n end", "def where(params)\n found = []\n\n @registry.each do |item|\n if item.to_h.values_at(*params.keys) == params.values\n found << item\n end\n end\n found\n end" ]
[ "0.58633673", "0.50954473", "0.50358456", "0.49046034", "0.48188692", "0.47691846", "0.47646478", "0.47630084", "0.47506502", "0.47243878", "0.46803775", "0.46600533", "0.45607966", "0.45484754", "0.45322666", "0.45157522", "0.45046684", "0.44887182", "0.44867975", "0.44701588", "0.4441082", "0.44401833", "0.44395277", "0.4420563", "0.44185966", "0.44043753", "0.44043034", "0.43923426", "0.43839517", "0.43780726", "0.43692368", "0.4368359", "0.43543944", "0.43399042", "0.43370473", "0.43365973", "0.4335292", "0.433465", "0.43338954", "0.4330855", "0.4325873", "0.43240225", "0.43072438", "0.43009195", "0.42891687", "0.42777765", "0.42763922", "0.4270564", "0.42675143", "0.42671517", "0.42621627", "0.42583272", "0.4252439", "0.42486352", "0.4241536", "0.4239371", "0.4231691", "0.42313376", "0.42272133", "0.4224443", "0.42123374", "0.42067677", "0.42009783", "0.4195737", "0.4195392", "0.41875544", "0.4183954", "0.41815224", "0.41814148", "0.41804153", "0.41642764", "0.41608253", "0.41608253", "0.4160437", "0.41592687", "0.41558775", "0.415304", "0.4148637", "0.41463295", "0.41456255", "0.41362113", "0.4118044", "0.4114021", "0.4112055", "0.4112055", "0.41026235", "0.40965682", "0.40964413", "0.40935767", "0.4085474", "0.40668386", "0.40658465", "0.40591586", "0.40385613", "0.40346527", "0.40334776", "0.4032047", "0.40316617", "0.40314353", "0.4023746" ]
0.6749866
0
Sets the current POV
def pov=(new_pov) new_pov @pov = pov.merge(new_pov) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pv\n @pv = Pv.find(params[:id])\n end", "def set_vprob\n @vprob = Vprob.find(params[:id])\n end", "def set_officev\n @officev = Officev.find(params[:id])\n end", "def set_poset\n @poset = Poset.find(params[:id])\n end", "def set_votacion\n @votacion = Votacion.find(params[:id])\n end", "def set_poke\n @poke = Poke.find(params[:id])\n end", "def set_vano\n @vano = Vano.find(params[:id])\n end", "def set_vet\n @vet = Vet.find(params[:id])\n end", "def set_prova_livro\n @prova_livro = ProvaLivro.find(params[:id])\n end", "def current_waypoint= _wp\n @current_waypoint = _wp\n SQF.setCurrentWaypoint @this, _wp\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vod\n @vod = Vod.find(params[:id])\n end", "def set_provin\n @provin = Provin.find(params[:id])\n end", "def set_poet\n @poet = Poet.find(params[:id])\n end", "def set_vip\n @vip = Vip.find(params[:id])\n end", "def set_vacation_approver\n @vacation_approver = VacationApprover.find(params[:id])\n end", "def viewpoint=(value)\n @viewpoint = value\n end", "def set_vendaplano\n @vendaplano = Vendaplano.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_voting\n @voting = Voting.find(params[:id])\n end", "def set_voting\n @voting = Voting.find(params[:id])\n end", "def set_voting\n @voting = Voting.find(params[:id])\n end", "def set_videoo\n @videoo = Videoo.find(params[:id])\n end", "def set_current_point(x, y, view)\r\n if ([email protected](view, x, y, @ip1))\r\n return false\r\n end\r\n need_draw = true\r\n \r\n # Set the tooltip that will be displayed\r\n view.tooltip = @ip.tooltip\r\n \r\n # Compute points\r\n if (@state == STATE_MOVING)\r\n vec = @wall.endpt - @wall.origin\r\n point = @ip.position.project_to_line(@wall.origin, @wall.endpt)\r\n start_vec = point - @wall.origin\r\n if ((start_vec.length == 0) || (start_vec.samedirection?(vec)))\r\n @offset = @wall.origin.distance point\r\n else\r\n @offset = 0 # point is beyond wall origin\r\n end\r\n Sketchup::set_status_text(@offset.to_s, SB_VCB_VALUE)\r\n \r\n find_end_points\r\n end\r\n\r\n view.invalidate if need_draw\r\nend", "def set_mottovote\n @mottovote = Mottovote.find(params[:id])\n end", "def set_rep_vote\n @rep_vote = RepVote.find(params[:id])\n end", "def set_pokemon\n @pokemon = Pokemon.find(params[:id])\n end", "def set_pokemon\n @pokemon = Pokemon.find(params[:id])\n end", "def set_pokemon\n @pokemon = Pokemon.find(params[:id])\n end", "def set_pokemon\n @pokemon = Pokemon.find(params[:id])\n end", "def set_pokemon\n @pokemon = Pokemon.find(params[:id])\n end", "def set_votable_item\n @votable_item = VotableItem.find(params[:id])\n end", "def vel=(v)\n self.mo = Vector[mo[0], *(mo[0]*v.normalize)]\n end", "def set_vicarage\n @vicarage = Vicarage.find(params[:id])\n end", "def pov\n default_pov unless @pov\n @pov\n end", "def set_vagance\n @vagance = Vagance.find(params[:id])\n end", "def set_userpoke\n @userpoke = Userpoke.find(params[:id])\n end", "def set_vas_question\n @vas_question = VasQuestion.find(params[:id])\n end", "def set_pvp_battle\n @pvp_battle = PvpBattle.find(params[:id])\n end", "def set_Vote(value)\n set_input(\"Vote\", value)\n end", "def set_Vote(value)\n set_input(\"Vote\", value)\n end", "def set_poligon\n @poligon = Poligon.find(params[:id])\n end", "def pos=(p1)\n #This is a stub, used for indexing\n end", "def set_tv\n @tv = Tv.find(params[:id])\n end", "def set_vote_poll\n @vote_poll = VotePoll.find(params[:id])\n end", "def set_pokemon_toy\n @pokemon_toy = PokemonToy.find(params[:id])\n end", "def set_ppt\n @presentation = Presentation.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_vote\n @vote = Vote.find(params[:id])\n end", "def set_proovedor\n @proovedor = Proovedor.find(params[:id])\n end", "def set_pozi\n @pozi = Pozi.find(params[:id])\n end", "def set_pin(p, v)\n return if borked?\n cmd = \"#{p.upcase}=#{v}\\r\\n\"\n @sp.write cmd\n end", "def set_vegetal\n @vegetal = Vegetal.find(params[:id])\n end", "def setpoint\n @setpoint\n end", "def set_PotentialStage(value)\n set_input(\"PotentialStage\", value)\n end", "def set_vik\n @vik = Vik.find(params[:id])\n end", "def set_provedor\n @provedor = Provedor.find(params[:id])\n end", "def v13_0=(value)\n @v13_0 = value\n end", "def set_lov\n @lov = Lov.find(params[:id])\n end", "def v10_13=(value)\n @v10_13 = value\n end", "def set_provincium\n @provincium = Provincium.find(params[:id])\n end", "def set_provincium\n @provincium = Provincium.find(params[:id])\n end", "def set_poc\n @poc = Poc.find(params[:id])\n end", "def set_poa\n @operative_plan = OperativePlan.find(params[:operative_plan_id])\n end", "def set_svote\n @svote = Svote.find(params[:id])\n end", "def set_vechicle\n @vechicle = Vechicle.find(params[:id])\n end", "def set_volunteer_opportunity\n @volunteer_opportunity = VolunteerOpportunity.find(params[:id])\n end", "def become(v)\n @x = v.x\n @y = v.y\n self\n end", "def set_next_veg(vgg)\n\t# Check if the next vegetable to eat is valid\n\t#check_veg(vgg)\n\t\n\t$cur_veg = vgg\nend", "def set_pokemon\n @pokemon = Pokemon.find(params[:id])\n end", "def set_viagem\n @viagem = Viagem.find(params[:id])\n end", "def set_vertical\n @vertical = Vertical.find(params[:id])\n end", "def set_vertical\n @vertical = Vertical.find(params[:id])\n end", "def set_gppt\n @gppt = Gppt.find(params[:id])\n end", "def set_prize\n @prize = Prize.find(params[:id])\n @goal = Goal.find(params[:goal_id])\n end", "def set_poem\n @poem = Poem.find(params[:id])\n end", "def set_poem\n @poem = Poem.find(params[:id])\n end", "def set_poem\n @poem = Poem.find(params[:id])\n end", "def set_vote\n\t\t@vote = Vote.find_by_id(params[:id])\n\t\tif @vote.nil?\n\t\t\tredirect_to main_app.admin_voters_path, alert: I18n.t(\"activerecord.errors.models.vote.not_found\")\n\t\tend\n\tend", "def set_vertical\n @vertical = Vertical.find(params[:id])\n end", "def set_pokemon_evolution\n @pokemon_evolution = PokemonEvolution.find(params[:id])\n end" ]
[ "0.6170124", "0.58831656", "0.5805392", "0.57393426", "0.5681483", "0.56764996", "0.55454487", "0.55406404", "0.55344963", "0.54906285", "0.5462184", "0.5428256", "0.54158354", "0.5414618", "0.5406406", "0.5395552", "0.53927726", "0.53619075", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53532916", "0.53470534", "0.53470534", "0.53470534", "0.53459436", "0.5345792", "0.5330637", "0.5266512", "0.5261223", "0.5261223", "0.5261223", "0.5261223", "0.5261223", "0.5250315", "0.52451235", "0.5237975", "0.52337754", "0.52182317", "0.52059007", "0.52003855", "0.5193208", "0.51853323", "0.51853323", "0.51848793", "0.51800966", "0.5169221", "0.51623046", "0.51609707", "0.5136552", "0.51275265", "0.51275265", "0.51275265", "0.5126027", "0.51232994", "0.5112633", "0.5110539", "0.5110392", "0.50972044", "0.5087483", "0.50854874", "0.50854176", "0.5083284", "0.50757825", "0.50542367", "0.50542367", "0.50536036", "0.5053533", "0.5051889", "0.504926", "0.503839", "0.5033963", "0.5032768", "0.50321573", "0.5028538", "0.50261897", "0.5021449", "0.5016633", "0.50154865", "0.50134325", "0.50134325", "0.50134325", "0.50118995", "0.5009159", "0.49891847" ]
0.61672235
1
Returns a hash indicating the current POV
def pov default_pov unless @pov @pov end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n @vbits.hash\n end", "def hash\n name.hash ^ version.hash\n end", "def hash\n 0\n end", "def hash\n [dpv_confirmation, dpv_cmra, dpv_vacant, dpv_active, dpv_footnotes, ews_match, lacs_indicator, lacs_return_code, suite_return_code].hash\n end", "def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end", "def hash\n return @revision.hash if @revision\n return object_id\n end", "def parcels_tracking\n hash[\"ParcelsTracking\"]\n end", "def hash\n @vector\n end", "def hash\n source_position.hash\n end", "def hash\n _window.hash\n end", "def hash\n [check_id, exceptions, key, links, port, proof, protocol, since, status].hash\n end", "def hash\n self[:pc].hash\n end", "def hash_code; end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash\n offset.hash\n end", "def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end", "def hash\n self.state.hash\n end", "def hash\n [_hash, name, owner].hash\n end", "def hash\n @hash || @hash = (value.hash * -1)\n end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash; end", "def hash\n @hash\n end", "def hash\r\n id.hash\r\n end", "def hash\n state.hash\n end", "def hash\n state.hash\n end", "def current_version_key\n \"#{::Album.hash_schema_version}.#{current_versions.version(self.album_type)}\"\n end", "def hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end", "def hash\n title.hash\n end", "def hash_id\n @hid\n end", "def hash\n @hash.hash\n end", "def hash\n id\n end", "def hash\n [oct, pc].hash\n end", "def verdict_details\n return @verdict_details\n end", "def hash\n @symbols.hash + 37*positive?.hash\n end", "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end", "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end", "def vote_hash # :nodoc:\n unless @vote_hash\n @vote_hash = {}\n image_votes.each do |vote|\n @vote_hash[vote.user_id.to_i] = vote.value.to_i\n end\n end\n @vote_hash\n end", "def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end", "def hash()\n #This is a stub, used for indexing\n end", "def hash\n @id\n end", "def prev_hash\n return nil unless out_point\n out_point.tx_hash\n end", "def hash\n return @id.hash\n end", "def hash\n @hash || calculate_hash!\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n prime = 31\n result = 1\n result = result * prime + (@decision_target == nil ? 0 : @decision_target.hash)\n result = prime * result + (@string_id == nil ? 0 : @string_id.hash)\n result\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\n type.hash ^ (id.hash >> 1)\n end", "def hash\n @offset.hash ^ @previous_offset.hash ^ @timestamp.hash\n end", "def hash\n @id.hash\n end", "def consistent_hash\n Zlib.crc32(self.to_yaml, 0)\n end", "def hash\n @id\n end", "def hash\n id.hash\n end", "def hash\n id.hash\n end", "def hash\r\n return to_s.hash\r\n end", "def c_vote_id(hash)\n sess_uri = \"http://polldaddy.com/n/#{hash}/#{self.poll_id}?#{Time.now.to_i}\"\n raw_id = self.http_get(sess_uri)\n raw_id[/'(.+?)'/,1]\n end", "def hash\n name.hash ^ provider.hash\n end", "def hash\n [sequence_number, corporate_number, process, correct, update_date, change_date, name, name_image_id, kind, prefecture_name, city_name, street_number, address_image_id, prefecture_code, city_code, post_code, address_outside, address_outside_image_id, close_date, close_cause, successor_corporate_number, change_cause, assignment_date, latest, en_name, en_prefecture_name, en_city_name, en_address_outside, furigana, hihyoji].hash\n end", "def hash\n end", "def hash\n end", "def hash\n end", "def hash\n guid.hash\n end", "def hash\n object_id\n end", "def hash\n [pulp_href, pulp_created, artifact, id, updated_date, description, issued_date, fromstr, status, title, summary, version, type, severity, solution, release, rights, pushcount, pkglist, references, reboot_suggested].hash\n end", "def hash\n value_id.hash\n end", "def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end", "def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end", "def current_sha\n @current_sha ||= Digest::SHA512.hexdigest(File.read(hostsfile_path))\n end", "def hash\n id.hash + 32 * bs_request.hash\n end", "def hash\n [title_code, _class, tenure, commonhold, addresses, is_not_main_title, is_scottish, purchase_register_entry_date, purchase_prices, purchase_dates].hash\n end", "def hash\n return to_s.hash\n end", "def hash\n size.hash ^ rank.hash\n end", "def competition_result_hash\n (\n person_id.hash ^\n (person_name.hash * 2) ^\n (place.hash * 3) ^\n (points.hash * 5) ^\n (team_id.hash * 7) ^\n (team_name.hash * 11)\n ).hash\n end", "def key\n 'V0'\n end", "def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end", "def to_hash() end", "def hash\n [ref, from, to, chg, line, loc, min, sale, plsp, incl, pror, proadj, tran, serv, dbt, adj, adjm, disc, opt, prop, bill, cust, lfln, date, qty, glref].hash\n end", "def hash\n @real.hash ^ @image.hash\n end", "def hash\n [id, banco, agencia, conta_corrente, especie, numero_convenio, carteira, codigo_cedente, especie_tipo, especie_documento, aceite, instrucoes, local_pagamento1, local_pagamento2, endereco_cobranca_emissor, nome_beneficiario, cnpj_beneficiario, operador, data, maquina].hash\n end" ]
[ "0.64884", "0.6146446", "0.6048215", "0.5984799", "0.5946371", "0.58862656", "0.5800202", "0.57888734", "0.5781309", "0.5768036", "0.5759176", "0.5740839", "0.5723677", "0.57196873", "0.57196873", "0.57196873", "0.57196873", "0.57196873", "0.57196873", "0.57196873", "0.57127464", "0.5696893", "0.56961364", "0.5682455", "0.56735516", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.5635625", "0.56206334", "0.56194216", "0.56094325", "0.56094325", "0.5584925", "0.55771214", "0.5572814", "0.5568873", "0.55647063", "0.5564511", "0.55454624", "0.5530269", "0.5527287", "0.55265284", "0.55265284", "0.5525306", "0.5522237", "0.5522008", "0.551986", "0.55134976", "0.5512839", "0.55113524", "0.5509571", "0.55067253", "0.55050915", "0.5505072", "0.5505072", "0.5505072", "0.5505072", "0.5505072", "0.5505072", "0.5505072", "0.5505072", "0.5505072", "0.54872733", "0.54827595", "0.54813135", "0.54784054", "0.5470254", "0.5462842", "0.5462842", "0.5459598", "0.54593426", "0.5453153", "0.5452571", "0.54355425", "0.54355425", "0.54355425", "0.5395874", "0.538789", "0.5372715", "0.53706527", "0.5356255", "0.5338507", "0.5328945", "0.532092", "0.5317517", "0.5313096", "0.53040123", "0.52992207", "0.5298976", "0.52988064", "0.5291633", "0.5289453", "0.5281932", "0.52818197" ]
0.0
-1
Get the default POV
def default_pov # Make sure we are connected check_attached @logger.info "Retrieving default POV" @req.GetDefaultPOV do |xml| xml.sID @session_id xml.getAtts '0' xml.alsTbl @preferences.alias_table end doc = invoke dims = doc.at('//res_GetDefaultPOV/dims').to_plain_text.split('|') @dimensions = dims unless @dimensions mbrs = doc.at('//res_GetDefaultPOV/mbrs').to_plain_text.split('|') @pov = {} 0.upto(dims.size-1) do |i| @pov[dims[i]] = mbrs[i] end @pov end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pov\n default_pov unless @pov\n @pov\n end", "def default\n find(\"Default\")\n end", "def get_default\n if self.current_defaults\n self.current_defaults.first\n else\n raise \"Cette instance ne possède de #{self.class.name} par default\"\n end\n end", "def default_variant\n return nil if parent\n @default_variant ||= variants.find(&:default?)\n end", "def default\n self['default']\n end", "def default_place\n [:noplace, :baduelle, :baltimora];\n end", "def default\n find_by(default: 1)\n end", "def default\r\n @opts[:default]\r\n end", "def default\n @default\n end", "def default\n return @default\n end", "def default_version\n return @versions[:large] if @versions.key?(:large)\n return @versions[:medium] if @versions.key?(:medium)\n return @versions[:small] if @versions.key?(:small)\n end", "def default\n options[:default]\n end", "def default_value\n self['default']\n end", "def get_default_preference(prefs_section, pref)\n driver.getDefaultPref(prefs_section, pref)\n end", "def po_box\n \"PO BOX #{po_box_number}\" unless po_box_number.vacant?\n end", "def default=(p0) end", "def assign_default_template\n self.variant ||= Variant.default.first\n end", "def get_default\n list.each do |plan|\n return plan if plan['default']\n end\n nil\n end", "def get_default\n list.each do |plan|\n return plan if plan['default']\n end\n nil\n end", "def get_default_value\n raise 'get_default_value must be implemented'\n end", "def preferred_name\n object.demographics&.preferred_name&.text\n end", "def default_config\n UvConfiguration.new\n end", "def default_pseud\n pseuds.to_enum.find(&:is_default?) || pseuds.first\n end", "def default_design\n designs.select { |d| d.default? }.first\n end", "def default\n game = self.new\n game.state = 'Texas' if game.respond_to? :state\n game.origin = 'hunted' if game.respond_to? :origin\n game.gender = 'male' if game.respond_to? :gender\n if game.respond_to? :parts\n parts = Part::NAMES.map { |part_name| {name: part_name} }\n parts << { other: true }\n game.parts = parts\n end\n game\n end", "def prov_set_default_options\n {\n :reason_text => nil,\n :applied_states => PROV_STATES.keys,\n :type_choice => 'all',\n :user_choice => approver? ? 'all' : current_user.id,\n :time_period => 7,\n }\n end", "def default_gear\n @gears[0]\n end", "def default_value\n @value || recommended_value\n end", "def default_value\n @value || recommended_value\n end", "def default\n by_id(default_id)\n end", "def default\n @default || atlas_default\n end", "def default\n nil\n end", "def default\n nil\n end", "def default_game_type\n GameType.game_types.first\n end", "def view_first\n return @vassals[0].view_first\n end", "def default_v_score ; raise 'not implemented'; end", "def default\n @default ||= highest\n end", "def default\n `return self.$default;`\n end", "def defaults\n {\n 'VERSION' => '4.0',\n 'PRODID' => \"-//Tilia//Tilia VObject #{Version::VERSION}//EN\",\n 'UID' => \"tilia-vobject-#{UuidUtil.uuid}\"\n }\n end", "def default_values\n # always uses the same elevator system\n self.elevator_system ||= ElevatorSystem.first\n # always starts on the first floor\n self.floor ||= Floor.where(number: 1).first\n end", "def default\n end", "def default_result\n data.default_result\n end", "def default\n igetset(:default) { nil }\n end", "def default_profile_pic\n profile_pics.where(is_default: true).first || ProfilePic.new\n end", "def default_value\n return @default_value\n end", "def choose_pokemon\n choice = nil\n call_scene(GamePlay::StorageTrade) { |scene| choice = scene.return_data }\n return choice\n end", "def get_default_label(t)\n arg = (t[@base_locator+\"/types/label\"].first)?(t[@base_locator+\"/types/label\"].first):(t[\"-\"].first)\n if arg\n return arg.value\n else\n return \"Unknown\"\n end\n end", "def preferred_name(default, preferred)\n if default.nil? && preferred.nil?\n 'No one'\n elsif preferred.nil?\n default\n else\n preferred\n end\n end", "def default\n #----------\n \n # the default field value; retrieve from the options\n default = options[ :default ]\n \n # is there are default value?\n unless default.nil?\n self.value_from( default.respond_to?( :call ) ? default.call : default )\n end\n \n end", "def set_default_stage\n if self.stage.blank?\n self.stage = self.instance.deal_stages.where(:percent.gt => 0).sorted_by_percentage.first\n end\n end", "def default\n attributes.default\n end", "def list_default\n normalize rvm(:list, :default, :string).stdout\n end", "def default\n entry = enumerations[type]\n entry[:default] || entry[:values]&.first\n end", "def get_preset\n pricingoptions.find_by(:preset => true) || pricingoptions.first\n end", "def default; end", "def default; end", "def govp()\n cmd(\"GOVP\").to_i * 0.1\n end", "def default_value\n return unless default?\n\n node_parts[1]\n end", "def provision_group_default\n @attributes[:provision_group_default]\n end", "def _pv_default(opts, key, default_value)\n value = _pv_opts_lookup(opts, key)\n if value == nil\n opts[key] = default_value\n end\n end", "def preference_for setting\n\n if preferences = self.preference\n pref = preferences.attributes[setting.to_s]\n return pref unless pref.empty?\n end\n\n Preference.default_for setting\n end", "def default_uv_config\n ViewerConfiguration.new\n end", "def primary_property\n pp = self.variant_properties.find_by(primary: true)\n pp ? pp : self.variant_properties.first\n end", "def default?(preference)\n self.send(preference.to_sym) == self.class.new.send(preference.to_sym)\n end", "def valores_por_default\n \t\tself.costo ||= 0\n \tend", "def default\n on_current_site.find_by(default: true)\n end", "def default_value\n return :not_applicable if c100.consent_order? || c100.child_protection_cases?\n\n GenericYesNo::NO\n end", "def default_X__PROPERTY_INT__X\n config_get_default('X__RESOURCE_NAME__X', 'X__PROPERTY_INT__X')\n end", "def default_for(entry)\n enumerations.dig(entry.to_sym, :default)\n end", "def default\n @stubs[:default]\n end", "def default_values\n {name: \"default\", index: -1, experiment_id: nil}\n end", "def primary_vm\n return vms.values.first if !multivm?\n\n config.global.vm.defined_vms.each do |name, subvm|\n return vms[name] if subvm.options[:primary]\n end\n\n nil\n end", "def ui_default s\n\t\t\tUI_DEFAULTS[s]\n\t\tend", "def default\n return nil unless default_value\n default_value.respond_to?(:call) ? default_value.call : default_value.dup\n end", "def v13_0\n return @v13_0\n end", "def read(key, default=nil)\n document = @dao.collection.find_one(selector(key))\n if !document.nil?\n document['v']\n else\n default\n end\n end", "def default(value)\n CommonsInstitutions.defaults[value.to_s.to_sym]\n end", "def default_version\n nil\n end", "def default\n children.where(:is_default => true).order(:position_value).first\n end", "def default_location\n @default_location ||= Spree::StockLocation.find_by_name('default')\n end", "def default_overlay\n @default_overlay ||= DataOverlay.new(self)\n end", "def label()\n if @v_index == nil\n return nil\n else\n return Vocab::dataviews_strings[@v_index]\n end\n end", "def get_defaults( name )\n @defaults[ name ] || {}\n end", "def configured_default\n @options[:default] || default_entry\n end", "def personal_objective_pronoun\n return @gender.personal_objective\n end", "def default?\n @vpc.is_default\n end", "def default(index)\n @defaults[index.to_s]\n end", "def default_pseud\n self.pseuds.where(:is_default => true).first\n end", "def fallback_to_first_possible_paper_reference\n model = @model_hash.values.detect { |model| model.try(:paper) }\n model.try(:paper)\n end", "def default_value\n\t\t# This bizarre construct is done in order to not be reliant\n\t\t# on the inherent assignment-order when using Property.new({...})\n\t\t# since that hash can be ordered anywhich way .daniel\n\t\tif value_id\n\t\t\tvalue_object.default_value\n\t\telse\t\t\t\n\t\t\t@default_value\n\t\tend\n\tend", "def get_default\n @df_int\n end", "def default_value(value); value; end", "def get_default(type=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'type', type);\n\t\t\tclient.queue_service_action_call('conversionprofile', 'getDefault', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def default\n @what = :default\n self\n end", "def initial\n if @default.nil?\n # no default - choose the middle option\n choices.size / 2\n elsif default_choice = choices.find_by(:name, @default)\n # found a Choice by name - use it\n choices.index(default_choice)\n else\n # default is the index number\n @default - 1\n end\n end", "def vrf_name\n return :default if @resource[:vrf_name] == :default &&\n @property_hash[:vrf_name] ==\n @aaa_group.default_vrf\n @property_hash[:vrf_name]\n end", "def default\n ''\n end", "def default_profile\n profiles.find_by_id(default_profile_id)\n end", "def today_pv(hours = 1)\n pv = @pv_value / hours\n pv.round(1)\n end", "def get_graphics_from_default\n if CXJ::CLASS_EXTENSIONS::ENABLE_COMBO_SPECIFIC_GRAPHICS\n return combo_class_graphics[@class_id][@subclass_id] if !combo_class_graphics.nil? && !combo_class_graphics[@class_id].nil? && !combo_class_graphics[@class_id][@subclass_id].nil?\n return default_combo_class_graphics[@class_id][@subclass_id] if !default_combo_class_graphics.nil? && !default_combo_class_graphics[@class_id].nil? && !default_combo_class_graphics[@class_id][@subclass_id].nil?\n end\n return generic_class_graphics[@class_id] if !generic_class_graphics.nil? && !generic_class_graphics[@class_id].nil?\n return default_generic_class_graphics[@class_id] if !default_generic_class_graphics.nil? && !default_generic_class_graphics[@class_id].nil?\n return nil\n end" ]
[ "0.5939354", "0.59290737", "0.5922274", "0.5554738", "0.55447453", "0.55122954", "0.5501516", "0.55004627", "0.5482217", "0.54771745", "0.54033804", "0.53995204", "0.5362484", "0.5357589", "0.5341343", "0.5334122", "0.5328234", "0.53162336", "0.53162336", "0.5245872", "0.52241766", "0.52220154", "0.5218175", "0.52179426", "0.52131647", "0.5190645", "0.51385975", "0.51328653", "0.51328653", "0.51232266", "0.5121289", "0.51070887", "0.51070887", "0.5100501", "0.5094126", "0.50900704", "0.5086216", "0.50787336", "0.5042511", "0.5041435", "0.502131", "0.5001642", "0.49888802", "0.49690622", "0.49562058", "0.49494675", "0.49257436", "0.49254104", "0.49235988", "0.49214965", "0.49209648", "0.49066067", "0.49054778", "0.4898007", "0.48961276", "0.48961276", "0.48937926", "0.48877895", "0.48834273", "0.48772606", "0.48708993", "0.48701924", "0.48527238", "0.48508096", "0.48502612", "0.48496497", "0.48383102", "0.48377943", "0.4834583", "0.4832194", "0.48304725", "0.4824967", "0.48237878", "0.48236883", "0.48221684", "0.4819656", "0.48121423", "0.4809327", "0.4804431", "0.48029986", "0.47996628", "0.47993493", "0.4794145", "0.47810385", "0.47797644", "0.47797164", "0.47721344", "0.477027", "0.47658965", "0.4765519", "0.4764288", "0.47639993", "0.47546428", "0.47533467", "0.47528657", "0.47527277", "0.47508973", "0.47501332", "0.47474235", "0.4746678" ]
0.7644387
0
Gets a default grid with the specified POV
def default_grid # Make sure we are attached to a cube check_attached @logger.info "Retrieving default grid" @req.GetDefaultGrid do |xml| xml.sID @session_id @preferences.inject_xml xml, @provider_type xml.backgroundpov do |xml| pov.each do |dim,mbr| xml.dim :name => dim, :pov => mbr end end end doc = invoke Grid.from_xml(doc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_grid\n Array.new(7) { Array.new(6) { Cell.new } }\n end", "def default_pov\n # Make sure we are connected\n check_attached\n\n @logger.info \"Retrieving default POV\"\n @req.GetDefaultPOV do |xml|\n xml.sID @session_id\n xml.getAtts '0'\n xml.alsTbl @preferences.alias_table\n end\n doc = invoke\n dims = doc.at('//res_GetDefaultPOV/dims').to_plain_text.split('|')\n @dimensions = dims unless @dimensions\n mbrs = doc.at('//res_GetDefaultPOV/mbrs').to_plain_text.split('|')\n @pov = {}\n 0.upto(dims.size-1) do |i|\n @pov[dims[i]] = mbrs[i]\n end\n @pov\n end", "def default_grid\n Array.new(3) { Array.new(3) {Cell.new} }\n end", "def default_grid\n Array.new(7) { Array.new(6) { CellNode.new }}\n end", "def free_form_grid(rows, cols, grid_pov=nil)\n # Make sure we are attached to a cube\n check_attached\n get_dimensions unless @dimensions\n\n # Update the POV if one is specified\n if grid_pov\n self.pov = grid_pov\n end\n\n grid = Grid.define(@dimensions, pov, rows, cols)\n\n @logger.info \"Retrieving free-form grid\"\n @req.ProcessFreeFormGrid do |xml|\n xml.sID @session_id\n @preferences.inject_xml xml, @provider_type\n xml.backgroundpov do |xml|\n pov.each do |dim,mbr|\n xml.dim :name => dim, :pov => mbr\n end\n end\n grid.to_xml(xml, false)\n grid.dims_to_xml(xml)\n end\n doc = invoke\n grid = Grid.from_xml(doc)\n\n # The grid returned does not contain data, so perform a refresh\n refresh(grid)\n end", "def grid\n @grid ||= if @opts.key? \"grid\"\n @opts.slice(\"grid\", \",\")\n else\n %w[0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%]\n end\n end", "def grid\n @grid ||= {}\nend", "def default_grid\n array = Array.new(8) { Array.new(8) }\n\n array[0][0] = Rook.new('white', [0,0], 'slide')\n array[1][0] = Knight.new('white', [1,0], 'step')\n array[2][0] = Bishop.new('white', [2,0], 'slide')\n array[3][0] = Queen.new('white', [3,0], 'slide')\n array[4][0] = King.new('white', [4,0], 'step')\n array[5][0] = Bishop.new('white', [5,0], 'slide')\n array[6][0] = Knight.new('white', [6,0], 'step')\n array[7][0] = Rook.new('white', [7,0], 'slide')\n array[0..7].each_with_index { |column, index| \n column[1] = Pawn.new('white', [index,1], 'step') }\n\n array[0][7] = Rook.new('black', [0,7], 'slide')\n array[1][7] = Knight.new('black', [1,7], 'step')\n array[2][7] = Bishop.new('black', [2,7], 'slide')\n array[3][7] = Queen.new('black', [3,7], 'slide')\n array[4][7] = King.new('black', [4,7], 'step')\n array[5][7] = Bishop.new('black', [5,7], 'slide')\n array[6][7] = Knight.new('black', [6,7], 'step')\n array[7][7] = Rook.new('black', [7,7], 'slide')\n array[0..7].each_with_index { |column, index| \n column[6] = Pawn.new('black', [index,6], 'step') }\n\n array\n end", "def gridpoints\n gridpoints = {'l' => @ngauss, 'e' => @negrid, 's' => @nspec}\n if @grid_option == \"single\"\n gridpoints.absorb({'x'=>1, 'y'=>1})\n else\n gridpoints.absorb({'x' => (@ntheta0 or (2.0 * (@nx - 1.0) / 3.0 + 1.0).floor), 'y' => (@naky or ((@ny - 1.0) / 3.0 + 1.0).floor)})\n end\n return gridpoints\nend", "def grid(index)\r\n out_short_name = FFI::MemoryPointer.new(:string)\r\n out_full_name = FFI::MemoryPointer.new(:string)\r\n out_package_name = FFI::MemoryPointer.new(:string)\r\n out_url = FFI::MemoryPointer.new(:string)\r\n out_direct_download = FFI::MemoryPointer.new(:int)\r\n out_open_license = FFI::MemoryPointer.new(:int)\r\n out_available = FFI::MemoryPointer.new(:int)\r\n\r\n result = Api.proj_coordoperation_get_grid_used(self.context, self, index,\r\n out_short_name, out_full_name, out_package_name,\r\n out_url, out_direct_download ,\r\n out_open_license, out_available)\r\n\r\n if result != 1\r\n Error.check_object(self)\r\n end\r\n\r\n name_ptr = out_short_name.read_pointer\r\n full_name_ptr = out_full_name.read_pointer\r\n package_name_ptr = out_package_name.read_pointer\r\n url_ptr = out_url.read_pointer\r\n downloadable_ptr = out_direct_download \r\n open_license_ptr = out_open_license\r\n available_ptr = out_available\r\n\r\n unless name_ptr.null?\r\n Grid.new(name_ptr.read_string_to_null, self.context,\r\n full_name: full_name_ptr.null? ? nil : full_name_ptr.read_string_to_null,\r\n package_name: package_name_ptr.null? ? nil : package_name_ptr.read_string_to_null,\r\n url: url_ptr.null? ? nil : url_ptr.read_string_to_null,\r\n downloadable: downloadable_ptr.null? ? nil : downloadable_ptr.read_int == 1 ? true : false,\r\n open_license: open_license_ptr.null? ? nil : open_license_ptr.read_int == 1 ? true : false,\r\n available: available_ptr.null? ? nil : available_ptr.read_int == 1 ? true : false)\r\n end\r\n end", "def grids\n @grids ||= {}\n end", "def create_grid\n grid = Array.new(6, Array.new(7, BLANK))\n end", "def grid\n @grid ||=\n {\n rows: lines_to_ranges(lines[:horizontal]),\n columns: lines_to_ranges(lines[:vertical])\n }\n end", "def get_cells(y_index, x_index, y_vector, x_vector, velocity)\n cells = []\n\n for i in 0 .. velocity\n x = (x_vector * i) + x_index\n y = (y_vector * i) + y_index\n if cell_in_grid(y, x)\n cells.push(OpenStruct.new(:x => x, :y => y, :val => $grid[y][x]))\n end\n\n end\n return cells\nend", "def initialize(grid=empty_grid)\n @grid = grid\n end", "def make_grid\n @grid = Array.new(4){Array.new(4)}\n end", "def grids\n [grid].compact\n end", "def create_grid\n @grid = {\"1a\" => \" \", \"1b\" => \" \", \"1c\" => \" \", \"1d\" => \" \", \"1e\" => \" \",\n \"2a\" => \" \", \"2b\" => \" \", \"2c\" => \" \", \"2d\" => \" \", \"2e\" => \" \",\n \"3a\" => \" \", \"3b\" => \" \", \"3c\" => \" \", \"3d\" => \" \", \"3e\" => \" \",\n \"4a\" => \" \", \"4b\" => \" \", \"4c\" => \" \", \"4d\" => \" \", \"4e\" => \" \",\n \"5a\" => \" \", \"5b\" => \" \", \"5c\" => \" \", \"5d\" => \" \", \"5e\" => \" \"}\n end", "def get_runner_gv(result,course,meet_id)\n return get_initial_gv(result) if @c_runner_gv[result.runner_id].nil?\n @c_runner_gv[result.runner_id][:cgv]\n end", "def [](pos)\n x, y = pos.first, pos[1]\n @grid[x][y]\n end", "def [](pos)\n row, col = pos\n @grid[row][col]\n end", "def board\n board = Board.new(true)\n grid do |p|\n new_position = p\n new_color = p.color\n new_piece = p.class.new(new_position, new_color, board )\n board[p.pos] = new_piece\n end\n board\n end", "def [](pos)\n x, y = pos\n grid[x][y]\n end", "def show\n @treinos_grid = initialize_grid(@aluno.treinos)\n end", "def start_cell\n if options[:type] == :polar\n grid[grid.rows-1, 0]\n else\n if !options[:distances] || options[:distances] == :auto\n column = grid.columns.times.find {|i| grid[0,i] }\n return grid[0,column] if column\n row = grid.rows.times.find {|i| grid[i,0] }\n return grid[row,0]\n else\n grid[*options[:distances]]\n end\n end\n end", "def [](pos)\n row, col = pos\n grid[row][col]\n end", "def [](pos)\n row, col = pos\n grid[row][col]\n end", "def grid_index(item)\n # noinspection RubyMismatchedReturnType\n return item if item.is_a?(GridIndex)\n GridIndex.new(item, grid_header_rows) unless item.blank?\n end", "def [](pos)\n x, y = pos\n @grid[x][y]\n end", "def [](pos)\n row, col = pos\n @grid[row][col]\n end", "def [](pos)\n row, col = pos \n @grid[row][col]\n end", "def draw_grid\n case view\n when :south_east\n size_y.times do |y|\n size_x.times do |x|\n draw_tile(x, y, x, y)\n end\n end\n when :south_west\n size_x.times do |y|\n size_y.times do |x|\n draw_tile(x, y, size_x - 1 - y, x)\n end\n end\n when :north_west\n size_y.times do |y|\n size_x.times do |x|\n draw_tile(x, y, size_x - 1 - x, size_y - 1- y)\n end\n end\n when :north_east\n size_x.times do |y|\n size_y.times do |x|\n draw_tile(x, y, y, size_y - 1 - x)\n end\n end\n else\n throw Exception.new(\"view was out of bounds!\")\n end\n\n end", "def [](pos)\n row = pos.first\n col = pos.last\n @grid[row][col]\n end", "def [](pos)\n x, y = pos\n @grid[x][y] \n end", "def index\n @gos_grid = initialize_grid(Go)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gos_grid }\n end\n end", "def three_row_grid\n grid = []\n grid << [\n Cell.new(:alive, 0, 0),\n Cell.new(:alive, 0, 1),\n Cell.new(:dead, 0, 2)\n ]\n grid << [\n Cell.new(:alive, 1, 0),\n Cell.new(:dead, 1, 1),\n Cell.new(:dead, 1, 2)\n ]\n grid << [\n Cell.new(:dead, 2, 0),\n Cell.new(:dead, 2, 1),\n Cell.new(:dead, 2, 2)\n ]\n grid\nend", "def set_default\n [[:white, 0, 1], [:black, 7, 6]].each do |color, row1, row2|\n [\"Rook\", \"Knight\", \"Elephant\", \"Queen\", \"King\", \"Elephant\", \"Knight\", \"Rook\"].each.with_index do |class_name, column|\n self[column, row1] = Module.const_get(\"ChessEngine::#{class_name}\").new(color)\n end\n\n 0.upto(7) do |column|\n self[column, row2] = Pawn.new(color)\n end\n end\n end", "def [](pos)\n r, c = pos[0],pos[1]\n grid[r][c]\n end", "def initialize\n @grid = empty_board\n end", "def index\n @slides_grid = initialize_grid(Slide,:per_page => 10)\n end", "def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end", "def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end", "def grid(name)\r\n out_full_name = FFI::MemoryPointer.new(:string)\r\n out_package_name = FFI::MemoryPointer.new(:string)\r\n out_url = FFI::MemoryPointer.new(:string)\r\n out_downloadable = FFI::MemoryPointer.new(:int)\r\n out_open_license = FFI::MemoryPointer.new(:int)\r\n out_available = FFI::MemoryPointer.new(:int)\r\n\r\n result = Api.proj_grid_get_info_from_database(self.context, name,\r\n out_full_name, out_package_name, out_url,\r\n out_downloadable, out_open_license, out_available)\r\n\r\n if result == 1\r\n full_name_ptr = out_full_name.read_pointer\r\n package_name_ptr = out_package_name.read_pointer\r\n url_ptr = out_url.read_pointer\r\n\r\n downloadable_ptr = out_downloadable\r\n open_license_ptr = out_open_license\r\n available_ptr = out_available\r\n\r\n full_name = full_name_ptr.read_string_to_null\r\n package_name = package_name_ptr.read_string_to_null\r\n url = url_ptr.read_string_to_null\r\n\r\n downloadable = downloadable_ptr.read_int == 1 ? true : false\r\n open_license = open_license_ptr.read_int == 1 ? true : false\r\n available = available_ptr.read_int == 1 ? true : false\r\n\r\n Grid.new(name, self.context,\r\n full_name: full_name, package_name: package_name,\r\n url: url ? URI(url) : nil,\r\n downloadable: downloadable, open_license: open_license, available: available)\r\n else\r\n Error.check_context(self.context)\r\n end\r\n end", "def vflip\n g = Grid.new\n self.each do |point,v|\n g[Point.new( point.x, @height - point.y - 1 )] = v \n end\n g\n end", "def initial_piece_placements\n self.grid.each_with_index do |row, row_idx|\n row.each_with_index do |cell, cell_idx|\n pos = [row_idx, cell_idx]\n if pos.all? {|coord| coord.even?} || pos.all? {|coord| coord.odd?}\n if row_idx < 3\n self[pos] = Piece.new(self, pos, :white)\n elsif row_idx >= 5\n self[pos] = Piece.new(self, pos, :black)\n end\n end\n end\n end\n end", "def start_grid\n Array.new(@lines) { Array.new(@columns) { Cell.new } }\n end", "def initialize(grid = Board.default_grid)\n @grid = grid\n end", "def grid\n Matrix.build(@row_count, @column_count) { Cell.new }.to_a\n end", "def absolute_point_to_grid(point)\n if point.x < min_x || point.x >= max_x || point.y < min_y || point.y >= max_y\n return nil\n end\n Point.new(((point.x - @pos.x) / @cellsize).to_i, ((point.y - @pos.y) / @cellsize).to_i)\n end", "def [](pos)\n grid[pos[0]][pos[1]]\n end", "def index!(division = 10)\n\t\t@grid_division = division\n\t\t@grid_size = env_max.zip(env_min).map{|x| (x[0] - x[1]).abs}.max / division\n\t\t@db = Hash.new\n\t\tself.each do |e|\n\t\t\th = hash(e.location)\n\t\t\t@db[h] ||= Array.new\n\t\t\t@db[h] << e\n\t\tend\n\t\treturn self\n\tend", "def default_values\n # always uses the same elevator system\n self.elevator_system ||= ElevatorSystem.first\n # always starts on the first floor\n self.floor ||= Floor.where(number: 1).first\n end", "def [](pos)\n self.grid[pos[1]][pos[0]]\n end", "def get_case(case_selected)\n grid[case_selected[0]][case_selected[1]]\n end", "def hflip\n g = Grid.new\n self.each do |point,v|\n g[Point.new( @width - point.x - 1, point.y )] = v \n end\n g\n end", "def get_cell(x, y)\n grid[x][y]\n end", "def index\n @grid_cells = GridCell.all\n end", "def [](index)\n self.grid[index]\n end", "def populate_grid\n start_rows = { red: (0..2), black: (5..7) }\n\n 8.times do |x|\n 8.times do |y|\n [:red, :black].each do |color|\n if (x + y).even? && start_rows[color].include?(y)\n self[[x, y]] = Piece.new(color, [x, y], self)\n end\n end\n end\n end\n\n grid.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n puts \"x=#{x}, y=#{y}, cell.class=#{cell.class}\"\n end\n end\n end", "def load_model_for_grid\n if params[\"model_id\"]\n @model_for_grid = @pool.models.find(params[\"model_id\"])\n else\n #if (params[:format].nil? || params[:format] == \"html\") && params[\"view\"] != \"browse\"\n if params[\"view\"] == \"grid\"\n @model_for_grid = @pool.models.first\n end\n end\n end", "def grid; @parameters['GRiD']; end", "def generate_grid\n grid = []\n @y.times do\n row = []\n @x.times do\n row << nil\n end\n grid << row\n end\n grid\n end", "def default_gear\n @gears[0]\n end", "def prepare_grid\n\t\tArray.new(rows) do |row|\n\t\t\tArray.new(columns) do |col|\n\t\t\t\tCell.new(row, col)\n\t\t\tend\n\t\tend\n\tend", "def max_grids_position\n Grid.where(sheet_variable_id: sheet_variables.select(:id)).pluck(:position).max || -1\n end", "def build_grid\n header = [\" \", \" a \", \" b \", \" c \", \" d \", \" e \", \" f \", \" g \", \" h \"]\n grid_display = @board.grid.map.with_index do |row, index|\n [8 - index] + build_row(row, index)\n end\n grid_display.unshift(header)\n end", "def [](row, col)\n @grid[row][col]\n end", "def get_piece(pos)\n @grid[pos[0]][pos[1]]\n end", "def grid\n state.grid\n end", "def grid\n state.grid\n end", "def get_point(pos)\n @grid[pos[0]][pos[1]]\n end", "def get_puzzle_grid(level)\n\n #get a random grid\n page = Net::HTTP.get_response(\"show.websudoku.com\", \"?select&level=#{level}\")\n\n #find the puzzle number for reference\n page.body =~ /Puzzle (.*?) /\n puzzle_id = $1\n\n #the puzzle is in a giant table\n page.body =~ /<TABLE .*?>(.*)?<\\/TABLE>/\n table = $1\n\n # each cell has ID=cxy where x is column, y is row\n grid = []\n (0..8).each do |r|\n row = []\n (0..8).each do |c|\n table =~ /<TD CLASS=.. ID=c#{c}#{r}>(.*?)<\\/TD>/\n cell = $1\n cell =~ /READONLY VALUE=\"(\\d)\"/\n if cell\n row.push($1.to_i)\n else\n row.push(0)\n end\n end\n grid.push(row)\n end\n\n return grid\nend", "def cell(row_num, col_num)\n return @puzzle[row_num][col_num]\n end", "def get_initial_gv(result)\n gv = (@course_time / result.float_time) * 100\n @c_runner_gv[result.runner_id] = {cgv: gv, score: gv, races: 1}\n gv\n end", "def initiate_grid\n new_grid = []\n @width.times do |x|\n new_grid[x] = []\n @height.times do |y|\n new_grid[x][y] = 0\n end\n end\n new_grid\n end", "def new_board()\n\t\t@default_box = \" - \"\n\t\tblank_board = Hash.new\n\t\ti = 1\n\t\twhile i < 10\n\t\t\tblank_board[i] = @default_box\n\t\t\ti += 1\n\t\tend\n\t\treturn blank_board\n\tend", "def index\n @game_pictures = initialize_grid(Game)\n end", "def cells_grid_1by1\n [\n [\n MazeMagic::Maze::Edge.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::Edge.instance\n ],\n [\n MazeMagic::Maze::VerticalWall.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::VerticalWall.instance\n ]\n ]\n end", "def grid(number)\n v = number + 1 # number of vertices\n coefficient = 1\n routes = 0\n 1.upto(v) do |i|\n routes += coefficient * coefficient\n coefficient = coefficient * (v - i) / i\n end\n routes\n end", "def grid\n @grid = if params[:grid]\n screen.grids.find {|grid| grid.class.to_s == params[:grid]}\n else\n screen.grids.find {|grid| grid.model.to_s.underscore.pluralize == controller_name}\n end\n # if can't find, return the first grid\n @grid || screen.grids.first\n end", "def default_recruit_board\n program.recruit_boards.where(:_id => recruit_boards.first.try(:id)).first\n end", "def grid(options = {}, &block)\n Grid.new({ parent: self }.merge!(options), &block)\n end", "def index\n @grids = Grid.all\n end", "def index\n @grids = Grid.all\n end", "def index\n @grids = Grid.all\n end", "def parse_clue(board, i, hv)\n combs_pre = combs_for_hint_value(hv)\n combs = remove_invalid_combs(board, i, combs_pre)\n coords = hint_idx_to_coord(i)\n\n coords.map.with_index do |coord, idx|\n possibilities = combs.map{ |a| a[idx] }.uniq\n {x: coord[:x], y: coord[:y], possibilities: possibilities}\n end\nend", "def translate_index_to_grid_position(index)\n @grid_positions[index]\nend", "def [](pos)\n if valid_pos?(pos)\n row, col = pos\n @grid[row][col]\n else\n puts \"Invalid position\"\n end\n end", "def [](row, column)\n\t\treturn nil unless row.between?(0, @rows-1)\n\t\treturn nil unless column.between?(0, @columns-1)\n\t\t@grid[row][column]\n\tend", "def index\n @storage=current_storage\n if [email protected]_pick\n @[email protected](\"shelf_type!='pick' or shelf_type is null\")\n end\n @shelves_grid = initialize_grid(@shelves,\n :order => 'shelves.id',\n :order_direction => 'desc',\n :include => :area)\n end", "def [](pos)\n @grid[pos[0]][pos[1]]\n # row,col = pos\n # @grid[row][col]\n end", "def grid(*)\n super\n end", "def default_place\n [:noplace, :baduelle, :baltimora];\n end", "def display(game) #this game refers to an instance of the game class\n p game.grid #WOWOW\n end", "def get_pg_inside\n pg_inside = {}\n\n # Get pnics in use in standard switches\n @item.config.network.vswitch.each do |vs|\n pg_inside[vs.name] = []\n vs.portgroup.each do |pg|\n pg.slice!(\"key-vim.host.PortGroup-\")\n pg_inside[vs.name] << pg\n end\n end\n\n pg_inside\n end", "def grid\n rows = []\n (1..self.height).to_a.each do |h|\n rows << row(h)\n end\n rows.reverse\n end", "def get x, y\n if x<0 || x>=size || y<0 || y>=size\n raise ArgumentError, \"Is there a #{x},#{y} cell in a #{size}x#{size} sudoku ?\"\n end\n @grid[x][y]\n end", "def find_empty_cell()\n\t$value_grid.each_with_index do |row, index_r|\n\t\trow.each_with_index do |col, index_c|\n\t\t\tif col.to_i == 0\n\t\t\t\treturn [index_r,index_c]\n\t\t\tend\n\t\tend\n\tend\n\treturn [$N,$N]\nend", "def generate\n for i in 0..$dimensions[0]-1\n for j in 0..$dimensions[1]-1\n for k in 0..$d-1\n item=populate k\n if item!=0 \n $grid[[i,j,k]]=item\n end\n end\n end\n end\nend", "def dup\n gridcpy = Grid.new(@num_rows,@num_columns)\n for r in 0...@num_rows\n for c in 0...@num_columns\n cur_cell = self.getCell(r,c)\n gridcpy.getCell(r,c).living = cur_cell.living\n gridcpy.getCell(r,c).neighbors = cur_cell.neighbors \n end # end col loop\n end # end row loop\n return gridcpy\n end" ]
[ "0.5971977", "0.5965197", "0.575852", "0.5713396", "0.53836936", "0.53076774", "0.524211", "0.5237517", "0.5233897", "0.52206445", "0.51251656", "0.50248826", "0.49595135", "0.48569524", "0.48031297", "0.47750446", "0.4755351", "0.46816182", "0.46778807", "0.4622908", "0.4622801", "0.46111906", "0.45984378", "0.4592302", "0.45905167", "0.45862764", "0.45862764", "0.45857745", "0.45849097", "0.45800567", "0.45775357", "0.4576068", "0.45730093", "0.45678055", "0.45669132", "0.45653328", "0.45513484", "0.454824", "0.45413095", "0.45189264", "0.45071056", "0.45071056", "0.45069015", "0.4504972", "0.44907382", "0.4485506", "0.44524014", "0.4451817", "0.4438363", "0.4436079", "0.4432091", "0.4427536", "0.4427197", "0.44271478", "0.44250175", "0.4422739", "0.44202515", "0.44151214", "0.44134256", "0.44036376", "0.44024435", "0.4395324", "0.4394174", "0.43906233", "0.4374745", "0.43725562", "0.4371925", "0.43568206", "0.43564537", "0.43564537", "0.4355673", "0.43537512", "0.43381023", "0.4317611", "0.4314849", "0.43138328", "0.43137977", "0.4313387", "0.4311644", "0.43067777", "0.43065676", "0.43063414", "0.43027705", "0.43027705", "0.43027705", "0.4298481", "0.4283761", "0.42597154", "0.42590654", "0.42553103", "0.42514524", "0.42506096", "0.4249876", "0.42472357", "0.4245635", "0.42386058", "0.42383787", "0.4236234", "0.42277417", "0.4225785" ]
0.65902126
0
Refresh a grid from the current provider
def refresh(grid) # Make sure we are attached to a cube check_attached @logger.info "Refreshing grid" @req.Refresh do |xml| xml.sID @session_id @preferences.inject_xml xml, @provider_type grid.to_xml(xml) end doc = invoke Grid.from_xml(doc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @grid.update\n end", "def refresh\n\t\[email protected]\n\t\tself.update\n\t\treturn self\n\tend", "def refresh!\n raise NotImplementedError, \"#refresh! is not implemented on #{@provider}:#{@type}\"\n end", "def refresh(provider)\n $evm.log(\"info\", \"Refreshing provider #{provider.name}\")\n provider.refresh\nend", "def refresh\n # FIXME\n end", "def refresh\n do_refresh\n end", "def refresh\n do_refresh\n end", "def refresh\n do_refresh\n self\n end", "def refresh\n end", "def refresh\r\n end", "def refresh\n end", "def refresh\n end", "def reload\n refresh\n end", "def reload\n refresh\n end", "def refresh\r\n @view.refresh\r\n end", "def refresh\n $driver.refresh\n end", "def refresh\n Vedeu.trigger(:_refresh_, current)\n end", "def refresh\n fetch_api_data\n self\n end", "def grid_modified!\n end", "def refresh; end", "def refresh\n Vedeu.trigger(:_refresh_view_, current)\n\n Vedeu.trigger(:_refresh_cursor_, current)\n end", "def refresh\n Vedeu.trigger(\"_refresh_#{current}_\".to_sym)\n end", "def refresh_data\n raise NotImplementedError\n end", "def refresh!\n records true\n self\n end", "def refresh\n raise NotImplementedError.new('I do not know how to refresh myself, please implement it in subclass.')\n end", "def refresh!; end", "def refresh\n send_cmd \"refresh\"\n nil\n end", "def refresh\n store\n\n render\n\n self\n end", "def refresh\r\n command 'refresh'\r\n end", "def refresh\r\n command 'refresh'\r\n end", "def refresh\n @cols = @defaults = nil\n self\n end", "def refresh\n load if changed?\n end", "def refresh_provider(service)\n provider = service.orchestration_manager\n\n $evm.log(\"info\", \"Refreshing provider #{provider.name}\")\n $evm.set_state_var('provider_last_refresh', provider.last_refresh_date.to_i)\n provider.refresh\nend", "def perform_reload\n api.stack_plan_reload(self)\n end", "def refresh\n @window.refresh\n end", "def reload!\n fetch_data!\n end", "def refresh(*args)\n alloc(*args).refresh\n end", "def refresh!\n refresh\n @window.refresh\n end", "def index\n\n fetcher = lambda { |sort_field, direction, page, per|\n records = Update.joins(:partner).where(:public_id => @user_id)\n [records.count, records.order(sort_field + ' ' + direction).page(page).per(per)]\n }\n\n cooker = lambda { |raws|\n raws.map do |raw|\n {\n 'id' => raw.id,\n 'headline' => raw.headline,\n 'list' => raw.list,\n 'partner' => raw.partner.name,\n 'posted' => raw.posted,\n 'html' => raw.html\n }\n end\n } \n\n callbacks = {\n :delete => {:controller => 'updates' }\n }\n\n columns = [ \n {field:'headline', displayName: 'Headline', order: 'headline'},\n {field:'list', displayName: 'List', order: 'list'},\n {field:'partner', displayName: 'Partner', order: 'partners.name'},\n {field:'posted', displayName:'Posted', order: 'posted'}\n ]\n\n angular_grid_simple_helper 'shared/angular_grid_partial', 'Your Updates', \\\n fetcher, cooker, columns, callbacks\n end", "def refresh!\n self.class.find(id)\n end", "def refresh!\n self.class.find(id)\n end", "def set_grid\n @grid = Grid.find(params[:id])\n end", "def on_refresh\n reload_bundles(true)\n stop_refreshing\n update_table_data\n end", "def set_grid\n @grid = Grid.find(params[:id])\n end", "def refresh; schedule_update end", "def refresh\n driver.navigate.refresh\n end", "def refresh\n driver.navigate.refresh\n end", "def refresh\n driver.navigate.refresh\n end", "def set_grid\n @grid = Grid.find(params[:id])\n end", "def set_grid\n @grid = Grid.find(params[:id])\n end", "def refresh!(*args)\n alloc(*args).refresh!\n end", "def refresh\n @browser.refresh\n end", "def refresh!\n update_members\n update_owners\n \n # and also update google.\n self.send_later(:update_google_members)\n self.send_later(:update_google_owners)\n \n end", "def refresh!\n load if changed?\n end", "def reload\n self\n end", "def reload_grid(dom_id)\n dom_id = \"##{dom_id}\" unless dom_id.start_with?('#')\n self << \"jQuery('#{dom_id}').trigger('reloadGrid');\"\n end", "def refresh\n loadCSV()\n redirect_to(records_path)\n end", "def refresh\n FeedSource.find(params[:feed_source_id]).refresh\n feed_sources = params[:feed_sources]\n @feed_source_titles = {}\n FeedSource.find(feed_sources).each { |source| @feed_source_titles[source.id] = source.title}\n @feed_items = FeedItem.where(\"feed_source_id IN (?)\", feed_sources).order(pub_date: :desc).limit(20).offset(0)\n @feed_items = @feed_items.sort_by{ |item| item.pub_date.to_i }.reverse\n render :index\n end", "def refresh\n # re-download the model from the server\n set_model\n end", "def _refresh_get(ds)\n # SEQUEL5: Remove\n if use_prepared_statements_for?(:refresh)\n _set_prepared_statement_server(model.send(:prepared_refresh)).call(pk_hash)\n else\n super\n end\n end", "def grid\n handle_date\n @pool = Pool.find(params[:pool_id])\n end", "def refresh\n self.class.new(__getobj__)\n end", "def reload!\n callsite = Callsites[@callsite_key]\n rows_hash = rows_by_key(callsite.primary_key)\n sql = callsite.reload_sql(rows_hash.keys, @fetched_columns)\n new_rows = callsite.connection.send(:select, sql, \"#{callsite.model_class_name} Reload SlimScrooged\")\n new_rows.each do |row|\n if old_row = rows_hash[row[callsite.primary_key]]\n old_row.result_set = nil\n old_row.monitored_columns.merge!(row)\n end\n end\n end", "def refresh\n update_databases()\n render json: {message: \"Information will be updated shortly\"}, status: :ok\n end", "def reload\n resp = api_client.get(url)\n refresh(JSON.load(resp.body))\n end", "def refresh(op)\n check_connection\n @protocol.refresh_command op\n self\n end", "def refresh\n\t\t\[email protected]\n\t\t\[email protected] { |w| w.refresh if w.visible? }\n\t\tend", "def reload\n reset\n fetch\n end", "def reload\n reset\n fetch\n end", "def reload\n end", "def perform_reload\n api.stack_reload(self)\n end", "def reload_grid(dom_id, *args)\n dom_id = \"##{dom_id}\" unless dom_id.start_with?('#')\n output = \"jQuery('#{dom_id}').trigger('reloadGrid');\".html_safe\n if(args.include?(:wrapped))\n javascript_tag(output)\n else \n output\n end\n end", "def update\n respond_to do |format|\n if @grid.update(grid_params)\n format.html { redirect_to @grid, notice: 'Grid was successfully updated.' }\n format.json { render :show, status: :ok, location: @grid }\n else\n format.html { render :edit }\n format.json { render json: @grid.errors, status: :unprocessable_entity }\n end\n end\n end", "def refresh\n self.operation = \"#{operation}#refresh\"\n\n return if params_missing?\n\n # Connection settings\n set_connection_data!\n logger.info_ext(operation, \"Connection set successfully\")\n\n # Get all tasks\n tasks, @refresh_state_uuid = {}, SecureRandom.uuid\n @parts_requested_cnt, @parts_received_cnt = Concurrent::AtomicFixnum.new(0), Concurrent::AtomicFixnum.new(0)\n @source_refs_requested, @source_refs_received = [], Concurrent::Array.new\n\n params.to_a.each do |task|\n if task['task_id'].blank? || task['source_ref'].blank?\n logger.warn_ext(operation, \"Missing data for task: #{task}\")\n next\n end\n tasks[task['task_id']] = task['source_ref']\n\n if tasks.length == REFS_PER_REQUEST_LIMIT\n refresh_part(tasks)\n tasks = {}\n end\n end\n\n refresh_part(tasks) unless tasks.empty?\n\n archive_not_received_service_instances unless on_premise?\n rescue => err\n metrics_err_type = on_premise? ? :receptor : :cloud unless endpoint.nil?\n metrics&.record_error(metrics_err_type || :general)\n logger.error_ext(operation, \"Error: #{err.message}\\n#{err.backtrace.join(\"\\n\")}\")\n end", "def refresh\n @server.make_json_request('show.refresh', tvdbid: @tvdbid)['message']\n end", "def refresh(options = {})\n self.link(:edit).get\n end", "def update\n respond_to do |format|\n if @grid.update(grid_params)\n format.html { redirect_to @grid, notice: \"Grid was successfully updated.\" }\n format.json { render :show, status: :ok, location: @grid }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @grid.errors, status: :unprocessable_entity }\n end\n end\n end", "def reset\n Grid.reset\n head :ok\n end", "def refresh\n raise Occi::Api::Client::Errors::NotImplementedError, \"#{__method__} is just a stub!\"\n end", "def refresh\n @data = read_data\n end", "def grid(index)\r\n out_short_name = FFI::MemoryPointer.new(:string)\r\n out_full_name = FFI::MemoryPointer.new(:string)\r\n out_package_name = FFI::MemoryPointer.new(:string)\r\n out_url = FFI::MemoryPointer.new(:string)\r\n out_direct_download = FFI::MemoryPointer.new(:int)\r\n out_open_license = FFI::MemoryPointer.new(:int)\r\n out_available = FFI::MemoryPointer.new(:int)\r\n\r\n result = Api.proj_coordoperation_get_grid_used(self.context, self, index,\r\n out_short_name, out_full_name, out_package_name,\r\n out_url, out_direct_download ,\r\n out_open_license, out_available)\r\n\r\n if result != 1\r\n Error.check_object(self)\r\n end\r\n\r\n name_ptr = out_short_name.read_pointer\r\n full_name_ptr = out_full_name.read_pointer\r\n package_name_ptr = out_package_name.read_pointer\r\n url_ptr = out_url.read_pointer\r\n downloadable_ptr = out_direct_download \r\n open_license_ptr = out_open_license\r\n available_ptr = out_available\r\n\r\n unless name_ptr.null?\r\n Grid.new(name_ptr.read_string_to_null, self.context,\r\n full_name: full_name_ptr.null? ? nil : full_name_ptr.read_string_to_null,\r\n package_name: package_name_ptr.null? ? nil : package_name_ptr.read_string_to_null,\r\n url: url_ptr.null? ? nil : url_ptr.read_string_to_null,\r\n downloadable: downloadable_ptr.null? ? nil : downloadable_ptr.read_int == 1 ? true : false,\r\n open_license: open_license_ptr.null? ? nil : open_license_ptr.read_int == 1 ? true : false,\r\n available: available_ptr.null? ? nil : available_ptr.read_int == 1 ? true : false)\r\n end\r\n end", "def refresh\n response = Clever.request :get, url\n refresh_from response[:data]\n self\n end", "def reload\n return if new_record?\n refresh\n end", "def refresh\n\t\t\treturn if completed?\n\t\t\t_runner.refresh\n\t\tend", "def reload\n\t\tself.request( :reload )\n\tend", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def reload\n end", "def process\n @type = 'refresh'\n full_analysis\n end", "def reload_data\n reset_collection_data\n reload_collection_data\n end", "def refresh\n # Only restart if we're actually running\n if (@parameters[:ensure] || newattr(:ensure)).retrieve == :running\n provider.restart\n else\n debug \"Skipping restart; service is not running\"\n end\n end", "def refresh_details\n\n currTab = @tabPnlDetails.selection_model.selected_item\n case currTab.text\n when \"State\"\n refresh_tab_state\n when \"Logs\"\n refresh_tab_logs\n when \"Ignore Rules\"\n refresh_tab_ignore_rules\n when \"Branches\"\n refresh_tab_branches\n when \"Tags\"\n refresh_tab_tags\n when \"Repository\"\n refresh_tab_repos\n end\n\n reset_gmsg\n\n # refresh state\n # refresh branch\n # refresh tags\n # refresh log\n # refresh files\n # refresh repos \n end", "def free_form_grid(rows, cols, grid_pov=nil)\n # Make sure we are attached to a cube\n check_attached\n get_dimensions unless @dimensions\n\n # Update the POV if one is specified\n if grid_pov\n self.pov = grid_pov\n end\n\n grid = Grid.define(@dimensions, pov, rows, cols)\n\n @logger.info \"Retrieving free-form grid\"\n @req.ProcessFreeFormGrid do |xml|\n xml.sID @session_id\n @preferences.inject_xml xml, @provider_type\n xml.backgroundpov do |xml|\n pov.each do |dim,mbr|\n xml.dim :name => dim, :pov => mbr\n end\n end\n grid.to_xml(xml, false)\n grid.dims_to_xml(xml)\n end\n doc = invoke\n grid = Grid.from_xml(doc)\n\n # The grid returned does not contain data, so perform a refresh\n refresh(grid)\n end", "def refresh_items\n rows.clear\n\n items.each do |item|\n rows << [item]\n end\n end", "def refresh_live_display\n\t\t# update the table model rows without affecting user selections\n\t\trow_count = @channel_records_table_model.getRowCount\n\t\tif row_count > 0\n\t\t\t@channel_records_table_model.fireTableRowsUpdated(0, row_count-1)\n\t\tend\n\n\t\t# update the live timestamp\n\t\t@live_update_timestamp_label.text = Java::Date.new.toString\n\tend", "def update\n current_site.grid_templates.find(params[:id]).update(params.require(:grid_template).permit(:name, :description))\n index\n end" ]
[ "0.7269299", "0.7165706", "0.6832801", "0.66368824", "0.6595634", "0.65622294", "0.65622294", "0.6493063", "0.640858", "0.6334815", "0.63031816", "0.63031816", "0.62334484", "0.62334484", "0.62175953", "0.61877894", "0.6185085", "0.6173953", "0.61363024", "0.6100245", "0.60786587", "0.6075974", "0.59981626", "0.5972642", "0.5971214", "0.59577155", "0.59494424", "0.5928072", "0.590475", "0.590475", "0.58862203", "0.5831184", "0.58193314", "0.57984275", "0.5763003", "0.57510626", "0.57482165", "0.5732423", "0.57096183", "0.57051075", "0.57051075", "0.5696739", "0.56901795", "0.56630975", "0.56448174", "0.5625034", "0.5625034", "0.5625034", "0.5624903", "0.5624903", "0.56192255", "0.56111974", "0.56087416", "0.5600339", "0.5574628", "0.55427766", "0.5521277", "0.5515242", "0.5504143", "0.5467862", "0.5462496", "0.5460398", "0.54603624", "0.54535097", "0.54257405", "0.54169035", "0.54055667", "0.54005116", "0.54005116", "0.53826994", "0.5373084", "0.535774", "0.53523725", "0.5352043", "0.5349499", "0.5349299", "0.53275555", "0.5312753", "0.53051335", "0.5304387", "0.52998585", "0.5299042", "0.5298482", "0.5293456", "0.5289857", "0.52888393", "0.52888393", "0.52888393", "0.52888393", "0.52888393", "0.52888393", "0.52888393", "0.5284843", "0.5262671", "0.5250254", "0.5249934", "0.52492434", "0.524707", "0.5239466", "0.5233607" ]
0.7629953
0
Return a grid for the spcified rows and columns and optional POV The rows must be a hash whose key is a single dimension name, or array of dimension names. The value of the hash must be an array containing tuples of member names for the dimension(s) in the rows. The cols must be a hash whose key is a single dimension name, or array of dimension names. The value of the hash must be an array containing tuples of member names for the dimension(s) in the cols. The pov is an optional POV that will be merged with the current POV to determine the retrieved POV.
def free_form_grid(rows, cols, grid_pov=nil) # Make sure we are attached to a cube check_attached get_dimensions unless @dimensions # Update the POV if one is specified if grid_pov self.pov = grid_pov end grid = Grid.define(@dimensions, pov, rows, cols) @logger.info "Retrieving free-form grid" @req.ProcessFreeFormGrid do |xml| xml.sID @session_id @preferences.inject_xml xml, @provider_type xml.backgroundpov do |xml| pov.each do |dim,mbr| xml.dim :name => dim, :pov => mbr end end grid.to_xml(xml, false) grid.dims_to_xml(xml) end doc = invoke grid = Grid.from_xml(doc) # The grid returned does not contain data, so perform a refresh refresh(grid) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grid\n @grid ||=\n {\n rows: lines_to_ranges(lines[:horizontal]),\n columns: lines_to_ranges(lines[:vertical])\n }\n end", "def create_grid\n @grid = {\"1a\" => \" \", \"1b\" => \" \", \"1c\" => \" \", \"1d\" => \" \", \"1e\" => \" \",\n \"2a\" => \" \", \"2b\" => \" \", \"2c\" => \" \", \"2d\" => \" \", \"2e\" => \" \",\n \"3a\" => \" \", \"3b\" => \" \", \"3c\" => \" \", \"3d\" => \" \", \"3e\" => \" \",\n \"4a\" => \" \", \"4b\" => \" \", \"4c\" => \" \", \"4d\" => \" \", \"4e\" => \" \",\n \"5a\" => \" \", \"5b\" => \" \", \"5c\" => \" \", \"5d\" => \" \", \"5e\" => \" \"}\n end", "def create_grid\n spaces = create_spaces\n assign_spaces_to_rows.map do |row|\n row.each.with_index do |coordinates, index|\n row[index] = {coordinates => spaces[coordinates]}\n end\n end\n end", "def three_row_grid\n grid = []\n grid << [\n Cell.new(:alive, 0, 0),\n Cell.new(:alive, 0, 1),\n Cell.new(:dead, 0, 2)\n ]\n grid << [\n Cell.new(:alive, 1, 0),\n Cell.new(:dead, 1, 1),\n Cell.new(:dead, 1, 2)\n ]\n grid << [\n Cell.new(:dead, 2, 0),\n Cell.new(:dead, 2, 1),\n Cell.new(:dead, 2, 2)\n ]\n grid\nend", "def prepare_grid\n\t\tArray.new(rows) do |row|\n\t\t\tArray.new(columns) do |col|\n\t\t\t\tCell.new(row, col)\n\t\t\tend\n\t\tend\n\tend", "def populate_grid\n start_rows = { red: (0..2), black: (5..7) }\n\n 8.times do |x|\n 8.times do |y|\n [:red, :black].each do |color|\n if (x + y).even? && start_rows[color].include?(y)\n self[[x, y]] = Piece.new(color, [x, y], self)\n end\n end\n end\n end\n\n grid.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n puts \"x=#{x}, y=#{y}, cell.class=#{cell.class}\"\n end\n end\n end", "def gen_cells args = {}\n\t\t\tx = args[:x] || 0\n\t\t\ty = args[:y] || 0\n\t\t\tw = args[:w] || 32\n\t\t\th = args[:h] || 32\n\n\t\t\tcell_count = {\n\t\t\t\tx: (current_room.w.to_f / w.to_f).floor,\n\t\t\t\ty: (current_room.h.to_f / h.to_f).floor\n\t\t\t}\n\n\t\t\treturn cell_count[:y].times.map do |row|\n\t\t\t\tnext cell_count[:x].times.map do |col|\n\t\t\t\t\tnext Cell.new(\n\t\t\t\t\t\tx: (w * col),\n\t\t\t\t\t\ty: (h * row),\n\t\t\t\t\t\tw: w, h: h,\n\t\t\t\t\t\tindex: { x: col, y: row },\n\t\t\t\t\t\tsolid: false\n\t\t\t\t\t)\n\t\t\t\tend\n\t\t\tend .flatten\n\t\tend", "def grid\n Matrix.build(@row_count, @column_count) { Cell.new }.to_a\n end", "def grid(cols, rows)\n vert rows do |r, i|\n r.horz cols do |c, j|\n yield r, c, i, j if block_given?\n end\n end\n end", "def grid *name_and_or_opts, &proc\n return unless configurable?\n name, opts = nil, Hash.new\n name_and_or_opts.each { |a| a.is_a?(Hash) ? opts.update(a) : name = a }\n id = Digest::MD5.hexdigest(name.to_s + proc.to_s)\n name ||= id\n if proc\n @grid, @grid_columns = name, 0\n self.instance_exec &proc\n @grid = nil\n end\n columns = opts.delete(:columns) || @grid_columns || 2\n grids[name] = Struct.new(:id, :name, :columns, :opts).new(id, name, columns, opts)\n end", "def grid(index)\r\n out_short_name = FFI::MemoryPointer.new(:string)\r\n out_full_name = FFI::MemoryPointer.new(:string)\r\n out_package_name = FFI::MemoryPointer.new(:string)\r\n out_url = FFI::MemoryPointer.new(:string)\r\n out_direct_download = FFI::MemoryPointer.new(:int)\r\n out_open_license = FFI::MemoryPointer.new(:int)\r\n out_available = FFI::MemoryPointer.new(:int)\r\n\r\n result = Api.proj_coordoperation_get_grid_used(self.context, self, index,\r\n out_short_name, out_full_name, out_package_name,\r\n out_url, out_direct_download ,\r\n out_open_license, out_available)\r\n\r\n if result != 1\r\n Error.check_object(self)\r\n end\r\n\r\n name_ptr = out_short_name.read_pointer\r\n full_name_ptr = out_full_name.read_pointer\r\n package_name_ptr = out_package_name.read_pointer\r\n url_ptr = out_url.read_pointer\r\n downloadable_ptr = out_direct_download \r\n open_license_ptr = out_open_license\r\n available_ptr = out_available\r\n\r\n unless name_ptr.null?\r\n Grid.new(name_ptr.read_string_to_null, self.context,\r\n full_name: full_name_ptr.null? ? nil : full_name_ptr.read_string_to_null,\r\n package_name: package_name_ptr.null? ? nil : package_name_ptr.read_string_to_null,\r\n url: url_ptr.null? ? nil : url_ptr.read_string_to_null,\r\n downloadable: downloadable_ptr.null? ? nil : downloadable_ptr.read_int == 1 ? true : false,\r\n open_license: open_license_ptr.null? ? nil : open_license_ptr.read_int == 1 ? true : false,\r\n available: available_ptr.null? ? nil : available_ptr.read_int == 1 ? true : false)\r\n end\r\n end", "def represent\n # grid_array will be an array of strings that represent our grid in NxN format\n grid_array=[]\n @h.times{|r| grid_array<<@grid[r*@w,@w].split('')*' '}\n grid_array\n end", "def build_grid\n x = 0\n 10.times do\n row = []\n y = 0\n 10.times do\n row.push({display: \"~~\", ship: false, coord: [x, y]})\n y += 1\n end\n self.grid << row\n x += 1\n end\n p self.grid\n end", "def create_grid\n grid = Array.new(6, Array.new(7, BLANK))\n end", "def rows_of_cols(cells = self.question_cells)\n result = cells.inject(Dictionary.new) do |rows, cell|\n rows[cell.row] = Dictionary.new if rows[cell.row].nil?\n rows[cell.row][cell.col] = cell\n rows\n end\n end", "def grid(cols, rows, col_size=1, row_size=1)\n (0..cols*rows).map do |i|\n x = col_size * (i % cols)\n y = row_size * i.div(cols)\n yield x, y\n end\n end", "def default_grid\n array = Array.new(8) { Array.new(8) }\n\n array[0][0] = Rook.new('white', [0,0], 'slide')\n array[1][0] = Knight.new('white', [1,0], 'step')\n array[2][0] = Bishop.new('white', [2,0], 'slide')\n array[3][0] = Queen.new('white', [3,0], 'slide')\n array[4][0] = King.new('white', [4,0], 'step')\n array[5][0] = Bishop.new('white', [5,0], 'slide')\n array[6][0] = Knight.new('white', [6,0], 'step')\n array[7][0] = Rook.new('white', [7,0], 'slide')\n array[0..7].each_with_index { |column, index| \n column[1] = Pawn.new('white', [index,1], 'step') }\n\n array[0][7] = Rook.new('black', [0,7], 'slide')\n array[1][7] = Knight.new('black', [1,7], 'step')\n array[2][7] = Bishop.new('black', [2,7], 'slide')\n array[3][7] = Queen.new('black', [3,7], 'slide')\n array[4][7] = King.new('black', [4,7], 'step')\n array[5][7] = Bishop.new('black', [5,7], 'slide')\n array[6][7] = Knight.new('black', [6,7], 'step')\n array[7][7] = Rook.new('black', [7,7], 'slide')\n array[0..7].each_with_index { |column, index| \n column[6] = Pawn.new('black', [index,6], 'step') }\n\n array\n end", "def grid(cols, rows, col_size=1, row_size=1)\n (0...cols*rows).map do |i|\n x = col_size * (i % cols)\n y = row_size * i.div(cols)\n yield x, y\n end\n end", "def draw_grid\n print_cap\n (0...@vertical).each do |vert_index|\n (0..@v_size).each do |block_height|\n (0...@horizontal).each do |horizontal_index|\n if block_height == (@v_size/2)\n print \"|\" + \" \"*(@h_size/2)\n \"#{print @contents[horizontal_index][vert_index]}|\"\n print \" \"*(@h_size/2-1)\n else\n print \"|\"; print \" \"*@h_size\n end\n end\n print \"|\\n\" \n \n end\n print_cap\n end\n end", "def draw_grid\n case view\n when :south_east\n size_y.times do |y|\n size_x.times do |x|\n draw_tile(x, y, x, y)\n end\n end\n when :south_west\n size_x.times do |y|\n size_y.times do |x|\n draw_tile(x, y, size_x - 1 - y, x)\n end\n end\n when :north_west\n size_y.times do |y|\n size_x.times do |x|\n draw_tile(x, y, size_x - 1 - x, size_y - 1- y)\n end\n end\n when :north_east\n size_x.times do |y|\n size_y.times do |x|\n draw_tile(x, y, y, size_y - 1 - x)\n end\n end\n else\n throw Exception.new(\"view was out of bounds!\")\n end\n\n end", "def build_grid size\n self.tiles.clear\n size.to_i.times do |row|\n size.to_i.times do |column|\n self.tiles.build({\n x: column,\n y: row\n })\n end\n end\n end", "def rows_of_cols\n result = self.answer_cells.inject({}) do |rows, cell|\n rows[cell.row] = {} unless rows[cell.row]\n rows[cell.row][cell.col] = cell\n rows\n end\n end", "def generate_grid\n grid = []\n @y.times do\n row = []\n @x.times do\n row << nil\n end\n grid << row\n end\n grid\n end", "def make_heat_map allowed_squares, heat_map = {}\n\n score_point = lambda do |point|\n case @opponent.grid.value_for_point point\n when :unknown \n 1.0\n when :empty \n 0.0\n when :recent_hit \n 4.0\n when :hit \n 0.2\n end\n end\n\n increment_heat_map_points = lambda do |points|\n inc = points.map(&score_point).reduce(:+) / points.size.to_f\n points.each do |point|\n p = point.to_hash\n if heat_map.has_key? p\n heat_map[p] += inc\n elsif @opponent.grid.is_unknown? point\n heat_map[p] = inc\n end\n end\n end\n\n #Produces a list of possible starting points for a ship\n possible_starting_points = []\n GRID_SIZE.times do |i|\n GRID_SIZE.times do |j|\n p = Point.new i, j\n possible_starting_points << p if allowed_squares.include? @opponent.grid.value_for_point p\n end\n end\n\n count_possible_placements = lambda do |ship_type, direction|\n #now iterate through starting points and see if ships can be placed\n possible_starting_points.each do |ship_start|\n continue = true\n begin\n temp_ship = Ship.ship_factory ship_type, ship_start, direction\n if @opponent.grid.can_place_ship? temp_ship, allowed_squares\n increment_heat_map_points.call temp_ship.points\n end\n rescue ArgumentError\n end\n end\n end\n\n @opponent.possible_ships.keys.each do |ship_type| \n @opponent.possible_ships[ship_type].times do \n count_possible_placements.call ship_type, :east\n count_possible_placements.call ship_type, :south\n end\n end\n\n # puts @opponent.grid.to_s\n # puts \"\"\n # puts (project_heat_map heat_map)\n\n #puts @opponent.remaining_ships.length.to_s\n\n return heat_map\n end", "def grid\n @grid ||= if @opts.key? \"grid\"\n @opts.slice(\"grid\", \",\")\n else\n %w[0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%]\n end\n end", "def default_grid\n Array.new(3) { Array.new(3) {Cell.new} }\n end", "def build_grid\n header = [\" \", \" a \", \" b \", \" c \", \" d \", \" e \", \" f \", \" g \", \" h \"]\n grid_display = @board.grid.map.with_index do |row, index|\n [8 - index] + build_row(row, index)\n end\n grid_display.unshift(header)\n end", "def get_cells(y_index, x_index, y_vector, x_vector, velocity)\n cells = []\n\n for i in 0 .. velocity\n x = (x_vector * i) + x_index\n y = (y_vector * i) + y_index\n if cell_in_grid(y, x)\n cells.push(OpenStruct.new(:x => x, :y => y, :val => $grid[y][x]))\n end\n\n end\n return cells\nend", "def cells\n rows.map { |r| r[key] }\n end", "def generate\n for i in 0..$dimensions[0]-1\n for j in 0..$dimensions[1]-1\n for k in 0..$d-1\n item=populate k\n if item!=0 \n $grid[[i,j,k]]=item\n end\n end\n end\n end\nend", "def generateLetterGrid(width, height, acceptableLetters)\n\n grid = Hash.new\n\n # Iterate through each grid entry\n for y in 0..height-1 do\n for x in 0..width-1 do\n \n # Generate a random letter from the acceptable letters list\n # and set it to the grid entry\n grid[[x, y]] = acceptableLetters.sample\n \n end \n end \n\n return grid\n \nend", "def initialize(width=30, height=30, random=true, random_seed=[true,false].to_a)\n\n @width=width\n @height=height\n\n #create an array\n @cells = ConwayModel::create_grid(width, height, random, random_seed)\n end", "def horizontal_data\n ret_hsh = {}\n @grid.each do |k, v|\n ret_hsh[k] = v.values\n end\n ret_hsh\n end", "def populateGrid\n\n\t\[email protected]_with_index do | row, i |\n\n\t\t\trow.each_with_index do | col, j |\n\n\t\t\t\[email protected][i][j] = Cell.new(i, j, false)\n\t\t\tend\n\t\tend\n\tend", "def hash_to_grid(hash)\n 0.upto(grid.size - 1).map do |i|\n 0.upto(grid[i].size - 1).map do |j|\n hash[[i, j]]\n end\n end\n end", "def hc(row,col)\n build :cell, row: row, col: col\n end", "def get_cells(rows, columns)\n cells = []\n rows.each do |r|\n columns.each do |c|\n cells << @fields[r][c]\n end\n end\n cells\n end", "def sudoku_with_options(grid_lines, grid_columns, sudoku)\n sudoku_grids = sudoku_grids(grid_lines, grid_columns, sudoku)\n sudoku_flatten = sudoku.map { |element| element.flatten }\n sudoku_transpose_flatten = sudoku.transpose.map { |element| element.flatten }\n\n sudoku_with_options = []\n line_index = 0\n\n sudoku_with_options = sudoku.each_with_index do |line, line_index|\n cell_index = 0\n line.each_with_index do |cell, cell_index|\n sudoku_grids_index = (line_index / grid_lines) * grid_lines + (cell_index / grid_columns)\n unless cell.length == 1\n (1..grid_size(grid_lines, grid_columns)).to_a.each do |i|\n cell << i unless sudoku_flatten[line_index].include?(i) || sudoku_transpose_flatten[cell_index].include?(i) || sudoku_grids[sudoku_grids_index].include?(i)\n end\n end\n cell_index += 1\n end\n line_index += 1\n end\n return sudoku_with_options\nend", "def create_cells\n (\"A\"..@height).each do |rows|\n ([email protected]_i).each do |column|\n k=\"#{rows}#{column}\"\n cells[k]=Cell.new(k)\n end\n end\n cells\n end", "def grids\n @grids ||= {}\n end", "def make_grid\n @grid = Array.new(4){Array.new(4)}\n end", "def PrintGrid\n\t\t(0..9).each do |i| #vertical parent grid\n\t\t\t(0..19).each do |j| #horizontal nested array\n\t\t\t\tprint @user_grid[i][j]\n\t\t\tend\n\t\tputs\n\t\tend\n\t\treturn @user_grid\n\tend", "def grid\n rows = []\n (1..self.height).to_a.each do |h|\n rows << row(h)\n end\n rows.reverse\n end", "def default_grid\n Array.new(7) { Array.new(6) { Cell.new } }\n end", "def dup\n gridcpy = Grid.new(@num_rows,@num_columns)\n for r in 0...@num_rows\n for c in 0...@num_columns\n cur_cell = self.getCell(r,c)\n gridcpy.getCell(r,c).living = cur_cell.living\n gridcpy.getCell(r,c).neighbors = cur_cell.neighbors \n end # end col loop\n end # end row loop\n return gridcpy\n end", "def create_board\n\t\t@board = Hash.new\n\t\t(0..7).each do |x|\n\t\t\t@board[x] = []\n\t\t\t(0..7).each do |y|\n\t\t\t\t@board[x][y] = Square.new([x, y])\n\t\t\tend\n\t\tend\n\tend", "def initialize\n\t\t@rows = 8\n\t\t@cols = 8\n\t\t@grid = Array.new(rows) { Array.new(cols) }\n\tend", "def make_grid(*points)\n self.convert_values()\n printed = \"\"\n if (@clear)\n system ('clear')\n end\n x_points = Array.new\n y_points = Array.new\n # Divide points\n (0..points.length - 1).each do |position|\n if (position % 2 == 0)\n x_points.push(points[position].to_i)\n else\n y_points.push(points[position].to_i)\n end\n end\n # Start loop\n (0..@y_size.to_i).each do |current_y|\n (0..@x_size.to_i).each do |current_x|\n # Setup\n print_fill = true\n relative_x = current_x - @x_offset\n relative_y = @y_offset - current_y\n point_amount = x_points.length - 1\n # Check point\n (0..point_amount.to_i).each do |position_point|\n if (x_points[position_point] == relative_x)\n if (y_points[position_point] == relative_y)\n printed << @point.to_s\n print_fill = false\n end\n end\n end\n # Fill\n if (print_fill)\n if (@x_offset == current_x)\n printed << \"|\"\n elsif (@y_offset == current_y)\n printed << \"-\"\n else\n printed << @blank_space.to_s\n end\n end\n if (y_offset == current_y && current_x != @x_size)\n printed << \"-\"\n else\n printed << \" \"\n end\n end\n printed << \"\\n\"\n end\n print printed\n return printed\n end", "def grid(name)\r\n out_full_name = FFI::MemoryPointer.new(:string)\r\n out_package_name = FFI::MemoryPointer.new(:string)\r\n out_url = FFI::MemoryPointer.new(:string)\r\n out_downloadable = FFI::MemoryPointer.new(:int)\r\n out_open_license = FFI::MemoryPointer.new(:int)\r\n out_available = FFI::MemoryPointer.new(:int)\r\n\r\n result = Api.proj_grid_get_info_from_database(self.context, name,\r\n out_full_name, out_package_name, out_url,\r\n out_downloadable, out_open_license, out_available)\r\n\r\n if result == 1\r\n full_name_ptr = out_full_name.read_pointer\r\n package_name_ptr = out_package_name.read_pointer\r\n url_ptr = out_url.read_pointer\r\n\r\n downloadable_ptr = out_downloadable\r\n open_license_ptr = out_open_license\r\n available_ptr = out_available\r\n\r\n full_name = full_name_ptr.read_string_to_null\r\n package_name = package_name_ptr.read_string_to_null\r\n url = url_ptr.read_string_to_null\r\n\r\n downloadable = downloadable_ptr.read_int == 1 ? true : false\r\n open_license = open_license_ptr.read_int == 1 ? true : false\r\n available = available_ptr.read_int == 1 ? true : false\r\n\r\n Grid.new(name, self.context,\r\n full_name: full_name, package_name: package_name,\r\n url: url ? URI(url) : nil,\r\n downloadable: downloadable, open_license: open_license, available: available)\r\n else\r\n Error.check_context(self.context)\r\n end\r\n end", "def board\n board = Board.new(true)\n grid do |p|\n new_position = p\n new_color = p.color\n new_piece = p.class.new(new_position, new_color, board )\n board[p.pos] = new_piece\n end\n board\n end", "def get2d_many(rows, cols)\n case rows\n when Fixnum\n case cols\n when Fixnum\n RAtlas::get2d_one(@storage, rows, cols)\n when Array\n self.class.new RAtlas::get2d_many(\n @storage, [rows], cols)\n when Range\n self.class.new RAtlas::get2d_by_range(\n @storage, Range.new(rows, rows), cols)\n end\n when Range\n case cols\n when Range\n self.class.new RAtlas::get2d_by_range(\n @storage, rows, cols)\n when Array\n rows = range2arr(rows, size[0])\n self.class.new RAtlas::get2d_many(\n @storage, rows, cols)\n when Fixnum\n self.class.new RAtlas::get2d_by_range(\n @storage, rows, Range.new(cols, cols))\n end\n when Array\n case cols\n when Range\n cols = range2arr(cols, size[1])\n self.class.new RAtlas::get2d_many(\n @storage, rows, cols)\n when Array\n self.class.new RAtlas::get2d_many(\n @storage, rows, cols)\n when Fixnum\n self.class.new RAtlas::get2d_many(\n @storage, rows, [cols])\n end\n end\n\n end", "def create_cells\n (0...rows).each do |r|\n (0...columns).each do |c|\n @fields[r][c] = Cell.new(r, c)\n end\n end\n end", "def build_row(row_id)\n (0..width).each do |col_id|\n cells.create(y: row_id, x: col_id, random_alive: true)\n end\n end", "def cells_grid_1by1\n [\n [\n MazeMagic::Maze::Edge.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::Edge.instance\n ],\n [\n MazeMagic::Maze::VerticalWall.instance,\n MazeMagic::Maze::HorizontalWall.instance,\n MazeMagic::Maze::VerticalWall.instance\n ]\n ]\n end", "def grid\n @grid ||= {}\nend", "def initialize(dimensions, pov, row_dims, col_dims, row_count, col_count, vals, types)\n @dimensions = dimensions\n @pov = pov\n @row_dims = row_dims\n @col_dims = col_dims\n @row_count = row_count\n @col_count = col_count\n @vals = vals\n @types = types\n end", "def display_grid\n # variables for grid display\n @grid = \" A B C \\n\" \\\n \"1 #{@a1} | #{@b1} | #{@c1} \\n\" \\\n \" ---+---+--- \\n\" \\\n \"2 #{@a2} | #{@b2} | #{@c2} \\n\" \\\n \" ---+---+--- \\n\" \\\n \"3 #{@a3} | #{@b3} | #{@c3} \\n\"\n end", "def print_grid\n puts\n puts \" 1 2 3\"\n puts \"A #{@a1} | #{@a2} | #{@a3} \"\n puts \" ---|---|---\"\n puts \"B #{@b1} | #{@b2} | #{@b3} \"\n puts \" ---|---|---\"\n puts \"C #{@c1} | #{@c2} | #{@c3} \"\n puts\n check_for_winner\n end", "def grid\n if 1 <= poster_slot && poster_slot <= 66\n offset = 1\n number_per_row = 11\n total_rows = 6\n group = 1\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 67 <= poster_slot && poster_slot <= 96\n offset = 67\n number_per_row = 15\n group = 2\n total_rows = 2\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 97 <= poster_slot && poster_slot <= 144\n offset = 97\n number_per_row = 6\n group = 3\n total_rows = 8\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.odd? # invert\n elsif 145 <= poster_slot && poster_slot <= 184\n offset = 145\n number_per_row = 20\n group = 4\n total_rows = 2\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 185 <= poster_slot && poster_slot <= 284\n offset = 185\n number_per_row = 25\n group = 5\n total_rows = 4\n row = total_rows - 1 - (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n elsif 285 <= poster_slot && poster_slot <= 314\n offset = 285\n number_per_row = 5\n group = 6\n total_rows = 6\n row = (poster_slot - offset).div(number_per_row)\n col = (poster_slot - offset).modulo(number_per_row)\n col = number_per_row - 1 - col if row.even? # invert\n else\n return nil\n end\n Grid.new(col, row, group)\n end", "def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end", "def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end", "def validate\n\n entireSet = Set.new([1, 2, 3, 4, 5, 6, 7, 8, 9])\n\n @rows = []\n 9.times { @rows.push(entireSet.dup) }\n\n @cols = []\n 9.times { @cols.push(entireSet.dup) }\n\n @box = []\n 3.times do\n subrow = []\n 3.times { subrow.push(entireSet.dup) }\n @box.push(subrow)\n end\n\n (0..8).each do |i|\n (0..8).each do |j|\n v = @grid[i,j]\n if v > 0\n raise \"dup number in row #{i} : #{v}\" unless @rows[i].delete?(v)\n raise \"dup number in column #{j} : #{v}\" unless @cols[j].delete?(v)\n raise \"dup number in box #{i/3}-#{j/3} : #{v}\" unless @box[i/3][j/3].delete?(v)\n end\n end\n end\n\n @poss = []\n @poss_grid = []\n (0..8).each do |i|\n poss_row = []\n (0..8).each do |j|\n if @grid[i,j] == 0 then\n p = Poss.new(i, j, @rows[i], @cols[j], @box[i/3][j/3])\n @poss.push(p)\n poss_row.push(p.to_a)\n else\n poss_row.push([])\n end\n end\n @poss_grid.push(poss_row)\n end\n @poss.sort! { |x, y| x.length <=> y.length }\n\n end", "def gridpoints\n gridpoints = {'l' => @ngauss, 'e' => @negrid, 's' => @nspec}\n if @grid_option == \"single\"\n gridpoints.absorb({'x'=>1, 'y'=>1})\n else\n gridpoints.absorb({'x' => (@ntheta0 or (2.0 * (@nx - 1.0) / 3.0 + 1.0).floor), 'y' => (@naky or ((@ny - 1.0) / 3.0 + 1.0).floor)})\n end\n return gridpoints\nend", "def drawGrid(cX, cY, gX, gY)\n\t# Convert number of intersections into city blocks that start at 0\n\tgX = gX - 2\n\tgY = gY - 2\n\t\n\tg = \"\\t\"\t\n\tfor i in 0..gY\n\t\tcY == 0 && cX == i ? g << \"X____\" : g << \" ____\"\n\tend\n\tg << \"\\n\\t\"\n\tfor i in 0..gY * 2\n\t\tif i % 2 == 0\n\t\t\tfor y in 0..gX\n\t\t\t\ty == gX ? g << \"| |\" : g << \"| \"\n\t\t\tend\n\t\telse\n\t\t\tfor y in 0..gX\n\t\t\t\ty == gX ? g << \"|____|\" : g << \"|____\"\n\t\t\tend\n\t\tend\n\t\tg << \"\\n\\t\"\n end\t\n\tfor i in 0..gY\n\t\ti == gY ? g << \"|____|\" : g << \"|____\"\t\n\tend\n\n\treturn g\nend", "def columns\n cols = []\n (0...size).each do |i|\n vals = []\n (0...size).each do |j|\n vals.push(get_square({:column => i, :row => j}))\n end\n cols.push(Row.new(size, {:vals => vals}))\n end\n cols\n end", "def create_spaces\n ((@tiles, @tile_map),\n (@up_vtexs, @up_vtex_map),\n (@down_vtexs, @down_vtex_map),\n (@asc_edges, @asc_edge_map),\n (@desc_edges, @desc_edge_map),\n (@vert_edges, @vert_edge_map)) =\n [[Tile, nil, 1..5, [3,4,5,4,3], [1..3, 1..4, 1..5, 2..5, 3..5]],\n [Vtex, :up, 1..6, [3,4,5,6,5,4], [1..3, 1..4, 1..5, 1..6, 2..6, 3..6]],\n [Vtex, :down, 0..5, [4,5,6,5,4,3], [0..3, 0..4, 0..5, 1..5, 2..5, 3..5]],\n [Edge, :asc, 1..6, [3,4,5,5,4,3], [1..3, 1..4, 1..5, 2..6, 3..6, 4..6]],\n [Edge, :desc, 1..6, [3,4,5,5,4,3], [1..3, 1..4, 1..5, 1..5, 2..5, 3..5]],\n [Edge, :vert, 1..5, [4,5,6,5,4], [1..4, 1..5, 1..6, 2..6, 3..6]]\n ].map {|cls, align, row_interval, row_counts, col_intervals|\n rows = row_counts.zip(row_interval.to_a).map {|c, r| [r]*c}.flatten\n cols = col_intervals.map {|ival| ival.to_a}.flatten\n count = rows.length\n list = (0...count).to_a.map {|i| cls.new}\n list.each {|obj| obj.alignment = align} unless align.nil?\n list.zip(rows, cols).each {|obj, row, col| obj.row, obj.col = row, col}\n map = Hash[list.map {|obj| [[obj.row, obj.col], obj]}]\n [list, map]\n }\n\n @vtexs = @up_vtexs + @down_vtexs\n @edges = @asc_edges + @desc_edges + @vert_edges\n @all_spaces = @tiles + @vtexs + @edges\n\n @vtex_map = Hash[@vtexs.map {|v| [v.coords, v]}]\n @edge_map = Hash[@edges.map {|e| [e.coords, e]}]\n\n @all_spaces.zip((0...(@all_spaces.length)).to_a).each do |obj, id|\n obj.id = id\n end\n end", "def start_grid\n Array.new(@lines) { Array.new(@columns) { Cell.new } }\n end", "def grids\n [grid].compact\n end", "def cell_columns\n cells = []\n # for each column\n 1.upto(3).each do |column|\n grid = []\n\n # for each row\n 1.upto(3).each do |row|\n grid << get_cell_value(row, column)\n end\n\n cells << grid\n end\n\n cells\n end", "def grid_nodes(width=@width, height=@height, nodeset=@nodes)\n num_cols = (Math.sqrt(nodeset.length)*(width/height)).ceil\n num_rows = (nodeset.length/num_cols.to_f).ceil\n col_len = width/num_cols\n row_len = height/num_rows\n nodeset.each_with_index{|(key, node), i| nodeset[key].location = \n Vector[(0.5 + (i%num_cols))*col_len,(0.5 + (i/num_cols))*row_len] if !nodeset[key].static}\n end", "def render_grid\n\t\t@grid_w.times.with_index do |x|\n\t\t\t@grid_h.times.with_index do |y|\n\t\t\t\tif !@has_enviroment_rendered\n \t \t\trender_wall x, y if @grid[x][y]==1\n\t\t\t\tend\n\t\t \trender_player x, y if @grid[x][y]==2\n \tend\n end\n #each_cell do |x, y, v|\n # render_wall x, y if !@has_environment_rendered && v == 1 \n # render_player x, y if v == 2\n #end\n\t\t@has_enviroment_rendered = true\n\tend", "def print_grid # prints 3 X 3 grid with values\n puts \"\\n\"\n @grid.each_slice(3) { |row| puts row.join(' | ') }\n puts \"\\n\"\n end", "def [](row, col)\n @grid[row][col]\n end", "def console_grid\n i = self.height\n grid.map do |row|\n puts row.map { |cell| \"[#{cell.value.empty? ? \"_\" : cell.value}]\" }.join(\"\") + \" #{i}\"\n i-=1\n end\n end", "def default_grid\n Array.new(7) { Array.new(6) { CellNode.new }}\n end", "def grid(n, m)\n arr = Array.new(n) { Array.new(m, :N) }\n arr\nend", "def solve(puzzle)\n result = Array.new\n puzzle['puzzle'].each_with_index do |row, rowindex|\n row.each_with_index do |column, colindex|\n if puzzle['puzzle'][rowindex][colindex] == true\n result.push({'X' => colindex, 'Y' => rowindex, 'Size' => 1})\n end\n end\n end\n return result\n end", "def setup_grid\n empty_rows\n [:white, :light_yellow].each do |color|\n back_rows(color)\n pawn_rows(color)\n end\n end", "def initialize_grid(word1, word2)\n\tgrid = []\n\n\t# build some top rows and columns with 0 to make things easier\n\tfor i in 0..word2.size + 1\n\t\tgrid << [0] * (word1.size + 1)\n\tend\n\n\tgrid\nend", "def initialize \n @rows = 8\n @columns = 8\n @grid = create_board\n end", "def valid_sudoku(table)\n subgrids = {}\n\n # return false if any element is repeated in a row\n table.each do |row|\n row_count = {}\n row.each do |element|\n if row_count[element]\n return false unless element == \".\"\n else\n row_count[element] = 1\n end\n end\n end\n\n # return false if any element is repeated in a column\n columns = {\n 0 => {},\n 1 => {},\n 2 => {},\n 3 => {},\n 4 => {},\n 5 => {},\n 6 => {},\n 7 => {},\n 8 => {},\n }\n table.each do |row|\n row.each_with_index do |element, index|\n if columns[index][element]\n return false unless element == \".\"\n else\n columns[index][element] = 1\n end\n end\n end\n\n first_subgrid = {}\n second_subgrid = {}\n third_subgrid = {}\n\n table[0..2].each do |row|\n row[0..2].each do |element|\n if first_subgrid[element]\n return false unless element == \".\"\n else\n first_subgrid[element] = 1\n end\n end\n\n row[3..5].each do |element|\n if second_subgrid[element]\n return false unless element == \".\"\n else\n second_subgrid[element] = 1\n end\n end\n\n row[6..8].each do |element|\n if third_subgrid[element]\n return false unless element == \".\"\n else\n third_subgrid[element] = 1\n end\n end\n end\n\n first_subgrid = {}\n second_subgrid = {}\n third_subgrid = {}\n\n table[3..5].each do |row|\n row[0..2].each do |element|\n if first_subgrid[element]\n return false unless element == \".\"\n else\n first_subgrid[element] = 1\n end\n end\n\n row[3..5].each do |element|\n if second_subgrid[element]\n return false unless element == \".\"\n else\n second_subgrid[element] = 1\n end\n end\n\n row[6..8].each do |element|\n if third_subgrid[element]\n return false unless element == \".\"\n else\n third_subgrid[element] = 1\n end\n end\n end\n\n first_subgrid = {}\n second_subgrid = {}\n third_subgrid = {}\n\n table[6..8].each do |row|\n row[0..2].each do |element|\n if first_subgrid[element]\n return false unless element == \".\"\n else\n first_subgrid[element] = 1\n end\n end\n\n row[3..5].each do |element|\n if second_subgrid[element]\n return false unless element == \".\"\n else\n second_subgrid[element] = 1\n end\n end\n\n row[6..8].each do |element|\n if third_subgrid[element]\n return false unless element == \".\"\n else\n third_subgrid[element] = 1\n end\n end\n end\n\n return true\nend", "def initialize(seeds)\n @grid = Array.new(9) { Array.new(9, nil) }\n @rows = {}\n @columns = {}\n @squares = {}\n 1.upto(9) do |i|\n @rows[i] = Hash.new(false)\n @columns[i] = Hash.new(false)\n @squares[i] = Hash.new(false)\n end\n seed_board(seeds)\n end", "def setup_grid(skip_render, skip_set_pieces)\n @grid = Array.new(8) { Array.new(8) { EmptySquare.new } }\n unless skip_set_pieces\n set_major_minor\n set_pawns\n end\n\n render unless skip_render\n end", "def index!(division = 10)\n\t\t@grid_division = division\n\t\t@grid_size = env_max.zip(env_min).map{|x| (x[0] - x[1]).abs}.max / division\n\t\t@db = Hash.new\n\t\tself.each do |e|\n\t\t\th = hash(e.location)\n\t\t\t@db[h] ||= Array.new\n\t\t\t@db[h] << e\n\t\tend\n\t\treturn self\n\tend", "def create_grid_from_size(size_arr)\n rows = size_arr[0]\n columns = size_arr[1]\n Array.new(rows) { Array.new(columns) }\n end", "def parse(lines)\n \n # build character grid\n @grid = []\n lines.each do |line|\n @grid << []\n line.each_byte do |c|\n @grid.last << c.chr\n end\n end\n \n # get height and width in characters\n @width = @grid[0].length\n @height = @grid.length\n \n row = -1\n col = -1\n colspan = 1\n rowspan = 1\n row_y = -1\n @height.times do |y|\n @width.times do |x|\n if check_upperleft(x,y) # new cell\n if row_y == y # new column\n col += 1 + colspan - 1\n else # new row\n row += 1\n col = 0\n row_y = y\n end\n topside, rightside, leftside, bottomside = trace(x,y)\n colspan = [topside.count('+'), bottomside.count('+')].max - 1\n rowspan = [rightside.count('+'), leftside.count('+')].max - 1\n width = calc_width(col, colspan, topside.length, @width)\n content = scan_cell(x, y, topside.length, leftside.length)\n @cells << Cell.new(self, x, y, col, row, colspan, rowspan, width, content)\n end\n end\n end\n \n end", "def initiate_grid\n new_grid = []\n @width.times do |x|\n new_grid[x] = []\n @height.times do |y|\n new_grid[x][y] = 0\n end\n end\n new_grid\n end", "def initialize(rows = self.class.blank_grid)\n @rows = rows\n end", "def p11\n\tgrid = Matrix[\n\t\t[8,\t2, 22,97,38,15,0, 40,0, 75,4, 5, 7, 78,52,12,50,77,91,8],\n\t\t[49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48,4, 56,62,0],\n\t\t[81,49,31,73,55,79,14,29,93,71,40,67,53,88,30,3, 49,13,36,65],\n\t\t[52,70,95,23,4, 60,11,42,69,24,68,56,1, 32,56,71,37,2, 36,91],\n\t\t[22,31,16,71,51,67,63,89,41,92,36,54,22,40,40,28,66,33,13,80],\n\t\t[24,47,32,60,99,3, 45,2, 44,75,33,53,78,36,84,20,35,17,12,50],\n\t\t[32,98,81,28,64,23,67,10,26,38,40,67,59,54,70,66,18,38,64,70],\n\t\t[67,26,20,68,2, 62,12,20,95,63,94,39,63,8, 40,91,66,49,94,21],\n\t\t[24,55,58,5, 66,73,99,26,97,17,78,78,96,83,14,88,34,89,63,72],\n\t\t[21,36,23,9, 75,0, 76,44,20,45,35,14,0, 61,33,97,34,31,33,95],\n\t\t[78,17,53,28,22,75,31,67,15,94,3, 80,4, 62,16,14,9, 53,56,92],\n\t\t[16,39,5, 42,96,35,31,47,55,58,88,24,0, 17,54,24,36,29,85,57],\n\t\t[86,56,0, 48,35,71,89,7, 5, 44,44,37,44,60,21,58,51,54,17,58],\n\t\t[19,80,81,68,5, 94,47,69,28,73,92,13,86,52,17,77,4, 89,55,40],\n\t\t[4,\t52,8, 83,97,35,99,16,7, 97,57,32,16,26,26,79,33,27,98,66],\n\t\t[88,36,68,87,57,62,20,72,3, 46,33,67,46,55,12,32,63,93,53,69],\n\t\t[4,\t42,16,73,38,25,39,11,24,94,72,18,8, 46,29,32,40,62,76,36],\n\t\t[20,69,36,41,72,30,23,88,34,62,99,69,82,67,59,85,74,4, 36,16],\n\t\t[20,73,35,29,78,31,90,1, 74,31,49,71,48,86,81,16,23,57,5, 54],\n\t\t[1,\t70,54,71,83,51,54,69,16,92,33,48,61,43,52,1, 89,19,67,48]\n\t]\n\tproducts = []\n\t(0...grid.row_count).each do |row|\n\t\t(0...grid.column_count).each do |col|\n\t\t\tright = col + 3 < grid.row_count\n\t\t\tdown = row + 3 < grid.column_count\n\t\t\tleft = col - 3 >= 0\n\t\t\tif right\n\t\t\t\tset = grid.minor(row..row,col..col+3)\n\t\t\t\tproducts << set.reduce(:*)\n\t\t\tend\n\t\t\tif down and right\n\t\t\t\tdiagonal = []\n\t\t\t\t(0..3).each do |x|\n\t\t\t\t\tdiagonal << grid.minor(row+x..row+x,col+x..col+x).component(0,0)\n\t\t\t\tend\n\t\t\t\tproducts << diagonal.reduce(:*)\n\t\t\tend\n\t\t\tif down\n\t\t\t\tset = grid.minor(row..row+3,col..col)\n\t\t\t\tproducts << set.reduce(:*)\n\t\t\tend\n\t\t\tif down and left\n\t\t\t\tdiagonal = []\n\t\t\t\t(0..3).each do |x|\n\t\t\t\t\tdiagonal << grid.minor(row+x..row+x,col-x..col-x).component(0,0)\n\t\t\t\tend\n\t\t\t\tproducts << diagonal.reduce(:*)\n\t\t\tend\n\t\tend\n\tend\n\tproducts.max\nend", "def print_grid\n self.print_head\n puts $line_break\n i = 0\n grid.each do |row|\n printable_row = []\n row.each do |cell|\n printable_row << cell[:display]\n end\n row_string = printable_row.join(\" | \")\n puts \"## #{$abc[i].upcase} #{row_string} ##\"\n # puts \"## #{row_string} ##\"\n puts \"##\" + \"------\" + \"+----\" * 9 + \"##\"\n i += 1\n end\n bottom_row = []\n l = 0\n 10.times do\n bottom_row << \" #{l} \"\n l += 1\n end\n print_row = bottom_row.join(\"|\")\n puts \"## #{print_row}##\"\n puts $line_break\n end", "def relative_rows(square_type = :terrain)\r\n @rows ||= {}\r\n return @rows[square_type] if @rows[square_type] \r\n \r\n @rows[square_type] = @all_rows.values_at(*relative_indexes(:rows, square_type)).map do |column|\r\n column.values_at(*relative_indexes(:columns, square_type))\r\n end\r\n end", "def setup_grid(seed_file)\n # Read the seed file\n file_object = File.open(seed_file)\n seed_data = file_object.readlines\n file_object.close\n\n @columns = seed_data[0].chomp.length\n @rows = seed_data.size\n\n # Init grid contents for rows and columns\n init_contents(@rows, @columns)\n\n # Loop through seed data and setup grid contents\n row = 0\n for each_line in seed_data\n column = 0\n each_line.chomp.each_char do |chr|\n cell = @contents[row][column] # Take out the Cell to set it's state\n cell.state = chr\n @contents[row][column] = cell\n column += 1\n end\n row += 1\n end\n end", "def draw_dynamic_grid(rect, cols, rows, shade=active_shade, state=active_state)\n rect = Convert.Rect(rect)\n rect.width = rect.width / cols\n rect.height = rect.height / rows\n draw_fixed_grid(r, cols, rows, shade, state)\n end", "def get_puzzle_grid(level)\n\n #get a random grid\n page = Net::HTTP.get_response(\"show.websudoku.com\", \"?select&level=#{level}\")\n\n #find the puzzle number for reference\n page.body =~ /Puzzle (.*?) /\n puzzle_id = $1\n\n #the puzzle is in a giant table\n page.body =~ /<TABLE .*?>(.*)?<\\/TABLE>/\n table = $1\n\n # each cell has ID=cxy where x is column, y is row\n grid = []\n (0..8).each do |r|\n row = []\n (0..8).each do |c|\n table =~ /<TD CLASS=.. ID=c#{c}#{r}>(.*?)<\\/TD>/\n cell = $1\n cell =~ /READONLY VALUE=\"(\\d)\"/\n if cell\n row.push($1.to_i)\n else\n row.push(0)\n end\n end\n grid.push(row)\n end\n\n return grid\nend", "def colorable_grid_map(color_option = :even)\n\t\tcolor_cordinates = []\n\t\tpixel_grid = @avatar[:grid].map.with_index(0) do |num, i|\n\t\t\tif num % 2 == 0\n\t\t\t\thorizontal = (i % 5) * 50\n\t\t\t\tvertical = (i / 5) * 50\n\n\t\t\t\ttop_left = [horizontal, vertical]\n\t\t\t\tbottom_right = [horizontal + 50, vertical + 50]\n\t\t\t\t[ top_left, bottom_right ]\n\t\t\tend\n\t\tend\n\t\tpixel_grid.compact\n\tend", "def build_cartons_grid(data_set, is_multi_select = nil)\n\n column_configs = Array.new\n\n\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'carton_number', :col_width => 120}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'pallet_number', :col_width => 150}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'rw_receipt_unit'} if is_multi_select\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'production_run_code', :col_width => 158}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'fg_product_code', :col_width => 294}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'fg_mark_code', :col_width => 170}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => \"attributes['farm_code']\", :column_caption => \"farm_code\", :col_width => 76}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'puc', :col_width => 76}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'fg_code_old', :col_width => 161}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'organization_code', :col_width => 40}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'grade_code', :col_width => 40}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'inventory_code', :col_width => 140}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'target_market_code', :col_width => 130}\n\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'extended_fg_code', :col_width => 516}\n\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => \"attributes['line_code']\", :column_caption => \"line_code\", :col_width => 47}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'order_number', :col_width => 150}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'pack_date_time', :col_width => 162}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'pick_reference', :col_width => 56}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'is_inspection_carton', :col_width => 45}\n\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'carton_fruit_nett_mass', :col_width => 60,:column_caption => 'mass'}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'id'}\n column_configs[column_configs.length()] = {:field_type => 'text', :field_name => 'bin_id'}\n\n if !@multi_select\n column_configs[column_configs.length()] = {:field_type => 'action', :field_name => 'carton',\n :settings =>\n {:link_text => 'view_carton',\n :target_action => 'view_carton',\n :id_column => 'id'}}\n end\n\n\n key_based_access = true\n key_based_access = @key_based_access if @key_based_access\n\n\n return get_data_grid(data_set, column_configs, nil, key_based_access)\n\n end", "def build_dimension(name, options={})\n options[:rows] ||= 100\n options[:generators] ||= {}\n rows = []\n\n dimension_class = Dimension.to_dimension(name)\n options[:rows].times do\n row = {}\n dimension_class.content_columns.each do |column|\n generator = (options[:generators][column.klass] ||\n @column_generators[column.name] ||\n @generators[column.klass])\n if generator.nil?\n raise ArgumentError, \"No generator found, unknown column type?: #{column.klass}\"\n end\n row[column.name] = generator.generate(column, options)\n end\n rows << row\n end\n\n rows\n end", "def grid; @parameters['GRiD']; end", "def grid(n, m)\n Array.new(n) { Array.new(n) } # If you attempted to write this as Array.new(n, Array.new(m)) the contents would be repeated for each array rather\nend", "def clone\n result = Grid.new(@width, @height)\n @width.times do |wIdx|\n @height.times do |hIdx|\n result.grid[wIdx][hIdx] = @grid[wIdx][hIdx]\n end\n end\n result\n end" ]
[ "0.64313143", "0.61897457", "0.61006105", "0.59698695", "0.59622866", "0.594811", "0.5921769", "0.5847691", "0.5672701", "0.55957943", "0.55472404", "0.55231", "0.55002207", "0.54943144", "0.5494288", "0.5479013", "0.54585916", "0.54568464", "0.54427224", "0.54367685", "0.5401142", "0.5394173", "0.53813225", "0.5379539", "0.53588575", "0.5356609", "0.53465647", "0.53415424", "0.5337216", "0.5321359", "0.5320368", "0.531977", "0.53112346", "0.5306726", "0.5284667", "0.52817816", "0.5279966", "0.52788836", "0.5270399", "0.52591145", "0.5250923", "0.5244139", "0.52234674", "0.5221582", "0.5211674", "0.5171457", "0.51498413", "0.51361096", "0.51262724", "0.5119308", "0.5115824", "0.51156455", "0.51098114", "0.5103047", "0.50891805", "0.5082004", "0.5060934", "0.50437796", "0.50387484", "0.50168276", "0.50168276", "0.4996427", "0.49942246", "0.4994092", "0.49874812", "0.4983082", "0.49780756", "0.49755508", "0.4955862", "0.4933453", "0.49302217", "0.4923203", "0.49221814", "0.4920867", "0.4900458", "0.4897554", "0.48972207", "0.48933366", "0.48933107", "0.48916337", "0.48854047", "0.48849812", "0.48740444", "0.48731247", "0.48596564", "0.48564988", "0.48505437", "0.48440453", "0.48411095", "0.4834386", "0.4830181", "0.48233396", "0.48209324", "0.4817256", "0.48117942", "0.48097724", "0.47921354", "0.47907162", "0.47899458", "0.4774253" ]
0.67455137
0
Checks to see that a session has been established, raising a NotConnected exception if one has not.
def check_connected raise NotConnected unless @session_id && @sso && @provider end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_server_connection\n\t\tsession[:foo] = \"bar\" unless session.id \n\t\traise \"session.id is nil\" unless session.id\n\t\tunless @client = ClientConnections.get(session.id.public_id)\n\t\t\tredirect_to root_path, flash: { error: \"Please connect to a formulary server\" }\n\t\tend\n\tend", "def check_server_connection\n\t\tsession[:foo] = \"bar\" unless session.id \n\t\traise \"session.id is nil\" unless session.id\n\t\tunless @client = ClientConnections.get(session.id.public_id)\n\t\t\tredirect_to root_path, flash: { error: \"Please connect to a formulary server\" }\n\t\tend\n\tend", "def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end", "def checkConnection\n unless connected?\n raise DictError.new(), \"Not connected.\"\n end\n end", "def assert_open\n raise ZookeeperException::SessionExpired if state == ZOO_EXPIRED_SESSION_STATE\n raise ZookeeperException::NotConnected unless connected?\n end", "def sanity_check\n raise Net::SSH::Exception, \"session not open\" unless @open\n end", "def connected?\n start_ssh {|ssh| } # do nothing\n rescue *CONNECTION_EXCEPTIONS => ex\n @connection_error = ex\n return false\n else\n return true\n end", "def established?\n @connected == true\n end", "def connected?\n @connection && [email protected]?\n end", "def assert_open\n if state == ZOO_EXPIRED_SESSION_STATE\n raise ZookeeperException::SessionExpired\n elsif state != Zookeeper::ZOO_CONNECTED_STATE\n raise ZookeeperException::ConnectionClosed\n end\n end", "def connected?; connection_state == :connected end", "def is_connected?\n if @connection == nil\n return false\n else \n return true\n end\n end", "def check_connection\n logger.debug \"Checking connection (#{is_connected?})\"\n is_connected? || connect_database\n # return connection status\n is_connected?\n end", "def check_connection\n logger.debug \"Checking connection (#{is_connected?})\"\n is_connected? || connect_database\n # return connection status\n is_connected?\n end", "def check_formulary_server_connection\n session[:foo] = \"bar\" unless session.id\n raise \"session.id is nil\" unless session.id\n unless @client = ClientConnections.get(session.id.public_id)\n reset_session\n redirect_to root_path, flash: { error: \"Please connect to a formulary server\" }\n end\n end", "def connected?\n self.connected_cache ||= session_info.success?\n end", "def is_connected\n begin\n if session.key?(:sos_note_email)\n true\n else\n false\n end\n rescue Exception => e \n false\n end\n end", "def is_connected?\n\t\tif @connection == nil\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend", "def connected?\n !!@session_id && !!@cluster\n end", "def connected?\n begin\n @client.cluster.health\n rescue => e\n raise Xi::ML::Error::CaughtException, \\\n \"ES client not connected: #{e.message}\"\n end\n true\n end", "def connected?\r\n [email protected]?\r\n end", "def check_client\n unless client\n raise ClientNotSetup\n end\n unless client.connected?\n if raise_on_error\n raise ClientNotConnected\n else\n @logger.error 'Client not connected! Check internet connection'\n return false\n end\n end\n true\n end", "def connected?\n !connection.blank?\n end", "def connected?\n @connection.present?\n end", "def established?\n !! @socket\n end", "def connected?\n !!(@connection && @connection.status == PGconn::CONNECTION_OK)\n rescue PGError\n false\n end", "def ensure_connected\n client = @connection.client(self)\n \n # If this connection has expired somehow, try to get another one.\n unless connected?(client)\n @connection.drop(self)\n client = @connection.client(self)\n end\n\n fail \"Bad Connection\" unless connected?(client)\n\n client\n end", "def connected?(conn)\n conn && conn.active?\n end", "def connected?\n [email protected]?\n end", "def connected?\n # FIXME: check if connection is connected\n not @connection.nil?\n end", "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "def ensure_connection!\n fail \"Must have active connection\" unless connection\n end", "def ready?\n @connected && @logged_in\n end", "def connected?\r\n @connection && @connection.connected?\r\n end", "def connect?\n connect != false\n end", "def connected?\n [email protected]? && @connected\n end", "def connect_error?\n @connerror || false\n end", "def connected?\n if @connection\n @connection.stat\n @connection.errno.zero?\n else\n false\n end\n end", "def connected?\n connection_handler.connected?(connection_specification_name, role: current_role, shard: current_shard)\n end", "def connected?\n return false unless @connection\n return false unless @connection.started?\n true\n end", "def verify!\n reconnect! unless active?\n end", "def still_connected?\n true\n end", "def connected?\n client.is_connected?\n end", "def connection_successful\n @authenticating = false\n opened!\n\n exec_callback_yielding_self(:connect)\n end", "def connected?\n return !@@connection.nil?\n end", "def raise_unless_connected!\n begin \n @connection.stats\n rescue\n raise Workling::StarlingNotFoundError.new\n end\n end", "def session_present\n @connack_flags[0]\n end", "def connected?\n\t\[email protected]?\n\tend", "def begin_session\n begin\n true if login\n rescue\n false\n end\n end", "def session(&block)\n raise ArgumentError, \"#{self.class}#shared_connection must be passed a block\" unless block\n\n begin\n t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n @in_session = true\n if NewRelic::Agent.config[:aggressive_keepalive]\n session_with_keepalive(&block)\n else\n session_without_keepalive(&block)\n end\n rescue *CONNECTION_ERRORS => e\n elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - t0\n raise NewRelic::Agent::ServerConnectionException, \"Recoverable error connecting to #{@collector} after #{elapsed} seconds: #{e}\"\n ensure\n @in_session = false\n end\n end", "def client_connected\n end", "def connected?\n status == CONNECTED\n end", "def connected?\n !socket.closed?\n end", "def connected?\n !!@socket && @socket.alive?\n end", "def connected?\n @conn.connected? && @channel.open?\n end", "def connected?\n !!@socket\n end", "def connected?\n !!@socket\n end", "def connected?\n @status == :connected\n end", "def waited_on_connect?\n @waited_on_connect\n end", "def ready?\n @wamp_client.is_open? && @session\n end", "def connection_valid?\n begin\n result = client.call(:fe_dummy).body[:fe_dummy_response][:fe_dummy_result]\n @observations << \"app_server: #{result[:app_server]}, db_server: #{result[:db_server]}, auth_server: #{result[:auth_server]}\"\n result[:app_server] == \"OK\" and result[:db_server] == \"OK\" and result[:auth_server] == \"OK\"\n rescue => e\n @errors << e.message\n @backtrace = e.backtrace\n false\n end\n end", "def connect_if_connection_initialized\n connection.connect if connection.initialized?\n end", "def on_session_ended\n @connection = nil\n\n # Automatically reconnect to the server if allowed\n if @reconnect\n reconnect_from(Exception) do\n connect\n trigger(:reconnected)\n end\n end\n end", "def valid_connection?\n @connection && @connection.valid?\n end", "def connected?\n (conn=self.conn) && conn.connected? && @pid == Process.pid || false\n end", "def isConnected()\r\n return @isConnected\r\n end", "def connected?\n @host && @port\n end", "def connect?\n if !!@connect\n puts \"okai\"\n @frame.destroy()\n else\n print_error_message\n puts \"wrong password or login\"\n return\n end\n end", "def connection_valid?\n if status.untested? or (changed? and (changes.keys & @@status_fields).empty?)\n begin\n test_connection\n status.success!\n rescue => e\n error_str = map_connection_exception_to_error(e)\n status.fail!(error_str)\n end\n end\n status.success?\n end", "def connected?\n return false if @connection.nil?\n return false if @connection.closed?\n return true\n end", "def connected?\n\t\treturn @conn ? true : false\n\tend", "def connected?\n !!@connected\n end", "def connected?\n not @sp.closed?\n end", "def connected?\n return false unless @connection\n return false unless @connection.started?\n true\n end", "def connection_check\n handle_action_exceptions(__method__) do\n check_connection\n end\n rescue RToolsHCKConnectionError => e\n if @json\n { 'result' => 'Failure', 'message' => e.message }\n else\n puts \"WARNING: #{e.message}\"\n false\n end\n end", "def connected\n Rails.logger.debug \"Status#status session[:client] #{session[:client].inspect}\"\n render :json => (session[:client] != nil)\n end", "def connected?\n connection { |conn| conn.alive? }\n end", "def connected?\n unless @server.nil?\n true\n else\n false\n end\n end", "def connected?\n [email protected]?\n end", "def _connect\n return if @ssl_connected\n\n Error.translate do\n @plaintext_connected ||= super\n return if !@plaintext_connected\n\n # Mark the connection as not connected due to the pending SSL handshake.\n @connected = false\n\n @socket.connect_nonblock\n @ssl_connected = @connected = true\n end\n rescue IO::WaitReadable, IO::WaitWritable, Errno::EINPROGRESS\n rescue Error => e\n close e\n end", "def ensure_connected(&block)\n begin\n connect unless connected?\n yield(current_actor)\n rescue Exception => e\n Failover.get(e).execute(e, current_actor, &block)\n end\n end", "def check_connection( conn )\n\tbegin\n\t\tconn.exec( \"SELECT 1\" )\n\trescue PG::Error => err\n\t\t$stderr.puts \"%p while testing connection: %s\" % [ err.class, err.message ]\n\t\tconn.reset\n\tend\nend", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def alive?\n @session && @login_info\n end", "def connected?()\n (self.remote_address rescue nil) ? true : false\n end", "def reconnect\n disconnect rescue nil\n @connected = true\n end", "def connected?\n with_timeout { listening? }\n end", "def connected?\n with_timeout { listening? }\n end", "def connect_reset_safe\n\t\tbegin\n\t\t\tconnect\n\t\trescue Rex::ConnectionRefused\n\t\t\treturn :refused\n\t\tend\n\t\treturn :connected\n\tend", "def connected?; end", "def connected?; end" ]
[ "0.68034667", "0.68034667", "0.67881316", "0.67881316", "0.67720455", "0.677098", "0.6672164", "0.66430384", "0.6632717", "0.66123366", "0.66106296", "0.6603487", "0.6565453", "0.6565453", "0.6543456", "0.6520118", "0.6489656", "0.6470741", "0.6449875", "0.6448576", "0.6431807", "0.6367091", "0.6343077", "0.63261676", "0.6301905", "0.6265856", "0.62583846", "0.6229977", "0.6198667", "0.61944324", "0.61799896", "0.61799896", "0.61799896", "0.61799896", "0.61799896", "0.61799896", "0.6164341", "0.6158237", "0.6149901", "0.613548", "0.6123465", "0.61165273", "0.6108991", "0.6104179", "0.61009693", "0.6096699", "0.60944724", "0.6083091", "0.60596067", "0.6046827", "0.6043517", "0.6027644", "0.6020334", "0.60095805", "0.6004088", "0.6002723", "0.6000711", "0.599409", "0.5992918", "0.5986619", "0.5986619", "0.59804934", "0.59648645", "0.5956923", "0.59527826", "0.59513617", "0.59369045", "0.593516", "0.59326494", "0.59322774", "0.59301746", "0.592748", "0.59134245", "0.59132385", "0.59095687", "0.5903274", "0.5888476", "0.5886342", "0.5884972", "0.58833045", "0.5881044", "0.58708125", "0.5861283", "0.5846994", "0.5839488", "0.58299106", "0.58276176", "0.58276176", "0.58276176", "0.58276176", "0.58276176", "0.58276176", "0.5826341", "0.5800978", "0.5798021", "0.5796528", "0.5796528", "0.57930166", "0.57894367", "0.57894367" ]
0.79844135
0